/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variáveis CSS para responsividade */
:root {
    --game-max-width: min(1100px, 96vw);
    --game-padding: clamp(10px, 2vw, 20px);
    --font-size-base: clamp(14px, 1.5vw, 16px);
    --font-size-title: clamp(1.5em, 4vw, 2em);
    --button-min-height: clamp(40px, 5vh, 48px);
    --canvas-height: clamp(350px, 55vh, 500px);
    --player-size: clamp(30px, 4vw, 40px);
    --news-size: clamp(25px, 3.5vw, 30px);
    --powerup-size: clamp(28px, 4vw, 35px);
    --door-width: clamp(40px, 6vw, 50px);
    --door-height: clamp(55px, 8vw, 70px);
}

html {
    font-size: var(--font-size-base);
}

body {
    font-family: 'Segoe UI', 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    margin: 0;
    padding: clamp(5px, 1vw, 10px);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Animação de fundo */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: backgroundFloat 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes backgroundFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Container Principal */
#game-root {
    width: 100%;
    max-width: var(--game-max-width);
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.85);
    border-radius: clamp(0px, 2vw, 15px);
    padding: var(--game-padding);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    height: auto;
    min-height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    position: relative;
    display: flex;
    flex-direction: column;
    border: 2px solid rgba(255, 215, 0, 0.3);
    overflow: hidden;
}

/* Título */
h1 {
    text-align: center;
    background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    font-size: var(--font-size-title);
    margin: 0 0 clamp(10px, 2vh, 15px) 0;
    animation: shimmer 3s ease-in-out infinite;
    line-height: 1.2;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Estatísticas do Jogo */
#game-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: clamp(5px, 1vw, 10px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    padding: clamp(8px, 1.5vw, 12px) clamp(10px, 2vw, 15px);
    border-radius: 10px;
    margin-bottom: clamp(5px, 1vh, 10px);
    font-size: clamp(0.8em, 1.2vw, 0.95em);
    font-weight: bold;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#game-stats > div, #game-stats > button {
    padding: clamp(3px, 0.5vw, 5px) clamp(5px, 1vw, 10px);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#game-stats > div:hover, #game-stats > button:hover {
    transform: translateY(-2px);
}

#score {
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

#timer {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: pulse-timer 1s infinite;
}

@keyframes pulse-timer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

#room-info {
    color: #87ceeb;
    text-shadow: 0 0 10px rgba(135, 206, 235, 0.5);
}

#streak-info {
    color: #ff69b4;
    text-shadow: 0 0 10px rgba(255, 105, 180, 0.5);
}

#high-score {
    color: #ff6b6b;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

/* Indicador de Acessibilidade */
#accessibility-indicator {
    background: linear-gradient(135deg, #00b894, #00cec9);
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: bold;
    animation: pulse-accessibility 2s infinite;
}

#accessibility-indicator.hidden {
    display: none;
}

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

/* Barra de Dificuldade */
#difficulty-bar {
    display: flex;
    align-items: center;
    gap: clamp(5px, 1vw, 10px);
    padding: clamp(5px, 1vw, 8px) clamp(10px, 2vw, 15px);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: clamp(5px, 1vh, 10px);
    font-size: clamp(0.75em, 1.1vw, 0.9em);
}

.difficulty-progress {
    flex: 1;
    height: clamp(8px, 1.5vh, 10px);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.difficulty-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff88, #ffd700, #ff6b6b);
    transition: width 0.5s ease;
    box-shadow: 0 0 10px currentColor;
}

/* Display da Senha */
.password-display {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    padding: clamp(8px, 1.5vw, 12px);
    border-radius: 10px;
    text-align: center;
    margin-bottom: clamp(5px, 1vh, 10px);
    border: 2px solid #ffd700;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.password-display::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.password-display p {
    margin: clamp(3px, 0.5vh, 5px) 0;
    font-size: clamp(0.8em, 1.2vw, 0.9em);
    position: relative;
    z-index: 1;
}

#password-digits {
    font-family: 'Courier New', monospace;
    font-size: clamp(1.2em, 3vw, 2em);
    font-weight: bold;
    color: #ffd700;
    letter-spacing: clamp(0.1em, 0.5vw, 0.3em);
    margin: clamp(5px, 1vh, 10px) 0;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
    position: relative;
    z-index: 1;
}

