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

body {
    font-family: 'Fira Code', 'Courier New', 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    background: #000000;
    color: #00ff41;
    height: 100vh;
    overflow: hidden;
    touch-action: manipulation;
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.5);
}

.terminal-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
    margin: 0 auto;
    background: #0a0a0a;
    border: 2px solid #00ff41;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.3);
}

.terminal-header {
    background: #1a1a1a;
    border-bottom: 2px solid #00ff41;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.terminal-controls {
    display: flex;
    gap: 0.5rem;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.control.close {
    background: #ff5f56;
    box-shadow: 0 0 5px rgba(255, 95, 86, 0.5);
}

.control.minimize {
    background: #ffbd2e;
    box-shadow: 0 0 5px rgba(255, 189, 46, 0.5);
}

.control.maximize {
    background: #27c93f;
    box-shadow: 0 0 5px rgba(39, 201, 63, 0.5);
}

.terminal-title {
    color: #00ff41;
    font-size: 0.9rem;
    font-weight: bold;
    flex: 1;
    text-align: center;
}

.terminal-body {
    flex: 1;
    position: relative;
    background: radial-gradient(circle at center, #0d1117 0%, #000000 100%);
    overflow: hidden;
}

.scanline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, #00ff41, transparent);
    animation: scanline 8s linear infinite;
    pointer-events: none;
    z-index: 10;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(100vh); }
}

.header {
    text-align: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    border-bottom: 1px solid #00ff41;
    position: relative;
    overflow: hidden;
}

.header-title-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.devin-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0, 255, 65, 0.5));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.ascii-art {
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    line-height: 1;
    color: #00ff41;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.8);
    white-space: pre;
    flex: 0 1 auto;
    overflow-x: auto;
}

.header-stats {
    display: none;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

#game-screen.active ~ .header .header-stats,
.game-active .header-stats {
    display: flex;
}

.header-stats .stat {
    background: #0d1117;
    border: 2px solid #00ff41;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    flex: 1;
    min-width: 120px;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.2), inset 0 0 5px rgba(0, 255, 65, 0.1);
}

.header-stats .stat-label {
    display: block;
    font-size: 0.8rem;
    color: #8b949e;
    margin-bottom: 0.25rem;
    font-weight: bold;
}

.header-stats .stat-value {
    display: block;
    font-size: 1.5rem;
    color: #00ff41;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.8);
}

.timer {
    display: inline-block;
    background: #0d1117;
    border: 2px solid #00ff41;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: bold;
    min-width: 150px;
    color: #00ff41;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.8);
    box-shadow: inset 0 0 10px rgba(0, 255, 65, 0.2);
}

.timer-label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    color: #8b949e;
}

.timer.warning {
    background: #ff0000;
    border-color: #ff0000;
    color: #ffffff;
    animation: pulse-warning 0.5s infinite;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
    box-shadow: inset 0 0 10px rgba(255, 0, 0, 0.3), 0 0 20px rgba(255, 0, 0, 0.5);
}

@keyframes pulse-warning {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: inset 0 0 10px rgba(255, 0, 0, 0.3), 0 0 20px rgba(255, 0, 0, 0.5);
    }
    50% { 
        transform: scale(1.02); 
        box-shadow: inset 0 0 15px rgba(255, 0, 0, 0.5), 0 0 30px rgba(255, 0, 0, 0.8);
    }
}

.game-area {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    padding-top: 0.5rem;
    overflow-y: auto;
}

.screen {
    display: none;
    width: 100%;
    max-width: 800px;
    text-align: center;
}

.screen.active {
    display: block;
}

.terminal-prompt {
    color: #00ff41;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.8);
}

.glitch {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: bold;
    margin-bottom: 1rem;
    color: #00ff41;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.8);
    animation: glitch 2s infinite;
}

@keyframes glitch {
    0%, 100% { 
        text-shadow: 0 0 10px rgba(0, 255, 65, 0.8);
        transform: translate(0);
    }
    20% { 
        text-shadow: -2px 0 #ff0000, 2px 0 #00ffff;
        transform: translate(-2px, 2px);
    }
    40% { 
        text-shadow: 2px 0 #ff0000, -2px 0 #00ffff;
        transform: translate(-2px, -2px);
    }
    60% { 
        text-shadow: 0 0 10px rgba(0, 255, 65, 0.8);
        transform: translate(2px, 2px);
    }
    80% { 
        text-shadow: 0 0 10px rgba(0, 255, 65, 0.8);
        transform: translate(2px, -2px);
    }
}

.code-block {
    background: #0d1117;
    border: 1px solid #00ff41;
    border-radius: 4px;
    padding: 1.5rem;
    margin: 2rem 0;
    font-family: 'Fira Code', monospace;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: #8b949e;
    text-align: left;
    box-shadow: inset 0 0 10px rgba(0, 255, 65, 0.1);
}

