/* R3 High Roller Invitational – delad stil (designspår 3: R3 + spelkort) */

/* ---------- Typsnitt ---------- */
@font-face { font-family: "TT Commons"; src: url("../fonts/TTCommons-ExtraLight.ttf") format("truetype"); font-weight: 200; font-display: swap; }
@font-face { font-family: "TT Commons"; src: url("../fonts/TTCommons-Light.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "TT Commons"; src: url("../fonts/TTCommons-LightItalic.ttf") format("truetype"); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: "TT Commons"; src: url("../fonts/TTCommons-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "TT Commons"; src: url("../fonts/TTCommons-Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "TT Commons"; src: url("../fonts/TTCommons-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --ink: #151515;
  --paper: #ffffff;
  --beige: #f7efe0;
  --felt: #004b4b;
  --signal: #ff3c46;
  --grey-1: #ededed;
  --grey-2: #c8c8c8;
  --grey-3: #a4a4a4;

  --font: "TT Commons", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --fs-display: clamp(52px, 9vw, 152px);
  --fs-h1: clamp(42px, 6.5vw, 96px);
  --fs-h2: clamp(34px, 4.5vw, 72px);
  --fs-h3: clamp(24px, 3vw, 40px);
  --fs-lead: clamp(20px, 2vw, 28px);
  --fs-body: 18px;
  --fs-small: 14px;
  --fs-pre: 13px;

  --s-1: 8px; --s-2: 16px; --s-3: 24px; --s-4: 32px; --s-5: 48px; --s-6: 64px; --s-7: 96px; --s-8: 144px;
  --gutter: 40px;
  --max: 1440px;
  --line-dark: rgba(255,255,255,.18);
  --line-light: rgba(0,0,0,.12);
}
@media (max-width: 767px) { :root { --gutter: 16px; } }

/* ---------- Bas ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--ink); color: var(--paper);
  font-family: var(--font); font-size: var(--fs-body); line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 300; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; }

/* Sidvisning (reveal.js): dold tills typsnitten laddats, sedan intoning. */
html.is-loading body { opacity: 0; }
html.is-revealing body { animation: page-fade .6s ease both; }
@keyframes page-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  html.is-revealing body { animation-duration: .3s; }
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
section { padding: var(--s-8) 0; }
@media (max-width: 767px) { section { padding: var(--s-7) 0; } }

.on-ink   { background: var(--ink);   color: var(--paper); }
.on-paper { background: var(--paper); color: var(--ink); }
.on-beige { background: var(--beige); color: var(--ink); }
.on-felt  { background: var(--felt);  color: var(--paper); }

.red { color: var(--signal); }
.suit { font-family: var(--font), "Apple Symbols", "Segoe UI Symbol", sans-serif; font-variant-emoji: text; }
.note { font-size: var(--fs-small); opacity: .7; }
.label { font-size: var(--fs-pre); text-transform: uppercase; letter-spacing: 2px; font-weight: 500; opacity: .6; margin-bottom: var(--s-2); display: block; }
.pre { font-size: var(--fs-pre); font-weight: 500; text-transform: uppercase; letter-spacing: 2px; display: inline-flex; gap: 12px; align-items: center; }
.num { font-weight: 400; opacity: .55; }
.plus-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.plus-list li::before { content: "+ "; opacity: .55; }

.chip-edge { height: 14px; width: 100%; background: repeating-linear-gradient(90deg, currentColor 0 48px, transparent 48px 96px); }
.chip-edge.thin { height: 6px; background: repeating-linear-gradient(90deg, currentColor 0 24px, transparent 24px 48px); }

.logo-on-light { mix-blend-mode: multiply; }
.logo-on-dark  { filter: invert(1); mix-blend-mode: screen; }

/* ---------- Avsnittsrubrik ---------- */
.section-head {
  display: grid; grid-template-columns: 120px 1fr; gap: var(--s-4);
  border-top: 1px solid currentColor; padding-top: var(--s-3); margin-bottom: var(--s-6);
}
.section-head .idx { font-size: var(--fs-h3); font-weight: 300; display: flex; gap: 10px; align-items: baseline; }
.section-head .idx .suit { font-size: .7em; }
.section-head h2 { font-size: var(--fs-h2); line-height: 1; }
.section-head p { margin-top: var(--s-3); max-width: 60ch; font-size: var(--fs-lead); font-weight: 300; line-height: 1.3; opacity: .8; }
@media (max-width: 767px) { .section-head { grid-template-columns: 1fr; gap: var(--s-1); margin-bottom: var(--s-5); } }

/* ---------- Toppnav ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--ink); color: var(--paper); border-bottom: 1px solid rgba(255,255,255,.12); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: var(--s-3); }
.top .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 500; letter-spacing: .3px; white-space: nowrap; }
.top .brand img { width: 36px; height: 36px; }
/* TT Commons versaler sitter högt i radboxen – flytta ner texten så den centreras optiskt mot logon */
.top .brand span { transform: translateY(0.12em); }
.top nav { display: flex; gap: var(--s-3); }
.top nav a { text-decoration: none; font-size: 17px; white-space: nowrap; opacity: .8; transform: translateY(0.12em); }
.top nav a:hover { opacity: 1; }
.top nav a .num { margin-right: 6px; font-size: 13px; }
@media (max-width: 1000px) { .top nav { display: none; } }

/* ---------- Mobilmeny ---------- */
.top .wrap { position: relative; z-index: 1; }
.menu-btn {
  display: none; position: relative; width: 44px; height: 44px; margin-right: -10px; flex: none;
  background: none; border: 0; padding: 0; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.menu-btn span { position: absolute; left: 10px; right: 10px; height: 1.5px; background: currentColor; transition: transform .3s cubic-bezier(.2,.8,.2,1), top .3s cubic-bezier(.2,.8,.2,1); }
.menu-btn span:nth-child(1) { top: 17px; }
.menu-btn span:nth-child(2) { top: 26px; }
.menu-open .menu-btn span:nth-child(1) { top: 21.5px; transform: rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { top: 21.5px; transform: rotate(-45deg); }

.menu-overlay {
  position: fixed; inset: 0; z-index: 0; background: var(--ink); color: var(--paper);
  padding: 96px var(--gutter) var(--s-4); display: none; flex-direction: column; justify-content: space-between; gap: var(--s-5);
  overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s linear .25s;
}
.menu-open .menu-overlay { opacity: 1; visibility: visible; transition: opacity .25s ease; }
.menu-overlay:focus { outline: none; }
.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list li, .menu-foot { opacity: 0; transform: translateY(14px); transition: opacity .3s ease, transform .4s cubic-bezier(.2,.8,.2,1); }
.menu-open .menu-list li, .menu-open .menu-foot { opacity: 1; transform: none; transition-delay: calc(.05s + var(--i) * .04s); }
.menu-list a {
  display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 8px;
  padding: 14px 0; text-decoration: none;
  font-size: clamp(34px, 9vw, 56px); font-weight: 300; letter-spacing: -0.02em; line-height: 1.05;
}
.menu-list a .num { font-size: 14px; }
/* Centrera siffran mot versalhöjden (TT Commons versaler sitter högt i radboxen) */
.menu-list a .num, .menu-list a .num + span { transform: translateY(0.12em); }
.menu-list a:hover, .menu-list a:focus-visible { color: var(--signal); outline: none; }
.menu-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); font-size: 17px; }
.menu-back { text-decoration: none; opacity: .8; }
.menu-suits { font-size: 22px; word-spacing: 10px; opacity: .9; }
/* Lås bara <html>: overflow på <body> gör body till scrollbehållare och bryter den sticky headern */
html.menu-locked { overflow: hidden; }

@media (max-width: 1000px) {
  .menu-btn { display: block; }
  .menu-overlay { display: flex; }
  .top .back { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .menu-overlay, .menu-list li, .menu-foot, .menu-btn span { transition: none !important; }
}

/* ---------- Knappar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 16px 24px; border: 1px solid currentColor; border-radius: 0;
  background: transparent; color: inherit; font-size: 16px; font-weight: 500; letter-spacing: .3px;
  text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn-solid { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.on-paper .btn-solid, .on-beige .btn-solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-signal { background: var(--signal); color: var(--paper); border-color: var(--signal); }
.btn:not(:disabled):hover { background: var(--signal); border-color: var(--signal); color: var(--paper); }
.tag { display: inline-block; font-size: 12px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; padding: 6px 10px; border: 1px solid currentColor; }
.tag.live { background: var(--signal); color: var(--paper); border-color: var(--signal); }

/* ---------- Snabbfakta ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid currentColor; }
.stat { padding: var(--s-3) var(--s-3) var(--s-3) 0; border-right: 1px solid var(--line-dark); }
.on-paper .stat, .on-beige .stat { border-color: var(--line-light); }
.stat + .stat { padding-left: var(--s-3); }
.stat:last-child { border-right: 0; }
.stat .v { font-size: clamp(40px, 5vw, 72px); font-weight: 200; line-height: 1; letter-spacing: -0.03em; margin-top: 8px; }
.stat .v small { font-size: .4em; font-weight: 400; letter-spacing: 0; margin-left: 4px; }
@media (max-width: 767px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(3) { padding-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line-dark); }
  .on-paper .stat:nth-child(n+3) { border-top-color: var(--line-light); }
}

/* ---------- Spelkort ---------- */
.pcard {
  --c-bg: var(--paper); --c-fg: var(--ink); --c-line: var(--ink);
  position: relative; aspect-ratio: 5 / 7; border-radius: 10px;
  background: var(--c-bg); color: var(--c-fg); border: 1px solid var(--c-line);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.pcard.ink   { --c-bg: var(--ink);    --c-fg: var(--paper); --c-line: rgba(255,255,255,.28); }
.pcard.felt  { --c-bg: var(--felt);   --c-fg: var(--paper); --c-line: var(--felt); }
.pcard.sig   { --c-bg: var(--signal); --c-fg: var(--paper); --c-line: var(--signal); }
.pcard.beige { --c-bg: var(--beige); }
.pcard .ix { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 22px; font-weight: 400; line-height: 1; }
.pcard .ix .suit { font-size: 16px; }
.pcard .ix.tl { top: 12px; left: 13px; }
.pcard .ix.br { bottom: 12px; right: 13px; transform: rotate(180deg); }
.pcard .pip { font-size: 64px; line-height: 1; }
.pcard.sig .red { color: inherit; }
.pcard .face { width: 66%; }

.fan { display: flex; justify-content: center; padding: calc(var(--fan-w, 150px) * .12) calc(var(--fan-w, 150px) * .32) calc(var(--fan-w, 150px) * .2); }
.fan .pcard { width: var(--fan-w, 150px); flex: none; margin-left: calc(var(--fan-w, 150px) * -0.55); transform-origin: 50% 120%; }
.fan .pcard:first-child { margin-left: 0; }
.fan .pcard:nth-child(1) { transform: rotate(-14deg); }
.fan .pcard:nth-child(2) { transform: rotate(-5deg); }
.fan .pcard:nth-child(3) { transform: rotate(5deg); }
.fan .pcard:nth-child(4) { transform: rotate(14deg); }
.fan .pcard .pip { font-size: calc(var(--fan-w, 150px) * .42); }
.fan .pcard .ix { font-size: calc(var(--fan-w, 150px) * .14); }
.fan .pcard .ix .suit { font-size: calc(var(--fan-w, 150px) * .11); }

/* Kortrad: blindnivåer */
.deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 12px; }
.deck > * { min-width: 0; }
.deck .pcard { align-items: stretch; justify-content: stretch; container-type: inline-size; }
.deck .pcard .ix { font-size: clamp(16px, 15cqi, 22px); top: 9cqi; left: 10cqi; }
.deck .lv { display: flex; flex-direction: column; justify-content: flex-end; width: 100%; min-width: 0; padding: 10cqi; }
/* Storleken följer kortets bredd så att även "3 000/6 000" får plats */
.deck .lv b { font-size: min(24px, 14.5cqi); font-weight: 300; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.deck .lv small { display: block; font-size: clamp(11px, 9cqi, 12px); opacity: .6; margin-top: 6px; }
.deck .done { opacity: .35; }
@media (max-width: 480px) { .deck { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } }

/* Pris: ess och kung */
.payout-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.payout-cards .pcard { flex-direction: column; gap: 10px; text-align: center; padding: var(--s-2); }
.payout-cards .pip { font-size: 56px; }
.payout-cards .amt { font-size: clamp(30px, 4vw, 60px); font-weight: 200; letter-spacing: -0.03em; line-height: 1; white-space: nowrap; }
@media (max-width: 480px) { .payout-cards { gap: 12px; } .payout-cards .pip { font-size: 40px; } }

/* Regelkort */
.rule-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-3); }
.rule-cards .pcard { aspect-ratio: auto; min-height: 260px; align-items: flex-end; justify-content: flex-start; padding: 56px var(--s-3) var(--s-3); }
.rule-cards h3 { font-size: var(--fs-h3); font-weight: 300; letter-spacing: -0.01em; margin: 8px 0 10px; line-height: 1.05; }
@media (max-width: 600px) { .rule-cards .pcard { min-height: 200px; } }

/* ---------- Tabeller ---------- */
table.data { width: 100%; border-collapse: collapse; }
.data th { text-align: left; font-size: var(--fs-pre); text-transform: uppercase; letter-spacing: 2px; font-weight: 500; opacity: .6; padding: 0 8px 12px 0; border-bottom: 1px solid currentColor; }
.data td { padding: 14px 8px 14px 0; border-bottom: 1px solid var(--line-light); font-size: 19px; }
.on-ink .data td, .on-felt .data td { border-bottom-color: var(--line-dark); }
.data .r { text-align: right; padding-right: 0; }
.data tr.hl td { background: var(--ink); color: var(--paper); }
.on-ink .data tr.hl td { background: var(--paper); color: var(--ink); }
.data tr.hl td:first-child { padding-left: 10px; }
.data tr.hl td:last-child { padding-right: 10px; }
.data tr.brk td { color: var(--signal); font-weight: 500; }

/* ---------- Numrerad lista ---------- */
.numbered { list-style: none; padding: 0; margin: 0; counter-reset: n; }
.numbered > li { counter-increment: n; display: grid; grid-template-columns: 48px 1fr; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--line-light); }
.on-ink .numbered > li, .on-felt .numbered > li { border-bottom-color: var(--line-dark); }
.numbered > li::before { content: counter(n, decimal-leading-zero); font-size: 14px; opacity: .55; padding-top: 5px; }
.numbered b { font-weight: 500; }

/* ---------- Marker ---------- */
.chip { display: inline-block; width: 22px; height: 22px; border-radius: 50%; vertical-align: -5px; margin-right: 10px; border: 1px solid rgba(0,0,0,.25);
  background: radial-gradient(circle, transparent 46%, rgba(255,255,255,.75) 47%, rgba(255,255,255,.75) 55%, transparent 56%), var(--chip); }
.chip.white { --chip: #f4f4f4; background: radial-gradient(circle, transparent 46%, rgba(0,0,0,.25) 47%, rgba(0,0,0,.25) 55%, transparent 56%), #f4f4f4; }
.chip.red { --chip: #d8323c; } .chip.blue { --chip: #2456a6; } .chip.green { --chip: #1f7a4a; } .chip.black { --chip: #151515; border-color: rgba(255,255,255,.4); }

/* ---------- Footer ---------- */
footer { padding: var(--s-8) 0 var(--s-4); }
footer .big { font-size: var(--fs-h1); font-weight: 300; line-height: 1; letter-spacing: -0.03em; max-width: 14ch; }
footer .meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-7); padding-top: var(--s-3); border-top: 1px solid rgba(255,255,255,.2); font-size: var(--fs-small); opacity: .7; }

/* ---------- Utskrift ---------- */
@media print {
  .top, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  section { padding: 24px 0; break-inside: avoid; }
}