/* Canvas do Jogo */
#game-canvas {
    width: 100%;
    height: var(--canvas-height);
    min-height: 300px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border: clamp(2px, 0.3vw, 3px) solid #ffd700;
    border-radius: clamp(8px, 1vw, 12px);
    position: relative;
    overflow: hidden;
    flex: 1;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Jogador */
#player {
    width: var(--player-size);
    height: var(--player-size);
    background: radial-gradient(circle, #ffd700, #ffed4e);
    border-radius: 50%;
    position: absolute;
    transition: none;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    z-index: 10;
    border: clamp(2px, 0.3vw, 3px) solid #ffed4e;
    animation: player-glow 2s ease-in-out infinite;
}

@keyframes player-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
    50% { box-shadow: 0 0 30px rgba(255, 215, 0, 1); }
}

#player::before {
    content: '🕵️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(16px, 2.5vw, 22px);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Animação de Movimento do Jogador */
#player.moving-left {
    transform: scaleX(-1);
}

#player.moving-right {
    transform: scaleX(1);
}

#player.moving-up::after {
    content: '⬆️';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(12px, 2vw, 16px);
    animation: fadeUp 0.5s ease-out;
}

#player.moving-down::after {
    content: '⬇️';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(12px, 2vw, 16px);
    animation: fadeDown 0.5s ease-out;
}

@keyframes fadeUp {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

@keyframes fadeDown {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(10px); }
}