.code-block p {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #1a1a1a;
    border: 1px solid #00ff41;
    border-radius: 2px;
    margin-bottom: 0.5rem;
    overflow: hidden;
    position: relative;
    display: none;
}

.game-active .progress-bar {
    display: block;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff41, #00cc33);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.progress-label {
    position: absolute;
    top: -25px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.8rem;
    color: #8b949e;
    font-weight: bold;
}

.question-container {
    background: #0d1117;
    border: 2px solid #00ff41;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.2), inset 0 0 10px rgba(0, 255, 65, 0.1);
    position: relative;
}

.question {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: bold;
    margin-bottom: 1.5rem;
    color: #00ff41;
    text-shadow: 0 0 15px rgba(0, 255, 65, 0.8);
    font-family: 'Fira Code', monospace;
}

.input-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.input-prompt {
    color: #00ff41;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.8);
}

.answer-input {
    width: calc(300px + 1rem);
    padding: 1.5rem;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    text-align: center;
    border: 2px solid #00ff41;
    border-radius: 4px;
    background: #000000;
    color: #00ff41;
    font-family: 'Fira Code', monospace;
    font-weight: bold;
    transition: all 0.2s ease;
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.5);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.answer-input:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 0 4px rgba(0, 255, 255, 0.3), inset 0 0 15px rgba(0, 255, 255, 0.3);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.number-pad {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.number-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    justify-content: center;
}

.number-btn {
    width: 100px;
    height: 70px;
    border: 2px solid #00ff41;
    border-radius: 4px;
    background: #0d1117;
    color: #00ff41;
    font-size: 1.3rem;
    font-weight: bold;
    font-family: 'Fira Code', monospace;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.5);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
    flex: 1;
    min-width: 0;
}

.number-btn:hover {
    background: #00ff41;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 65, 0.4), 0 0 20px rgba(0, 255, 65, 0.6);
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.number-btn:active {
    background: #00cc33;
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 255, 65, 0.3), inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.number-btn.clear-btn {
    background: #1a1a1a;
    color: #ff5f56;
    border-color: #ff5f56;
    text-shadow: 0 0 5px rgba(255, 95, 86, 0.5);
    box-shadow: 0 0 10px rgba(255, 95, 86, 0.2);
}

.number-btn.clear-btn:hover {
    background: #ff5f56;
    color: #000000;
    box-shadow: 0 5px 15px rgba(255, 95, 86, 0.4), 0 0 20px rgba(255, 95, 86, 0.6);
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.answer-input.correct {
    background: #00ff41;
    border-color: #00ff41;
    color: #000000;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.6), inset 0 0 10px rgba(0, 0, 0, 0.3);
    animation: success-pulse 0.5s;
}

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

.answer-input.incorrect {
    background: #ff0000;
    border-color: #ff0000;
    color: #ffffff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.3);
    animation: error-shake 0.5s;
}

@keyframes error-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.stats {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
}

.stat {
    background: #0d1117;
    border: 2px solid #00ff41;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    flex: 1;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.2), inset 0 0 5px rgba(0, 255, 65, 0.1);
}

.stat.warning {
    background: #1a0a0a;
    border-color: #ff0000;
    animation: stat-pulse 1s infinite;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4), inset 0 0 5px rgba(255, 0, 0, 0.2);
}

@keyframes stat-pulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 0 15px rgba(255, 0, 0, 0.4), inset 0 0 5px rgba(255, 0, 0, 0.2);
    }
    50% { 
        transform: scale(1.02); 
        box-shadow: 0 0 25px rgba(255, 0, 0, 0.6), inset 0 0 10px rgba(255, 0, 0, 0.3);
    }
}

.stat-label {
    display: block;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: #8b949e;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.stat-value {
    display: block;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: bold;
    color: #00ff41;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.8);
}

.final-score {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: bold;
    margin: 2rem 0;
    color: #00ff41;
    text-shadow: 0 0 20px rgba(0, 255, 65, 0.8);
    font-family: 'Fira Code', monospace;
}

.score-label {
    display: block;
    font-size: 1rem;
    color: #8b949e;
    margin-bottom: 0.5rem;
}

.celebration-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.devin-mascot {
    position: absolute;
    width: 80px;
    height: 80px;
    opacity: 0;
    pointer-events: none;
    left: -100px;
    top: 0;
}

.devin-mascot.animate {
    animation: flyAcross 3s ease-in-out forwards;
}

@keyframes flyAcross {
    0% {
        opacity: 0;
        transform: translate(-100px, var(--start-y)) rotate(0deg) scale(0.5);
    }
    10% {
        opacity: 1;
    }
    50% {
        transform: translate(50vw, calc(var(--start-y) - 100px)) rotate(360deg) scale(1.2);
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(calc(100vw + 100px), var(--start-y)) rotate(720deg) scale(0.5);
    }
}

