/* ============================================================
   Számvadász — skandináv számvadászat
   krémpapír · svédkék rács · elefántcsont csempék · mustár akcent
   (a Játéksarok / Svédkocka palettájával közös)
   ============================================================ */

:root {
  --paper: #f3ebdb;
  --paper-2: #eadfc7;
  --card: #fbf7ec;
  --ink: #22304a;
  --ink-2: #4a5872;
  --line: #d9cbab;
  --blue: #1f4e8c;
  --blue-deep: #16365f;
  --blue-light: #2d63ab;
  --sun: #f2b23e;
  --sun-deep: #d3961d;
  --sun-ink: #3d2c05;
  --red: #bf4530;
  --red-soft: #e8d3c6;
  --green: #3e7d52;
  --tile-ivory: #fdfaf1;
  --tile-edge: #e4dbc4;

  --font-display: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: Corbel, Candara, "Segoe UI", "Trebuchet MS", sans-serif;
  --font-num: Consolas, "Cascadia Mono", "Courier New", monospace;

  --radius: 14px;
  --shadow-soft: 0 10px 30px rgba(34, 48, 74, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(242, 178, 62, .16), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(31, 78, 140, .10), transparent 55%),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.45;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.55 0 0 0 0 0.48 0 0 0 0 0.36 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
button { font: inherit; color: inherit; }

/* ---------- fejléc ---------- */

.topbar {
  max-width: 1040px;
  margin: 0 auto;
  padding: 22px 20px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }

.brand-badge {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;
  width: 46px; height: 46px;
  padding: 3px;
  background: linear-gradient(150deg, var(--blue-light), var(--blue-deep));
  border-radius: 10px;
  transform: rotate(-6deg);
  box-shadow: 3px 4px 0 rgba(34, 48, 74, .25);
}
.bb-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--tile-ivory);
  font-family: var(--font-display);
  font-weight: bold;
  font-size: 15px;
  color: var(--ink);
}
.bb-a { color: var(--blue); }
.bb-c { color: var(--red); }

.brand-text h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: .04em;
  line-height: 1;
}
.brand-sub {
  display: block;
  font-size: 13px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-top: 4px;
}

.topnav { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- gombok ---------- */

.btn {
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: .02em;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
  background: none;
}
.btn:active { transform: translateY(2px); }
.btn:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

a.btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}

.btn-primary {
  background: linear-gradient(180deg, #f7c159, var(--sun) 55%, var(--sun-deep));
  color: var(--sun-ink);
  border-color: var(--sun-deep);
  box-shadow: 0 5px 0 #a97a14, 0 10px 22px rgba(211, 150, 29, .35);
  font-size: 18px;
  padding: 12px 30px;
}
.btn-primary:hover:not([disabled]) { filter: brightness(1.05); }
.btn-primary:active:not([disabled]) { box-shadow: 0 2px 0 #a97a14; transform: translateY(3px); }

.btn-hint {
  background: var(--card);
  border-color: var(--blue);
  color: var(--blue);
}
.btn-hint:hover:not([disabled]) { background: var(--blue); color: var(--card); }

.btn-stop {
  background: var(--card);
  border-color: var(--ink);
  color: var(--ink);
}
.btn-stop:hover:not([disabled]) { background: var(--ink); color: var(--card); }

.btn-ghost { color: var(--ink); border-color: transparent; }
.btn-ghost:hover { background: rgba(34, 48, 74, .08); }

.btn-outline { border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--card); }

/* ---------- állapotsor ---------- */

.stage { max-width: 1040px; margin: 0 auto; padding: 0 20px 30px; }

.statusbar {
  display: flex;
  align-items: stretch;
  gap: 14px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 92px;
  box-shadow: 0 2px 0 rgba(34, 48, 74, .06);
}
.stat-l {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--ink-2);
}
.stat-v {
  font-family: var(--font-num);
  font-size: 24px;
  font-weight: 700;
}
.stat-v.bump { animation: bump .3s ease; }
@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.16); }
  100% { transform: scale(1); }
}
.stat-diff { margin-left: auto; }