/* Itens de Notícia */
.news-item {
    width: var(--news-size);
    height: var(--news-size);
    background: radial-gradient(circle, #4169E1, #1e3c72);
    border-radius: 50%;
    position: absolute;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 0 15px rgba(65, 105, 225, 0.8);
    animation: pulse-news 2s infinite;
    border: 2px solid #6495ED;
}

.news-item::before {
    content: '📰';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(12px, 2vw, 16px);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.news-item:hover {
    transform: scale(1.2) rotate(10deg);
    box-shadow: 0 0 25px rgba(65, 105, 225, 1);
}

@keyframes pulse-news {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 0 15px rgba(65, 105, 225, 0.8);
    }
    50% { 
        transform: scale(1.1); 
        box-shadow: 0 0 25px rgba(65, 105, 225, 1);
    }
}

/* Power-ups */
.power-up {
    width: var(--powerup-size);
    height: var(--powerup-size);
    position: absolute;
    cursor: pointer;
    animation: float-powerup 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
    transition: transform 0.3s ease;
}

.power-up:hover {
    transform: scale(1.3) rotate(360deg);
}

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

.power-up.time::before { content: '⏰'; font-size: clamp(20px, 3vw, 28px); }
.power-up.hint::before { content: '💡'; font-size: clamp(20px, 3vw, 28px); }
.power-up.shield::before { content: '🛡️'; font-size: clamp(20px, 3vw, 28px); }
.power-up.speed::before { content: '⚡'; font-size: clamp(20px, 3vw, 28px); }
.power-up.radar::before { content: '🎯'; font-size: clamp(20px, 3vw, 28px); }

/* Porta */
.door {
    position: absolute;
    right: clamp(10px, 2vw, 20px);
    top: 50%;
    transform: translateY(-50%);
    width: var(--door-width);
    height: var(--door-height);
    background: linear-gradient(180deg, #8B4513, #A0522D, #654321);
    border-radius: 10px 10px 0 0;
    border: clamp(2px, 0.3vw, 3px) solid #654321;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(0, 0, 0, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
}

.door::before {
    content: '🚪';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(22px, 3.5vw, 30px);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
}

.door::after {
    content: '🔒';
    position: absolute;
    top: 70%;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(12px, 2vw, 16px);
}

.door:hover {
    transform: translateY(-50%) scale(1.05);
}

.door.unlocked {
    border-color: #ffd700;
    box-shadow: 
        inset 0 0 30px rgba(255, 215, 0, 0.3),
        0 0 30px rgba(255, 215, 0, 0.8);
    animation: glow-door 1.5s infinite alternate;
}

.door.unlocked::after {
    content: '🔓';
}

@keyframes glow-door {
    from { 
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
        border-color: #ffd700;
    }
    to { 
        box-shadow: 0 0 40px rgba(255, 215, 0, 1);
        border-color: #ffed4e;
    }
}

/* Modais */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: clamp(20px, 3vw, 30px);
    border-radius: 15px;
    max-width: min(500px, 90vw);
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.7);
    border: 3px solid #ffd700;
    margin: 20px;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2, .modal-content h3 {
    color: #ffd700;
    margin-bottom: clamp(15px, 2vh, 20px);
    font-size: clamp(1.2em, 2.5vw, 1.5em);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.modal-content p {
    font-size: clamp(0.9em, 1.4vw, 1.1em);
    line-height: 1.5;
    margin-bottom: clamp(15px, 2vh, 20px);
    padding: clamp(10px, 2vw, 15px);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Modal Tutorial */
.modal-content.tutorial {
    max-width: min(600px, 90vw);
    background: linear-gradient(135deg, #1e3c72, #2a5298);
}

.tutorial-content h3 {
    color: #00ff88;
    margin-top: clamp(15px, 2vh, 20px);
    margin-bottom: clamp(8px, 1vh, 10px);
    font-size: clamp(1em, 1.8vw, 1.2em);
}

.tutorial-content ul {
    text-align: left;
    margin: 10px 0;
    padding-left: clamp(15px, 2vw, 20px);
}

.tutorial-content li {
    margin: clamp(5px, 1vh, 8px) 0;
    list-style: none;
    position: relative;
    padding-left: clamp(20px, 3vw, 25px);
    font-size: clamp(0.85em, 1.3vw, 1em);
}

.tutorial-content li::before {
    content: '✨';
    position: absolute;
    left: 0;
}

/* Seleção de Modo */
.mode-selection {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn.accessibility {
    background: linear-gradient(45deg, #00b894, #00cec9);
}

kbd {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Modal Mochila */
.modal-content.mochila {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    max-width: min(600px, 90vw);
}

#inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(50px, 10vw, 80px), 1fr));
    gap: clamp(8px, 1.5vw, 15px);
    margin: clamp(15px, 2vh, 20px) 0;
    padding: clamp(10px, 2vw, 20px);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.inventory-item {
    width: 100%;
    aspect-ratio: 1;
    min-width: 50px;
    max-width: 100px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #ffd700;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.inventory-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.inventory-item .item-icon {
    font-size: clamp(24px, 4vw, 32px);
    margin-bottom: 5px;
}

.inventory-item .item-count {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: #ffd700;
    color: #000;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: clamp(10px, 1.5vw, 12px);
    font-weight: bold;
}

.inventory-item .item-name {
    font-size: clamp(8px, 1.2vw, 10px);
    color: #ffd700;
}

.mochila-tip {
    color: #ffd700;
    font-size: clamp(0.8em, 1.2vw, 0.9em);
    font-style: italic;
    margin: 10px 0;
}

/* Seção de Dicas */
#hint-section {
    background: rgba(255, 215, 0, 0.2);
    padding: clamp(8px, 1.5vw, 10px);
    border-radius: 8px;
    margin: clamp(10px, 2vh, 15px) 0;
    border: 1px solid #ffd700;
}

.hint-text {
    color: #ffd700;
    font-style: italic;
    font-size: clamp(0.85em, 1.3vw, 1em);
}

/* Botões */
.btn {
    padding: clamp(10px, 1.5vh, 12px) clamp(16px, 3vw, 24px);
    border: none;
    border-radius: 8px;
    font-size: clamp(0.85em, 1.3vw, 1em);
    min-height: var(--button-min-height);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn.fake {
    background: linear-gradient(45deg, #e17055, #d63031);
    color: white;
    box-shadow: 0 4px 15px rgba(225, 112, 85, 0.4);
}

.btn.real {
    background: linear-gradient(45deg, #00b894, #00cec9);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.4);
}

.btn.hint {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #333;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.btn.start {
    background: linear-gradient(45deg, #00ff88, #00b894);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
    font-size: clamp(1em, 1.5vw, 1.2em);
    padding: clamp(12px, 2vh, 15px) clamp(30px, 5vw, 40px);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Modal Buttons */
.modal-buttons {
    display: flex;
    gap: clamp(10px, 2vw, 15px);
    justify-content: center;
    margin-top: clamp(15px, 2vh, 20px);
    flex-wrap: wrap;
}

/* Feedback Visual */
.feedback {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: clamp(15px, 2.5vw, 20px) clamp(20px, 4vw, 30px);
    border-radius: 10px;
    z-index: 1002;
    font-size: clamp(0.9em, 1.4vw, 1.1em);
    font-weight: bold;
    max-width: 80%;
    text-align: center;
    animation: slideDownFeedback 0.5s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@keyframes slideDownFeedback {
    from {
        transform: translateX(-50%) translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.feedback.correct {
    background: linear-gradient(45deg, #00b894, #00cec9);
    border: 2px solid #00ff88;
}

.feedback.incorrect {
    background: linear-gradient(45deg, #e17055, #d63031);
    border: 2px solid #ff6b6b;
}

/* Game Over Screen */
.game-over {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: clamp(25px, 4vw, 40px);
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.7);
    border: 3px solid #ffd700;
    z-index: 1001;
    animation: zoomIn 0.5s ease;
    max-width: min(500px, 90vw);
    width: 100%;
}

@keyframes zoomIn {
    from {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.game-over h2 {
    color: #ffd700;
    margin-bottom: clamp(15px, 2.5vh, 20px);
    font-size: clamp(1.5em, 3vw, 2em);
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.7);
}

.game-over p {
    margin: clamp(8px, 1.5vh, 10px) 0;
    font-size: clamp(0.9em, 1.4vw, 1.1em);
}

.restart-btn {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #2d3436;
    padding: clamp(12px, 2vh, 15px) clamp(30px, 5vw, 40px);
    border: none;
    border-radius: 10px;
    font-size: clamp(1em, 1.5vw, 1.2em);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: clamp(15px, 2.5vh, 20px);
    text-transform: uppercase;
}

.restart-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5);
}

/* Instructions */
#instructions {
    text-align: center;
    margin-top: clamp(5px, 1vh, 10px);
    padding: clamp(8px, 1.5vw, 12px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 8px;
    font-size: clamp(0.75em, 1.1vw, 0.9em);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.desktop-instructions {
    display: block;
}

.mobile-instructions {
    display: none;
}

/* Efeitos Especiais */
#effects-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

.particle {
    position: absolute;
    pointer-events: none;
    animation: float-particle 2s ease-out forwards;
}

@keyframes float-particle {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0);
    }
}

/* Efeito de Velocidade */
.speed-boost #player {
    box-shadow: 0 0 30px rgba(255, 215, 0, 1);
    animation: speed-glow 0.5s ease-in-out infinite;
}

@keyframes speed-glow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 1);
    }
    50% {
        box-shadow: 0 0 50px rgba(255, 255, 0, 1);
    }
}

/* Efeito de Escudo */
.shield-active #player::after {
    content: '';
    position: absolute;
    width: calc(var(--player-size) * 1.5);
    height: calc(var(--player-size) * 1.5);
    border: 3px solid rgba(135, 206, 235, 0.7);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: shield-rotate 2s linear infinite;
}

@keyframes shield-rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Efeito Radar */
.radar-active .news-item::after,
.radar-active .power-up::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: radar-pulse 1s ease-out infinite;
}

@keyframes radar-pulse {
    0% {
        width: 30px;
        height: 30px;
        opacity: 1;
    }
    100% {
        width: 60px;
        height: 60px;
        opacity: 0;
    }
}

/* Animações de Entrada */
@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInFromBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    border-top-color: #ffd700;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Accessibility */
:focus {
    outline: 2px solid #ffd700;
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   CONTROLES MOBILE
   ======================================== */

#mobile-controls {
    position: fixed;
    bottom: clamp(10px, 2vh, 20px);
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 clamp(10px, 2vw, 20px);
    pointer-events: none;
    z-index: 100;
}

#mobile-controls.hidden {
    display: none;
}

#joystick-container {
    pointer-events: auto;
}

#joystick-base {
    width: clamp(80px, 15vw, 120px);
    height: clamp(80px, 15vw, 120px);
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 215, 0, 0.5);
    border-radius: 50%;
    position: relative;
    touch-action: none;
}

#joystick-stick {
    width: clamp(30px, 5vw, 40px);
    height: clamp(30px, 5vw, 40px);
    background: radial-gradient(circle, #ffd700, #ffed4e);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    pointer-events: none;
}

#mobile-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
}

.mobile-btn {
    width: clamp(45px, 8vw, 60px);
    height: clamp(45px, 8vw, 60px);
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid #ffd700;
    border-radius: 50%;
    font-size: clamp(18px, 3vw, 24px);
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    transition: all 0.3s ease;
}

.mobile-btn:active {
    transform: scale(0.9);
    background: rgba(255, 215, 0, 0.4);
}

/* ========================================
   MODO ACESSIBILIDADE
   ======================================== */

.accessibility-mode #timer {
    color: #00ff88;
    text-decoration: line-through;
    opacity: 0.5;
}

.accessibility-mode #timer::after {
    content: ' (Pausado)';
    color: #00ff88;
    text-decoration: none;
}

