:root { --bg-color: #ffffff; --text-color: #1e293b; --btn-bg: #e2e8f0; --btn-hover: #cbd5e1; --primary: #3b82f6; --board-bg: #f8fafc; --cell-border: #cbd5e1; }
body.dark-mode { --bg-color: #050505; --text-color: #f8fafc; --btn-bg: #1f2937; --btn-hover: #374151; --board-bg: #111827; --cell-border: #374151; --primary: #60a5fa; }
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, sans-serif; }
body { background-color: var(--bg-color); color: var(--text-color); transition: 0.3s; display: flex; flex-direction: column; min-height: 100vh; }

.top-bar { display: flex; justify-content: space-between; align-items: center; padding: max(20px, env(safe-area-inset-top)) 20px 20px 20px; width: 100%; }
.icon-btn { background: none; border: none; font-size: 1.5rem; color: var(--text-color); cursor: pointer; transition: 0.2s; padding: 8px; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.icon-btn:hover { color: var(--primary); transform: scale(1.1); }
.lang-btn { font-size: 1rem; font-weight: bold; border: 2px solid var(--text-color); border-radius: 50%; width: 36px; height: 36px; padding: 0; }
.lang-btn:hover { border-color: var(--primary); }
.right-icons { display: flex; gap: 10px; align-items: center; flex-wrap: nowrap; }

.container { display: flex; flex-direction: column; align-items: center; flex-grow: 1; padding: 20px; width: 100%; }
.game-header { display: flex; flex-direction: column; align-items: center; margin-bottom: 15px; }
h1 { font-size: 2.5rem; text-align: center; }
.round-indicator { background: var(--btn-bg); padding: 5px 15px; border-radius: 20px; font-weight: bold; margin-top: 10px; font-size: 0.9rem; border: 1px solid var(--cell-border); }

/* Caixa Base do Jogo */
.daily-game-box { background-color: var(--board-bg); border: 2px solid var(--cell-border); border-radius: 16px; width: 100%; max-width: 420px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); height: 540px; display: flex; position: relative; overflow: hidden; }

/* Lógica de Estados */
.game-state { display: none; flex-direction: column; width: 100%; height: 100%; position: absolute; top: 0; left: 0; background-color: var(--board-bg); }
.game-state.active { display: flex; animation: fadeIn 0.2s ease-in-out; z-index: 5; }
.padded-state { padding: 25px; align-items: center; justify-content: space-between; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.countdown-text { font-family: 'Orbitron', monospace; font-size: 7rem; font-weight: bold; color: var(--primary); animation: pop 1s infinite; margin: auto; }
@keyframes pop { 0% { transform: scale(0.8); opacity: 0; } 50% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }

#stateMemorize { justify-content: flex-start; align-items: flex-end; padding: 25px; }
.memory-timer { font-family: 'Orbitron', monospace; font-size: 5.5rem; font-weight: bold; color: #fff; text-shadow: 0 4px 15px rgba(0,0,0,0.5); line-height: 1; margin-top: 10px; }
.memory-label { color: #fff; font-weight: bold; font-size: 1rem; text-shadow: 0 2px 5px rgba(0,0,0,0.5); margin-top: 5px; opacity: 0.9; }

.color-preview-large { width: 100%; flex-grow: 1; border-radius: 12px; border: 4px solid var(--cell-border); box-shadow: 0 4px 10px rgba(0,0,0,0.2); margin-bottom: 20px; transition: background-color 0.1s; }
.sliders-container { width: 100%; display: flex; flex-direction: column; gap: 14px; margin-bottom: 10px; }
.slider-group { text-align: left; width: 100%; }
.slider-group label { display: block; font-weight: bold; font-size: 0.85rem; margin-bottom: 5px; opacity: 0.9; }
.color-slider { -webkit-appearance: none; width: 100%; height: 16px; border-radius: 8px; outline: none; opacity: 0.9; transition: opacity .2s; }
.color-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 3px solid #333; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.4); }
.hue-slider { background: linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); }

.result-half { width: 100%; height: 50%; position: relative; padding: 25px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; }
.result-score { position: absolute; top: 25px; right: 25px; font-family: 'Orbitron', monospace; font-size: 5.5rem; font-weight: bold; color: #fff; text-shadow: 0 4px 15px rgba(0,0,0,0.3); line-height: 1; }
.half-info { display: flex; flex-direction: column; gap: 2px; }
.half-label { font-weight: bold; color: rgba(255,255,255,0.7); font-size: 0.9rem; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.color-values { color: #fff; font-weight: bold; font-size: 1.3rem; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.floating-next-btn { position: absolute; bottom: 25px; right: 25px; width: 65px; height: 65px; border-radius: 50%; background-color: #ffffff; color: #1e293b; border: none; font-size: 1.6rem; cursor: pointer; box-shadow: 0 5px 15px rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; transition: 0.2s; z-index: 10; }
.floating-next-btn:hover { transform: scale(1.1); }

.final-score { font-family: 'Orbitron', monospace; font-size: 5rem; font-weight: bold; color: var(--text-color); margin: 10px 0; }
.round-breakdown { display: flex; flex-direction: column; gap: 6px; width: 100%; margin-bottom: 20px; background: var(--btn-bg); padding: 15px; border-radius: 12px; border: 1px solid var(--cell-border); font-family: 'Orbitron', monospace; font-weight: bold; }
.round-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed rgba(128,128,128,0.2); }
.round-row:last-child { border-bottom: none; }

.breakdown-colors { display: flex; gap: 15px; align-items: center; }
.bd-color-item { display: flex; align-items: center; gap: 5px; }
.bd-label { font-size: 0.75rem; opacity: 0.7; font-family: sans-serif; font-weight: bold; }
.bd-swatch { width: 28px; height: 28px; border-radius: 6px; border: 2px solid var(--cell-border); box-shadow: 0 2px 4px rgba(0,0,0,0.2); }

.pulse-score { color: #22c55e; animation: pulseGreen 2s infinite; }
@keyframes pulseGreen { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }

.primary-btn { background-color: var(--primary); color: white; border: none; padding: 14px 20px; font-size: 1.1rem; font-weight: bold; border-radius: 10px; cursor: pointer; width: 100%; transition: 0.2s; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.primary-btn:hover { filter: brightness(1.1); transform: translateY(-2px); }
.pulse-btn { animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); } 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); } }
.mt-2 { margin-top: 10px; }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); display: none; justify-content: center; align-items: center; z-index: 2000; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal-content { background-color: var(--board-bg); color: var(--text-color); padding: 40px 35px; border-radius: 16px; width: 100%; max-width: 550px; border: 2px solid var(--cell-border); box-shadow: 0 20px 50px rgba(0,0,0,0.3); }
.modal-content h2 { margin-bottom: 25px; color: var(--primary); text-align: center; font-size: 1.8rem; }
.modal-content p { white-space: pre-line; text-align: left; line-height: 1.7; margin-bottom: 50px; font-size: 1.05rem; padding: 0 10px; }
.close-btn { background-color: var(--primary); color: white; border: none; padding: 14px; font-size: 1.1rem; font-weight: bold; border-radius: 8px; cursor: pointer; width: 100%; transition: 0.2s; }
.close-btn:hover { filter: brightness(1.1); }

.fb-input { width: 100%; padding: 12px; margin-bottom: 15px; border-radius: 8px; border: 1px solid var(--cell-border); background-color: var(--bg-color); color: var(--text-color); font-family: inherit; font-size: 1rem; }
.fb-file-label { display: block; margin-bottom: 5px; font-size: 0.9rem; color: var(--text-color); }
.fb-input-file { margin-bottom: 20px; width: 100%; color: var(--text-color); }

.ad-container { margin-top: 40px; display: flex; justify-content: center; width: 100%; min-height: 90px; }

/* Menu Lateral */
.side-menu { position: fixed; top: 0; left: -250px; width: 250px; height: 100%; background-color: var(--board-bg); box-shadow: 2px 0 10px rgba(0,0,0,0.2); transition: 0.3s; z-index: 1000; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; }
.side-menu.open { left: 0; }
.side-menu h2 { margin-bottom: 30px; color: var(--primary); border-bottom: 2px solid var(--cell-border); padding-bottom: 10px; font-size: 1.5rem;}
.side-menu ul { list-style: none; }
.side-menu li { margin-bottom: 15px; }
.side-menu a { text-decoration: none; color: var(--text-color); font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
.side-menu a.active { color: var(--primary); font-weight: bold; }
.menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: none; z-index: 999; }
.menu-overlay.open { display: block; }
.menu-category { font-size: 0.85rem; font-weight: bold; color: var(--primary); opacity: 0.7; margin-bottom: 8px; letter-spacing: 1px; pointer-events: none; }