/* Super Massive Games — folha de estilo unica.
   Todas as cores ficam nas variaveis abaixo: para um reskin completo,
   altere apenas o bloco :root (e o [data-theme="dark"] logo em seguida).

   Identidade: fliperama. Cantos mais retos, ciano eletrico como marca,
   laranja como acento, titulos em caixa alta com letter-spacing. */

:root {
  /* superficies */
  --bg: #eef3f8;
  --bg-soft: #e2ebf4;
  --surface: #ffffff;
  --surface-2: #f4f8fc;
  --border: #d6e2ee;
  --border-strong: #b6c7d9;

  /* texto */
  --text: #0c1a28;
  --text-soft: #3d5265;
  --text-mute: #6a8098;

  /* marca */
  --brand: #0891b2;
  --brand-strong: #0e7490;
  --brand-soft: #dcf3fa;
  --accent: #f97316;
  --accent-soft: #ffeddd;
  --gold: #eab308;
  --mint: #10b981;
  --sky: #0ea5e9;

  /* estado */
  --ok: #0d9668;
  --ok-soft: #dff7ee;
  --warn: #a95a08;
  --warn-soft: #fdefdb;
  --danger: #dc2626;

  /* cores usadas pelos jogos (lidas tambem pelo JS via getComputedStyle) */
  --tile-1: #e0f7fd;
  --tile-2: #c3edf8;
  --tile-3: #93dcf0;
  --tile-4: #4ec3e3;
  --tile-5: #22a5c9;
  --tile-6: #0e7490;
  --tile-7: #f97316;
  --tile-8: #eab308;
  --board: #dbe7f1;
  --board-line: #bccddd;

  /* forma e ritmo */
  --radius: 8px;
  --radius-sm: 5px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(12, 26, 40, .07), 0 8px 22px rgba(12, 26, 40, .07);
  --shadow-lg: 0 16px 44px rgba(12, 26, 40, .16);
  --ring: 0 0 0 3px rgba(8, 145, 178, .34);
  --max: 1180px;
  --gap: 22px;

  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Archivo", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #070d14;
  --bg-soft: #0c141e;
  --surface: #111c28;
  --surface-2: #17242f;
  --border: #23343f;
  --border-strong: #33495a;

  --text: #e8f4fb;
  --text-soft: #a9c4d6;
  --text-mute: #7d97ab;

  --brand: #22d3ee;
  --brand-strong: #67e8f9;
  --brand-soft: #10303c;
  --accent: #fb923c;
  --accent-soft: #38230f;
  --gold: #fbbf24;
  --mint: #34d399;
  --sky: #38bdf8;

  --ok: #34d399;
  --ok-soft: #10322a;
  --warn: #fbbf24;
  --warn-soft: #34290f;
  --danger: #f87171;

  --tile-1: #16303c;
  --tile-2: #1b4150;
  --tile-3: #1f5568;
  --tile-4: #1f7590;
  --tile-5: #1c9cbd;
  --tile-6: #22d3ee;
  --tile-7: #fb923c;
  --tile-8: #fbbf24;
  --board: #142230;
  --board-line: #21384a;

  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 28px rgba(0, 0, 0, .45);
  --shadow-lg: 0 22px 60px rgba(0, 0, 0, .6);
  --ring: 0 0 0 3px rgba(34, 211, 238, .42);
}

/* ---------------------------------------------------------------- base ---- */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 460px;
  background:
    radial-gradient(60% 100% at 12% 0%, rgba(79, 70, 229, .16), transparent 70%),
    radial-gradient(50% 100% at 88% 6%, rgba(240, 53, 110, .13), transparent 72%);
  pointer-events: none;
  z-index: 0;
}