/* Indicador de proximidade para acessibilidade */
.proximity-indicator {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border-radius: 50%;
    animation: proximity-pulse 1s infinite;
}

.proximity-close {
    border: 3px solid rgba(255, 0, 0, 0.8);
    animation-duration: 0.5s;
}

.proximity-medium {
    border: 3px solid rgba(255, 255, 0, 0.6);
    animation-duration: 1s;
}

.proximity-far {
    border: 3px solid rgba(0, 255, 0, 0.4);
    animation-duration: 1.5s;
}

@keyframes proximity-pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Feedback visual de direção para acessibilidade */
.direction-indicator {
    position: absolute;
    width: 30px;
    height: 30px;
    background: rgba(255, 215, 0, 0.8);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    animation: direction-pulse 0.5s infinite;
    pointer-events: none;
}

@keyframes direction-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.direction-north {
    top: -40px;
    left: 50%;
    transform: translateX(-50%) rotate(0deg);
}

.direction-south {
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%) rotate(180deg);
}

.direction-east {
    right: -40px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
}

.direction-west {
    left: -40px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
}

/* ========================================
   RESPONSIVIDADE MELHORADA
   ======================================== */

/* Smartphones Pequenos (320px - 360px) */
@media (max-width: 360px) {
    :root {
        --canvas-height: clamp(200px, 40vh, 280px);
        --player-size: 28px;
        --news-size: 22px;
        --powerup-size: 25px;
        --font-size-title: 1.3em;
    }

    #game-root {
        padding: 6px;
        border-radius: 0;
        min-height: 100vh;
        max-height: 100vh;
    }

    h1 {
        font-size: 1.1em;
        margin-bottom: 6px;
    }

    #game-stats {
        grid-template-columns: repeat(2, 1fr);
        padding: 5px 6px;
        font-size: 0.7em;
        gap: 4px;
    }

    #game-stats > div,
    #game-stats > button {
        padding: 4px 5px;
        font-size: 0.68em;
    }

    #difficulty-bar {
        font-size: 0.7em;
        padding: 5px 8px;
    }

    .password-display {
        padding: 6px;
    }

    .password-display p {
        font-size: 0.75em;
    }

    #password-digits {
        font-size: 1.3em;
        margin: 5px 0;
    }

    #game-canvas {
        min-height: 200px;
    }

    #inventory-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        padding: 8px;
    }

    .inventory-item {
        min-width: 45px;
        max-width: 55px;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .modal-content {
        padding: 15px;
        margin: 10px;
    }

    .modal-content h2,
    .modal-content h3 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }

    .modal-content p {
        font-size: 0.85em;
        padding: 8px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.8em;
    }

    #instructions {
        font-size: 0.7em;
        padding: 6px;
    }

    #joystick-base {
        width: 70px;
        height: 70px;
    }

    #joystick-stick {
        width: 28px;
        height: 28px;
    }

    .mobile-btn {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }
}

