/* Jogos por nível (kit) */
.timer { color: var(--accent); font-size: 16px; min-width: 70px; text-align: right; }
.stage {
  position: relative;
  background: var(--panel);
  border: 2px solid var(--panel-2);
  border-radius: var(--radius);
  padding: 16px;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.hud { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; color: var(--muted); font-size: 14px; }
.hud b { color: var(--accent); }
.overlay {
  position: absolute; inset: 0;
  background: rgba(13, 11, 30, 0.88);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; border-radius: var(--radius); z-index: 5; text-align: center; padding: 16px;
}
.overlay[hidden] { display: none; }
.overlay .pixel { color: var(--accent); font-size: 16px; }
.overlay p { color: var(--muted); font-size: 14px; max-width: 380px; }
.help { color: var(--muted); font-size: 13px; text-align: center; margin-top: 12px; }

/* Cobrinha */
#snake-canvas { display: block; width: min(100%, 420px); aspect-ratio: 1; margin: 0 auto; background: #120f26; border-radius: 10px; touch-action: none; }
.dpad { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 56px); gap: 6px; justify-content: center; margin-top: 14px; }
.dpad button { font-size: 22px; background: var(--panel-2); color: var(--text, #fff); border: 0; border-radius: 12px; cursor: pointer; }
.dpad .up { grid-column: 2; grid-row: 1; }
.dpad .left { grid-column: 1; grid-row: 2; }
.dpad .down { grid-column: 2; grid-row: 2; }
.dpad .right { grid-column: 3; grid-row: 2; }

/* Memória */
.mem-grid { display: grid; gap: 8px; justify-content: center; margin: 0 auto; }
.mcard {
  width: clamp(54px, 17vw, 84px); aspect-ratio: 1; border: 0; border-radius: 12px;
  background: var(--panel-2); font-size: clamp(24px, 8vw, 40px); cursor: pointer; color: inherit;
}
.mcard.up { background: #2d2750; }
.mcard.ok { background: var(--ok); opacity: 0.85; }

/* Alvo */
.arena-alvo { position: relative; width: 100%; aspect-ratio: 1 / 0.65; background: #120f26; border-radius: 10px; overflow: hidden; cursor: crosshair; touch-action: none; }
.target {
  position: absolute; border-radius: 50%; transform: translate(-50%, -50%); border: 0; padding: 0; cursor: pointer;
  background: radial-gradient(circle, var(--accent-2) 0 22%, #fff 22% 44%, var(--accent-2) 44% 66%, #fff 66% 100%);
}

/* Simon */
.simon { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; width: min(100%, 340px); margin: 0 auto; }
.pad { aspect-ratio: 1; border: 0; border-radius: 18px; opacity: 0.45; cursor: pointer; transition: opacity 0.08s, transform 0.08s; }
.pad.lit { opacity: 1; transform: scale(1.04); filter: brightness(1.3); }
.pad[data-i="0"] { background: #ff4f81; }
.pad[data-i="1"] { background: #4fc3ff; }
.pad[data-i="2"] { background: #ffd23f; }
.pad[data-i="3"] { background: #5be37d; }

/* Quiz (comex) */
.q-text { font-size: 18px; font-weight: 600; margin: 4px 0 14px; min-height: 3.2em; }
.q-opts { display: grid; gap: 10px; }
.qopt {
  text-align: left; padding: 12px 14px; min-height: 48px; border: 2px solid var(--panel-2);
  background: transparent; color: var(--text); border-radius: 12px; font-size: 15px; cursor: pointer;
}
.qopt:hover { border-color: var(--accent); }
.qopt.right { background: var(--ok); border-color: var(--ok); color: #0d0b1e; }
.qopt.wrong { background: var(--bad); border-color: var(--bad); color: #0d0b1e; }
.q-why { color: var(--muted); font-size: 14px; margin-top: 12px; min-height: 2.6em; }

/* Processo (ordenar) */
.steps-done { list-style: none; counter-reset: s; display: grid; gap: 6px; margin: 0 0 14px; padding: 0; }
.steps-done li { counter-increment: s; background: var(--ok); color: #0d0b1e; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.steps-done li::before { content: counter(s) "º  "; font-weight: 700; }
.steps-pool { display: grid; gap: 8px; }
.step-btn { text-align: left; padding: 12px 14px; min-height: 48px; border: 2px solid var(--panel-2); background: var(--panel-2); color: var(--text); border-radius: 12px; font-size: 14px; cursor: pointer; }
.step-btn.bad { border-color: var(--bad); animation: shake 0.3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* Caça aos erros */
.docs { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .docs { grid-template-columns: 1fr 1fr; } }
.doc { background: #fbfaf5; color: #1b1530; border-radius: 10px; padding: 10px; }
.doc h4 { margin: 0 0 6px; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.drow { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; padding: 8px; min-height: 40px; background: transparent; border: 0; border-bottom: 1px dashed #c9c3a8; color: inherit; font-size: 13px; cursor: pointer; }
.drow span:first-child { color: #6b6485; }
.drow span:last-child { font-weight: 600; text-align: right; }
.drow.found { background: #b8f0c9; }
.drow.miss { background: #ffc9c9; }

/* Clássicos */
.tray-actions { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }

/* Sudoku */
.sdk { display: grid; grid-template-columns: repeat(9, 1fr); width: min(100%, 440px); margin: 0 auto; border: 2px solid var(--muted); border-radius: 6px; overflow: hidden; background: var(--panel-2); gap: 1px; }
.sc { aspect-ratio: 1; border: 0; background: var(--panel); color: var(--accent); font: 700 clamp(15px, 4.6vw, 24px) system-ui, sans-serif; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; }
.sc.fixo { color: var(--text, #fff); background: #1d1838; }
.sc.rb { margin-right: 1px; box-shadow: 1px 0 0 var(--muted); }
.sc.bb { margin-bottom: 1px; box-shadow: 0 1px 0 var(--muted); }
.sc.rb.bb { box-shadow: 1px 0 0 var(--muted), 0 1px 0 var(--muted); }
.sc.same { background: #2c2552; }
.sc.sel { background: #4b3d8f; outline: 2px solid var(--accent); outline-offset: -2px; }
.sc.bad { color: #ff5d6c; background: #3a1d2c; }
.sc .nt { display: grid; grid-template-columns: repeat(3, 1fr); font: 600 clamp(7px, 2vw, 10px)/1.1 system-ui, sans-serif; color: var(--muted); width: 100%; padding: 2px; text-align: center; }
.numpad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; width: min(100%, 440px); margin: 12px auto 0; }
.np { padding: 12px 0; border: 0; border-radius: 10px; background: var(--panel-2); color: var(--text, #fff); font: 700 20px system-ui, sans-serif; cursor: pointer; }
.np:active { background: var(--accent); color: #1b1530; }

/* Caça-palavras */
.ws { --n: 8; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 2px; width: min(100%, 520px); margin: 0 auto; }
.wc { aspect-ratio: 1; border: 0; border-radius: 6px; background: var(--panel-2); color: var(--text, #fff); font: 700 clamp(11px, 3.4vw, 20px) system-ui, sans-serif; padding: 0; cursor: pointer; }
.wc.ini { outline: 3px solid var(--accent); outline-offset: -3px; }
.wordlist { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 14px; }
.ww { padding: 4px 9px; border-radius: 999px; background: var(--panel-2); color: var(--muted); font: 600 13px system-ui, sans-serif; letter-spacing: .04em; }
.ww.ok { text-decoration: line-through; opacity: .5; }

/* 2048 */
.g2048 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(100%, 380px); margin: 0 auto; padding: 8px; background: var(--panel-2); border-radius: 12px; touch-action: none; }
.tl { aspect-ratio: 1; border-radius: 8px; background: rgba(255,255,255,.06); display: flex; align-items: center; justify-content: center; font: 800 clamp(18px, 6vw, 32px) system-ui, sans-serif; color: #1b1530; }
.tl[data-v="2"] { background: #f4e9ff; } .tl[data-v="4"] { background: #e3cbff; }
.tl[data-v="8"] { background: #ffb98a; } .tl[data-v="16"] { background: #ff9a6b; }
.tl[data-v="32"] { background: #ff7a7a; } .tl[data-v="64"] { background: #ff5d8f; color: #fff; }
.tl[data-v="128"] { background: #ffd56f; } .tl[data-v="256"] { background: #ffc83d; }
.tl[data-v="512"] { background: #8dff9b; } .tl[data-v="1024"] { background: #6fd6ff; font-size: clamp(15px, 5vw, 26px); }
.tl[data-v="2048"] { background: #c79bff; font-size: clamp(15px, 5vw, 26px); }

/* Campo Minado */
.mines { --cols: 8; display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 2px; width: min(100%, 480px); margin: 0 auto; touch-action: manipulation; }
.mc { aspect-ratio: 1; border: 0; border-radius: 5px; background: #3b3170; color: var(--text, #fff); font: 800 clamp(10px, 3.2vw, 18px) system-ui, sans-serif; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mc.open { background: var(--panel-2); cursor: default; }
.mc.boom { background: #a02040; }
.mc[data-n="1"] { color: #6fd6ff; } .mc[data-n="2"] { color: #8dff9b; } .mc[data-n="3"] { color: #ff7a7a; }
.mc[data-n="4"] { color: #c79bff; } .mc[data-n="5"] { color: #ffb98a; } .mc[data-n="6"] { color: #6fffe0; }
.mc[data-n="7"] { color: #fff; } .mc[data-n="8"] { color: #aaa; }

/* Termo e parentes */
.hudmsg { text-align: center; min-height: 20px; margin: -4px 0 10px; color: var(--accent); font-size: 14px; }
.tboards { display: grid; gap: 14px 10px; justify-content: center; margin: 0 auto; }
.tboards:not([data-n="1"]) { grid-template-columns: repeat(2, auto); }
.tb { --len: 5; --cs: clamp(30px, 11vw, 52px); display: grid; grid-template-columns: repeat(var(--len), var(--cs)); gap: 4px; }
.tboards:not([data-n="1"]) .tb { --cs: clamp(22px, 6.4vw, 36px); gap: 3px; }
.tc { width: var(--cs); height: var(--cs); border: 2px solid var(--panel-2); border-radius: 6px; display: flex; align-items: center; justify-content: center; font: 800 calc(var(--cs) * .5) system-ui, sans-serif; color: var(--text, #fff); background: transparent; }
.tc.typed { border-color: var(--muted); }
.tc.fx { border-color: var(--accent); color: var(--accent); }
.tc.s0 { background: #3a3560; border-color: #3a3560; }
.tc.s1 { background: #d9a82b; border-color: #d9a82b; color: #1b1530; }
.tc.s2 { background: #3fae5a; border-color: #3fae5a; color: #fff; }
.tkeys { display: grid; gap: 6px; margin-top: 16px; }
.kr { display: flex; gap: 5px; justify-content: center; }
.tk { flex: 1 1 0; max-width: 40px; min-width: 0; height: 46px; border: 0; border-radius: 8px; background: var(--panel-2); color: var(--text, #fff); font: 700 15px system-ui, sans-serif; cursor: pointer; padding: 0; }
.tk.big { flex: 1.6 1 0; max-width: 64px; }
.tk.s0 { background: #2a2650; color: #7b76a8; } .tk.s1 { background: #d9a82b; color: #1b1530; } .tk.s2 { background: #3fae5a; color: #fff; }
.shake { animation: shk .35s; }
@keyframes shk { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Jogos do dia */
.tb.dia { --cs: min(52px, calc((100vw - 100px) / var(--len))); }
.dia-result { text-align: center; }
.dia-result .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.dia-result .stats b { display: block; font-size: 22px; color: var(--accent); }
.dia-result .stats span { font-size: 12px; color: var(--muted); }
.dist { display: grid; gap: 4px; margin: 0 auto 16px; max-width: 340px; text-align: left; }
.drow { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dbar { background: var(--panel-2); color: var(--text, #fff); padding: 2px 8px; border-radius: 4px; font-size: 12px; text-align: right; }
.dbar.me { background: #3fae5a; }
.dia-result .btn { margin: 4px 0; }
.dia-result p { margin: 10px 0; }
