:root {
  color-scheme: dark;
  --ink: #f5f1e7; --muted: #a8b8ae; --night: #06100c; --felt: #0e583c;
  --felt-dark: #093e2b; --gold: #d7b765; --red: #c9303e;
  --card-width: clamp(52px, 7vw, 86px); --card-height: calc(var(--card-width) * 1.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--night); color: var(--ink); }
button, a { font: inherit; } button { color: inherit; }
.landing-page { min-height: 100vh; overflow: hidden; background: radial-gradient(circle at 75% 40%, rgba(30,105,73,.28), transparent 32rem), linear-gradient(145deg,#08150f,#030906); }
.landing-page::before, .game-page::before { content:""; position:fixed; inset:0; pointer-events:none; opacity:.22; background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.14'/%3E%3C/svg%3E"); z-index:20; }
.landing { min-height:100vh; width:min(1180px,calc(100% - 48px)); margin:0 auto; display:grid; grid-template-columns:minmax(0,1.15fr) minmax(400px,.85fr); align-items:center; gap:clamp(36px,5vw,76px); }
.hero { position:relative; z-index:1; min-width:0; }
.brand-mark,.mini-brand { display:inline-grid; place-items:center; border:1px solid rgba(215,183,101,.6); color:var(--gold); font-family:Georgia,serif; font-weight:700; }
.brand-mark { width:58px; height:58px; border-radius:50%; font-size:30px; margin-bottom:40px; }
.brand-mark span,.mini-brand span { font-size:.4em; margin-left:-3px; }
.eyebrow { color:var(--gold); font-size:12px; letter-spacing:.2em; text-transform:uppercase; font-weight:700; }
.hero h1 { font:700 clamp(64px,10vw,132px)/.78 Georgia,serif; letter-spacing:-.07em; margin:20px 0 36px; }
.lead { color:#c4d0c8; font-size:clamp(17px,2vw,22px); line-height:1.55; max-width:650px; }
.feature-row { display:flex; gap:10px; flex-wrap:wrap; margin:34px 0; }
.feature-row span { border:1px solid #284438; border-radius:999px; padding:8px 12px; color:#c7d3ca; font-size:13px; }
.start-instructions { display:flex; gap:14px; align-items:center; border-top:1px solid #20372e; padding-top:24px; max-width:620px; }
.step-number { flex:0 0 auto; display:grid; place-items:center; width:34px; height:34px; background:var(--felt); border-radius:50%; font-weight:800; }
.start-instructions p { margin:0; color:#b7c6bc; }
code { background:#10251c; color:#f0dca0; padding:.25em .5em; border-radius:5px; }
.dev-hint { color:#74877b; font-size:13px; } a { color:#e2ca84; }
.hero-cards { position:relative; height:510px; }
.showcase-card { position:absolute; left:50%; top:50%; width:220px; height:320px; margin:-160px 0 0 -110px; background:#fffdf8; color:#101713; border-radius:18px; box-shadow:0 30px 80px #0009,inset 0 0 0 1px #d8d6d0; padding:24px; display:flex; flex-direction:column; font:700 48px/1 Georgia,serif; }
.showcase-card span { margin:auto; font-size:110px; } .showcase-card.red-card { color:var(--red); }
.tilt-left { transform:translate(-96px,18px) rotate(-16deg); } .tilt-mid { transform:translate(0,-24px) rotate(1deg); z-index:2; } .tilt-right { transform:translate(97px,22px) rotate(17deg); }
.game-page { min-height:100vh; overflow:hidden; background:#050d09; }
.game-header { height:64px; padding:0 max(18px,env(safe-area-inset-left)); display:flex; align-items:center; gap:14px; background:#07130e; border-bottom:1px solid #193429; position:relative; z-index:10; }
.mini-brand { width:38px; height:38px; border-radius:50%; font:700 21px Georgia,serif; text-decoration:none; }
.game-label { display:block; color:#758c7e; font-size:9px; letter-spacing:.16em; } #game-code { letter-spacing:.16em; font-size:14px; }
.connection { margin-left:auto; display:flex; align-items:center; gap:7px; color:#91a69a; font-size:12px; }
.connection i { width:7px; height:7px; border-radius:50%; background:#d9a441; box-shadow:0 0 8px currentColor; }
.connection.online i { background:#54c98b; } .connection.offline i { background:#d25757; }
.table-shell { height:calc(100vh - 64px); padding:clamp(8px,1.5vw,22px); }
.card-table { position:relative; height:100%; max-width:1500px; margin:auto; overflow:hidden; border:9px solid #172c23; border-radius:clamp(28px,6vw,78px); background:radial-gradient(ellipse at 50% 45%,#146c4b 0%,var(--felt) 42%,var(--felt-dark) 100%); box-shadow:inset 0 0 65px #001b10aa,0 24px 80px #0009; }
.card-table::after { content:""; position:absolute; inset:9px; border:1px solid rgba(224,202,137,.15); border-radius:inherit; pointer-events:none; }
.player-seat { position:absolute; z-index:4; display:flex; flex-direction:column; align-items:center; gap:6px; }
.seat-top { top:12px; left:50%; transform:translateX(-50%); } .seat-left { left:16px; top:43%; transform:translateY(-50%); flex-direction:row-reverse; } .seat-right { right:16px; top:43%; transform:translateY(-50%); flex-direction:row; } .seat-bottom { bottom:clamp(150px,25vh,230px); left:50%; transform:translateX(-50%); }
.player-badge { min-width:132px; padding:8px 12px; border-radius:11px; border:1px solid rgba(255,255,255,.15); background:rgba(4,20,13,.82); box-shadow:0 8px 22px #00150c66; text-align:center; transition:.2s ease; }
.player-badge.current { border-color:var(--gold); box-shadow:0 0 0 2px rgba(215,183,101,.18),0 8px 25px #00150c88; }
.player-name { display:block; max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:750; }
.player-stats { display:flex; justify-content:center; gap:10px; color:#9db1a5; font-size:10px; margin-top:3px; text-transform:uppercase; letter-spacing:.05em; }
.player-role { display:block; color:var(--gold); font-size:9px; font-weight:800; letter-spacing:.09em; margin-top:4px; text-transform:uppercase; }
.score-delta { color:#93d5af; } .score-delta.negative { color:#ee9da5; }
.opponent-cards { height:38px; min-width:90px; display:flex; justify-content:center; padding-left:10px; }
.card-back-mini { width:25px; height:36px; margin-left:-10px; border:2px solid #e8e1d2; border-radius:4px; background-color:#182f63; background-image:repeating-linear-gradient(45deg,transparent,transparent 3px,#39558b 3px,#39558b 5px); box-shadow:0 2px 4px #001b10aa; }
.seat-left .opponent-cards,.seat-right .opponent-cards { width:28px; min-width:28px; height:92px; margin:0; padding:0; flex-direction:column; justify-content:center; }
.seat-left .card-back-mini,.seat-right .card-back-mini { margin:-28px 0 0; flex:0 0 36px; }
.seat-left .card-back-mini:first-child,.seat-right .card-back-mini:first-child { margin-top:0; }
.table-center { position:absolute; inset:22% 23% 31%; z-index:2; display:flex; align-items:center; justify-content:center; }
.status-panel { position:absolute; top:0; text-align:center; width:100%; }
.status-panel span { color:#98b7a6; font-size:9px; letter-spacing:.16em; } .status-panel p { margin:5px 0; font:600 clamp(12px,1.3vw,16px) Georgia,serif; color:#f6edda; }
.action-panel { position:absolute; z-index:8; top:54px; left:50%; transform:translateX(-50%); width:min(520px,72vw); display:none; padding:14px; border:1px solid rgba(231,215,168,.28); border-radius:14px; background:rgba(3,29,18,.92); box-shadow:0 16px 40px #00150c99; text-align:center; }
.action-panel.visible { display:block; }
.action-panel h2 { margin:0 0 6px; font:700 clamp(17px,2vw,23px) Georgia,serif; }
.action-panel p { color:#b7c9be; font-size:12px; margin:5px 0 11px; }
.action-row { display:flex; justify-content:center; gap:7px; flex-wrap:wrap; }
.game-action { min-width:42px; border:1px solid #527463; border-radius:8px; background:#102f22; padding:8px 10px; cursor:pointer; font-weight:750; }
.game-action:hover:not(:disabled),.game-action.selected { border-color:var(--gold); background:#1b4935; transform:translateY(-1px); }
.game-action:disabled { opacity:.36; cursor:default; }
.game-action.danger { color:#ffd9dd; border-color:#88444d; background:#3b161c; }
.game-action.primary { background:#2b8d62; border-color:#52b487; }
.bid-log { display:flex; justify-content:center; gap:5px; flex-wrap:wrap; margin:8px 0 11px; }
.bid-chip { border-radius:999px; padding:4px 8px; background:#081b13; color:#a9bdb1; font-size:10px; }
.contract-strip { display:inline-flex; gap:8px; align-items:center; border-radius:999px; padding:6px 10px; background:#0b2419; color:#e7d59d; font-size:11px; }
.suit-choice { font-size:18px; } .suit-choice.red { color:#ff7c87; }
.partner-card-choice { display:grid; grid-template-columns:repeat(auto-fit,minmax(45px,1fr)); gap:5px; margin:9px 0; max-height:100px; overflow:auto; }
.played-cards { position:relative; width:min(290px,38vw); height:min(230px,29vh); margin-top:35px; }
.table-card { position:absolute; width:var(--card-width); height:var(--card-height); }
.table-card.rel-0 { bottom:0; left:50%; transform:translateX(-50%); } .table-card.rel-1 { left:0; top:50%; transform:translateY(-50%) rotate(90deg); } .table-card.rel-2 { top:0; left:50%; transform:translateX(-50%) rotate(180deg); } .table-card.rel-3 { right:0; top:50%; transform:translateY(-50%) rotate(-90deg); }
.playing-card { width:var(--card-width); height:var(--card-height); flex:0 0 var(--card-width); border:0; border-radius:max(6px,calc(var(--card-width) * .1)); background:linear-gradient(145deg,#fff,#f2eee5); color:#121512; box-shadow:0 7px 13px #00150c88,inset 0 0 0 1px #d4d0c8; padding:calc(var(--card-width) * .1); display:flex; flex-direction:column; text-align:left; font:800 clamp(14px,2vw,22px)/.9 Georgia,serif; user-select:none; }
.playing-card.red { color:var(--red); } .playing-card .suit-center { margin:auto; font-size:clamp(24px,3.5vw,44px); align-self:center; } .playing-card .corner-suit { font-size:.75em; }
.hand-zone { position:absolute; z-index:5; left:2%; right:2%; bottom:max(10px,env(safe-area-inset-bottom)); }
.hand-toolbar { display:flex; justify-content:space-between; align-items:center; width:min(100%,980px); margin:0 auto 7px; }
.hand-toolbar>span { font-size:9px; letter-spacing:.16em; color:#9eb5a7; }
.text-button { border:0; background:#072a1cbb; border-radius:999px; padding:7px 11px; color:#d9e3dd; font-size:11px; cursor:pointer; }
.hand { height:var(--card-height); display:flex; justify-content:center; align-items:flex-end; padding:0 calc(var(--card-width) / 2); }
.hand .playing-card { margin-left:calc(var(--card-width) * -.28); cursor:pointer; transition:transform .14s ease,filter .14s ease; transform-origin:bottom center; }
.hand .playing-card:first-child { margin-left:0; } .hand .playing-card:hover:not(:disabled),.hand .playing-card:focus-visible:not(:disabled) { transform:translateY(-14px); z-index:5; outline:3px solid var(--gold); }
.hand .playing-card:disabled { cursor:default; filter:brightness(.82) saturate(.8); } .hand.can-play .playing-card:not(:disabled) { box-shadow:0 0 0 2px rgba(215,183,101,.55),0 8px 15px #00150caa; }
.empty-hand { color:#9cb1a5; font:italic 15px Georgia,serif; align-self:center; }
.toast { position:fixed; left:50%; bottom:26px; transform:translate(-50%,30px); opacity:0; z-index:30; background:#270d10; border:1px solid #8d3741; color:#ffdfe2; padding:11px 17px; border-radius:9px; transition:.2s ease; pointer-events:none; }
.toast.show { opacity:1; transform:translate(-50%,0); }
.dev-page { min-height:100vh; background:radial-gradient(circle at 50% 0,#123627,#050d09 60%); padding:5vh 20px; }
.dev-panel { width:min(760px,100%); margin:auto; background:#0b1b14; border:1px solid #254336; border-radius:22px; padding:clamp(24px,5vw,52px); box-shadow:0 30px 100px #0007; }
.dev-panel h1 { font:700 clamp(34px,6vw,62px)/1 Georgia,serif; margin:14px 0 20px; } .dev-panel>p { color:#aec0b5; line-height:1.6; }
.dev-links { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:30px 0; }
.dev-links a { display:grid; grid-template-columns:1fr auto; gap:4px; padding:16px; background:#10271d; border:1px solid #2b4b3d; border-radius:10px; text-decoration:none; }
.dev-links span { grid-column:1/-1; color:#799184; font-size:9px; letter-spacing:.15em; } .dev-links strong { color:#f7f2e6; } .dev-links em { color:var(--gold); font-size:12px; font-style:normal; }
.dev-actions { display:flex; gap:10px; flex-wrap:wrap; } .primary-button,.secondary-button { border-radius:8px; padding:11px 16px; cursor:pointer; font-weight:750; }
.primary-button { border:0; background:#2c9165; } .secondary-button { background:transparent; border:1px solid #527463; } .dev-status { min-height:25px; color:#e2ca84!important; }
@media (max-width:760px) {
  :root { --card-width:clamp(45px,13vw,64px); } .landing { grid-template-columns:1fr; padding:60px 0; } .hero-cards { display:none; } .brand-mark { margin-bottom:26px; }
  .game-header { height:54px; } .table-shell { height:calc(100vh - 54px); padding:0; } .card-table { border-width:4px; border-radius:20px; }
  .seat-top { top:6px; } .seat-left { left:2px; top:38%; } .seat-right { right:2px; top:38%; } .seat-bottom { bottom:calc(var(--card-height) + 48px); }
  .player-badge { min-width:96px; padding:6px 7px; } .player-name { max-width:104px; font-size:11px; } .player-stats { gap:5px; font-size:8px; }
  .opponent-cards { transform:scale(.8); transform-origin:top center; margin-bottom:-5px; } .seat-left .opponent-cards,.seat-right .opponent-cards { transform:scale(.76); transform-origin:center; margin:0; }
  .table-center { inset:20% 17% 34%; } .played-cards { width:60vw; height:27vh; } .status-panel { top:14%; }
  .action-panel { top:30%; width:82vw; padding:10px; } .action-panel h2 { font-size:15px; } .action-panel p { font-size:10px; } .game-action { padding:6px 8px; font-size:11px; }
  .hand-zone { left:0; right:0; } .hand-toolbar { padding:0 9px; } .hand { justify-content:flex-start; overflow-x:auto; overflow-y:hidden; padding:0 25vw 0 10px; scrollbar-width:none; }
  .hand::-webkit-scrollbar { display:none; } .hand .playing-card { margin-left:calc(var(--card-width) * -.34); } .hand .playing-card:first-child { margin-left:0; } .dev-links { grid-template-columns:1fr; }
}
@media (max-height:640px) and (orientation:landscape) {
  :root { --card-width:45px; } .player-badge { padding:4px 7px; } .opponent-cards { display:none; } .seat-bottom { bottom:calc(var(--card-height) + 34px); } .table-center { inset:10% 22% 29%; } .status-panel { top:2px; }
}

/* Public lobby entry */
.landing-page { overflow:auto; }
.discord-route { display:flex; align-items:center; gap:13px; max-width:620px; border-top:1px solid #20372e; padding-top:24px; }
.discord-route p { margin:4px 0 0; color:#91a69a; font-size:13px; line-height:1.5; }
.discord-icon { display:grid; place-items:center; flex:0 0 38px; width:38px; height:38px; border-radius:12px; background:#5865f2; color:white; font-weight:900; }
.lobby-entry { position:relative; z-index:2; min-width:0; width:min(100%,510px); justify-self:end; padding:clamp(28px,4.5vw,52px); border:1px solid rgba(215,183,101,.28); border-radius:26px; background:linear-gradient(155deg,rgba(15,42,30,.96),rgba(5,18,12,.98)); box-shadow:0 34px 100px #0009,inset 0 1px rgba(255,255,255,.04); }
.lobby-entry::before { content:""; position:absolute; inset:-1px; z-index:-1; border-radius:inherit; background:radial-gradient(circle at 80% 0,rgba(215,183,101,.13),transparent 45%); pointer-events:none; }
.lobby-entry.invited { border-color:rgba(215,183,101,.7); box-shadow:0 34px 100px #0009,0 0 0 4px rgba(215,183,101,.08); }
.lobby-entry-header h2 { margin:8px 0 9px; font:700 clamp(34px,4.5vw,52px)/1 Georgia,serif; letter-spacing:-.04em; }
.lobby-entry-header>p:last-child { margin:0 0 28px; color:#a9bbb0; line-height:1.55; }
.lobby-form label { display:block; margin-bottom:7px; color:#d6ded9; font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.lobby-form input { width:100%; min-width:0; height:48px; border:1px solid #355646; border-radius:10px; outline:0; background:#06160f; color:#f5f1e7; padding:0 14px; transition:border-color .15s ease,box-shadow .15s ease; }
.lobby-form input::placeholder { color:#62796d; }
.lobby-form input:focus { border-color:var(--gold); box-shadow:0 0 0 3px rgba(215,183,101,.12); }
.form-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:9px; }
.lobby-button { min-height:48px; padding:0 18px; border-radius:10px; white-space:nowrap; }
.primary-button.lobby-button { color:white; background:linear-gradient(180deg,#35a574,#267c58); box-shadow:0 8px 20px rgba(18,111,73,.26); }
.secondary-button.lobby-button { color:#e9e2d0; border-color:#547866; background:#102c20; }
.lobby-button:hover:not(:disabled) { filter:brightness(1.1); transform:translateY(-1px); }
.lobby-button:disabled { cursor:wait; opacity:.65; }
.form-divider { display:flex; align-items:center; gap:12px; margin:25px 0; color:#6f8579; font-size:10px; letter-spacing:.14em; text-transform:uppercase; }
.form-divider::before,.form-divider::after { content:""; flex:1; height:1px; background:#294238; }
.join-fields { display:grid; grid-template-columns:120px minmax(0,1fr); gap:7px 10px; align-items:center; }
.join-fields label { margin:0; }
.lobby-form .code-input { font:800 18px/1 ui-monospace,SFMono-Regular,Consolas,monospace; letter-spacing:.18em; text-transform:uppercase; }
.full-button { width:100%; margin-top:12px; }
.lobby-error { display:none; margin:14px 0 0; border:1px solid #793842; border-radius:9px; background:#301217; color:#ffd8dc; padding:9px 11px; font-size:12px; }
.lobby-error.visible { display:block; }
.privacy-note { margin:15px 0 -3px; color:#63796d; text-align:center; font-size:10px; }
.lobby-invite { display:flex; align-items:center; justify-content:center; gap:7px; margin:9px 0; }
.lobby-code { color:#f1d889; font:800 20px/1 ui-monospace,SFMono-Regular,Consolas,monospace; letter-spacing:.18em; }

@media (max-width:1000px) {
  .landing { width:min(100% - 28px,620px); min-height:auto; grid-template-columns:minmax(0,1fr); gap:38px; padding:42px 0; }
  .hero h1 { font-size:clamp(60px,20vw,92px); }
  .lobby-entry { width:100%; justify-self:stretch; padding:26px 20px; border-radius:20px; }
  .discord-route { align-items:flex-start; }
}
@media (max-width:430px) {
  .form-row { grid-template-columns:1fr; }
  .join-fields { grid-template-columns:1fr; }
  .join-fields label:not(:first-child) { margin-top:5px; }
}