/* Smartphones Médios (361px - 480px) */
@media (min-width: 361px) and (max-width: 480px) {
    :root {
        --canvas-height: clamp(250px, 45vh, 340px);
        --player-size: 32px;
        --news-size: 26px;
        --powerup-size: 30px;
        --font-size-title: 1.4em;
    }

    #game-root {
        padding: 8px;
        border-radius: 8px;
        min-height: 100vh;
        max-height: 100vh;
    }

    h1 {
        font-size: 1.3em;
        margin-bottom: 8px;
    }

    #game-stats {
        grid-template-columns: repeat(3, 1fr);
        font-size: 0.75em;
        padding: 6px 8px;
    }

    #game-stats > div,
    #game-stats > button {
        padding: 5px 7px;
    }

    #game-canvas {
        min-height: 250px;
    }

    #inventory-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .inventory-item {
        min-width: 50px;
        max-width: 65px;
    }

    .modal-content {
        padding: 20px;
        margin: 15px;
    }

    .modal-buttons {
        gap: 10px;
    }

    .btn {
        padding: 10px 18px;
        font-size: 0.85em;
    }

    #instructions {
        font-size: 0.75em;
        padding: 8px;
    }
}

/* Smartphones Grandes (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    :root {
        --canvas-height: clamp(300px, 50vh, 400px);
        --player-size: 36px;
        --news-size: 28px;
        --powerup-size: 32px;
    }

    #game-root {
        padding: 15px;
        height: 100vh;
        border-radius: 0;
    }

    h1 {
        font-size: 1.5em;
        margin-bottom: 12px;
    }

    #game-canvas {
        height: 350px;
        min-height: 300px;
    }

    #game-stats {
        font-size: 0.85em;
        padding: 10px;
        grid-template-columns: repeat(4, 1fr);
    }

    #game-stats > div,
    #game-stats > button {
        padding: 6px 10px;
    }

    #difficulty-bar {
        font-size: 0.85em;
    }

    .password-display {
        padding: 10px;
    }

    .modal-content {
        margin: 15px;
        padding: 20px;
    }

    .modal-buttons {
        flex-direction: row;
        gap: 10px;
    }

    #inventory-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .inventory-item {
        min-width: 60px;
        max-width: 70px;
    }

    .btn {
        padding: 11px 20px;
        font-size: 0.9em;
    }

    #instructions {
        font-size: 0.8em;
        padding: 10px;
    }

    #joystick-base {
        width: 100px;
        height: 100px;
    }

    #joystick-stick {
        width: 35px;
        height: 35px;
    }

    .mobile-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* Tablets (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --canvas-height: min(450px, 60vh);
        --player-size: 38px;
        --news-size: 30px;
        --powerup-size: 34px;
    }

    #game-root {
        padding: 20px;
        border-radius: 12px;
    }

    h1 {
        font-size: 1.8em;
        margin-bottom: 15px;
    }

    #game-canvas {
        height: min(450px, 60vh);
        min-height: 350px;
    }

    #game-stats {
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        font-size: 0.9em;
        padding: 12px 15px;
    }

    #game-stats > div,
    #game-stats > button {
        padding: 6px 12px;
    }

    .password-display {
        padding: 12px;
    }

    #inventory-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 15px;
    }

    .inventory-item {
        min-width: 70px;
        max-width: 85px;
    }

    .modal-content {
        padding: 25px;
        margin: 20px;
    }

    .btn {
        padding: 12px 24px;
        font-size: 0.95em;
    }

    #instructions {
        font-size: 0.85em;
        padding: 12px;
    }
}

/* Desktop Médio (1025px - 1440px) */
@media (min-width: 1025px) and (max-width: 1440px) {
    :root {
        --canvas-height: clamp(400px, 60vh, 550px);
        --game-max-width: min(1100px, 94vw);
    }

    #game-root {
        min-height: calc(100vh - 40px);
        max-height: calc(100vh - 40px);
        padding: 18px;
    }

    #game-canvas {
        min-height: 400px;
    }

    #game-stats {
        display: flex;
        gap: 15px;
        padding: 12px 15px;
    }

    h1 {
        font-size: 1.9em;
        margin-bottom: 15px;
    }
}

