* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: #000;
    color: #fff;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    font-smooth: never;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: unset;
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#homeScreen.active {
    overflow-y: auto;
}

/* Simple 8-bit block text style - readable */
* {
    font-smooth: never;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: unset;
    text-rendering: optimizeSpeed;
}

body, h1, h2, button, .emotion-name, .emotion-stats, .score-display, 
.final-score, .emotion-used, th, td, #playerName, .subtitle {
    font-family: 'Press Start 2P', 'Courier New', 'Courier', monospace;
    font-weight: normal;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    font-size: 2.5rem;
    letter-spacing: 0;
    font-weight: normal;
    line-height: 1.4;
}

h2 {
    font-size: 1.2rem;
    letter-spacing: 0;
    font-weight: normal;
    line-height: 1.4;
}

button {
    font-weight: normal;
    letter-spacing: 0;
    line-height: 1.6;
}

.twitter-link {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.twitter-link:hover {
    color: #ccc;
    text-decoration: underline;
}

.twitter-link:active {
    color: #999;
}

h1 {
    letter-spacing: 0.1em;
}

/* Rewards Banner */
.rewards-banner {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border: 3px solid #ffd700;
    border-radius: 8px;
    padding: 15px 25px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    }
    to {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
    }
}

.rewards-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.9rem;
    color: #ffd700;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.rewards-prizes {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.prize-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 15px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid;
}

.prize-item.first-place {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.prize-item.second-place {
    border-color: #c0c0c0;
    box-shadow: 0 0 10px rgba(192, 192, 192, 0.3);
}

.prize-item.third-place {
    border-color: #cd7f32;
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.3);
}

.prize-rank {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    margin-bottom: 5px;
}

.first-place .prize-rank {
    color: #ffd700;
}

.second-place .prize-rank {
    color: #c0c0c0;
}

.third-place .prize-rank {
    color: #cd7f32;
}

.prize-amount {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.5rem;
    color: #fff;
}

.countdown-container {
    margin-top: 10px;
}

.countdown-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.5rem;
    color: #fff;
    margin-bottom: 10px;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.countdown-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #000;
    border: 2px solid #ffd700;
    padding: 8px 12px;
    min-width: 50px;
}

.countdown-segment span:first-child {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.2rem;
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.countdown-unit {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.4rem;
    color: #888;
    margin-top: 4px;
}

/* Home Screen */
#homeScreen {
    padding: 20px;
    justify-content: flex-start;
    padding-top: 40px;
    overflow-y: auto;
}

#homeScreen h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 0.2em;
}

.play-button {
    padding: 20px 60px;
    font-size: 2rem;
    margin-bottom: 40px;
    background: #fff;
    color: #000;
    border: 3px solid #000;
    cursor: pointer;
    transition: all 0.2s;
}

.play-button:hover {
    background: #000;
    color: #fff;
    border-color: #fff;
}

.home-leaderboard {
    width: 100%;
    max-width: 800px;
    margin-top: 20px;
}

.home-leaderboard h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 0.1em;
}

.home-leaderboard .leaderboard-container {
    max-height: 400px;
    overflow-y: auto;
}

/* Emotion Selection Screen */
#emotionScreen {
    padding: 20px;
}

#emotionScreen h1 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-align: center;
}

.back-button {
    margin-top: 30px;
    padding: 15px 40px;
    font-size: 1.2rem;
}

/* Start Screen (legacy - keeping for compatibility) */
#startScreen {
    padding: 20px;
}

#startScreen h1 {
    font-size: 4rem;
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 0.2em;
}

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 40px;
    text-align: center;
}

.emotion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    max-width: 800px;
    width: 100%;
}

.emotion-card {
    background: #fff;
    color: #000;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    border: 2px solid #000;
    transition: transform 0.2s;
}

.emotion-card:hover {
    transform: scale(1.05);
    background: #000;
    color: #fff;
    border-color: #fff;
}

.emotion-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 10px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    display: block;
    margin: 0 auto 10px auto;
}

.emotion-name {
    font-size: 0.7rem;
    font-weight: normal;
    margin-bottom: 8px;
    line-height: 1.6;
}

.emotion-stats {
    font-size: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.6;
}

.emotion-stats div {
    line-height: 1.6;
}

/* Game Screen */
#gameScreen {
    position: relative;
    padding: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: #000;
}

#gameScreen.active {
    display: flex;
}