img, svg, canvas { max-width: 100%; }
canvas { display: block; touch-action: none; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.22; margin: 0 0 .5em; letter-spacing: -.015em; }
h1 { font-size: clamp(1.85rem, 1.3rem + 2.2vw, 2.85rem); }
h2 { font-size: clamp(1.4rem, 1.15rem + 1.1vw, 1.85rem); }
h3 { font-size: 1.18rem; }
p { margin: 0 0 1.05em; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 60;
  background: var(--surface);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.skip:focus { left: 12px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }
.narrow { max-width: 760px; }

/* ------------------------------------------------------------- topbar ---- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.bar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.06rem;
  color: var(--text);
  letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand .logo { width: 32px; height: 32px; flex: none; border-radius: 9px; }
.brand small {
  display: block;
  font-weight: 500;
  font-size: .705rem;
  color: var(--text-mute);
  letter-spacing: 0;
  line-height: 1.3;
}

.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: .94rem;
  font-weight: 600;
}
.nav a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); }

.icon-btn {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  border-radius: 11px;
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 19px; height: 19px; }
.burger { display: none; }

[data-theme="dark"] .sun, .moon { display: none; }
[data-theme="dark"] .moon { display: block; }

@media (max-width: 860px) {
  .burger { display: grid; }
  .brand small { display: none; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 16px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 11px 14px; border-radius: var(--radius-sm); }
}

/* --------------------------------------------------------------- hero ---- */

main { flex: 1 0 auto; position: relative; z-index: 1; }

.hero { padding: 52px 0 30px; }
.hero p.lede { font-size: 1.13rem; color: var(--text-soft); max-width: 62ch; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--brand-strong);
  background: var(--brand-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: .96rem;
  cursor: pointer;
}
.btn:hover { background: var(--brand-strong); color: #fff; text-decoration: none; }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.small { padding: 8px 15px; font-size: .88rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* -------------------------------------------------------------- cards ---- */

section { padding: 30px 0; }
.section-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.section-head p { margin: 4px 0 0; color: var(--text-soft); font-size: .97rem; }
.section-head .count { margin-left: auto; color: var(--text-mute); font-size: .88rem; white-space: nowrap; }

.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
a.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
  text-decoration: none;
  color: inherit;
}
.card h3 { margin: 0; font-size: 1.08rem; }
.card p { margin: 0; color: var(--text-soft); font-size: .93rem; line-height: 1.55; }
.card .thumb {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 1.35rem;
  font-weight: 800;
}
.card .meta { margin-top: auto; padding-top: 6px; color: var(--text-mute); font-size: .82rem; }

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: .76rem;
  font-weight: 600;
}
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

/* --------------------------------------------------------------- game ---- */

.stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 0 0 26px;
}
.stage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.stage-head .spacer { margin-left: auto; }

.scores { display: flex; flex-wrap: wrap; gap: 10px; }
.score {
  min-width: 84px;
  padding: 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}
.score b { display: block; font-size: 1.22rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.score span { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-mute); }

.board-wrap { display: flex; justify-content: center; }
.status {
  min-height: 1.6em;
  margin: 14px 0 0;
  text-align: center;
  font-weight: 600;
  color: var(--text-soft);
}
.status.win { color: var(--ok); }
.status.lose { color: var(--danger); }

.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin-top: 16px; }
.controls label { font-size: .9rem; color: var(--text-soft); font-weight: 600; }

select, input[type="text"], input[type="email"], input[type="number"], textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  width: 100%;
}
select { cursor: pointer; }
textarea { resize: vertical; min-height: 150px; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.seg button {
  border: 0;
  background: none;
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-soft);
  padding: 6px 15px;
  border-radius: 999px;
  cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; }

.hint { color: var(--text-mute); font-size: .86rem; text-align: center; margin: 10px 0 0; }
.keys { font-family: var(--mono); font-size: .82em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }

/* -------------------------------------------------------------- prose ---- */

.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.7em; }
.prose h3 { margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.15em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--brand); }
.prose strong { color: var(--text); }

.byline { color: var(--text-mute); font-size: .88rem; margin: -4px 0 22px; }

.breadcrumb { font-size: .87rem; color: var(--text-mute); padding: 22px 0 0; }
.breadcrumb a { color: var(--text-soft); }

.callout {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 15px 18px;
  margin: 0 0 1.3em;
  font-size: .95rem;
  color: var(--text-soft);
}
.callout.estimate { border-left-color: var(--gold); }
.callout p:last-child { margin-bottom: 0; }

.faq { margin: 1.4em 0; }
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0 16px;
  margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--brand); font-weight: 700; }
.faq details[open] summary::after { content: "\2013"; }
.faq details > p:last-child { margin-bottom: 14px; }

table { width: 100%; border-collapse: collapse; margin: 0 0 1.3em; font-size: .94rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--text-mute); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }

.next-read { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--border); }

/* --------------------------------------------------------------- form ---- */

.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: .92rem; }
.field .help { color: var(--text-mute); font-size: .83rem; }
.field.full { grid-column: 1 / -1; }

.notice { padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: .95rem; }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.bad { background: var(--accent-soft); color: var(--danger); }