/* Desktop Grande (1441px - 1920px) */
@media (min-width: 1441px) and (max-width: 1920px) {
    :root {
        --game-max-width: 1200px;
        --canvas-height: clamp(450px, 65vh, 600px);
    }

    #game-root {
        min-height: calc(100vh - 40px);
        max-height: calc(100vh - 40px);
        padding: 20px;
    }

    #game-canvas {
        min-height: 450px;
    }

    h1 {
        font-size: 2em;
        margin-bottom: 18px;
    }
}

/* Monitores 4K e Ultrawide (> 1920px) */
@media (min-width: 1921px) {
    :root {
        --game-max-width: 1400px;
        --font-size-base: 18px;
        --canvas-height: clamp(500px, 70vh, 700px);
        --player-size: 50px;
        --news-size: 40px;
        --powerup-size: 45px;
        --door-width: 60px;
        --door-height: 80px;
    }

    #game-root {
        min-height: calc(100vh - 40px);
        max-height: calc(100vh - 40px);
        padding: 22px;
    }

    #game-canvas {
        min-height: 500px;
    }
}

/* Modo Paisagem em dispositivos móveis */
@media (orientation: landscape) and (max-height: 500px) {
    :root {
        --canvas-height: calc(100vh - 200px);
        --player-size: 30px;
        --news-size: 24px;
        --powerup-size: 28px;
    }

    #game-root {
        max-height: 100vh;
        padding: 5px;
        border-radius: 0;
    }

    h1 {
        font-size: 1.2em;
        margin-bottom: 5px;
        line-height: 1;
    }

    #game-canvas {
        height: calc(100vh - 200px);
        min-height: 150px;
        flex: 1;
    }

    #game-stats {
        padding: 5px 8px;
        font-size: 0.75em;
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 4px;
    }

    #game-stats > div,
    #game-stats > button {
        padding: 3px 6px;
        font-size: 0.7em;
    }

    #difficulty-bar {
        padding: 4px 8px;
        font-size: 0.7em;
        margin-bottom: 4px;
    }

    .password-display {
        padding: 5px 8px;
        margin-bottom: 4px;
    }

    .password-display p {
        font-size: 0.7em;
        margin: 2px 0;
    }

    #password-digits {
        font-size: 1.2em;
        margin: 3px 0;
    }

    #instructions {
        display: none;
    }

    .modal-content {
        max-height: 85vh;
        padding: 12px;
        margin: 10px;
    }

    .modal-content h2,
    .modal-content h3 {
        font-size: 1.1em;
        margin-bottom: 8px;
    }

    .modal-content p {
        font-size: 0.85em;
        padding: 8px;
    }

    .modal-buttons {
        gap: 8px;
        margin-top: 10px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.8em;
    }

    #joystick-base {
        width: 70px;
        height: 70px;
    }

    #joystick-stick {
        width: 28px;
        height: 28px;
    }

    .mobile-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    #mobile-controls {
        bottom: 5px;
        padding: 0 10px;
    }
}

