/* ============================================================
   styles.css — tema "Dark Premium" para a Arena Offline
   ============================================================ */
:root {
  --bg: #070b14; --panel: #0f1626; --panel2: #1a2338; --line: #26324d;
  --text: #e8edf7; --muted: #8b97b3; --a: #7c3aed; --b: #06b6d4; --gold: #f5c451;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, #1b1450 0%, transparent 60%), radial-gradient(900px 500px at 100% 0%, #052e3a 0%, transparent 55%), var(--bg);
}
body.noscroll { overflow: hidden; }
.muted { color: var(--muted); }

/* ---------- topo / hero / filtros ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; gap: 12px; align-items: center; padding: 12px clamp(12px, 4vw, 40px); background: rgba(7, 11, 20, .8); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { font-size: 1.2rem; white-space: nowrap; }
.brand b { background: linear-gradient(90deg, var(--a), var(--b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
#search { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 1rem; }
#search:focus { outline: 2px solid var(--a); }
.hero { text-align: center; padding: clamp(28px, 6vw, 64px) 16px 10px; }
.hero h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 5vw, 3.2rem); letter-spacing: -.02em; }
.hero em { font-style: normal; background: linear-gradient(90deg, var(--a), var(--b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0 auto; max-width: 640px; color: var(--muted); line-height: 1.5; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 18px clamp(12px, 4vw, 40px) 6px; }
.chip { border: 1px solid var(--line); background: var(--panel); color: var(--muted); padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: .9rem; }
.chip:hover { color: var(--text); }
.chip.on { background: linear-gradient(135deg, var(--a), var(--b)); color: #fff; border-color: transparent; }
.count { padding: 6px clamp(12px, 4vw, 40px); color: var(--muted); font-size: .85rem; }

/* ---------- cards ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; padding: 8px clamp(12px, 4vw, 40px) 40px; }
.card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; display: flex; flex-direction: column; }
.card:hover, .card:focus-visible { transform: translateY(-4px); border-color: hsl(var(--hue) 80% 60%); box-shadow: 0 10px 30px hsl(var(--hue) 80% 40% / .3); outline: none; }
.thumb { height: 110px; display: grid; place-items: center; font-size: 3.6rem; background: linear-gradient(135deg, hsl(var(--hue) 70% 38%), hsl(calc(var(--hue) + 50) 70% 18%)); }
.cbody { padding: 12px 14px 14px; display: grid; gap: 6px; align-content: start; flex: 1; }
.cbody h3 { margin: 0; font-size: 1.05rem; }
.cbody p { margin: 0; font-size: .85rem; line-height: 1.35; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag { font-size: .7rem; padding: 3px 8px; border-radius: 999px; background: #1e293b; color: #cbd5e1; }
.tag.alt { background: #1e1b4b; color: #c4b5fd; }
.tag.gold { background: #3b2f08; color: var(--gold); }
.fav { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .45); color: #fff; font-size: 1.1rem; cursor: pointer; }
.fav.on { color: #fb7185; }
.empty { grid-column: 1 / -1; text-align: center; padding: 40px 0; }
footer { padding: 20px clamp(12px, 4vw, 40px) 50px; color: var(--muted); font-size: .9rem; max-width: 820px; margin: 0 auto; }
footer summary { cursor: pointer; color: var(--text); }
footer li { margin: 4px 0; }

/* ---------- botões ---------- */
.btn { background: linear-gradient(135deg, var(--a), var(--b)); color: #fff; border: 0; border-radius: 12px; padding: 10px 18px; font-weight: 700; font-size: 1rem; cursor: pointer; font-family: inherit; }
.btn:hover:not(:disabled) { filter: brightness(1.15); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 6px 12px; font-size: .85rem; }
.btn.big { font-size: 2rem; padding: 18px 28px; }
.btn.ghost { background: var(--panel2); }
.btn.key { min-width: 34px; padding: 10px 6px; background: var(--panel2); font-size: .95rem; }
.btn.key.ok, .tcell.ok { background: #16a34a; }
.btn.key.pos, .tcell.pos { background: #ca8a04; }
.btn.key.no, .tcell.no { background: #334155; opacity: .8; }
.btn.opt { width: min(92vw, 440px); text-align: left; background: var(--panel2); }
.btn.opt.ok { background: #16a34a; } .btn.opt.no { background: #b91c1c; }
.btn.swatch { width: 44px; height: 44px; padding: 0; }
.btn.up { width: 100%; text-align: left; background: var(--panel2); }
.row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.center { display: grid; place-items: center; min-height: 240px; }
.toolbar { display: flex; gap: 8px; }

/* ---------- janela do jogo ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(3, 6, 14, .88); display: flex; align-items: center; justify-content: center; padding: 8px; }
.modal[hidden] { display: none; }
.mbox { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; width: min(100%, 780px); max-height: 98vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 80px #000a; }
.mbar { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mbar b { font-size: 1rem; }
.sp { flex: 1; }
.pill { background: #1e1b4b; color: #c4b5fd; padding: 4px 10px; border-radius: 999px; font-size: .8rem; }
.pill:empty { display: none; }
.pill.alt { background: #0c4a6e; color: #7dd3fc; } .pill.gold { background: #3b2f08; color: var(--gold); }
.ibtn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); cursor: pointer; font-size: 1rem; }
.ibtn:hover { border-color: var(--b); }
.help { padding: 6px 14px; font-size: .8rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.stage { position: relative; flex: 1; min-height: 320px; overflow: auto; padding: 14px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 12px; }
.game-canvas { max-width: 100%; height: auto; border-radius: 12px; background: #000; touch-action: none; user-select: none; box-shadow: 0 6px 30px #0008; }
.overlay { position: absolute; inset: 0; z-index: 5; background: rgba(5, 8, 22, .8); backdrop-filter: blur(3px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 20px; }
.overlay h2 { margin: 0; font-size: clamp(1.4rem, 5vw, 2rem); }
.overlay p { margin: 0; } .rec { color: var(--gold); font-weight: 700; }
#pad { display: none; justify-content: space-between; align-items: center; padding: 10px 18px; border-top: 1px solid var(--line); }
#pad.show { display: flex; }
@media (pointer: coarse) { #pad { display: flex; } }
.dpad { display: grid; grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(3, 52px); gap: 4px; }
.dpad button, .act { border-radius: 50%; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 1.2rem; touch-action: none; user-select: none; }
.dpad button:nth-child(1) { grid-area: 1 / 2; } .dpad button:nth-child(2) { grid-area: 2 / 1; }
.dpad button:nth-child(3) { grid-area: 3 / 2; } .dpad button:nth-child(4) { grid-area: 2 / 3; }
.act { width: 76px; height: 76px; font-size: 1.5rem; font-weight: 800; background: linear-gradient(135deg, var(--a), var(--b)); }

/* ---------- tabuleiros genéricos ---------- */
.grid { display: grid; gap: 4px; width: min(92vw, var(--w, 360px)); }
.cell { aspect-ratio: 1; border: 0; border-radius: 10px; background: var(--panel2); color: var(--text); font-size: clamp(18px, 5vw, 28px); font-weight: 700; cursor: pointer; display: grid; place-items: center; user-select: none; padding: 0; font-family: inherit; }
.cell:hover:not(:disabled) { filter: brightness(1.2); }
.cell.sel { outline: 3px solid var(--gold); }
.cell.done { opacity: .3; }

/* ---------- jogos específicos ---------- */
.reflex { width: min(92vw, 520px); min-height: 260px; border-radius: 18px; display: grid; place-items: center; font-size: 1.8rem; font-weight: 800; cursor: pointer; user-select: none; text-align: center; padding: 16px; }
.reflex.wait { background: #7f1d1d; } .reflex.go { background: #15803d; }
.hole { background: #3f2a14; font-size: 2.4rem; }
.stroop { font-size: clamp(2.4rem, 10vw, 4rem); font-weight: 900; padding: 24px; }
.typeword, .mathq { font-size: clamp(2rem, 8vw, 3.2rem); font-weight: 800; padding: 18px; letter-spacing: .08em; text-align: center; }
.txtin { font-size: 1.4rem; padding: 10px 14px; border-radius: 12px; background: #0b1220; color: #fff; border: 2px solid #334155; width: min(92vw, 360px); text-align: center; font-family: inherit; }
.txtin:focus { outline: none; border-color: var(--b); }
.msg { margin: 0; text-align: center; min-height: 1.4em; } .msg.big { font-size: 1.6rem; font-weight: 800; }
.simon .cell { border-radius: 24px; opacity: .55; transition: opacity .1s, transform .1s; }
.pad0 { background: #ef4444; } .pad1 { background: #22c55e; } .pad2 { background: #3b82f6; } .pad3 { background: #eab308; }
.simon .cell.lit { opacity: 1; transform: scale(1.04); filter: brightness(1.4); }
.tile { background: var(--panel2); font-size: clamp(20px, 6vw, 34px); font-weight: 800; color: #fff; cursor: default; }
.g2048 { background: #0b1220; padding: 6px; border-radius: 14px; touch-action: none; }
.mines .mcell { background: #26324d; font-size: clamp(11px, 3.2vw, 18px); border-radius: 5px; }
.mines { gap: 2px; }
.mcell.open { background: #0b1220; cursor: default; }
[data-n="1"] { color: #60a5fa; } [data-n="2"] { color: #4ade80; } [data-n="3"] { color: #f87171; } [data-n="4"] { color: #a78bfa; }
[data-n="5"] { color: #fb923c; } [data-n="6"] { color: #22d3ee; } [data-n="7"] { color: #fff; } [data-n="8"] { color: #94a3b8; }
.memory .cell.up { background: #4f46e5; } .memory .cell.done { background: #16a34a; opacity: 1; }
.slide .cell { background: #4f46e5; font-size: clamp(20px, 7vw, 36px); } .slide .cell.blank { background: transparent; cursor: default; }
.light { background: #1e293b; } .light.on { background: #fde047; box-shadow: 0 0 16px #fde04788; }
.flood { gap: 1px; } .fcell { aspect-ratio: 1; }
.sudoku { gap: 1px; background: #475569; padding: 2px; border-radius: 6px; }
.sudoku .cell { border-radius: 2px; background: #111a2e; color: #7dd3fc; font-size: clamp(14px, 4vw, 22px); }
.sudoku .cell.given { color: #e2e8f0; background: #1e293b; }
.sudoku .cell.sel { outline: 2px solid var(--gold); outline-offset: -2px; background: #26324d; }
.sudoku .cell.bad { color: #f87171; }
.sudoku .bR { border-right: 3px solid #475569; } .sudoku .bB { border-bottom: 3px solid #475569; }
.hanoi { display: flex; gap: 14px; justify-content: center; align-items: flex-end; margin-top: 20px; }
.tower { position: relative; width: 120px; height: 220px; display: flex; flex-direction: column-reverse; align-items: center; background: var(--panel2); border-radius: 12px; padding-bottom: 6px; cursor: pointer; }
.tower.sel { outline: 3px solid var(--gold); }
.rod { position: absolute; bottom: 0; width: 8px; height: 190px; background: #64748b; border-radius: 4px; }
.disc { position: relative; z-index: 1; height: 20px; border-radius: 10px; margin-top: 2px; }
.candy { font-size: clamp(18px, 6vw, 32px); background: #1a2338; }
.ttt .cell { font-size: clamp(2rem, 14vw, 3.6rem); } .ttt .X { color: #60a5fa; } .ttt .O { color: #f472b6; }
.c4 { gap: 3px; background: #1d4ed8; padding: 6px; border-radius: 14px; }
.c4cell { border-radius: 50%; background: #0b1220; } .c4cell.p1 { background: #ef4444; } .c4cell.p2 { background: #facc15; } .c4cell.win { box-shadow: inset 0 0 0 4px #fff; }
.reversi { background: #166534; padding: 4px; border-radius: 12px; gap: 2px; }
.rv { position: relative; background: #15803d; border-radius: 4px; }
.rv.p1::after, .rv.p2::after { content: ''; position: absolute; inset: 12%; border-radius: 50%; }
.rv.p1::after { background: #111; } .rv.p2::after { background: #f8fafc; }
.rv.hint::after { content: ''; position: absolute; inset: 38%; border-radius: 50%; background: rgba(255, 255, 255, .4); }
.cards { display: grid; gap: 14px; justify-items: center; text-align: center; }
.hand { font-size: 1.3rem; min-height: 1.6em; } .versus { font-size: clamp(2rem, 9vw, 3rem); padding: 16px; letter-spacing: .08em; }
.slots { display: flex; gap: 10px; margin-top: 14px; }
.reel { font-size: 3.4rem; background: var(--panel2); border: 2px solid #334155; border-radius: 14px; padding: 10px 14px; min-width: 90px; text-align: center; }
.clicker { display: grid; gap: 12px; justify-items: center; }
.cookie { font-size: 6rem; background: none; border: 0; cursor: pointer; transition: transform .05s; }
.cookie:active { transform: scale(.9); }
.shop { display: grid; gap: 8px; width: min(92vw, 380px); }
.hword { font-size: clamp(1.6rem, 7vw, 2.4rem); font-weight: 800; letter-spacing: .15em; min-height: 1.4em; }
.kb { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 540px; }
.kb .row { width: 100%; gap: 5px; }
.termo { gap: 5px; }
.tcell { border: 2px solid #334155; background: transparent; font-size: clamp(1.2rem, 6vw, 1.8rem); font-weight: 800; cursor: default; }
.quiz { display: grid; gap: 10px; justify-items: center; } .quiz h3 { text-align: center; margin: 6px 0 10px; }
.tugbar { position: relative; width: min(92vw, 520px); height: 42px; margin: 40px 0 10px; border-radius: 21px; background: linear-gradient(90deg, #ef4444, #334155 50%, #3b82f6); }
.tugmark { position: absolute; top: 50%; transform: translate(-50%, -50%); font-size: 2rem; }
.lan { display: grid; gap: 10px; width: min(94vw, 540px); }
.lan h3, .lan p { margin: 0; } .chk { font-size: .85rem; color: var(--muted); }
.lan-work { display: grid; gap: 8px; justify-items: start; } .lbl { font-size: .8rem; color: var(--muted); }
textarea.code { width: 100%; font: 11px/1.3 ui-monospace, monospace; background: #0b1220; color: #e2e8f0; border: 1px solid var(--line); border-radius: 8px; padding: 8px; resize: vertical; }