.result-content {
    background: #0d1117;
    border: 2px solid #00ff41;
    padding: 3rem 2rem 4rem;
    border-radius: 8px;
    margin: 0 auto 3rem;
    max-width: 800px;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.2), inset 0 0 10px rgba(0, 255, 65, 0.1);
    position: relative;
    z-index: 1;
}

.start-content {
    background: #0d1117;
    border: 2px solid #00ff41;
    padding: 3rem 2rem;
    border-radius: 8px;
    margin: 0 auto;
    max-width: 800px;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.2), inset 0 0 10px rgba(0, 255, 65, 0.1);
}

.jersey-showcase {
    margin: 2rem 0;
    padding: 2rem;
    background: #000000;
    border: 2px solid #00ff41;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3), inset 0 0 15px rgba(0, 255, 65, 0.1);
    animation: jersey-glow 2s ease-in-out infinite alternate;
}

@keyframes jersey-glow {
    0% {
        box-shadow: 0 0 20px rgba(0, 255, 65, 0.3), inset 0 0 15px rgba(0, 255, 65, 0.1);
    }
    100% {
        box-shadow: 0 0 30px rgba(0, 255, 65, 0.5), inset 0 0 20px rgba(0, 255, 65, 0.2);
    }
}

.jersey-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    display: block;
    margin: 0 auto 1rem;
    border-radius: 4px;
    filter: drop-shadow(0 0 15px rgba(0, 255, 65, 0.4));
    transition: transform 0.3s ease;
}

.jersey-image:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 25px rgba(0, 255, 65, 0.6));
}

.jersey-label {
    text-align: center;
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: bold;
    color: #00ff41;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.8);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.selfie-option {
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d1117 100%);
    border: 2px solid #00ffff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3), inset 0 0 15px rgba(0, 255, 255, 0.1);
    animation: selfie-glow 3s ease-in-out infinite alternate;
}

@keyframes selfie-glow {
    0% {
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.3), inset 0 0 15px rgba(0, 255, 255, 0.1);
    }
    100% {
        box-shadow: 0 0 30px rgba(0, 255, 255, 0.5), inset 0 0 20px rgba(0, 255, 255, 0.2);
    }
}

.selfie-content h3 {
    text-align: center;
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    margin-bottom: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.selfie-steps {
    background: #000000;
    border: 1px solid #00ffff;
    border-radius: 4px;
    padding: 1.5rem;
    margin: 1rem 0;
    font-family: 'Fira Code', monospace;
    font-size: clamp(1.1rem, 2.2vw, 1.3rem);
    color: #00ffff;
    text-align: left;
    box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.1);
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.selfie-steps p {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.selfie-steps p:last-child {
    margin-bottom: 0;
}

.result-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.btn {
    padding: 1rem 2rem;
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: bold;
    font-family: 'Fira Code', monospace;
    border: 2px solid #00ff41;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 200px;
    touch-action: manipulation;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#submit-btn {
    width: calc(300px + 1rem);
    min-width: unset;
}

#start-btn {
    width: 100%;
    max-width: 100%;
    min-width: unset;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2rem;
    animation: button-pulse 2s ease-in-out infinite;
}

@keyframes button-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(0, 255, 65, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 30px rgba(0, 255, 65, 0.6);
    }
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 65, 0.4), 0 0 20px rgba(0, 255, 65, 0.6);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 255, 65, 0.3);
}

.btn.primary {
    background: #00ff41;
    color: #000000;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.btn.primary:hover {
    background: #00cc33;
    border-color: #00cc33;
}

.btn.secondary {
    background: #0d1117;
    color: #00ff41;
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.5);
}

.btn.secondary:hover {
    background: #1a1a1a;
    border-color: #00ffff;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.footer {
    padding: 1.5rem;
    text-align: center;
    background: #0d1117;
    border-top: 2px solid #00ff41;
    margin-top: auto;
}

.attribution {
    padding: 0.5rem;
    text-align: center;
    background: #000000;
    border-top: 1px solid #00ff41;
    font-size: 0.8rem;
    color: #8b949e;
    font-family: 'Fira Code', monospace;
}

/* Vertical orientation optimization */
@media screen and (orientation: portrait) {
    .terminal-container {
        max-width: 100vh;
        margin: 0 auto;
    }
    
    .devin-logo {
        width: 60px;
        height: 60px;
    }
}