/* Modo Retrato em Tablets */
@media (orientation: portrait) and (min-width: 768px) and (max-width: 1024px) {
    :root {
        --canvas-height: min(600px, 55vh);
        --player-size: 38px;
        --news-size: 30px;
        --powerup-size: 34px;
    }

    #game-canvas {
        height: min(600px, 55vh);
        min-height: 400px;
    }

    #game-stats {
        grid-template-columns: repeat(3, 1fr);
        font-size: 0.9em;
    }

    #inventory-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========================================
   DETECÇÃO DE CAPACIDADES
   ======================================== */

/* Dispositivos Touch */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .inventory-item,
    .news-item,
    .power-up {
        min-width: 44px;
        min-height: 44px;
    }
    
    #mobile-controls {
        display: flex !important;
    }
    
    #mobile-controls.hidden {
        display: none !important;
    }
    
    .mobile-instructions {
        display: block;
    }
    
    .desktop-instructions {
        display: none;
    }
    
    #game-canvas {
        margin-bottom: 150px;
    }
}

/* Dispositivos com Mouse */
@media (hover: hover) and (pointer: fine) {
    #mobile-controls {
        display: none !important;
    }
}

/* Alto DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), 
       (min-resolution: 192dpi) {
    .news-item,
    .power-up,
    #player,
    .door {
        image-rendering: crisp-edges;
        image-rendering: -webkit-crisp-edges;
    }
}

/* Preferência de Movimento Reduzido */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Teclado Virtual Mobile */
@media (max-height: 500px) and (max-width: 768px) {
    .modal-content {
        max-height: 70vh;
        padding: 10px;
        overflow-y: auto;
    }

    .modal-buttons {
        position: sticky;
        bottom: 0;
        background: inherit;
        padding: 10px 0;
        z-index: 1;
    }

    #game-root {
        height: auto;
        min-height: 100vh;
    }
}