.seg { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.seg-b {
  border: 2px solid var(--ink);
  background: transparent;
  border-radius: 9px;
  padding: 3px 13px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
}
.seg-b.is-on { background: var(--ink); color: var(--card); }
.seg-b[disabled] { opacity: .5; cursor: not-allowed; }
.seg-b:focus-visible { outline: 3px solid var(--sun); outline-offset: 1px; }

/* ---------- játéktér: tábla + talon ---------- */

.playfield {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 18px;
  align-items: start;
}

.board-wrap {
  position: relative;
  border-radius: 22px;
  padding: 18px;
  background:
    radial-gradient(120% 130% at 50% -20%, var(--blue-light), var(--blue) 55%, var(--blue-deep)),
    var(--blue);
  box-shadow:
    inset 0 0 0 3px rgba(242, 178, 62, .5),
    inset 0 0 0 6px rgba(23, 54, 95, .9),
    inset 0 14px 44px rgba(9, 22, 44, .5),
    var(--shadow-soft);
  overflow: hidden;
}
.board-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.045 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23f)'/%3E%3C/svg%3E");
}

.board-hint {
  position: relative;
  text-align: center;
  color: rgba(251, 247, 236, .9);
  font-size: 16px;
  padding: 40px 10px;
}
.board-hint strong { color: var(--sun); }
.playfield.is-live .board-hint { display: none; }

.board-grid {
  position: relative;
  z-index: 1;
  display: none;
  grid-template-columns: repeat(var(--cols, 7), 1fr);
  grid-template-rows: repeat(var(--rows, 7), 1fr);
  gap: 3px;
  /* Négyzetes tábla, ami a szélességbe ÉS a magasságba is belefér:
     a szélességet a rendelkezésre álló függőleges helyhez kötjük, hogy
     100%-os nagyításnál se lógjon le a tábla alja (--vspace = a fejléc,
     státuszsor, tábla-padding és lábléc együttes helyigénye). */
  --vspace: 300px;
  width: 100%;
  max-width: calc(100vh - var(--vspace));
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}
.playfield.is-live .board-grid { display: grid; }

.cell {
  position: relative;
  border: 0;
  padding: 0;
  border-radius: 14%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(10px, 2.4vw, 30px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .1s ease, box-shadow .15s ease;
  /* a cellák négyzetességét a négyzetes board-grid 1fr sorai/oszlopai adják;
     a cellán NINCS aspect-ratio, hogy ne feszítse szét a rács magasságát */
  min-width: 0;
  min-height: 0;
}
.cell.is-empty {
  background: rgba(9, 22, 44, .28);
  box-shadow: inset 0 0 0 1px rgba(251, 247, 236, .12);
  color: transparent;
  cursor: pointer;
}
.cell.is-empty:hover {
  background: rgba(242, 178, 62, .28);
  box-shadow: inset 0 0 0 2px rgba(242, 178, 62, .7);
}
.cell.is-filled {
  background: linear-gradient(150deg, #ffffff, var(--tile-ivory) 55%, #efe7cf);
  color: var(--ink);
  box-shadow: 0 2px 4px rgba(9, 22, 44, .4), inset 0 0 0 1px var(--tile-edge);
  cursor: default;
}
.cell.is-filled:hover { transform: none; }

/* néhány számjegy-szín, hogy a rács ne legyen egyhangú */
.cell.d0 { color: #6b7688; }
.cell.d1 { color: var(--blue); }
.cell.d5 { color: var(--red); }
.cell.d7 { color: var(--sun-deep); }
.cell.d9 { color: var(--green); }

/* kiürítés: pop + halványulás */
.cell.cleared-pop { animation: clearedPop .42s ease forwards; }
@keyframes clearedPop {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.cell.cleared-fade { opacity: .2; transition: opacity .18s ease; }

/* szikrák */
.burst {
  position: absolute;
  left: 50%; top: 50%;
  width: 0; height: 0;
  pointer-events: none;
  z-index: 5;
}
.spark {
  position: absolute;
  left: 0; top: 0;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, var(--sun) 55%, var(--sun-deep) 100%);
  animation: sparkFly var(--d, 340ms) ease-out forwards;
}
@keyframes sparkFly {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx, 0), var(--dy, 0)) scale(.2); opacity: 0; }
}

