/* ==========================================
   Re del Trono – Giochi tra amici
   Stile condiviso (neo-brutalista giallo, come il sito)
   ========================================== */
:root {
  --bg: #fef3c7;
  --ink: #0f172a;
  --black: #000;
  --card: #fff;
  --yellow: #fde047;
  --yellow-2: #facc15;
  --green: #34d399;
  --pink: #fb7185;
  --sky: #7dd3fc;
  --violet: #c4b5fd;
  --orange: #fdba74;
  --muted: #475569;
  --radius: 22px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: 40px;
}
::selection { background: var(--yellow); }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 900; letter-spacing: -0.02em; }
p { margin: 0; }
.hidden { display: none !important; }

/* ---------- Barra superiore ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--yellow);
  border-bottom: 4px solid var(--black);
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.tb-title {
  font-weight: 900; text-transform: uppercase; font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; text-align: center;
}
.tb-title small { display: block; font-size: 9px; letter-spacing: .12em; color: #334155; }

/* ---------- Layout ---------- */
.wrap { max-width: 480px; margin: 0 auto; padding: 16px; }
.wrap.wide { max-width: 1000px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.center { text-align: center; }
.muted { color: var(--muted); font-weight: 700; font-size: 13px; }
.tiny { font-size: 11px; }
.label {
  font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: #334155;
  display: block; margin-bottom: 6px;
}

/* ---------- Card ---------- */
.card {
  background: var(--card);
  border: 4px solid var(--black);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--black);
  padding: 18px;
}
.card.flat { box-shadow: none; }
.card.yellow { background: #fef9c3; }

/* ---------- Bottoni ---------- */
.btn {
  appearance: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 900; text-transform: uppercase; font-size: 13px; letter-spacing: .02em;
  color: var(--ink); text-decoration: none;
  background: var(--yellow);
  border: 3px solid var(--black); border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 4px 4px 0 var(--black);
  transition: transform .08s ease, box-shadow .08s ease, background .15s;
}
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--black); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { display: flex; width: 100%; }
.btn.big { font-size: 17px; padding: 16px 18px; border-radius: 18px; }
.btn.sm { font-size: 11px; padding: 7px 10px; border-radius: 11px; box-shadow: 3px 3px 0 var(--black); }
.btn.b-white { background: #fff; }
.btn.b-green { background: var(--green); }
.btn.b-pink { background: var(--pink); }
.btn.b-sky { background: var(--sky); }
.btn.b-violet { background: var(--violet); }
.btn.b-orange { background: var(--orange); }
.btn.b-black { background: var(--black); color: var(--yellow); }

/* ---------- Chip / scelte ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  cursor: pointer; user-select: none;
  border: 3px solid var(--black); border-radius: 999px;
  background: #fff; font-weight: 900; font-size: 13px;
  padding: 8px 13px;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--black); color: var(--yellow); }
.chip .b18 { font-size: 10px; background: var(--pink); color: #000; border-radius: 6px; padding: 1px 4px; border: 2px solid #000; }

.modes { display: grid; gap: 10px; }
.mode {
  cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 12px;
  border: 3px solid var(--black); border-radius: 16px; background: #fff; padding: 12px;
  text-align: left; font: inherit; color: inherit; width: 100%;
}
.mode .em { font-size: 28px; line-height: 1; }
.mode b { display: block; font-size: 15px; font-weight: 900; }
.mode span.d { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
.mode .tick {
  margin-left: auto; width: 26px; height: 26px; flex: 0 0 26px; border-radius: 8px; border: 3px solid #000;
  display: flex; align-items: center; justify-content: center; font-weight: 900;
}
.mode.on { background: #fef08a; box-shadow: 3px 3px 0 #000; }
.mode.on .tick { background: #000; color: var(--yellow); }
.mode.on .tick::after { content: "✓"; }

/* ---------- Stepper ---------- */
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stepper .val { font-size: 26px; font-weight: 900; min-width: 50px; text-align: center; font-variant-numeric: tabular-nums; }
.stepper .btn { width: 46px; height: 46px; padding: 0; font-size: 22px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 2px dashed #0002; }
.setting:first-child { border-top: 0; }
.setting .k { font-weight: 900; font-size: 14px; }
.setting .k small { display: block; font-weight: 700; color: var(--muted); font-size: 11px; }

/* ---------- Giocatori ---------- */
.players { display: flex; flex-wrap: wrap; gap: 8px; }
.player {
  display: inline-flex; align-items: center; gap: 6px;
  border: 3px solid #000; border-radius: 12px; background: #fff;
  padding: 6px 6px 6px 11px; font-weight: 900; font-size: 14px;
}
.player button {
  border: 0; background: #000; color: #fff; border-radius: 8px; width: 24px; height: 24px; cursor: pointer;
  font-weight: 900; line-height: 1;
}
.add-player { display: flex; gap: 8px; margin-top: 10px; }
.input {
  flex: 1; min-width: 0;
  font: inherit; font-weight: 800; font-size: 16px;
  border: 3px solid #000; border-radius: 12px; padding: 11px 12px; background: #fff; color: var(--ink);
}
.input:focus { outline: 3px solid var(--yellow-2); outline-offset: 1px; }
textarea.input { resize: vertical; min-height: 90px; }

/* ---------- Carta di gioco ---------- */
.gamecard {
  position: relative;
  min-height: 330px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 26px 20px;
  background: #fff;
  border: 4px solid #000; border-radius: 28px; box-shadow: 8px 8px 0 #000;
  animation: pop .25s ease;
}
.gamecard .who {
  position: absolute; top: 14px; left: 14px; right: 14px;
  display: flex; justify-content: space-between; align-items: center; font-weight: 900; font-size: 12px; text-transform: uppercase;
}
.gamecard .tag {
  background: #000; color: var(--yellow); border-radius: 8px; padding: 3px 8px; font-size: 11px; font-weight: 900; text-transform: uppercase;
}
.gamecard .txt { font-size: clamp(21px, 6vw, 28px); font-weight: 900; line-height: 1.22; letter-spacing: -0.01em; }
.gamecard .sub { margin-top: 14px; font-size: 14px; font-weight: 800; color: var(--muted); }
.gamecard .big-emoji { font-size: 64px; line-height: 1; margin-bottom: 12px; }
.gamecard.c-yellow { background: #fef08a; }
.gamecard.c-green { background: #a7f3d0; }
.gamecard.c-pink { background: #fecdd3; }
.gamecard.c-sky { background: #bae6fd; }
.gamecard.c-violet { background: #ddd6fe; }
.gamecard.c-orange { background: #fed7aa; }
.gamecard.c-black { background: #111; color: #fff; }
.gamecard.c-black .sub { color: #cbd5e1; }
@keyframes pop { from { transform: scale(.94) rotate(-1deg); opacity: .3; } to { transform: none; opacity: 1; } }

.counter { font-weight: 900; font-size: 12px; color: var(--muted); text-align: center; }

/* Preferiresti */
.wyr { display: grid; gap: 12px; }
.wyr .opt {
  cursor: pointer; font: inherit; color: inherit; text-align: center;
  border: 4px solid #000; border-radius: 24px; box-shadow: 6px 6px 0 #000;
  padding: 26px 18px; font-size: clamp(19px, 5.4vw, 24px); font-weight: 900; line-height: 1.25;
  min-height: 140px; display: flex; align-items: center; justify-content: center;
  transition: transform .1s;
}
.wyr .opt.a { background: #fecdd3; }
.wyr .opt.b { background: #bae6fd; }
.wyr .opt.sel { transform: scale(1.02); outline: 5px solid #000; }
.wyr .or {
  justify-self: center; background: #000; color: var(--yellow); font-weight: 900; border-radius: 999px; padding: 6px 14px;
  margin: -24px 0; z-index: 2; border: 3px solid var(--yellow);
}

/* Timer */
.timer-big {
  font-size: 84px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; text-align: center;
}
.timer-bar { height: 14px; border: 3px solid #000; border-radius: 999px; background: #fff; overflow: hidden; }
.timer-bar > i { display: block; height: 100%; background: var(--green); transition: width .25s linear; }
.timer-bar.warn > i { background: var(--pink); }

/* Punteggi */
.scores { display: grid; gap: 6px; }
.score-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 3px solid #000; border-radius: 12px; background: #fff; padding: 7px 10px; font-weight: 900;
}
.score-row.lead { background: #fef08a; }
.score-row .pts { font-variant-numeric: tabular-nums; font-size: 18px; }

/* Rivelazione (passa il telefono) */
.reveal {
  min-height: 360px; cursor: pointer; user-select: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px;
  border: 4px solid #000; border-radius: 28px; box-shadow: 8px 8px 0 #000; padding: 24px;
  background: #111; color: #fff;
}
.reveal .em { font-size: 72px; line-height: 1; }
.reveal h2 { font-size: 30px; }
.reveal.shown { background: #fef08a; color: #000; }
.reveal.shown.bad { background: #fb7185; }

/* Regole */
.rules h2 { font-size: 22px; margin-bottom: 10px; }
.rules h3 { font-size: 16px; margin: 16px 0 6px; }
.rules p, .rules li { font-size: 15px; line-height: 1.55; font-weight: 500; }
.rules p + p { margin-top: 8px; }
.rules ol, .rules ul { padding-left: 22px; margin: 8px 0; }
.rules li + li { margin-top: 4px; }

/* Pagina di presentazione dei giochi 3D a schermo intero */
.play-hero { min-height: 320px; gap: 4px; }
.play-hero h1.txt { font-size: clamp(30px, 8vw, 44px); }

/* Sezioni di approfondimento (SEO) */
.seo { padding-top: 0; }
.rules ul.esempi { columns: 2 260px; column-gap: 28px; padding-left: 20px; }
.rules ul.esempi li { break-inside: avoid; margin: 0 0 8px; }
.seo .grid-games { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.seo .tile { min-height: 120px; }
.wrap.rules, .wrap.seo { max-width: 760px; }

/* Avviso 18+ */
.overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.overlay .card { max-width: 400px; width: 100%; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 120;
  background: #000; color: var(--yellow); font-weight: 900; border-radius: 14px; padding: 12px 18px;
  border: 3px solid var(--yellow); max-width: calc(100% - 32px); text-align: center;
  animation: pop .2s ease;
}

/* ---------- Hub giochi ---------- */
.hero { text-align: center; padding: 18px 0 6px; }
.hero h1 { font-size: clamp(30px, 8vw, 46px); text-transform: uppercase; line-height: 1; }
.hero p { margin-top: 10px; font-weight: 700; color: #334155; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 18px 0; }
.grid-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 6px; text-decoration: none;
  border: 4px solid #000; border-radius: 22px; box-shadow: 5px 5px 0 #000; padding: 14px; min-height: 150px;
  transition: transform .1s;
}
.tile:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 #000; }
.tile:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }
.tile .em { font-size: 40px; line-height: 1; }
.tile b { font-size: 16px; font-weight: 900; line-height: 1.1; }
.tile span { font-size: 12px; font-weight: 700; color: #1e293b; line-height: 1.3; }
.tile .meta { margin-top: auto; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.tile .b18 {
  position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 900;
  background: #000; color: #fff; border-radius: 8px; padding: 2px 6px;
}
.t-yellow { background: #fef08a; } .t-green { background: #a7f3d0; } .t-pink { background: #fecdd3; }
.t-sky { background: #bae6fd; } .t-violet { background: #ddd6fe; } .t-orange { background: #fed7aa; }

.tile h3 { font-size: 16px; font-weight: 900; line-height: 1.1; }

/* ---------- Home (vetrina) ---------- */
.home-hero { padding: 26px 0 8px; }
.home-hero h1 { font-size: clamp(30px, 8vw, 52px); text-transform: none; line-height: 1.02; max-width: 760px; margin: 0 auto; }
.home-hero p { font-size: 17px; max-width: 620px; margin: 14px auto 0; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 22px; }
.pills { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.pill { background: #fff; border: 3px solid #000; border-radius: 18px; padding: 14px; box-shadow: 4px 4px 0 #000; }
.pill span { font-size: 30px; display: block; }
.pill b { display: block; font-size: 16px; font-weight: 900; margin: 4px 0; }
.pill p { font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.4; }
.home-cat { margin-top: 18px; scroll-margin-top: 80px; }
.home-cat h3 { font-size: 18px; }
.home-cat .muted { margin: 4px 0 10px; }
.linklist { display: flex; flex-wrap: wrap; gap: 8px; }
.linklist .chip { text-decoration: none; }
.linklist .chip small { font-size: 10px; background: var(--pink); border-radius: 6px; padding: 0 4px; }

/* ---------- /giochi/ (console) ---------- */
.hub-head { padding-top: 10px; }
.hub-head h1 { font-size: clamp(28px, 7vw, 40px); text-transform: uppercase; }
.hub-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.hub-tools .input { flex: 1 1 260px; }
.hub-head .filters { justify-content: flex-start; margin: 14px 0 18px; }

.home-sec { margin-top: 34px; scroll-margin-top: 80px; }
.home-sec > h2 { font-size: clamp(22px, 5vw, 28px); }
.home-sec > p.muted { margin: 6px 0 14px; font-size: 14px; }
.hero .filters a { text-decoration: none; }
.faq { border-top: 2px dashed #0002; padding: 12px 0; }
.faq:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 900; font-size: 16px; }
.faq p { margin-top: 8px; }
@media (max-width: 560px) {
  .feature { flex-direction: column; align-items: flex-start; text-align: left; }
  .feature-em { font-size: 54px; }
}

.site-foot { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 24px 16px 0; }
.site-foot a { font-weight: 900; }

@media (min-width: 640px) {
  .wyr { grid-template-columns: 1fr auto 1fr; align-items: stretch; }
  .wyr .or { margin: 0 -22px; align-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