/* Media query específica para viewport comum de smartphones modernos */
@media (min-width: 361px) and (max-width: 414px) {
    :root {
        --canvas-height: clamp(280px, 48vh, 360px);
        --font-size-title: 1.35em;
    }

    #game-root {
        padding: 8px;
        min-height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    h1 {
        font-size: 1.25em;
        margin-bottom: 8px;
    }

    #game-stats {
        grid-template-columns: repeat(2, 1fr);
        font-size: 0.72em;
        padding: 6px 8px;
        gap: 4px;
    }

    #game-stats > div,
    #game-stats > button {
        padding: 5px 6px;
        font-size: 0.7em;
    }

    #difficulty-bar {
        font-size: 0.72em;
        padding: 5px 8px;
        gap: 6px;
    }

    .password-display {
        padding: 8px;
        margin-bottom: 6px;
    }

    .password-display p {
        font-size: 0.75em;
        margin: 3px 0;
    }

    #password-digits {
        font-size: 1.4em;
        letter-spacing: 0.2em;
    }

    #game-canvas {
        min-height: 280px;
    }

    #instructions {
        font-size: 0.7em;
        padding: 6px;
    }
}

/* Ajustes adicionais para telas muito pequenas */
@media (max-width: 320px) {
    :root {
        --canvas-height: clamp(180px, 35vh, 250px);
        --player-size: 26px;
        --news-size: 20px;
        --powerup-size: 23px;
        --door-width: 35px;
        --door-height: 50px;
    }

    body {
        padding: 0;
    }

    #game-root {
        padding: 5px;
        margin: 0;
        border-radius: 0;
    }

    h1 {
        font-size: 1em;
        margin-bottom: 6px;
    }

    #game-stats {
        grid-template-columns: repeat(2, 1fr);
        font-size: 0.65em;
        padding: 4px 6px;
        gap: 3px;
    }

    #game-stats > div,
    #game-stats > button {
        padding: 3px 4px;
        font-size: 0.65em;
    }

    .password-display p {
        font-size: 0.7em;
    }

    #password-digits {
        font-size: 1.1em;
    }

    #game-canvas {
        min-height: 180px;
    }

    .modal-content {
        padding: 12px;
        margin: 8px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 0.75em;
        min-height: 40px;
    }

    .btn.start {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .tutorial-content li {
        font-size: 0.8em;
        padding-left: 18px;
    }

    #joystick-base {
        width: 65px;
        height: 65px;
    }

    #joystick-stick {
        width: 25px;
        height: 25px;
    }

    .mobile-btn {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
}

/* Melhorias para tablets em paisagem */
@media (orientation: landscape) and (min-width: 768px) and (max-width: 1024px) {
    :root {
        --canvas-height: min(500px, 70vh);
    }

    #game-stats {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-around;
    }

    #game-canvas {
        height: min(500px, 70vh);
    }
}

/* Prevenção de overflow em dispositivos pequenos */
@media (max-width: 768px) {
    :root {
        --game-max-width: 100vw;
    }

    body {
        padding: 0;
    }

    #game-root {
        overflow-y: auto;
        overflow-x: hidden;
        border-radius: 0;
        width: 100vw;
        max-width: 100vw;
    }

    .modal {
        overflow-y: auto;
    }

    .modal-content {
        max-height: 85vh;
        overflow-y: auto;
    }

    .tutorial-content {
        max-height: 60vh;
        overflow-y: auto;
    }

    #game-canvas {
        touch-action: none;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }

    #game-stats {
        white-space: nowrap;
    }

    #game-stats > div,
    #game-stats > button {
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Alto Contraste para Acessibilidade */
.high-contrast {
    filter: contrast(1.5);
}

.high-contrast .news-item {
    border: 3px solid #fff;
}

.high-contrast .power-up {
    border: 3px solid #ffd700;
}

/* ========================================
   FIXES ESPECÍFICOS PARA NAVEGADORES
   ======================================== */

/* iOS Safari */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }
    
    #game-root {
        height: -webkit-fill-available;
    }
    
    /* Previne zoom em inputs */
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Firefox */
@-moz-document url-prefix() {
    #game-canvas {
        image-rendering: -moz-crisp-edges;
    }
}

/* Modo Escuro/Claro do Sistema */
@media (prefers-color-scheme: light) {
    .modal-content {
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
    }
}