/* súgó-villanás */
.cell.hint-flash { animation: hintFlash .9s ease; }
@keyframes hintFlash {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(251, 247, 236, .12); }
  50% { box-shadow: inset 0 0 0 3px var(--sun), 0 0 16px rgba(242, 178, 62, .8); background: rgba(242, 178, 62, .4); }
}

/* tiltott kattintás (foglalt mezőre) */
.cell.cell-deny { animation: cellDeny .36s ease; }
@keyframes cellDeny {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* üzenetsáv (a tábla teteje felett úszik) */
.banner {
  position: absolute;
  top: 12px; left: 14px; right: 14px;
  z-index: 6;
  text-align: center;
  border-radius: 10px;
  font-weight: 700;
  padding: 9px 14px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(9, 22, 44, .35);
}
.banner.show { opacity: 1; transform: translateY(0); }
.banner.b-info { background: rgba(251, 247, 236, .95); color: var(--ink); }
.banner.b-warn { background: var(--sun); color: var(--sun-ink); }
.banner.b-danger { background: var(--red); color: #fff; }
.banner.b-success { background: var(--green); color: #fff; }

/* ---------- szünet ---------- */

/* szünetben a tábla erősen elmosódik és olvashatatlan, nem kattintható */
.playfield.is-paused .board-grid {
  filter: blur(11px) brightness(.82) contrast(.85);
  pointer-events: none;
  transition: filter .2s ease;
}
/* a talon számai is olvashatatlanná válnak szünetben */
.playfield.is-paused .talon-strip {
  filter: blur(9px) brightness(.9);
  pointer-events: none;
  transition: filter .2s ease;
}

/* Az overlay CSAK szünetben látszik — a láthatóságot az is-paused osztály
   vezérli (nem a hidden attribútum, amit a display:flex felülírna). */
.pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 30, 55, .38);
  border-radius: 22px;
}
.playfield.is-paused .pause-overlay { display: flex; }
.pause-box {
  text-align: center;
  background: var(--card);
  border-radius: 16px;
  padding: 22px 30px;
  box-shadow: 0 18px 50px rgba(9, 22, 44, .5);
}
.pause-ico {
  display: block;
  font-size: 30px;
  letter-spacing: 4px;
  color: var(--blue);
}
.pause-title {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 8px 0 16px;
  letter-spacing: .06em;
}

/* ---------- talon-panel ---------- */

.talon-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 2px 0 rgba(34, 48, 74, .06);
  position: sticky;
  top: 12px;
}
.talon-head { margin-bottom: 12px; }
.talon-title {
  display: block;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: .03em;
}
.talon-sub { font-size: 13px; color: var(--ink-2); }