/* Tablet adjustments */
@media (max-width: 768px) {
    .devin-logo {
        width: 50px;
        height: 50px;
    }
    
    .header-title-section {
        gap: 0.5rem;
    }
    
    .ascii-art {
        font-size: 0.45rem;
    }
    
    .header-stats {
        gap: 0.5rem;
    }
    
    .timer {
        min-width: 120px;
        padding: 0.5rem 1rem;
    }
}

/* Mobile phone optimizations */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .terminal-container {
        border: 1px solid #00ff41;
    }
    
    .terminal-header {
        padding: 0.5rem;
    }
    
    .terminal-title {
        font-size: 0.7rem;
    }
    
    .control {
        width: 8px;
        height: 8px;
    }
    
    .devin-logo {
        width: 40px;
        height: 40px;
    }
    
    .ascii-art {
        font-size: 0.35rem;
    }
    
    .header {
        padding: 0.5rem;
    }
    
    .header-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .header-stats .stat {
        min-width: unset;
        width: 100%;
        padding: 0.4rem 0.8rem;
    }
    
    .timer {
        width: 100%;
        min-width: unset;
        padding: 0.5rem 1rem;
        font-size: 1.8rem;
    }
    
    .game-area {
        padding: 0.5rem;
    }
    
    .question-container {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .question {
        font-size: clamp(2rem, 8vw, 3rem);
        margin-bottom: 1rem;
    }
    
    .answer-input {
        width: 100%;
        max-width: 280px;
        padding: 1rem;
        font-size: 1.5rem;
    }
    
    .number-pad {
        max-width: 300px;
        margin-top: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .number-row {
        gap: 0.4rem;
        margin-bottom: 0.4rem;
    }
    
    .number-btn {
        height: 60px;
        font-size: 1.2rem;
        min-width: 80px;
    }
    
    #submit-btn {
        width: 100%;
        max-width: 280px;
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .code-block {
        padding: 1rem;
        font-size: 0.9rem;
        margin: 1rem 0;
    }
    
    .jersey-showcase {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .jersey-image {
        max-width: 250px;
    }
    
    .jersey-label {
        font-size: 0.9rem;
    }
    
    .selfie-option {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .selfie-content h3 {
        font-size: 1rem;
    }
    
    .selfie-steps {
        padding: 1rem;
        font-size: 0.8rem;
    }
    
    .start-content,
    .result-content {
        padding: 1.5rem 1rem;
    }
    
    #start-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .btn {
        min-width: 150px;
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .final-score {
        font-size: 2.5rem;
        margin: 1rem 0;
    }
    
    .glitch {
        font-size: 1.8rem;
    }
    
    .attribution {
        font-size: 0.7rem;
        padding: 0.3rem;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .ascii-art {
        font-size: 0.28rem;
    }
    
    .number-pad {
        max-width: 260px;
    }
    
    .number-btn {
        height: 55px;
        font-size: 1.1rem;
        min-width: 70px;
    }
    
    .answer-input {
        max-width: 240px;
        font-size: 1.3rem;
    }
    
    #submit-btn {
        max-width: 240px;
    }
}

/* Large touchscreen optimizations */
@media (min-height: 1200px) {
    .header {
        padding: 2rem 1rem;
    }
    
    .question-container {
        padding: 4rem 3rem;
        margin-bottom: 3rem;
    }
    
    .btn {
        padding: 1.5rem 3rem;
        font-size: 1.5rem;
        min-width: 250px;
    }
    
    .number-btn {
        width: 120px;
        height: 90px;
        font-size: 1.5rem;
    }
}

/* Touch-friendly sizing */
@media (pointer: coarse) {
    .btn {
        min-height: 70px;
        min-width: 200px;
    }
    
    .answer-input {
        min-height: 80px;
        font-size: 2rem;
    }
    
    .number-btn {
        width: 110px;
        height: 80px;
        font-size: 1.4rem;
    }
}

/* Prevent zoom on iOS and ensure touch-friendly inputs */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    select, textarea, input[type="text"], input[type="number"], 
    input[type="password"], input[type="datetime"], input[type="datetime-local"], 
    input[type="date"], input[type="month"], input[type="time"], input[type="week"],
    input[type="number"], input[type="search"], input[type="tel"], input[type="url"],
    input[type="email"], input[type="color"], input[type="file"] {
        font-size: 16px;
    }
}

/* Mobile landscape optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 0.3rem 0.5rem;
    }
    
    .devin-logo {
        width: 35px;
        height: 35px;
    }
    
    .ascii-art {
        font-size: 0.3rem;
    }
    
    .game-area {
        padding: 0.5rem;
    }
    
    .question-container {
        padding: 0.75rem 1rem;
    }
    
    .question {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }
    
    .number-pad {
        margin-top: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .number-btn {
        height: 50px;
        font-size: 1.1rem;
    }
    
    .answer-input {
        padding: 0.75rem;
        font-size: 1.3rem;
    }
}
