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

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    min-height: 100vh;
    color: #fff;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 15px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.back-btn {
    position: absolute;
    left: 0;
    top: 0;
    background: #df4601;
    color: #fff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85em;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #ff5a0a;
    transform: translateY(-2px);
}

h1 {
    font-size: 2.2em;
    color: #df4601;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-top: 45px;
    letter-spacing: 3px;
    font-weight: 800;
}

.subtitle {
    color: #ffa500;
    font-size: 1em;
    letter-spacing: 2px;
    margin-top: 5px;
}

/* Screens */
.screen {
    display: none;
    flex: 1;
}

.screen.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Start Screen */
.title-card {
    background: linear-gradient(135deg, #df4601 0%, #b33a00 100%);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(223, 70, 1, 0.3);
    margin-bottom: 20px;
}

.jersey-number {
    font-size: 5em;
    font-weight: 900;
    color: #fff;
    text-shadow: 3px 3px 0 #000, -1px -1px 0 #000;
    line-height: 1;
    margin-bottom: 10px;
}

.title-card h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.title-card p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
}

.high-score-display {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 1.1em;
}

#highScoreDisplay {
    font-weight: 700;
    color: #ffd700;
}

.play-button {
    background: #000;
    color: #df4601;
    border: 3px solid #df4601;
    padding: 15px 50px;
    font-size: 1.3em;
    font-weight: 700;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    letter-spacing: 2px;
}

.play-button:hover {
    background: #df4601;
    color: #000;
    transform: scale(1.05);
}

.instructions {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
}

.instructions h3 {
    color: #df4601;
    margin-bottom: 15px;
    text-align: center;
}

.instructions ul {
    list-style: none;
}

.instructions li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    color: rgba(255, 255, 255, 0.9);
}

.instructions li::before {
    content: '⚾';
    position: absolute;
    left: 0;
}

/* Game Screen */
#gameScreen {
    align-items: center;
}

.scoreboard {
    display: flex;
    justify-content: space-around;
    width: 100%;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 3px solid #df4601;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
}

.score-item {
    text-align: center;
}

.score-label {
    display: block;
    font-size: 0.75em;
    color: #888;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.score-value {
    font-size: 2em;
    font-weight: 700;
    color: #df4601;
}

.strike-indicators {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 5px;
}

.strike-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #333;
    border: 2px solid #666;
    transition: all 0.3s ease;
}

.strike-dot.active {
    background: #ff0000;
    border-color: #ff0000;
    box-shadow: 0 0 10px #ff0000;
}

#gameCanvas {
    background: linear-gradient(180deg, #87CEEB 0%, #87CEEB 40%, #228B22 40%, #228B22 100%);
    border-radius: 15px;
    border: 4px solid #df4601;
    max-width: 100%;
    height: auto;
    touch-action: none;
}

.swing-zone {
    margin-top: 15px;
    width: 100%;
}

.swing-button {
    width: 100%;
    background: linear-gradient(135deg, #df4601 0%, #ff6b1a 100%);
    color: #fff;
    border: none;
    padding: 25px;
    font-size: 1.8em;
    font-weight: 700;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.1s ease;
    font-family: inherit;
    letter-spacing: 3px;
    box-shadow: 0 8px 25px rgba(223, 70, 1, 0.4);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.swing-button:hover {
    background: linear-gradient(135deg, #ff6b1a 0%, #df4601 100%);
}

.swing-button:active {
    transform: scale(0.95);
    box-shadow: 0 4px 15px rgba(223, 70, 1, 0.4);
}

.swing-button:disabled {
    background: #666;
    cursor: not-allowed;
    box-shadow: none;
}

.result-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5em;
    font-weight: 800;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 100;
    text-align: center;
}

.result-message.show {
    opacity: 1;
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.result-message.home-run {
    color: #ffd700;
    font-size: 3em;
}

.result-message.hit {
    color: #00ff00;
}

.result-message.strike {
    color: #ff4444;
}

.result-message.foul {
    color: #ffaa00;
}

/* Game Over Screen */
.game-over-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 4px solid #df4601;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
}

.game-over-card h2 {
    font-size: 2.5em;
    color: #df4601;
    margin-bottom: 25px;
    letter-spacing: 3px;
}

.final-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 25px;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    color: #888;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 2.5em;
    font-weight: 700;
    color: #df4601;
}

.new-record {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #000;
    padding: 10px 30px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1.2em;
    margin-bottom: 20px;
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.ripken-quote {
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 25px;
    padding: 15px;
    border-left: 3px solid #df4601;
    text-align: left;
    font-size: 0.95em;
    line-height: 1.5;
}

footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8em;
}

/* Responsive */
@media (max-width: 500px) {
    h1 {
        font-size: 1.8em;
        margin-top: 50px;
    }

    .back-btn {
        font-size: 0.75em;
        padding: 6px 12px;
    }

    .jersey-number {
        font-size: 4em;
    }

    .swing-button {
        padding: 20px;
        font-size: 1.5em;
    }

    .result-message {
        font-size: 2em;
    }

    .result-message.home-run {
        font-size: 2.5em;
    }
}
