/* Couch Club — shared tokens and base styles (TV, 1920×1080). Each game sets --accent on <body>.
 * DESIGN.md §2. Packaged into every game's .wgt as core/css/cc.css. */
@font-face { font-family: 'Rubik'; src: url('../fonts/Rubik.ttf') format('truetype'); font-weight: 300 900; font-display: block; }

:root {
  --bg: #15111F; --surface-1: #221B33; --surface-2: #2E2545; --edge: #0C0914;
  --text-1: #FFF6E8; --text-2: #BDB2D1; --text-3: #857A9C;
  --brand: #FF6B57; --good: #3DDC97; --bad: #FF5470; --warn: #FFC23D;
  --gold: #E8B45A; --felt: #1E9E6A; --sunny: #FFC83D; --sky: #6CC7FF; --magenta: #FF4FA3; --amber: #FF9F1C;
  --accent: var(--brand);
  --r: 28px; --r-sm: 18px;
  --cushion: 0 10px 0 var(--edge);
  --cushion-lift: 0 14px 0 var(--edge);
  --ring: 0 0 0 6px var(--text-1);
  --safe-x: 80px; --safe-y: 48px;
  --t-fast: 180ms cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 1920px; height: 1080px; overflow: hidden; }
body {
  background: radial-gradient(1400px 700px at 50% -200px, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%), var(--bg);
  color: var(--text-1); font: 500 32px/1.3 'Rubik', system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
/* Tizen's engine may predate color-mix; fall back to a plain glow. */
@supports not (color: color-mix(in srgb, red 10%, transparent)) {
  body { background: radial-gradient(1400px 700px at 50% -200px, rgba(255,107,87,.14), transparent 70%), var(--bg); }
}
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.01em; }
button { font: inherit; color: inherit; }

.cc-app { position: absolute; top: var(--safe-y); bottom: var(--safe-y); left: var(--safe-x); right: var(--safe-x); display: flex; flex-direction: column; }
.cc-header { display: flex; align-items: center; gap: 24px; height: 96px; }
.cc-header__logo { display: flex; align-items: center; gap: 18px; font-size: 44px; font-weight: 800; }
.cc-header__logo img { height: 88px; }
.cc-header__logo b { color: var(--accent); }
.cc-header__spacer { flex: 1; }
.cc-header__meta { color: var(--text-3); font-size: 28px; display: flex; gap: 24px; align-items: center; }
.cc-hint { position: absolute; bottom: 0; inset-inline: 0; text-align: center; color: var(--text-3); font-size: 26px; height: 40px; }

.cc-label { font-size: 26px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.cc-muted { color: var(--text-2); }

.cc-card { background: var(--surface-1); border-radius: var(--r); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), var(--cushion); padding: 32px; }

/* Focusable things: cushion edge, lift + ring on focus, press on OK */
.cc-btn, .cc-focusable {
  background: var(--surface-2); border: 0; border-radius: var(--r-sm); padding: 22px 40px; font-weight: 700; font-size: 34px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), var(--cushion); transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.cc-btn--primary { background: var(--accent); color: #1A0E0A; }
.cc-btn[disabled], .cc-btn.is-disabled { opacity: .4; }
.is-focused { transform: translateY(-4px); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), var(--cushion-lift), var(--ring); }
.is-pressed { transform: translateY(6px); box-shadow: 0 4px 0 var(--edge); }

/* Avatars */
.cc-av { --s: 64px; width: var(--s); height: var(--s); border-radius: 50%; background: var(--surface-2); display: inline-grid; place-items: center; overflow: hidden; flex: none; position: relative; box-shadow: 0 4px 0 var(--edge); }
.cc-av img { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; }
.cc-av b { font-size: calc(var(--s) * .45); font-weight: 800; color: var(--text-1); }
.cc-av[data-av=fox] { background: #E9773E; } .cc-av[data-av=owl] { background: #8C6BD8; } .cc-av[data-av=cat] { background: #F0A35E; }
.cc-av[data-av=frog] { background: #46B96A; } .cc-av[data-av=bear] { background: #9A6A45; } .cc-av[data-av=panda] { background: #5E5A6E; }
.cc-av[data-av=tiger] { background: #F28C28; } .cc-av[data-av=koala] { background: #8E9AAF; } .cc-av[data-av=penguin] { background: #3B5B92; }
.cc-av[data-av=rabbit] { background: #E58FB4; } .cc-av[data-av=monkey] { background: #B07A4A; } .cc-av[data-av=lion] { background: #E0A537; }

/* Lobby */
.cc-lobby { display: grid; grid-template-columns: auto 1fr 520px; gap: 56px; align-items: center; }
.cc-lobby__qr svg { display: block; border-radius: 20px; box-shadow: var(--cushion); }
.cc-lobby__how { display: flex; flex-direction: column; gap: 20px; }
.cc-lobby__code { display: flex; gap: 16px; direction: ltr; }
.cc-lobby__code i { font-style: normal; width: 112px; height: 132px; display: grid; place-items: center; font-size: 88px; font-weight: 800; background: var(--surface-1); border-radius: var(--r-sm); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), var(--cushion); color: var(--text-1); }
.cc-lobby__players { display: flex; flex-wrap: wrap; gap: 16px; align-content: flex-start; min-height: 200px; }
.cc-chip { display: flex; align-items: center; gap: 14px; background: var(--surface-1); border-radius: 999px; padding: 8px 26px 8px 8px; font-weight: 700; box-shadow: var(--cushion); animation: cc-pop .4s cubic-bezier(.3,1.6,.5,1); }
[dir=rtl] .cc-chip { padding: 8px 8px 8px 26px; }
.cc-chip.is-away { opacity: .45; }
@keyframes cc-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* Toast */
.cc-toast { position: fixed; bottom: 90px; left: 50%; transform: translate(-50%, 40px); opacity: 0; background: var(--surface-2); padding: 20px 40px; border-radius: 999px; font-size: 30px; font-weight: 700; box-shadow: var(--cushion); transition: all var(--t-fast); z-index: 100; }
.cc-toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* Modal layer (settings, how to play, confirm) */
.cc-layer { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(10,7,16,.72); display: grid; place-items: center; z-index: 50; }
.cc-layer[hidden] { display: none; }
.cc-layer .cc-card { min-width: 760px; max-width: 1200px; }

.cc-offline { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); background: var(--bad); color: #1A0E0A; font-weight: 800; padding: 10px 28px; border-radius: 999px; font-size: 26px; z-index: 90; }
.cc-offline[hidden] { display: none; }

/* Compact lobby: one column, for a side panel (CC.lobby(el, {compact: true, qrSize: 200})) */
.cc-lobby--compact { grid-template-columns: 1fr; gap: 24px; justify-items: center; text-align: center; }
.cc-lobby--compact .cc-lobby__code i { width: 84px; height: 100px; font-size: 64px; }
.cc-lobby--compact .cc-lobby__players { min-height: 0; justify-content: center; }
.cc-lobby--compact .cc-lobby__how { align-items: center; }

/* Burn-in guard (cc.js): a dark veil after 10 idle minutes; any key or game activity lifts it */
.cc-dim { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 2s ease; z-index: 200; }
.cc-dim.is-on { opacity: .6; }
.cc-app { transition: transform 3s linear; }