.talon-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  min-height: 72px;
}
.talon-slot {
  display: flex;
  align-items: center;
  justify-content: center;
}
.talon-chip {
  width: 62px; height: 62px;
  border: 2px solid var(--tile-edge);
  border-radius: 14px;
  background: linear-gradient(150deg, #fff, var(--tile-ivory) 55%, #efe7cf);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  color: var(--ink);
  cursor: default;
  box-shadow: 0 2px 5px rgba(9, 22, 44, .18);
}
.talon-slot.is-active .talon-chip {
  border: 3px solid var(--sun);
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(242, 178, 62, .35), 0 4px 14px rgba(211, 150, 29, .4);
  transform: scale(1.06);
}
.talon-slot.is-active .talon-chip:hover { filter: brightness(1.04); }
.talon-slot.is-reserve .talon-chip {
  width: 46px; height: 46px;
  font-size: 22px;
  opacity: .6;
}
.talon-chip.d1 { color: var(--blue); }
.talon-chip.d5 { color: var(--red); }
.talon-chip.d7 { color: var(--sun-deep); }
.talon-chip.d9 { color: var(--green); }

.talon-tip {
  font-size: 12.5px;
  color: var(--ink-2);
  margin: 12px 0;
  line-height: 1.4;
}
/* a talon akciógombjai csak aktív játék közben jelennek meg */
.talon-actions { display: none; flex-direction: column; gap: 8px; }
.playfield.is-live .talon-actions { display: flex; }
.talon-actions .btn { width: 100%; text-align: center; justify-content: center; }

/* ---------- párbeszédablakok ---------- */

.dlg {
  border: 0;
  border-radius: 18px;
  padding: 0;
  background: var(--card);
  color: var(--ink);
  width: min(520px, calc(100vw - 36px));
  box-shadow: 0 30px 80px rgba(9, 22, 44, .45);
}
.dlg-wide { width: min(760px, calc(100vw - 36px)); }
.dlg::backdrop { background: rgba(18, 28, 48, .55); backdrop-filter: blur(3px); }

.dlg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 2px solid var(--paper-2);
  background: linear-gradient(180deg, #fffdf6, var(--card));
  border-radius: 18px 18px 0 0;
}
.dlg-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: .04em;
}
.dlg-head-win { justify-content: center; background: linear-gradient(180deg, #f7c159, var(--sun)); }
.dlg-head-win h2 { color: var(--sun-ink); }

.dlg-x {
  border: 0;
  background: none;
  font-size: 19px;
  cursor: pointer;
  padding: 4px 9px;
  border-radius: 8px;
  color: var(--ink-2);
}
.dlg-x:hover { background: var(--paper-2); color: var(--ink); }

.dlg-body { padding: 20px 24px 24px; max-height: min(72vh, 640px); overflow-y: auto; }
.dlg-center { text-align: center; }

.dlg-note .dlg-body { padding-top: 28px; }
.note-icon {
  width: 58px; height: 58px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.note-icon.note-ask { background: var(--blue); }
.dlg-note h2 { font-family: var(--font-display); margin: 4px 0 8px; }
.dlg-note p { margin: 0 0 18px; color: var(--ink-2); }

.btnrow { display: flex; gap: 12px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

/* toplista */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tab {
  border: 2px solid var(--ink);
  background: transparent;
  border-radius: 10px;
  padding: 6px 18px;
  cursor: pointer;
  font-weight: 700;
}
.tab.is-on { background: var(--ink); color: var(--card); }
.tab:focus-visible { outline: 3px solid var(--sun); outline-offset: 1px; }

.toptable { width: 100%; border-collapse: collapse; font-size: 15px; }
.toptable th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-2);
  border-bottom: 2px solid var(--paper-2);
  padding: 6px 8px;
}
.toptable td { padding: 7px 8px; border-bottom: 1px solid var(--paper-2); }
.toptable td.num, .toptable th.num { text-align: right; font-family: var(--font-num); }
.toptable th.num { font-family: inherit; }
.toptable tr.is-new td { background: rgba(242, 178, 62, .28); font-weight: 700; }
.toptable tr:first-child .medal { color: var(--sun-deep); }
.top-empty { text-align: center; color: var(--ink-2); padding: 26px 10px; font-style: italic; }
.top-note { margin: 14px 0 0; font-size: 12px; color: var(--ink-2); letter-spacing: .03em; }

/* győzelem */
.win-lead { font-size: 18px; margin: 4px 0 14px; }
.win-stats { margin: 0 auto 14px; border-collapse: collapse; }
.win-stats th, .win-stats td { padding: 4px 14px; text-align: left; }
.win-stats th { color: var(--ink-2); font-weight: 400; }
.win-stats td { font-family: var(--font-num); font-weight: 700; }
.win-score {
  background: var(--ink);
  color: var(--card);
  border-radius: 14px;
  padding: 10px 18px;
  display: inline-flex;
  flex-direction: column;
  margin-bottom: 14px;
}
.win-score span { font-size: 12px; text-transform: uppercase; letter-spacing: .2em; color: rgba(251,247,236,.7); }
.win-score strong { font-family: var(--font-num); font-size: 34px; color: var(--sun); }
.win-qualify { font-weight: 700; color: var(--green); margin: 6px 0 8px; }
.win-form input {
  display: block;
  margin: 0 auto 12px;
  font: inherit;
  padding: 9px 14px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  width: min(280px, 100%);
  text-align: center;
  background: #fffdf6;
}
.win-form input:focus-visible { outline: 3px solid var(--sun); outline-offset: 1px; }
.win-noq { color: var(--ink-2); font-style: italic; }

/* ---------- szabályok tartalma ---------- */

.rules-body { font-size: 16px; }
.rules-body h3 {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: .03em;
  margin: 26px 0 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--paper-2);
  display: flex;
  align-items: center;
  gap: 9px;
}
.rules-body h3:first-child { margin-top: 0; }
.rules-body h3 .hnum {
  width: 17px; height: 17px;
  border-radius: 4px;
  background: var(--blue);
  border: 2px solid var(--blue-deep);
  transform: rotate(-8deg);
  flex: none;
}
.rules-body p { margin: 8px 0; }
.rules-body ul { margin: 8px 0; padding-left: 22px; }
.rules-body li { margin: 5px 0; }

.mini-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 7px;
  background: linear-gradient(150deg, #fff, var(--tile-ivory));
  border: 1.5px solid var(--tile-edge);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  box-shadow: 1px 2px 0 rgba(34, 48, 74, .12);
}
.mini-cell.mc-empty { background: var(--paper-2); border-style: dashed; box-shadow: none; }
.mini-cell.mc-target { background: rgba(242, 178, 62, .3); border-color: var(--sun-deep); }
.mini-cell.d1 { color: var(--blue); }
.mini-cell.d5 { color: var(--red); }
.mini-cell.d9 { color: var(--green); }

.mini-grid {
  display: inline-grid;
  grid-template-columns: repeat(3, 30px);
  grid-template-rows: repeat(3, 30px);
  gap: 3px;
  vertical-align: middle;
}

.rule-ex {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--paper-2);
  border-radius: 12px;
  padding: 14px;
  margin: 12px 0;
}
.rule-ex-text { flex: 1; min-width: 200px; }

