/* The Card Room - hub styles. Warm dark room, gold accents, felt tables. Mobile first. */
:root {
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gold: #e8b64a; --gold-hi: #f8dc8e; --gold-lo: #a8741a;
  --ink: #f4ecd8; --ink-dim: #c9b894; --ink-faint: #9a8a6c;
  --panel: rgba(27, 17, 9, .78); --panel-edge: rgba(232, 182, 74, .22);
  --good: #7ee2a0;
  --felt-1: #1f8556; --felt-2: #0e5a3a; --felt-3: #06301e;
  --rail-1: #8a5530; --rail-2: #5a3418; --rail-3: #2e1809;
  --room-1: #2a190c; --room-2: #120a05;
  --paper-1: #fffdf6; --paper-2: #efe6cf; --face-bg: #fff8e6;
  --c-S: #17171c; --c-C: #17171c; --c-H: #c2352b; --c-D: #c2352b;
  --gut: clamp(16px, 5vw, 40px);
  color-scheme: dark;
}
html[data-table="midnight"] { --felt-1: #2f4f94; --felt-2: #19305f; --felt-3: #0a1633; --rail-1: #5b6277; --rail-2: #353b4f; --rail-3: #171a28; --room-1: #0f1424; --room-2: #070a14; }
html[data-table="burgundy"] { --felt-1: #9a2c3e; --felt-2: #681828; --felt-3: #350812; --rail-1: #6a4a2a; --rail-2: #3e2812; --rail-3: #1e1006; --room-1: #2a0e14; --room-2: #12050a; }
html[data-table="wood"] { --felt-1: #c58b4f; --felt-2: #9a6430; --felt-3: #5c3416; --rail-1: #3b2a20; --rail-2: #231710; --rail-3: #0f0905; --room-1: #22160e; --room-2: #0e0803; }
html[data-deck="fourcolor"] { --c-D: #1f62c8; --c-C: #1f8a3a; }
html[data-deck="dark"] { --paper-1: #2b2e42; --paper-2: #171926; --face-bg: #222538; --c-S: #ece6d4; --c-C: #ece6d4; --c-H: #ff7468; --c-D: #ff7468; }
/* a poster keeps its own felt no matter which table the player chose */
[data-felt="green"] { --felt-1: #1f8556; --felt-2: #0e5a3a; --felt-3: #06301e; }
[data-felt="burgundy"] { --felt-1: #9a2c3e; --felt-2: #681828; --felt-3: #350812; }
[data-felt="midnight"] { --felt-1: #2f4f94; --felt-2: #19305f; --felt-3: #0a1633; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body {
  margin: 0; min-height: 100dvh; color: var(--ink); font-family: var(--font-ui); font-size: 16px; line-height: 1.5;
  background: radial-gradient(1200px 700px at 70% -10%, var(--room-1), var(--room-2) 70%) fixed, var(--room-2);
  padding-inline: var(--gut); overflow-x: hidden; transition: background .4s;
}
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.1; letter-spacing: -.01em; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; }
.wrap, main, .top, .foot { max-width: 1120px; margin-inline: auto; }

/* ----- header ----- */
.top { display: flex; align-items: center; gap: 14px; padding-block: 14px; position: sticky; top: 0; z-index: 20; background: linear-gradient(var(--room-2) 60%, transparent); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--gold-hi), var(--gold-lo)); box-shadow: 0 3px 10px rgba(0,0,0,.5); }
.brand-mark svg { width: 20px; height: 20px; fill: #7a1c14; }
.brand-name { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.top-nav { display: none; gap: 20px; }
.top-nav a { text-decoration: none; color: var(--ink-dim); font-weight: 600; font-size: 14px; }
.top-nav a:hover { color: var(--gold-hi); }
@media (min-width: 640px) { .top-nav { display: flex; } }
.acct-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--panel); border: 1px solid var(--panel-edge); text-decoration: none; font-weight: 700; font-size: 14px; cursor: pointer; }
a.acct-chip { padding: 8px 16px; }
.acct-chip img { width: 28px; height: 28px; border-radius: 50%; }

/* ----- buttons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 14px; font-weight: 800; font-size: 16px; text-decoration: none; cursor: pointer; border: 1.5px solid transparent; transition: transform .12s, box-shadow .2s, filter .2s; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { color: #2a1604; background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo)); box-shadow: 0 6px 18px rgba(232,182,74,.3), inset 0 1px 0 rgba(255,255,255,.55); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 8px 24px rgba(232,182,74,.45), inset 0 1px 0 rgba(255,255,255,.55); }
.btn.ghost { background: rgba(255,255,255,.04); border-color: var(--panel-edge); color: var(--ink); }
.btn.ghost:hover { background: rgba(255,255,255,.09); }
.btn.wide { width: 100%; }

/* ----- hero ----- */
.hero { display: grid; gap: 34px; padding-block: clamp(20px, 5vw, 56px) clamp(36px, 7vw, 80px); align-items: center; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.05fr 1fr; gap: 56px; } }
.eyebrow { margin: 0 0 14px; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.hero h1 { font-size: clamp(40px, 9.5vw, 78px); font-weight: 800; text-wrap: balance; }
.hero h1 em { font-style: italic; color: var(--gold-hi); }
.lede { font-size: clamp(16px, 2.3vw, 19px); color: var(--ink-dim); max-width: 46ch; margin: 18px 0 26px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 26px; padding: 0; margin: 28px 0 0; color: var(--ink-faint); font-size: 14px; }
.facts b { font-family: var(--font-display); font-size: 22px; color: var(--gold-hi); margin-right: 4px; }

.hero-art { position: relative; aspect-ratio: 1 / .82; width: 100%; max-width: 520px; margin-inline: auto; }
.hero-table { position: absolute; inset: 6% 0 0; border-radius: 50%; background: radial-gradient(ellipse at 50% 38%, var(--felt-1), var(--felt-2) 55%, var(--felt-3)); border: clamp(8px, 2vw, 14px) solid var(--rail-1); box-shadow: 0 0 0 3px var(--rail-3), 0 30px 60px rgba(0,0,0,.6), inset 0 0 60px rgba(0,0,0,.45); transition: background .4s; }
.fan { position: absolute; left: 50%; top: 24%; width: 0; height: 0; }
.fan-c { position: absolute; left: 0; top: 0; transform-origin: 50% 160%; transform: translate(-50%, 0) rotate(calc(var(--i) * 13deg)); }
.fan .fan-c { animation: float 5s ease-in-out infinite; animation-delay: calc(var(--i) * -.6s); }
@keyframes float { 50% { translate: 0 -8px; } }
.hero-pals .pal { position: absolute; width: clamp(54px, 13vw, 84px); aspect-ratio: 1; animation: bob 4s ease-in-out infinite; }
.pal .avatar { width: 100%; height: 100%; }
.pal.p0 { left: 41%; bottom: 3%; width: clamp(64px, 16vw, 96px); }
.pal.p1 { left: 1%; top: 36%; animation-delay: -1s; }
.pal.p2 { right: 1%; top: 36%; animation-delay: -2s; }
.pal.p3 { left: 41%; top: 4%; animation-delay: -3s; display: none; }
@keyframes bob { 50% { translate: 0 -6px; } }

/* ----- cards (miniature) ----- */
.pc { position: relative; width: clamp(54px, 13vw, 84px); aspect-ratio: 5 / 7; border-radius: 8px; background: linear-gradient(145deg, var(--paper-1), var(--paper-2)); border: 1px solid rgba(0,0,0,.3); box-shadow: 0 6px 14px rgba(0,0,0,.45); color: var(--c-S); }
.pc i { position: absolute; left: 7%; top: 3%; font: 800 clamp(13px, 3.4vw, 20px)/1 var(--font-display); font-style: normal; }
.pc u { position: absolute; right: 7%; bottom: 3%; font: 800 clamp(13px, 3.4vw, 20px)/1 var(--font-display); text-decoration: none; transform: rotate(180deg); }
.pc svg { position: absolute; left: 50%; top: 52%; width: 46%; translate: -50% -50%; fill: currentColor; }
.pc.s-H { color: var(--c-H); } .pc.s-D { color: var(--c-D); } .pc.s-C { color: var(--c-C); } .pc.s-S { color: var(--c-S); }

/* ----- avatar ----- */
.avatar { position: relative; width: 56px; height: 56px; border-radius: 50%; background: radial-gradient(circle at 35% 28%, var(--c1, #e0705f), var(--c2, #a73a2c)); border: 2.5px solid rgba(255,255,255,.85); box-shadow: 0 4px 10px rgba(0,0,0,.55), inset 0 -4px 8px rgba(0,0,0,.25); display: block; }
.avatar .av-svg { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; }
.avatar.big { width: clamp(84px, 24vw, 116px); height: clamp(84px, 24vw, 116px); cursor: pointer; border-width: 3.5px; }
.avatar.pop { animation: avpop .5s ease-out; }
@keyframes avpop { 40% { transform: scale(1.18) rotate(-4deg); } }

/* ----- sections ----- */
section { padding-block: clamp(30px, 6vw, 64px); }
.sec-head { margin-bottom: 26px; max-width: 60ch; }
.sec-head h2 { font-size: clamp(28px, 6vw, 44px); font-weight: 800; }
.sec-head p { color: var(--ink-dim); margin: 10px 0 0; }

/* ----- game cards ----- */
.game-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.gcard { display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; background: var(--panel); border: 1px solid var(--panel-edge); box-shadow: 0 14px 34px rgba(0,0,0,.45); transition: transform .2s, box-shadow .2s, border-color .2s; }
.gcard:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent) 60%, var(--gold)); box-shadow: 0 22px 44px rgba(0,0,0,.55), 0 0 0 1px var(--accent); }
.gposter { position: relative; height: 170px; overflow: hidden; background: radial-gradient(ellipse at 50% 120%, var(--felt-1), var(--felt-2) 50%, var(--felt-3)); }
.gposter::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 50%, rgba(0,0,0,.35)); pointer-events: none; }
.gp-fan { position: absolute; left: 50%; top: 52%; width: 0; height: 0; }
.gp-fan .fan-c { transform-origin: 50% 120%; transform: translate(-50%, -30%) rotate(calc(var(--i) * 16deg)); transition: transform .3s; }
.gcard:hover .gp-fan .fan-c { transform: translate(-50%, -38%) rotate(calc(var(--i) * 24deg)); }
.gp-fan .pc { width: 76px; }
.gp-badge { position: absolute; z-index: 2; top: 12px; left: 12px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.2); }
.gbody { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.gbody h3 { font-size: 26px; font-weight: 800; }
.gtag { margin: 0; color: var(--gold-hi); font-weight: 700; font-size: 14px; }
.gblurb { margin: 4px 0 8px; color: var(--ink-dim); font-size: 15px; flex: 1; }
.gmeta { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 14px; }
.gmeta li { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.07); color: var(--ink-dim); }

/* ----- seat editor ----- */
.seat-sec { border-radius: 28px; }
.seat-layout { display: grid; gap: 28px; }
.seat-preview { order: -1; }
@media (min-width: 900px) { .seat-preview { order: 0; } .seat-layout { grid-template-columns: 1.15fr 1fr; align-items: start; } .seat-preview { position: sticky; top: 90px; } }
.seat-form { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 24px; padding: clamp(16px, 4vw, 28px); display: grid; gap: 22px; }
.fld { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; }
.fld > span { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
#p-name { min-height: 52px; padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--panel-edge); background: rgba(0,0,0,.35); font-size: 18px; }
#p-name:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(232,182,74,.25); }
.chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; }
.char { display: grid; justify-items: center; gap: 6px; padding: 10px 4px 8px; border-radius: 16px; background: rgba(255,255,255,.04); border: 1.5px solid transparent; cursor: pointer; transition: transform .15s, background .2s, border-color .2s; }
.char .avatar { width: 58px; height: 58px; }
.char b { font-size: 12px; color: var(--ink-dim); }
.char:hover { background: rgba(255,255,255,.09); transform: translateY(-2px); }
.char.on { border-color: var(--gold); background: rgba(232,182,74,.12); }
.char.on b { color: var(--gold-hi); }
.rings { display: flex; flex-wrap: wrap; gap: 12px; }
.ring { width: 44px; height: 44px; border-radius: 50%; cursor: pointer; background: radial-gradient(circle at 35% 28%, var(--c1), var(--c2)); border: 3px solid rgba(255,255,255,.35); transition: transform .15s; }
.ring:hover { transform: scale(1.08); }
.ring.on { border-color: #fff; box-shadow: 0 0 0 3px var(--gold); }
.tables, .decks { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.swatch, .deckopt { display: grid; justify-items: center; gap: 8px; padding: 12px 8px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1.5px solid transparent; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--ink-dim); transition: background .2s, border-color .2s; }
.swatch:hover, .deckopt:hover { background: rgba(255,255,255,.09); }
.swatch.on, .deckopt.on { border-color: var(--gold); background: rgba(232,182,74,.12); color: var(--gold-hi); }
.swatch i { width: 100%; height: 38px; border-radius: 50%/60%; background: radial-gradient(ellipse at 50% 35%, var(--f1), var(--f3)); border: 4px solid var(--r); }
.deckopt .pair { display: flex; }
.deckopt .pair .pc { width: 30px; border-radius: 4px; margin-left: -8px; box-shadow: 0 2px 5px rgba(0,0,0,.5); }
.deckopt .pair .pc:first-child { margin-left: 0; }
.deckopt .pair .pc i, .deckopt .pair .pc u { font-size: 9px; }
.deckopt .pair[data-deck="fourcolor"] { --c-D: #1f62c8; --c-C: #1f8a3a; --c-S: #17171c; --c-H: #c2352b; }
.deckopt .pair[data-deck="dark"] { --paper-1: #2b2e42; --paper-2: #171926; --c-S: #ece6d4; --c-C: #ece6d4; --c-H: #ff7468; --c-D: #ff7468; }
.deckopt .pair[data-deck="classic"] { --paper-1: #fffdf6; --paper-2: #efe6cf; --c-S: #17171c; --c-C: #17171c; --c-H: #c2352b; --c-D: #c2352b; }
.save-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.save-note { color: var(--ink-faint); font-size: 14px; }
.save-note.good { color: var(--good); }

/* preview table */
.preview-table { border-radius: 26px; padding: 12px; background: linear-gradient(145deg, var(--rail-1), var(--rail-2)); box-shadow: 0 0 0 2px var(--rail-3), 0 24px 50px rgba(0,0,0,.55); transition: background .4s; }
.pv-felt { position: relative; border-radius: 18px; min-height: 300px; display: grid; align-content: space-between; justify-items: center; padding: 18px 12px 16px; overflow: hidden; background: radial-gradient(ellipse at 50% 30%, var(--felt-1), var(--felt-2) 55%, var(--felt-3)); box-shadow: inset 0 0 50px rgba(0,0,0,.5); transition: background .4s; }
.pv-cards { position: relative; width: 0; height: 110px; margin-top: 56px; }
.pv-cards .fan-c { transform-origin: 50% 200%; transform: translate(-50%, 0) rotate(calc(var(--i) * 11deg)); }
.pv-cards .pc { width: 64px; }
.pv-me { display: grid; justify-items: center; gap: 8px; }
.pv-plate { padding: 4px 16px; border-radius: 999px; font-weight: 800; font-size: 15px; background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.75)); border: 1px solid var(--panel-edge); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-hint { text-align: center; color: var(--ink-faint); font-size: 13px; margin: 12px 0 0; }

/* ----- sign in ----- */
.signin-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(20px, 5vw, 36px); border-radius: 26px; background: linear-gradient(135deg, rgba(232,182,74,.16), rgba(232,182,74,.04)), var(--panel); border: 1px solid var(--panel-edge); }
.signin-copy { max-width: 56ch; flex: 1 1 300px; }
.signin-copy h2 { font-size: clamp(24px, 5vw, 34px); }
.signin-copy p { color: var(--ink-dim); margin: 10px 0 0; }
.signin-small { font-size: 13px !important; color: var(--ink-faint) !important; }
.signin-btn { min-height: 44px; display: grid; place-items: center; }

/* ----- footer ----- */
.foot { padding-block: 36px calc(36px + env(safe-area-inset-bottom, 0px)); text-align: center; color: var(--ink-faint); font-size: 14px; border-top: 1px solid rgba(232,182,74,.12); margin-top: 20px; }
.foot p { margin: 4px 0; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; }
.foot-links a { color: var(--ink-dim); text-decoration: none; }
.foot-links a:hover { color: var(--gold-hi); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
