/* MWS Games — site styles.
   Page = navy header, then content in one 1120px column. The home opens with a gold band and a shelf of
   colour-coded game covers; game pages are a slim toolbar over a themed play surface (.stage).
   Signature: vintage keycap buttons (.key) that sink when pressed. */

@font-face { font-family: "Poppins"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/poppins-700.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap; src: url("/assets/fonts/poppins-500.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/inter-400.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/fonts/inter-600.woff") format("woff"); }

:root {
  --navy: #141c28;
  --navy-2: #1f2a3b;
  --gold: #f2b705;
  --gold-edge: #b88a00;
  --paper: #f1f3f6;
  --card: #ffffff;
  --ink: #141c28;
  --muted: #5a6577;
  --line: #d8dee7;
  --cap: #ece5d2;          /* vintage keycap beige */
  --cap-edge: #bdb39b;
  --cap-text: #232323;
  --ok: #1f8a4c;
  --bad: #d0312d;
  --gutter: 16px;
  --display: "Poppins", "Arial Black", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1219; --card: #161e2b; --ink: #e9edf3; --muted: #9aa6b8; --line: #273244;
    --cap: #ddd5c0; --cap-edge: #8f8672; --cap-text: #1d1d1d; --ok: #4cc283; --bad: #ff6b63;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1219; --card: #161e2b; --ink: #e9edf3; --muted: #9aa6b8; --line: #273244;
  --cap: #ddd5c0; --cap-edge: #8f8672; --cap-text: #1d1d1d; --ok: #4cc283; --bad: #ff6b63;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--body); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img, svg { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }

.wrap {
  width: 100%; max-width: 1120px; margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* ---------- Header ---------- */
.top { background: var(--navy); color: #fff; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.15rem/1 var(--display); letter-spacing: -0.01em; color: #fff; white-space: nowrap; }
.brand-mark { width: 40px; height: auto; fill: var(--gold); flex: none; }
.tm { font-size: .45em; font-weight: 500; vertical-align: super; line-height: 0; margin-left: 1px; opacity: .85; }
.nav { display: flex; gap: 6px; align-items: center; font: 600 0.92rem/1 var(--body); }
.nav a { text-decoration: none; color: #b9c3d3; padding: 9px 10px; border-radius: 8px; }
.nav a:hover, .nav a[aria-current="page"] { color: #fff; }
.nav .lang { border: 1.5px solid #3a4960; border-radius: 999px; padding: 6px 11px; font-size: 0.8rem; letter-spacing: 0.06em; color: #fff; margin-left: 4px; }
.nav .lang:hover { border-color: var(--gold); }
@media (max-width: 480px) { .brand { font-size: 1.02rem; gap: 8px; } .brand-mark { width: 34px; } .nav { gap: 2px; font-size: 0.88rem; } .nav a { padding: 9px 7px; } .nav .lang { padding: 6px 9px; margin-left: 2px; } }

/* ---------- Keycap buttons ---------- */
.key {
  --d: 6px; --edge: var(--cap-edge);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px calc(11px + var(--d)); border-radius: 11px; border: 0; cursor: pointer;
  background: var(--cap); color: var(--cap-text); text-decoration: none; white-space: nowrap;
  font: 700 0.95rem/1 var(--display); letter-spacing: 0.01em;
  box-shadow: inset 0 calc(-1 * var(--d)) 0 var(--edge), 0 2px 0 rgba(0,0,0,.14);
  transition: transform .08s ease, box-shadow .08s ease, padding .08s ease, filter .12s ease;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.key:hover { filter: brightness(1.04); }
.key:active, .key.on {
  transform: translateY(calc(var(--d) - 2px));
  padding-bottom: calc(11px + 2px);
  box-shadow: inset 0 -2px 0 var(--edge), 0 0 0 rgba(0,0,0,0);
}
.key.gold { background: var(--gold); color: #141c28; --edge: var(--gold-edge); }
.key.navy { background: var(--navy); color: #fff; --edge: #05080d; }
.key.on { background: var(--gold); color: #141c28; --edge: var(--gold-edge); }
.key.sm { --d: 4px; padding: 8px 12px calc(8px + var(--d)); border-radius: 9px; font-size: 0.82rem; gap: 6px; }
.key.sm:active, .key.sm.on { padding-bottom: calc(8px + 2px); }
.key svg { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.key small { font-family: var(--body); font-weight: 600; opacity: .7; }
.key[disabled], .key[aria-disabled="true"] { cursor: default; opacity: .55; filter: none; }
.key[disabled]:active, .key[aria-disabled="true"]:active { transform: none; padding-bottom: calc(11px + var(--d)); box-shadow: inset 0 calc(-1 * var(--d)) 0 var(--edge), 0 2px 0 rgba(0,0,0,.14); }
.key.sm[disabled]:active { padding-bottom: calc(8px + var(--d)); }
@media (prefers-reduced-motion: reduce) { .key { transition: none; } html { scroll-behavior: auto; } }
.keys { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Home: gold band ---------- */
.hero { background: var(--gold); color: #141c28; overflow: hidden; }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 24px; min-height: 340px; }
.hero-copy { padding-block: 44px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.7rem); line-height: 1.04; margin: 0 0 14px; letter-spacing: -0.03em; }
.hero .lead { font-size: 1.12rem; line-height: 1.5; max-width: 34ch; margin: 0 0 22px; color: #3a2f08; }
.hero-art { align-self: end; margin-bottom: -6px; }
.hero-art svg { width: 100%; height: auto; overflow: visible; }
@media (max-width: 820px) {
  .hero-in { grid-template-columns: 1fr; gap: 0; min-height: 0; }
  .hero-copy { padding-block: 30px 6px; }
  .hero .lead { margin-bottom: 16px; }
  .hero-art { max-width: 440px; margin-inline: auto; width: 100%; }
}

/* ---------- Sections ---------- */
.sec { padding-block: 34px 10px; }
.sec:last-of-type { padding-bottom: 48px; }
.sec-h { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.sec-h h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); line-height: 1.15; margin: 0; }
.sec-h h2::before { content: ""; display: inline-block; width: .55em; height: .55em; margin-right: .45em; background: var(--gold); border-radius: 3px; box-shadow: inset 0 -3px 0 var(--gold-edge); }
.sec-sub { color: var(--muted); margin: -6px 0 18px; max-width: 62ch; }

/* ---------- Game covers ---------- */
.covers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .covers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.cover {
  --c: #1d6a47;
  display: flex; flex-direction: column; min-width: 0; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.cover-art { aspect-ratio: 16 / 10; background: var(--c); overflow: hidden; position: relative; }
.cover-art::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: radial-gradient(120% 100% at 30% 0%, rgba(255,255,255,.2), rgba(255,255,255,0) 55%), linear-gradient(rgba(0,0,0,0) 55%, rgba(0,0,0,.22)); pointer-events: none; }
.cover-art svg { width: 100%; height: 100%; transition: transform .25s ease; position: relative; z-index: 1; }
.cover-body { padding: 14px 16px 16px; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; }
.cover-body h3 { font-size: 1.2rem; line-height: 1.2; margin: 0; }
.cover-body p { grid-column: 1; margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.35; }
.cover-body .key { grid-column: 2; grid-row: 1 / span 2; }
a.cover:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(20,28,40,.16); border-color: transparent; }
a.cover:hover .cover-art svg { transform: scale(1.04); }
@media (max-width: 560px) {
  .cover { border-radius: 14px; }
  .cover-body { grid-template-columns: 1fr; padding: 10px 12px 12px; }
  .cover-body h3 { font-size: 1.02rem; }
  .cover-body p { font-size: 0.8rem; }
  .cover-body .key { display: none; }
}
@media (prefers-reduced-motion: reduce) { .cover, .cover-art svg { transition: none; } }

/* ---------- Android app cards ---------- */
.games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 760px) { .games { grid-template-columns: 1fr; gap: 14px; } }
.game { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.game-art { aspect-ratio: 1024 / 500; background: var(--line); overflow: hidden; }
.game-art img { width: 100%; height: 100%; object-fit: cover; }
.game-body { padding: 16px 18px 18px; display: grid; gap: 12px; flex: 1; align-content: start; }
.game-head { display: flex; gap: 14px; align-items: center; }
.game-icon { width: 56px; height: 56px; border-radius: 14px; flex: none; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.game h3 { font-size: 1.2rem; line-height: 1.2; margin: 0; }
.genre { font: 600 0.74rem/1.2 var(--body); color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 4px; }
.game p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { font: 600 0.74rem/1 var(--body); padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.live { border-color: var(--ok); color: var(--ok); }
.game .keys { margin-top: auto; padding-top: 4px; }

/* ---------- Footer ---------- */
footer { background: var(--navy); color: #b9c3d3; font-size: 0.92rem; margin-top: 24px; }
footer .wrap { padding-block: 26px 34px; display: flex; gap: 14px 28px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
footer .brand { font-size: 1rem; }
footer .brand-mark { width: 34px; }
footer nav { display: flex; gap: 6px 18px; flex-wrap: wrap; }
footer a { color: #dfe5ee; text-underline-offset: 3px; }
.mail { user-select: all; }
.foot-note { flex-basis: 100%; color: #8793a6; font-size: 0.84rem; }

/* ---------- Text pages (privacy) ---------- */
.doc .wrap { max-width: 780px; padding-block: 36px 48px; }
.doc h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); line-height: 1.1; margin: 0; }
.doc h2 { font-size: 1.15rem; margin: 28px 0 0; letter-spacing: -0.01em; }
.doc .date { font-size: 0.88rem; color: var(--muted); margin: 10px 0 22px; }
.doc p, .doc li { max-width: 68ch; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 44px 0 30px; }
.eyebrow { font: 600 0.76rem/1 var(--body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; overflow-wrap: anywhere; }
.toc { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 8px; }
.plist { display: grid; gap: 12px; padding: 0; list-style: none; margin: 0; }
.plist a { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); text-decoration: none; }
.plist a:hover { border-color: var(--ink); }
.plist img { width: 44px; height: 44px; border-radius: 11px; flex: none; }
.pkg { font-size: 0.8rem; color: var(--muted); overflow-wrap: anywhere; }
.note { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 12px; padding: 12px 16px; margin: 0 0 22px; }
.note p { margin: 0; }

/* ---------- Game pages ---------- */
.gp .wrap { padding-block: 12px 8px; }
.g-bar { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 10px; }
.g-bar h1 { font-size: 1.4rem; line-height: 1.1; margin: 0 auto 0 0; }
.stats { display: flex; gap: 14px; font: 600 0.9rem/1 var(--body); color: var(--muted); white-space: nowrap; }
.stats b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; margin-left: 5px; }
.g-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.g-actions .sep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 2px; }
.seg { display: inline-flex; gap: 4px; }
.seg-label { display: none; font: 600 0.8rem/1 var(--body); color: var(--muted); white-space: nowrap; margin-right: -2px; }
@media (max-width: 720px) {
  .gp .wrap { padding-top: 8px; }
  .g-bar { gap: 8px 10px; margin-bottom: 8px; }
  .g-bar h1 { font-size: 1.12rem; }
  .stats { gap: 10px; font-size: 0.84rem; }
  .g-actions { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 3px; margin-bottom: -3px; }
  .g-actions::-webkit-scrollbar { display: none; }
  .g-actions.inline { width: auto; }
  .g-actions .key .lbl-x { display: none; }
  .g-actions .key.sm { padding-inline: 11px; }
  .seg-label { display: inline; }
}

.stage { position: relative; border-radius: 18px; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.stage.felt { background: radial-gradient(120% 90% at 50% 0%, #2f9265 0%, #1d6a47 55%, #155034 100%); }
.stage.indigo { background: radial-gradient(120% 90% at 50% 0%, #5444c4 0%, #3b2f8f 55%, #2a2069 100%); }
.stage.slate { background: radial-gradient(120% 90% at 50% 0%, #5d7089 0%, #44546a 55%, #344154 100%); }
.stage.wood { background-color: #8a5529; background-image: radial-gradient(120% 90% at 50% 0%, rgba(255,214,150,.28), rgba(0,0,0,0) 60%), repeating-linear-gradient(90deg, rgba(0,0,0,.07) 0 2px, rgba(0,0,0,0) 2px 88px), linear-gradient(#9a6231, #7a4a22); }
.stage.lacquer { background: radial-gradient(120% 90% at 50% 0%, #a3343a 0%, #7d1f24 55%, #5c1418 100%); }
.stage.plain { background: transparent; border-radius: 0; overflow: visible; }
.stage.felt, .stage.indigo, .stage.slate, .stage.wood, .stage.lacquer { box-shadow: inset 0 0 0 2px rgba(255,255,255,.07), inset 0 0 70px rgba(0,0,0,.22); }
@media (max-width: 720px) {
  .stage.felt, .stage.indigo, .stage.slate, .stage.wood, .stage.lacquer { border-radius: 0; margin-inline: calc(-1 * max(var(--gutter), env(safe-area-inset-left, 0px))); }
}

.toast { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 9100; max-width: calc(100% - 24px);
  background: rgba(10,14,20,.9); color: #fff; padding: 9px 15px; border-radius: 999px; font: 600 0.9rem/1.3 var(--body); text-align: center; pointer-events: none; animation: toast-in .18s ease; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
.dlg:focus { outline: none; }
.dlg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 9000; display: grid; place-items: center; padding: 14px; background: rgba(8,12,18,.6); animation: fade-in .2s ease; overflow: auto; }
@keyframes fade-in { from { opacity: 0; } }
.dlg-box { background: var(--card); color: var(--ink); border-radius: 18px; padding: 22px 20px 20px; width: 100%; max-width: 380px; text-align: center; box-shadow: 0 22px 50px rgba(0,0,0,.45); animation: pop-in .22s cubic-bezier(.2,1.2,.4,1); }
@keyframes pop-in { from { transform: scale(.92); opacity: 0; } }
.dlg-box h2 { font-size: 1.6rem; line-height: 1.15; margin: 0 0 4px; }
.dlg-box p { margin: 0 0 12px; color: var(--muted); }
.dlg-stats { display: flex; justify-content: center; gap: 22px; margin: 12px 0 16px; }
.dlg-stats div { font: 600 0.78rem/1.2 var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.dlg-stats b { display: block; font: 700 1.5rem/1.2 var(--display); color: var(--ink); letter-spacing: -0.01em; text-transform: none; font-variant-numeric: tabular-nums; }
.dlg-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.dlg table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.dlg th, .dlg td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: center; }
.dlg th:first-child, .dlg td:first-child { text-align: left; color: var(--muted); font-weight: 400; }
.dlg thead th { font: 700 0.9rem/1.2 var(--display); }
.dlg tfoot td { font: 700 1.05rem/1.2 var(--display); border-bottom: 0; }
.dlg td.win { color: var(--ok); font-weight: 600; }
.confetti { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 8900; }
@media (prefers-reduced-motion: reduce) { .dlg, .dlg-box, .toast { animation: none; } }

.howto { padding-block: 26px 6px; }
.howto h2 { font-size: 1.25rem; margin: 0 0 8px; }
.howto p, .howto li { color: var(--muted); max-width: 70ch; margin: 0 0 8px; }
.howto ul { padding-left: 1.2em; margin: 0 0 8px; }
.more { padding-block: 18px 30px; }
.more h2 { font-size: 1.25rem; margin: 0 0 12px; }
.minis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.mini { --c: #1d6a47; text-decoration: none; border-radius: 14px; overflow: hidden; background: var(--card); border: 1px solid var(--line); min-width: 0; transition: transform .16s ease, box-shadow .16s ease; }
.mini:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(20,28,40,.15); }
.mini .cover-art { aspect-ratio: 16 / 10; }
.mini span { display: block; padding: 8px 10px 10px; font: 700 0.92rem/1.2 var(--display); letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  .minis { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 132px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
}

/* ---------- Playing cards (shared by Solitaire, Spider, Scopa) ---------- */
.cards { touch-action: manipulation; }
.card { position: absolute; left: 0; top: 0; width: var(--cw); height: var(--ch); z-index: var(--z, 1);
  transform: translate3d(var(--x, 0px), var(--y, 0px), 0) rotate(var(--r, 0deg)) scale(var(--k, 1)); transition: transform .24s cubic-bezier(.2,.8,.25,1);
  cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
.card.mv { z-index: calc(var(--z, 1) + 3000); }
.card.drag { transition: none; z-index: calc(var(--z, 1) + 6000); cursor: grabbing; }
.card.drag .ci { box-shadow: 0 12px 22px rgba(0,0,0,.4); }
.card.nomove { cursor: default; }
.ci { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: calc(var(--cw) * .08); overflow: hidden; box-shadow: 0 0 0 1px rgba(10,15,24,.42), 0 1px 3px rgba(0,0,0,.3); background: var(--card-back) center / 100% 100% no-repeat; }
.card.up .ci { background: #fffdf8; }
.ci svg { width: 100%; height: 100%; }
.card:not(.up) .ci svg { display: none; }
.card.flip .ci { animation: card-flip .22s ease; }
@keyframes card-flip { 50% { transform: scaleX(.04); } }
.card.no .ci { animation: card-no .28s ease; }
@keyframes card-no { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.card.hint .ci { animation: card-hint .9s ease 2; }
@keyframes card-hint { 50% { box-shadow: 0 0 0 4px var(--gold), 0 0 22px 6px rgba(242,183,5,.75); } }
.card.sel .ci { box-shadow: 0 0 0 3px var(--gold), 0 6px 14px rgba(0,0,0,.4); }
.slot { position: absolute; left: 0; top: 0; width: var(--cw); height: var(--ch); transform: translate3d(var(--x, 0px), var(--y, 0px), 0);
  border-radius: calc(var(--cw) * .08); border: 2px solid rgba(255,255,255,.2); background: rgba(0,0,0,.1); padding: 0; cursor: pointer;
  display: grid; place-items: center; color: rgba(255,255,255,.3); -webkit-tap-highlight-color: transparent; }
.slot svg { width: 46%; height: auto; fill: currentColor; }
.slot.hint { animation: slot-hint .9s ease 2; }
@keyframes slot-hint { 50% { border-color: var(--gold); box-shadow: 0 0 18px 4px rgba(242,183,5,.7); } }
.slot[disabled] { cursor: default; }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card.flip .ci, .card.no .ci { animation: none; } }

/* ---------- Minesweeper ---------- */
.mines-wrap { display: grid; place-items: center; padding: 14px 8px; min-height: inherit; overflow-x: auto; }
.mines-board { display: grid; gap: var(--g, 2px); padding: 8px; border-radius: 14px; background: rgba(9,14,22,.4); box-shadow: inset 0 2px 6px rgba(0,0,0,.35); touch-action: manipulation; }
.mc { width: var(--s); height: var(--s); border: 0; padding: 0 0 calc(var(--s) * .1); border-radius: calc(var(--s) * .17); background: #ece5d2; color: #232323;
  box-shadow: inset 0 calc(var(--s) * -.1) 0 #bdb39b; font: 700 calc(var(--s) * .56)/1 var(--display); display: grid; place-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mc:hover:not(.o) { background: #f4eedd; }
.mc:not(.o):active { box-shadow: inset 0 -1px 0 #bdb39b; padding-bottom: 1px; }
.mc.o { background: #e2e7ee; box-shadow: none; padding: 0; cursor: default; }
.mc svg { width: 72%; height: 72%; pointer-events: none; }
.mc.boom { background: #e2433f; }
.mc.x { background: #f3d9d7; }
.flagging .mc:not(.o) { cursor: crosshair; }
.mc.n1 { color: #1f5fbf; } .mc.n2 { color: #1f8a4c; } .mc.n3 { color: #c62828; } .mc.n4 { color: #3d2a8c; }
.mc.n5 { color: #8a3b12; } .mc.n6 { color: #0e7c86; } .mc.n7 { color: #141c28; } .mc.n8 { color: #6b7280; }
.mc:focus-visible { outline-offset: -3px; }

/* ---------- Sudoku ---------- */
.sdk { --s-line: #c3ccd9; --s-cell: #ffffff; --s-given: #141c28; --s-user: #1f5fbf; --s-sel: #ffd85c; --s-peer: #e9eef6; --s-same: #cbdcfa;
  --s-err: #d0312d; --s-errbg: #fde3e1; --s-note: #5a6577; --s-frame: #141c28;
  display: grid; grid-template-columns: auto minmax(0, 300px); gap: 26px; justify-content: center; align-items: start; padding-block: 6px 10px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sdk { --s-line: #2e3b50; --s-cell: #161e2b; --s-given: #eef1f6; --s-user: #7db2ff; --s-sel: #7a5c00; --s-peer: #1d2737; --s-same: #27406a;
    --s-err: #ff7a72; --s-errbg: #4b2020; --s-note: #9aa6b8; --s-frame: #05080d; }
}
:root[data-theme="dark"] .sdk { --s-line: #2e3b50; --s-cell: #161e2b; --s-given: #eef1f6; --s-user: #7db2ff; --s-sel: #7a5c00; --s-peer: #1d2737; --s-same: #27406a;
  --s-err: #ff7a72; --s-errbg: #4b2020; --s-note: #9aa6b8; --s-frame: #05080d; }
.sdk-board { width: var(--S, 320px); height: var(--S, 320px); display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 3px; padding: 3px;
  background: var(--s-frame); border-radius: 12px; overflow: hidden; touch-action: manipulation; box-shadow: 0 8px 22px rgba(20,28,40,.16); }
.sdk-box { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 1px; background: var(--s-line); min-width: 0; min-height: 0; }
.sc { border: 0; padding: 0; margin: 0; min-width: 0; min-height: 0; background: var(--s-cell); color: var(--s-user); position: relative; cursor: pointer;
  font: 500 calc(var(--S, 320px) / 9 * .58)/1 var(--display); display: grid; place-items: center; -webkit-tap-highlight-color: transparent; }
.sc.given { color: var(--s-given); font-weight: 700; }
.sc.peer { background: var(--s-peer); }
.sc.same { background: var(--s-same); }
.sc.err { color: var(--s-err); background: var(--s-errbg); }
.sc.sel { background: var(--s-sel); }
.sc:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; border-radius: 0; z-index: 1; }
.sc .nt { position: absolute; top: 6%; right: 6%; bottom: 6%; left: 6%; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); font: 600 calc(var(--S, 320px) / 9 * .25)/1 var(--body); color: var(--s-note); }
.sc .nt i { font-style: normal; display: grid; place-items: center; }
.sdk-side { display: grid; gap: 14px; align-content: start; min-width: 0; }
.sdk-info { font: 400 0.92rem/1.35 var(--body); color: var(--muted); min-height: 1.35em; }
.sdk-info b { color: var(--ink); font-weight: 600; }
.sdk-pad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.sdk-pad .key { flex-direction: column; gap: 3px; font-size: 1.55rem; padding: 12px 0 calc(8px + var(--d)); min-width: 0; }
.sdk-pad .key:active, .sdk-pad .key.on { padding-bottom: calc(8px + 2px); }
.sdk-pad .key small { font: 600 0.68rem/1 var(--body); opacity: .6; min-height: .68rem; }
.sdk-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sdk-tools .key { flex-direction: column; gap: 5px; padding: 9px 2px calc(7px + var(--d)); font: 600 0.72rem/1 var(--body); min-width: 0; letter-spacing: 0; }
.sdk-tools .key:active, .sdk-tools .key.on { padding-bottom: calc(7px + 2px); }
.sdk-tools .key svg { width: 20px; height: 20px; }
.sdk-check { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; color: var(--muted); cursor: pointer; width: fit-content; }
.sdk-check input { width: 18px; height: 18px; accent-color: var(--gold); margin: 0; }
@media (max-width: 859px) {
  .sdk { grid-template-columns: minmax(0, 1fr); gap: 10px; justify-items: center; padding-top: 2px; }
  .sdk-side { width: var(--S, 320px); gap: 9px; }
  .sdk-info { order: -1; text-align: center; }
  .sdk-pad { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; }
  .sdk-pad .key { font-size: 1.25rem; padding: 9px 0 calc(6px + var(--d)); border-radius: 8px; --d: 4px; }
  .sdk-pad .key:active, .sdk-pad .key.on { padding-bottom: calc(6px + 2px); }
  .sdk-tools .key { --d: 4px; }
  .sdk-check { justify-self: center; }
}

/* ---------- Scopa ---------- */
.scopa-turn { position: absolute; left: 50%; transform: translateX(-50%); z-index: 4000; padding: 5px 13px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  font: 600 0.82rem/1.2 var(--body); background: rgba(24,14,4,.6); color: #f3e6d3; transition: background .2s ease, color .2s ease; }
.scopa-turn.you { background: var(--gold); color: #141c28; }
.sbadge { position: absolute; z-index: 4000; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 4px; pointer-events: none; }
.sbadge b { background: #141c28; color: #fff; border-radius: 999px; padding: 3px 10px; font: 700 0.84rem/1.2 var(--display); min-width: 32px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.sbadge span { background: var(--gold); color: #141c28; border-radius: 999px; padding: 2px 8px; font: 700 0.7rem/1.2 var(--display); white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.scopa-flash { position: absolute; left: 50%; top: 44%; z-index: 8000; transform: translate(-50%, -50%); pointer-events: none; letter-spacing: -0.02em;
  font: 700 clamp(2.6rem, 10vw, 4.4rem)/1 var(--display); color: var(--gold); text-shadow: 0 3px 0 #7a4a00, 0 8px 20px rgba(0,0,0,.55); animation: scopa-pop 1.05s ease forwards; }
@keyframes scopa-pop {
  0% { transform: translate(-50%, -50%) scale(.4) rotate(-8deg); opacity: 0; }
  22% { transform: translate(-50%, -50%) scale(1.12) rotate(-5deg); opacity: 1; }
  72% { transform: translate(-50%, -50%) scale(1) rotate(-5deg); opacity: 1; }
  100% { transform: translate(-50%, -64%) scale(1) rotate(-5deg); opacity: 0; }
}
.card.hand:hover .ci { box-shadow: 0 0 0 3px var(--gold), 0 8px 16px rgba(0,0,0,.4); }
.sc-opts { display: grid; gap: 8px; margin: 12px 0 16px; }
.sc-opt { display: flex; gap: 6px; justify-content: center; align-items: center; padding: 8px; border-radius: 12px; border: 2px solid var(--line); background: var(--paper); cursor: pointer; }
.sc-opt:hover, .sc-opt:focus-visible { border-color: var(--gold); }
.sc-opt svg { width: 46px; height: auto; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }

/* ---------- Mahjong ---------- */
.mj-board { position: absolute; top: 0; right: 0; bottom: 0; left: 0; touch-action: manipulation; }
.mj { position: absolute; left: 0; top: 0; width: var(--tw); height: var(--th); padding: 0; margin: 0; border: 0; border-radius: calc(var(--tw) * .14); background: #fbf6e6; cursor: pointer;
  transform: translate3d(var(--x, 0px), var(--y, 0px), 0); box-shadow: var(--mj-side); transition: transform .22s ease, opacity .22s ease; -webkit-tap-highlight-color: transparent; }
.mj svg { width: 100%; height: 100%; pointer-events: none; }
.mj::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: inherit; pointer-events: none; transition: background .15s ease; }
.mj.sel::after { box-shadow: inset 0 0 0 3px var(--gold); background: rgba(242,183,5,.25); }
.mj.blocked { cursor: default; }
.show-free .mj.blocked::after { background: rgba(40,24,10,.45); }
.mj.hint::after { animation: mj-hint .8s ease 2; }
@keyframes mj-hint { 50% { box-shadow: inset 0 0 0 4px var(--gold); background: rgba(242,183,5,.5); } }
.mj.no { animation: mj-no .28s ease; }
@keyframes mj-no { 25% { transform: translate3d(calc(var(--x) - 4px), var(--y), 0); } 75% { transform: translate3d(calc(var(--x) + 4px), var(--y), 0); } }
.mj.out { opacity: 0; transform: translate3d(var(--x), calc(var(--y) - 14px), 0) scale(.86); pointer-events: none; }
.mj:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; z-index: 99999 !important; }
.mj-info { position: absolute; left: 50%; top: 9px; transform: translateX(-50%); z-index: 5; padding: 5px 13px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  font: 600 0.82rem/1.2 var(--body); background: rgba(30,8,10,.5); color: #f6e3e0; }
@media (prefers-reduced-motion: reduce) { .mj { transition: none; } .mj.no, .mj.hint::after { animation: none; } }

/* Older browsers without aspect-ratio (Safari 14 and earlier): keep the cover and app-art boxes in shape. */
@supports not (aspect-ratio: 1) {
  .cover-art { height: 0; padding-bottom: 62.5%; }
  .cover-art svg { position: absolute; top: 0; left: 0; }
  .game-art { height: 0; padding-bottom: 48.8%; position: relative; }
  .game-art img { position: absolute; top: 0; left: 0; }
}