.rule-table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.rule-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-2);
  border-bottom: 2px solid var(--paper-2);
  padding: 6px 8px;
}
.rule-table th.num { text-align: right; }
.rule-table td { padding: 7px 8px; border-bottom: 1px solid var(--paper-2); }
.rule-table td.num { text-align: right; font-family: var(--font-num); }
.rule-table td.pts { font-family: var(--font-num); font-weight: 700; text-align: right; }

.end-cards { display: flex; gap: 14px; flex-wrap: wrap; margin: 12px 0; }
.end-card {
  flex: 1;
  min-width: 190px;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--line);
  background: #fffdf6;
}
.end-card strong { font-family: var(--font-display); font-size: 18px; }
.end-card span:last-child { font-size: 14px; color: var(--ink-2); }
.end-ico {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
}
.end-win .end-ico { background: var(--green); }
.end-lose .end-ico { background: var(--red); }

.foot {
  max-width: 1040px;
  margin: 0 auto;
  padding: 6px 20px 26px;
  color: var(--ink-2);
  font-size: 13px;
  letter-spacing: .05em;
}

/* ---------- reszponzív ---------- */

@media (max-width: 760px) {
  .playfield { grid-template-columns: 1fr; }
  .talon-panel { position: static; order: -1; }
  .talon-strip { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  /* egyoszlopos nézetben a szélesség a szűk keresztmetszet — a magasság-korlát
     feloldva, hogy a tábla a teljes szélességet használhassa (görgethető) */
  .board-grid { max-width: 100%; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .brand-text h1 { font-size: 27px; }
  .stat { padding: 6px 12px; min-width: 74px; }
  .stat-v { font-size: 19px; }
  .stat-diff { margin-left: 0; width: 100%; }
}

/* ---------- csökkentett mozgás ---------- */

@media (prefers-reduced-motion: reduce) {
  .cell.cleared-pop, .spark, .cell.hint-flash, .cell.cell-deny,
  .stat-v.bump, .banner { animation: none !important; }
  .banner, .cell { transition-duration: .01s !important; }
}