/* ------------------------------------------------------------- footer ---- */

.footer {
  margin-top: 56px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 0 28px;
  font-size: .92rem;
  color: var(--text-soft);
  position: relative;
  z-index: 1;
}
.footer h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--text-mute); margin-bottom: 12px; }
.footer .cols { display: grid; gap: 28px; grid-template-columns: 1.4fr repeat(3, 1fr); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 8px; }
.footer a { color: var(--text-soft); }
.footer a:hover { color: var(--brand); }
.footer .legal {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  font-size: .86rem;
  color: var(--text-mute);
}
.footer .legal .sep { margin-left: auto; }
.disclaimer { margin: 14px 0 0; font-size: .84rem; color: var(--text-mute); max-width: 90ch; }

@media (max-width: 760px) {
  .footer .cols { grid-template-columns: 1fr 1fr; }
  .hero { padding: 34px 0 22px; }
  body { font-size: 16.5px; }
  .stage { padding: 15px; border-radius: var(--radius); }
}

/* --------------------------------------------------- jogos: 2048 ------- */

.g2048 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  width: min(420px, 100%);
  aspect-ratio: 1 / 1;
  padding: 9px;
  background: var(--board);
  border-radius: var(--radius);
  outline: none;
}
.g2048 .tile {
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: clamp(1.1rem, 4.6vw, 1.9rem);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  transition: background-color .11s ease, color .11s ease;
}
.g2048 .tile.small { font-size: clamp(.95rem, 3.7vw, 1.5rem); }
.g2048 .tile.tiny { font-size: clamp(.8rem, 3vw, 1.15rem); }
.g2048 .tile.v2 { background: var(--tile-1); }
.g2048 .tile.v4 { background: var(--tile-2); }
.g2048 .tile.v8 { background: var(--tile-3); }
.g2048 .tile.v16 { background: var(--tile-4); color: #fff; }
.g2048 .tile.v32 { background: var(--tile-5); color: #fff; }
.g2048 .tile.v64 { background: var(--tile-6); color: #fff; }
.g2048 .tile.v128 { background: var(--sky); color: #fff; }
.g2048 .tile.v256 { background: var(--mint); color: #fff; }
.g2048 .tile.v512 { background: var(--tile-8); color: #23201a; }
.g2048 .tile.v1024 { background: var(--tile-7); color: #fff; }
.g2048 .tile.v2048,
.g2048 .tile.v4096 { background: var(--text); color: var(--bg); }
.g2048 .tile.pop { animation: pop .16s ease-out; }

@keyframes pop { from { transform: scale(.6); } to { transform: scale(1); } }

/* ----------------------------------------------- jogos: minesweeper ---- */

.ms-board {
  display: grid;
  gap: 3px;
  padding: 8px;
  background: var(--board);
  border-radius: var(--radius-sm);
  max-width: 100%;
  overflow: auto;
}
.ms-cell {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 5px;
  background: var(--border-strong);
  font: inherit;
  font-weight: 800;
  font-size: .92rem;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  user-select: none;
}
.ms-cell:hover:not(.open) { background: var(--brand-soft); }
.ms-cell.open { background: var(--surface-2); cursor: default; }
.ms-cell.flag { background: var(--warn-soft); }
.ms-cell.boom { background: var(--accent); color: #fff; }
.ms-cell.n1 { color: var(--sky); }
.ms-cell.n2 { color: var(--ok); }
.ms-cell.n3 { color: var(--accent); }
.ms-cell.n4 { color: var(--brand); }
.ms-cell.n5 { color: var(--warn); }
.ms-cell.n6 { color: #0d9488; }
.ms-cell.n7 { color: var(--text); }
.ms-cell.n8 { color: var(--text-mute); }

@media (max-width: 560px) {
  .ms-cell { width: 26px; height: 26px; font-size: .84rem; }
}

/* --------------------------------------------------- jogos: sudoku ----- */

.sudoku {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  width: min(460px, 100%);
  aspect-ratio: 1 / 1;
  background: var(--board-line);
  border: 2px solid var(--text-soft);
  border-radius: 8px;
  overflow: hidden;
}
.sd-cell {
  border: 0;
  background: var(--surface);
  color: var(--brand);
  font: inherit;
  font-weight: 700;
  font-size: clamp(.95rem, 3.4vw, 1.35rem);
  text-align: center;
  padding: 0;
  outline: none;
  border-right: 1px solid var(--board-line);
  border-bottom: 1px solid var(--board-line);
  -moz-appearance: textfield;
}
.sd-cell::-webkit-outer-spin-button,
.sd-cell::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sd-cell:focus { background: var(--brand-soft); }
.sd-cell.fixed { color: var(--text); background: var(--surface-2); font-weight: 800; }
.sd-cell.bad { background: var(--accent-soft); color: var(--danger); }
.sd-cell.col3 { border-right: 2px solid var(--text-soft); }
.sd-cell.row3 { border-bottom: 2px solid var(--text-soft); }

/* -------------------------------------------- jogos: sliding puzzle ---- */

.slide-board {
  display: grid;
  gap: 7px;
  width: min(420px, 100%);
  aspect-ratio: 1 / 1;
  padding: 7px;
  background: var(--board);
  border-radius: var(--radius);
}
.sl-tile {
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: clamp(1rem, 4vw, 1.6rem);
  cursor: pointer;
  padding: 0;
  transition: transform .08s ease;
}
.sl-tile:hover { transform: scale(1.03); }
.sl-tile.blank { background: transparent; cursor: default; }
.sl-tile.blank:hover { transform: none; }
.sl-tile.home { background: var(--mint); }

/* --------------------------------------------- jogos: memory match ---- */

.mem-grid { display: grid; gap: 10px; width: min(520px, 100%); }
.mem-card {
  position: relative;
  aspect-ratio: 3 / 4;
  border: 0;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--brand);
  cursor: pointer;
  font-size: clamp(1.3rem, 5vw, 2rem);
  display: grid;
  place-items: center;
  color: transparent;
}
.mem-card::after {
  content: "?";
  position: absolute;
  color: rgba(255, 255, 255, .7);
  font-weight: 800;
  font-size: 1.2rem;
}
.mem-card.up, .mem-card.done { background: var(--surface-2); color: var(--text); }
.mem-card.up::after, .mem-card.done::after { content: none; }
.mem-card.done { background: var(--ok-soft); cursor: default; opacity: .75; }

/* -------------------------------------------------- jogos: simon ------ */

.simon {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: min(360px, 100%);
  aspect-ratio: 1 / 1;
}
.simon-pad {
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  opacity: .45;
  transition: opacity .1s ease, transform .1s ease;
}
.simon-pad.lit, .simon-pad:active { opacity: 1; transform: scale(1.02); }
.simon-pad[data-pad="0"] { background: var(--mint); }
.simon-pad[data-pad="1"] { background: var(--accent); }
.simon-pad[data-pad="2"] { background: var(--sky); }
.simon-pad[data-pad="3"] { background: var(--gold); }

/* -------------------------------------------- jogos: connect four ----- */

.c4-wrap { display: inline-block; max-width: 100%; }
.c4-drop { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.c4-drop button {
  border: 1px dashed var(--border-strong);
  background: var(--surface-2);
  color: var(--text-soft);
  border-radius: 7px;
  padding: 4px 0;
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
}
.c4-drop button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.c4-drop button:disabled { opacity: .35; cursor: not-allowed; }
.c4 {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 8px;
  background: var(--brand);
  border-radius: var(--radius);
  width: min(440px, 100%);
}
.c4 .slot { aspect-ratio: 1 / 1; border-radius: 50%; background: var(--bg); }
.c4 .slot.p1 { background: var(--accent); }
.c4 .slot.p2 { background: var(--gold); }
.c4 .slot.line { box-shadow: 0 0 0 3px var(--text) inset; }

/* ------------------------------------------- jogos: reaction time ----- */

.rt-pad {
  width: 100%;
  min-height: 260px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}
.rt-pad.wait { background: var(--warn-soft); color: var(--warn); }
.rt-pad.go { background: var(--ok); color: #fff; }
.rt-pad.early { background: var(--accent-soft); color: var(--danger); }
.rt-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.rt-list span {
  padding: 5px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  font-size: .88rem;
}

/* --------------------------------------------------- canvas frames ---- */

.canvas-frame {
  background: var(--board);
  border-radius: var(--radius);
  padding: 8px;
  display: inline-block;
  max-width: 100%;
}
.canvas-frame canvas { border-radius: var(--radius-sm); width: 100%; height: auto; }

/* ------------------------------------------------------- utilitarios ---- */

.center { text-align: center; }
.mt0 { margin-top: 0; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* ------------------------------------------------------ identidade SMG ---- */
/* Fliperama: titulos condensados em caixa alta, contadores em mono,
   faixa ciano no topo e cantos retos nas miniaturas. */

.topbar { border-bottom: 2px solid var(--brand); }
.hero h1,
.section-head h2,
.stage-head .btn { font-family: var(--font-display); }
.hero h1,
.section-head h2 { text-transform: uppercase; letter-spacing: .015em; }
.eyebrow { text-transform: uppercase; letter-spacing: .13em; font-size: .74rem; }
.score b { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.card .thumb { border-radius: 6px; }
.card:hover { border-color: var(--brand); }
.btn { text-transform: uppercase; letter-spacing: .04em; font-size: .92rem; }
.btn.small { letter-spacing: .05em; }

/* ------------------------------------------------------- star defense ---- */
/* O tabuleiro e 640x520 no canvas; sem o teto o inline-block estica em
   telas largas e o jogo fica com pixels borrados. O checkbox de escudos
   entra na mesma linha dos botoes de rank, entao ganha respiro proprio. */

#sdf-canvas { max-width: 640px; }
.stage .controls label[for="sdf-shields"] { display: inline-flex; align-items: center; gap: 7px; }
.stage .controls label[for="sdf-shields"] input { accent-color: var(--brand); }

/* ------------------------------------------------- jogos: pong rally ---- */
/* O seletor de nivel da CPU fica desabilitado no modo de dois jogadores;
   sem isso o botao desligado fica identico ao ligado. */

.seg button:disabled { opacity: .42; cursor: not-allowed; }

/* -------------------------------------------------- jogos: mole rush ---- */
/* Tabuleiro de botoes reais (nao canvas) para funcionar no teclado e em
   leitor de tela. O estado vem do atributo data-state escrito pelo JS;
   alem da cor, cada tipo tem uma forma diferente, para nao depender de
   distinguir verde de vermelho. */

.mole-grid {
  display: grid;
  gap: 10px;
  width: min(520px, 100%);
  margin: 0 auto;
}
.mole-grid.cols3 { grid-template-columns: repeat(3, 1fr); }
.mole-grid.cols4 { grid-template-columns: repeat(4, 1fr); }

.mole-hole {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--board);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: background .1s ease-out;
}
.mole-hole[hidden] { display: none; }
.mole-hole:hover { border-color: var(--border-strong); }

.mole-face {
  width: 58%;
  height: 58%;
  border-radius: 50%;
  background: var(--board-line);
  transform: scale(.52);
  transition: transform .09s ease-out, background .09s ease-out;
}
.mole-hole[data-state="mole"] .mole-face { background: var(--mint); transform: scale(1); }
.mole-hole[data-state="gold"] .mole-face {
  background: var(--gold);
  transform: scale(1);
  box-shadow: 0 0 0 5px var(--warn-soft);
}
.mole-hole[data-state="bomb"] .mole-face {
  background: var(--danger);
  border-radius: 16%;
  transform: scale(.92) rotate(45deg);
}
.mole-hole[data-state="hit"] { background: var(--ok-soft); }
.mole-hole[data-state="gold-hit"] { background: var(--warn-soft); }
.mole-hole[data-state="boom"] { background: var(--accent); }
.mole-hole[data-state="wrong"] { background: var(--accent-soft); }
.mole-hole[data-state="hit"] .mole-face,
.mole-hole[data-state="gold-hit"] .mole-face,
.mole-hole[data-state="boom"] .mole-face,
.mole-hole[data-state="wrong"] .mole-face { transform: scale(0); }

.mole-key {
  position: absolute;
  top: 5px;
  left: 7px;
  font-family: var(--mono);
  font-size: .72rem;
  line-height: 1;
  color: var(--text-mute);
  opacity: .6;
  pointer-events: none;
}

@media (max-width: 480px) {
  .mole-grid { gap: 7px; }
  .mole-key { font-size: .64rem; top: 4px; left: 5px; }
}

/* --------------------------------------------- jogos: target rush ------ */
/* A moldura do canvas fica com largura propria para o tabuleiro nao
   esticar alem do desenhado em telas grandes. */

.aim-frame { width: min(660px, 100%); }
.aim-frame canvas { cursor: crosshair; }

/* -------------------------------------------- jogos: tower stacker ----- */

.tower-frame { width: min(420px, 100%); }
.stack-actions { display: flex; justify-content: center; margin-top: 14px; }
.stack-actions .btn { min-width: 190px; justify-content: center; }