#gameCanvas {
    display: block;
    background: #000;
    width: 100%;
    max-width: 100vw;
    height: 150px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.game-ui {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.score-display {
    font-size: 1rem;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    line-height: 1.6;
}

.health-bar {
    width: 200px;
    height: 20px;
    border: 2px solid #fff;
    background: #000;
}

.health-fill {
    height: 100%;
    background: #fff;
    width: 100%;
    transition: width 0.1s;
}

/* Death Screen */
#deathScreen {
    padding: 20px;
}

#deathScreen h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 0.1em;
}

.final-score {
    font-size: 1.2rem;
    margin-bottom: 10px;
    text-align: center;
    line-height: 1.6;
}

.emotion-used {
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-align: center;
    line-height: 1.6;
}

/* Personal Best Styles */
.personal-best-home {
    font-size: 0.8rem;
    margin-bottom: 20px;
    color: #888;
    text-align: center;
}

.personal-best-home span {
    color: #fff;
}

.personal-best-death {
    font-size: 0.8rem;
    margin-bottom: 10px;
    text-align: center;
    color: #888;
}

.new-pb-indicator {
    font-size: 1rem;
    color: #0f0;
    text-align: center;
    margin-bottom: 10px;
    animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0.7; transform: scale(1.05); }
}

/* Death Message */
.death-message {
    font-size: 0.6rem;
    color: #888;
    text-align: center;
    margin-bottom: 20px;
    font-style: italic;
    max-width: 400px;
    line-height: 1.8;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.share-btn {
    padding: 10px 20px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.twitter-btn {
    background: #1da1f2;
    color: #fff;
    border: 2px solid #1da1f2;
}

.twitter-btn:hover {
    background: #0d8ddb;
    border-color: #0d8ddb;
    color: #fff;
}

.copy-btn {
    background: #333;
    color: #fff;
    border: 2px solid #555;
}

.copy-btn:hover {
    background: #555;
    border-color: #777;
    color: #fff;
}

.submit-form {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

#playerName {
    padding: 10px;
    font-size: 0.6rem;
    background: #000;
    color: #fff;
    border: 2px solid #fff;
    width: 300px;
    text-align: center;
    text-transform: none;
}

#playerName:focus {
    outline: none;
    background: #fff;
    color: #000;
}

button {
    padding: 15px 30px;
    font-size: 1rem;
    background: #fff;
    color: #000;
    border: 2px solid #000;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background: #000;
    color: #fff;
    border-color: #fff;
}

#submitStatus {
    margin: 10px 0;
    min-height: 20px;
    text-align: center;
}

/* Leaderboard Screen */
#leaderboardScreen {
    padding: 20px;
    overflow-y: auto;
}

#leaderboardScreen h1 {
    font-size: 3rem;
    margin-bottom: 30px;
    text-align: center;
    letter-spacing: 0.1em;
}

.leaderboard-container {
    max-width: 800px;
    width: 100%;
    margin-bottom: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #000;
}

th, td {
    padding: 15px;
    text-align: left;
    border: 1px solid #fff;
    font-size: 0.7rem;
    line-height: 1.6;
}

th {
    font-size: 0.7rem;
}

th {
    background: #fff;
    color: #000;
    font-weight: bold;
}

tr:nth-child(even) {
    background: #111;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #homeScreen h1 {
        font-size: 2.5rem;
    }

    .play-button {
        padding: 15px 40px;
        font-size: 1.5rem;
        margin-bottom: 30px;
    }

    .home-leaderboard {
        max-width: 100%;
    }

    #startScreen h1 {
        font-size: 2.5rem;
    }

    .emotion-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .emotion-card {
        padding: 15px;
    }

    .emotion-icon {
        font-size: 2rem;
    }

    #gameCanvas {
        width: 100vw;
        height: 100vh;
    }

    .game-ui {
        top: 10px;
        left: 10px;
    }

    .score-display {
        font-size: 1.2rem;
        padding: 8px;
    }

    #playerName {
        width: 90%;
        max-width: 300px;
        font-size: 0.5rem;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 10px 5px;
    }
}

@media (max-width: 480px) {
    .emotion-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .emotion-card {
        padding: 10px;
    }

    .emotion-icon {
        font-size: 1.5rem;
    }

    .emotion-name {
        font-size: 1rem;
    }

    .emotion-stats {
        font-size: 0.7rem;
    }
}

