:root {
  --bg: #0b0820;
  --bg2: #17123a;
  --panel: rgba(30, 24, 70, .72);
  --line: rgba(150, 130, 255, .22);
  --text: #f4f0ff;
  --muted: #a49cd0;
  --accent: #ff5470;
  --accent2: #ffd166;
  --ok: #06d6a0;
  --radius: 18px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --display: "Segoe UI Black", "Arial Black", Impact, var(--font);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[hidden] { display: none !important; }

/* animated backdrop */
body::before, body::after {
  content: ""; position: fixed; z-index: -2; width: 70vmax; height: 70vmax; border-radius: 50%;
  filter: blur(80px); opacity: .55; pointer-events: none;
}
body::before { background: radial-gradient(circle, #6c3df5 0%, transparent 65%); top: -25vmax; left: -20vmax; animation: drift1 18s ease-in-out infinite alternate; }
body::after { background: radial-gradient(circle, #e0407a 0%, transparent 65%); bottom: -30vmax; right: -20vmax; animation: drift2 22s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(14vmax, 10vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-12vmax, -8vmax) scale(1.1); } }
.screen::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.55) 1px, transparent 1.4px);
  background-size: 90px 90px; background-position: 0 0;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
}

.screen { max-width: 1000px; margin: 0 auto; padding: 26px 16px 56px; display: flex; flex-direction: column; gap: 20px; animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* brand */
.brand { text-align: center; padding: 14px 0 0; }
.logo-bomb { font-size: 54px; line-height: 1; filter: drop-shadow(0 0 18px rgba(255, 84, 112, .7)); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(6deg); } }
.brand h1 {
  margin: 4px 0 0; font-family: var(--display); font-size: clamp(44px, 10vw, 84px); letter-spacing: 5px; font-weight: 900; line-height: 1;
  text-shadow: 0 4px 0 rgba(0,0,0,.35), 0 0 40px rgba(108, 61, 245, .55);
}
.brand h1 span {
  background: linear-gradient(180deg, #ff8aa0, #ff3d63 70%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 84, 112, .55));
}
.brand p { margin: 10px 0 0; color: var(--muted); font-size: 16px; }

/* glass panels */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.07);
}
.panel h2 { margin: 0 0 14px; font-size: 14px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.join-panel { max-width: 540px; width: 100%; margin: 0 auto; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field span { color: var(--muted); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 700; }
input {
  background: rgba(8, 5, 28, .6); border: 2px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 13px 15px; font-size: 17px; font-weight: 600; outline: none; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 84, 112, .18); }
.code-input { text-transform: uppercase; text-align: center; letter-spacing: 10px; font-weight: 900; font-size: 24px; max-width: 190px; padding-left: 24px; }

.join-row { display: flex; gap: 10px; justify-content: center; align-items: stretch; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; margin: 18px 0; }
.or::before, .or::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* buttons */
.btn {
  background: rgba(255,255,255,.06); color: var(--text); border: 2px solid var(--line); border-radius: 12px;
  padding: 10px 16px; font-size: 15px; font-weight: 800; cursor: pointer; font-family: inherit;
  transition: transform .1s, border-color .15s, background .15s, box-shadow .2s, filter .15s;
}
.btn:hover:not(:disabled) { border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.1); }
.btn:active:not(:disabled) { transform: translateY(2px) scale(.99); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, #ff6b87, #ff3d63); border-color: #ff8aa0; color: #fff;
  box-shadow: 0 6px 0 #a3203d, 0 10px 28px rgba(255, 61, 99, .4); text-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); background: linear-gradient(180deg, #ff6b87, #ff3d63); border-color: #ffc0cc; }
.btn.primary:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 #a3203d, 0 6px 18px rgba(255, 61, 99, .4); }
.btn.primary:disabled { box-shadow: 0 6px 0 #5a2230; }
.btn.danger:hover:not(:disabled) { border-color: #ff3b3b; color: #ff9a9a; }
.btn.big { padding: 14px 24px; font-size: 17px; }
.btn.small { padding: 8px 13px; font-size: 13px; }
.join-row .btn.primary { flex: 1; }

/* game cards */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 14px; }
.card {
  --gc: #ff5470;
  position: relative; overflow: hidden; text-align: left; border: 2px solid var(--line); border-radius: 16px;
  padding: 16px; display: flex; flex-direction: column; gap: 8px; color: var(--text); font: inherit;
  background: linear-gradient(160deg, color-mix(in srgb, var(--gc) 22%, #1a1445) 0%, #140f36 70%);
  transition: transform .15s, border-color .15s, box-shadow .2s;
}
.card::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--gc) 55%, transparent), transparent 70%); opacity: .55; pointer-events: none;
}
.card .icon { font-size: 38px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); position: relative; z-index: 1; }
.card.selectable { cursor: pointer; }
.card.selectable:hover { transform: translateY(-4px) rotate(-.4deg); border-color: var(--gc); box-shadow: 0 14px 30px rgba(0,0,0,.4), 0 0 0 1px var(--gc); }
.card.selected { border-color: var(--gc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gc) 45%, transparent), 0 16px 34px rgba(0,0,0,.45); transform: translateY(-2px); }
.card.selected::before {
  content: "✓ AUSGEWÄHLT"; position: absolute; top: 12px; right: 12px; font-size: 10px; font-weight: 900; letter-spacing: 1px;
  background: var(--gc); color: #170d2e; padding: 3px 8px; border-radius: 999px; z-index: 2;
}
.card.soon { filter: saturate(.55); opacity: .72; }
.card .name { font-family: var(--display); font-size: 15px; letter-spacing: 1.2px; position: relative; z-index: 1; }
.card .tag { color: var(--muted); font-size: 13px; line-height: 1.4; flex: 1; position: relative; z-index: 1; }
.card .meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; position: relative; z-index: 1; }
.pill { background: rgba(255,255,255,.08); border-radius: 999px; padding: 4px 11px; font-weight: 800; font-size: 11px; letter-spacing: .5px; }
.pill.soon { background: rgba(255, 209, 102, .16); color: var(--accent2); }
.pill.live { background: rgba(6, 214, 160, .16); color: var(--ok); }

/* lobby */
.lobby-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 14px; }
.code-big {
  font-family: var(--display); font-size: clamp(46px, 11vw, 84px); letter-spacing: 14px; line-height: 1; padding-left: 14px;
  background: linear-gradient(180deg, #ffe49a, #ffb347); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(255, 190, 80, .4));
}
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lobby-grid { display: grid; grid-template-columns: 310px 1fr; gap: 20px; align-items: start; }
@media (max-width: 780px) { .lobby-grid { grid-template-columns: 1fr; } }

.players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.players li { display: flex; align-items: center; gap: 12px; background: rgba(8, 5, 28, .5); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; animation: rise .3s both; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 900; font-size: 15px; color: #1a0f2e;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.2), inset 0 3px 0 rgba(255,255,255,.35), 0 3px 8px rgba(0,0,0,.4);
}
.avatar.sm { width: 28px; height: 28px; font-size: 13px; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.players .me { border-color: rgba(255, 209, 102, .7); background: rgba(255, 209, 102, .07); }
.players .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.players .host { font-size: 11px; color: var(--accent2); font-weight: 900; letter-spacing: 1px; }
.count { color: var(--muted); font-weight: 700; font-size: 14px; margin-left: 6px; letter-spacing: 0; }
.muted { color: var(--muted); }
.small-text { font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 600; margin-left: 8px; }

.start-row { display: flex; align-items: center; gap: 16px; margin-top: 20px; flex-wrap: wrap; }
.reason { color: var(--accent2); font-size: 14px; font-weight: 600; }

/* results */
.results { max-width: 540px; width: 100%; margin: 40px auto 0; text-align: center; }
.results h2 { font-family: var(--display); font-size: 30px; letter-spacing: 1px; text-transform: none; color: var(--accent2); margin: 4px 0 0; }
.ranking { list-style: none; padding: 0; margin: 18px 0 22px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.ranking li { display: flex; gap: 12px; align-items: center; background: rgba(8, 5, 28, .5); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font-weight: 800; animation: rise .4s both; }
.ranking li:nth-child(2) { animation-delay: .06s; } .ranking li:nth-child(3) { animation-delay: .12s; } .ranking li:nth-child(n+4) { animation-delay: .18s; }
.ranking li .place { width: 28px; color: var(--muted); font-family: var(--display); }
.ranking li.first { background: linear-gradient(90deg, rgba(255, 209, 102, .22), rgba(255, 209, 102, .05)); border: 2px solid var(--accent2); box-shadow: 0 0 30px rgba(255, 209, 102, .25); }
.ranking li.first .place { color: var(--accent2); }
.res-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* game */
.screen-game { position: fixed; inset: 0; background: #0a0816; touch-action: none; }
#game-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.game-leave { position: fixed; right: 10px; bottom: 10px; opacity: .7; }
.game-leave:hover { opacity: 1; }

.toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 50;
  background: rgba(58, 18, 32, .96); border: 2px solid var(--accent); color: #fff; padding: 11px 20px;
  border-radius: 12px; font-weight: 700; max-width: 90vw; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.5);
  animation: toastin .25s cubic-bezier(.2,.9,.3,1.3) both;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, -14px) scale(.95); } }
.toast.info { background: rgba(17, 38, 58, .96); border-color: #4cc9f0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* name + skin row */
.name-row { display: flex; gap: 12px; align-items: flex-end; }
.name-row .field { flex: 1; }
.skin-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 14px; padding: 6px 10px 5px; cursor: pointer;
  background: rgba(255,255,255,.06); border: 2px solid var(--line); border-radius: 14px; color: var(--text); font: inherit;
  transition: border-color .15s, transform .1s, background .15s;
}
.skin-btn:hover { border-color: var(--accent); background: rgba(255,255,255,.1); }
.skin-btn:active { transform: scale(.97); }
.skin-btn-label { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--muted); }
.btn.full { width: 100%; margin-bottom: 14px; }
.avatar-wrap { display: grid; place-items: center; width: 40px; height: 40px; flex: none; }
.players li.bot { opacity: .85; border-style: dashed; }
.bottag { font-size: 11px; font-weight: 900; letter-spacing: 1px; color: #7ee0ff; }

/* bots box */
.bot-box { margin-top: 16px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 14px; background: rgba(8,5,28,.35); }
.bot-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 800; position: relative; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.slider { width: 44px; height: 26px; border-radius: 999px; background: rgba(255,255,255,.12); border: 2px solid var(--line); position: relative; transition: background .2s; flex: none; }
.slider::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + .slider { background: var(--ok); border-color: var(--ok); }
.switch input:checked + .slider::after { transform: translateX(18px); }
.switch input:disabled ~ .switch-label, .switch input:disabled + .slider { opacity: .5; cursor: not-allowed; }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px rgba(255,84,112,.4); }
.stepper { display: inline-flex; align-items: center; gap: 10px; }
.stepper.off { opacity: .4; }
.stepper-val { min-width: 26px; text-align: center; font-family: var(--display); font-size: 22px; }
.bot-box .small-text { display: block; margin: 8px 0 0; }

/* skin editor */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(5, 3, 18, .78); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: rise .25s both; }
.modal-card { width: min(860px, 100%); max-height: 94vh; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.modal-head h2 { margin: 0; }
.skin-layout { display: grid; grid-template-columns: 290px 1fr; gap: 20px; align-items: start; }
@media (max-width: 720px) { .skin-layout { grid-template-columns: 1fr; } }
.skin-preview { display: flex; flex-direction: column; gap: 10px; }
#skin-canvas { width: 100%; height: 270px; border-radius: 16px; background: linear-gradient(180deg, rgba(8,5,28,.7), rgba(30,22,80,.7)); border: 1px solid var(--line); display: block; }
.skin-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.check input { width: auto; accent-color: var(--accent); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { background: rgba(255,255,255,.06); color: var(--muted); border: 2px solid transparent; border-radius: 999px; padding: 8px 15px; font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; transition: all .15s; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(255,61,99,.4); }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.opts.colors { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); }
.swatch { aspect-ratio: 1; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); cursor: pointer; transition: transform .12s, border-color .15s; box-shadow: inset 0 -5px 0 rgba(0,0,0,.18), inset 0 4px 0 rgba(255,255,255,.3); }
.swatch:hover { transform: scale(1.12); }
.swatch.sel { border-color: #fff; box-shadow: 0 0 0 3px var(--accent), inset 0 -5px 0 rgba(0,0,0,.18), inset 0 4px 0 rgba(255,255,255,.3); transform: scale(1.08); }
.tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 7px; background: rgba(8,5,28,.5); border: 2px solid var(--line); border-radius: 14px; color: var(--text); font: inherit; cursor: pointer; transition: transform .12s, border-color .15s, background .15s; }
.tile:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.5); }
.tile.sel { border-color: var(--accent); background: rgba(255,84,112,.14); box-shadow: 0 0 0 2px rgba(255,84,112,.35); }
.tile-art { display: grid; place-items: center; width: 64px; height: 64px; font-size: 34px; }
.tile-label { font-size: 11px; font-weight: 800; color: var(--muted); text-align: center; line-height: 1.15; }
.tile.sel .tile-label { color: var(--text); }

.ranking li .rname { flex: 1; }
.ranking li .rextra { color: var(--accent2); font-family: var(--display); }
#res-sub { margin-top: 4px; font-size: 13px; }
.game-dom { position: absolute; inset: 0; overflow: auto; -webkit-overflow-scrolling: touch; background: radial-gradient(1100px 650px at 50% -10%, #2d2166 0%, #120c2e 55%, #0a0816 100%); }

/* ---------- Telephone Doodle ---------- */
.td { max-width: 880px; margin: 0 auto; padding: 14px 14px 90px; display: flex; flex-direction: column; gap: 12px; min-height: 100%; }
.td-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.td-title { font-family: var(--display); letter-spacing: 3px; font-size: 13px; color: var(--muted); }
.td-round { font-weight: 800; font-size: 13px; color: var(--accent2); min-width: 90px; }
.td-mute { background: none; border: 0; color: var(--text); font-size: 18px; cursor: pointer; min-width: 90px; text-align: right; }
.td-bar { height: 10px; border-radius: 6px; background: rgba(255,255,255,.1); overflow: hidden; }
.td-bar-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #06d6a0, #ffd166); border-radius: 6px; transition: width .1s linear; }
.td-bar-fill.low { background: linear-gradient(90deg, #ff5470, #ffb347); animation: tdpulse .5s infinite alternate; }
@keyframes tdpulse { to { opacity: .55; } }
.td-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 6px; }
.td-card { width: min(560px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 12px; backdrop-filter: blur(12px); box-shadow: 0 18px 50px rgba(0,0,0,.35); animation: rise .3s both; text-align: center; }
.td-card.wide { width: min(760px, 100%); }
.td-card h2 { margin: 0; font-family: var(--display); font-size: 22px; letter-spacing: 1px; }
.td-hint { margin: 0; color: var(--muted); font-size: 14px; }
.td-input { width: 100%; resize: none; background: rgba(8,5,28,.6); border: 2px solid var(--line); color: var(--text); border-radius: 12px; padding: 12px 14px; font: 600 18px var(--font); outline: none; text-align: center; }
.td-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255,84,112,.18); }
.td-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.td-dots { font-size: 22px; letter-spacing: 6px; color: var(--accent2); animation: tdpulse 1s infinite alternate; }
.td-prompt { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.td-prompt-label { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.td-prompt-text { font-family: var(--display); font-size: clamp(18px, 3.4vw, 26px); color: var(--accent2); }
.td-canvas { width: max(260px, min(100%, calc((100vh - 360px) * 1.3333))); height: auto; margin: 0 auto; aspect-ratio: 4 / 3; border-radius: 14px; background: #fff; touch-action: none; cursor: crosshair; box-shadow: inset 0 0 0 3px rgba(0,0,0,.15), 0 8px 24px rgba(0,0,0,.35); display: block; }
.td-tools { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.td-palette { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; max-width: 320px; }
.td-col { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); cursor: pointer; padding: 0; }
.td-col.sel { border-color: #fff; box-shadow: 0 0 0 3px var(--accent); transform: scale(1.1); }
.td-sizes { display: flex; gap: 6px; }
.td-size { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.08); border: 2px solid var(--line); display: grid; place-items: center; cursor: pointer; padding: 0; }
.td-size span { display: block; background: #fff; border-radius: 50%; }
.td-size.sel { border-color: var(--accent); background: rgba(255,84,112,.18); }
.td-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.td-chip { display: flex; align-items: center; gap: 6px; background: rgba(8,5,28,.55); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px 3px 4px; font-size: 12px; font-weight: 700; opacity: .65; }
.td-chip.me { border-color: rgba(255,209,102,.6); }
.td-chip.done { opacity: 1; border-color: var(--ok); }
.td-chip-av { display: grid; place-items: center; width: 30px; height: 30px; }
.td-chip-ok { color: var(--ok); display: none; }
.td-chip.done .td-chip-ok { display: inline; }

/* reveal */
.td-reveal { width: min(760px, 100%); display: flex; flex-direction: column; gap: 12px; padding-bottom: 20px; }
.td-rv-head { display: flex; justify-content: space-between; align-items: baseline; }
.td-rv-owner { font-family: var(--display); font-size: 20px; color: var(--accent2); }
.td-rv-count { color: var(--muted); font-weight: 700; font-size: 13px; }
.td-rv-list { display: flex; flex-direction: column; gap: 12px; }
.td-entry { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; animation: rise .4s both; transition: opacity .3s; }
.td-entry.old { opacity: .88; }
.td-entry.draw .td-canvas { cursor: default; width: min(100%, 520px); }
.td-entry-head { display: flex; align-items: center; gap: 8px; }
.td-entry-name { font-weight: 800; }
.td-entry-kind { margin-left: auto; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.td-bubble { background: rgba(255,255,255,.08); border-radius: 14px; padding: 14px 16px; font-size: clamp(18px, 3vw, 24px); font-weight: 800; text-align: center; }
.td-entry-foot { display: flex; justify-content: flex-end; }
.td-star { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,209,102,.12); border: 2px solid rgba(255,209,102,.4); color: var(--accent2); border-radius: 999px; padding: 6px 14px; font: 800 15px var(--font); cursor: pointer; transition: transform .1s, background .15s; }
.td-star:hover { background: rgba(255,209,102,.25); }
.td-star.pop { animation: starpop .35s; }
.td-star.mine { background: rgba(255,209,102,.3); border-color: var(--accent2); }
@keyframes starpop { 40% { transform: scale(1.3) rotate(-6deg); } }
.td-chainend { text-align: center; font-family: var(--display); color: var(--muted); padding: 10px; letter-spacing: 1px; }
.td-reactions { position: sticky; bottom: 8px; display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; background: rgba(12,8,34,.85); border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; backdrop-filter: blur(10px); }
.td-react { background: none; border: 0; font-size: 24px; cursor: pointer; padding: 2px 6px; transition: transform .1s; }
.td-react:hover { transform: scale(1.25); }
.td-react:active { transform: scale(.9); }
.td-next { margin-left: 8px; padding: 8px 16px; }
.td-float { position: absolute; bottom: 70px; display: flex; flex-direction: column; align-items: center; pointer-events: none; animation: tdfloat 2.3s ease-out forwards; z-index: 5; }
.td-float-e { font-size: 38px; }
.td-float-n { font-size: 11px; font-weight: 800; background: rgba(8,5,28,.7); border-radius: 999px; padding: 1px 8px; }
@keyframes tdfloat { from { transform: translateY(0) scale(.6); opacity: 1; } to { transform: translateY(-340px) scale(1.2); opacity: 0; } }
@media (max-width: 560px) { .td-palette { grid-template-columns: repeat(8, 1fr); } .td-col { width: 26px; height: 26px; } }

/* ---------- control scheme picker ---------- */
.ctl-ui { position: absolute; inset: 0; pointer-events: none; z-index: 8; }
.ctl-pick {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); width: min(620px, calc(100% - 24px));
  background: rgba(14, 9, 40, .92); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px 10px;
  backdrop-filter: blur(10px); box-shadow: 0 18px 50px rgba(0,0,0,.5); pointer-events: auto; text-align: center;
  transition: opacity .5s, transform .5s;
}
.ctl-pick.gone { opacity: 0; transform: translateX(-50%) translateY(20px); pointer-events: none; }
.ctl-title { font-family: var(--display); letter-spacing: 1px; font-size: 15px; margin-bottom: 10px; color: var(--accent2); }
.ctl-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ctl-opt {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 10px 9px; cursor: pointer; font: inherit; color: var(--text);
  background: rgba(255,255,255,.06); border: 2px solid var(--line); border-radius: 14px; transition: border-color .15s, background .15s, transform .1s;
}
.ctl-opt:hover { border-color: rgba(255,255,255,.5); transform: translateY(-2px); }
.ctl-opt.sel { border-color: var(--accent); background: rgba(255,84,112,.16); box-shadow: 0 0 0 2px rgba(255,84,112,.3); }
.ctl-ico { font-size: 26px; line-height: 1; }
.ctl-opt b { font-size: 15px; }
.ctl-opt small { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.ctl-foot { margin-top: 8px; font-size: 11px; color: var(--muted); }
.ctl-foot kbd { background: rgba(255,255,255,.12); border-radius: 5px; padding: 1px 6px; font: 700 11px var(--font); }
.ctl-badge {
  position: absolute; right: 10px; bottom: 56px; pointer-events: auto; cursor: pointer; font: 800 12px var(--font); color: var(--text);
  background: rgba(14, 9, 40, .8); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; opacity: .8;
}
.ctl-badge:hover { opacity: 1; border-color: var(--accent); }
@media (max-width: 560px) { .ctl-opts { grid-template-columns: 1fr; } .ctl-pick { bottom: 70px; } }

/* ---------- login ---------- */
.login-panel { max-width: 520px; width: 100%; margin: 0 auto; text-align: center; display: flex; flex-direction: column; gap: 14px; }
.login-panel h2 { margin-bottom: 0; }
.login-text { margin: 0; color: var(--text); line-height: 1.5; }
.login-fine { margin: 0; font-size: 12px; }
.login-msg { background: rgba(255, 84, 112, .14); border: 1px solid rgba(255, 84, 112, .5); border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 14px; }
.btn.discord { background: linear-gradient(180deg, #6d7cff, #5865f2); border-color: #8c97ff; box-shadow: 0 6px 0 #3a45b8, 0 10px 28px rgba(88, 101, 242, .4); text-decoration: none; display: block; }
.btn.discord:hover { background: linear-gradient(180deg, #7d8bff, #5f6cf5); }
.dev-login { display: flex; flex-direction: column; gap: 8px; }

/* ---------- profile bar ---------- */
.profile { max-width: 540px; width: 100%; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.pf-avatar { width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.pf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pf-name { font-family: var(--display); font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-lv { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.pf-lv b { color: var(--accent2); white-space: nowrap; }
.pf-bar, .xp-bar { flex: 1; height: 10px; border-radius: 6px; background: rgba(255,255,255,.1); overflow: hidden; min-width: 60px; }
.pf-bar div, .xp-bar div { height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #06d6a0, #ffd166); transition: width 1s cubic-bezier(.2,.8,.2,1); }
.pf-stats { font-size: 12px; }
.lv { font-size: 11px; font-weight: 900; color: var(--accent2); background: rgba(255, 209, 102, .12); border-radius: 999px; padding: 2px 8px; letter-spacing: .5px; }

/* ---------- XP after a match ---------- */
.xp-box { margin: 0 0 18px; padding: 14px 16px; background: rgba(8, 5, 28, .5); border: 1px solid var(--line); border-radius: 14px; text-align: left; display: flex; flex-direction: column; gap: 10px; animation: rise .4s .2s both; }
.xp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.xp-gain { font-family: var(--display); font-size: 26px; color: var(--ok); }
.xp-up { font-family: var(--display); font-size: 16px; color: var(--accent2); animation: tdpulse .6s infinite alternate; }
.xp-bar { height: 14px; flex: none; }
.xp-parts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; font-weight: 700; }
.xp-unlocks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.xp-unl-title { width: 100%; font-weight: 900; font-size: 13px; color: var(--accent2); }
.xp-chip { background: rgba(255, 209, 102, .14); border: 1px solid rgba(255, 209, 102, .4); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 800; }

/* ---------- locked cosmetics ---------- */
.tab small { opacity: .7; font-weight: 700; margin-left: 2px; }
.tile.locked { opacity: .55; cursor: not-allowed; }
.tile.locked .tile-art { filter: grayscale(1) brightness(.55); }
.tile.locked:hover { transform: none; border-color: var(--line); }
.tile-lock { position: absolute; top: 6px; right: 6px; background: rgba(8, 5, 28, .88); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; font-size: 10px; font-weight: 900; color: var(--accent2); }
.tile { position: relative; }
.swatch { position: relative; display: grid; place-items: center; }
.swatch.locked { filter: grayscale(.85) brightness(.5); cursor: not-allowed; }
.swatch.locked:hover { transform: none; }
.swatch-lock { font-size: 14px; filter: none; }

.xp-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; border: 1px solid rgba(255,255,255,.6); }

/* ---------- chat dock ---------- */
.dock { position: fixed; right: 14px; bottom: 14px; z-index: 30; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.dock[hidden] { display: none; }
.dock-toggle { position: relative; width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--line); background: linear-gradient(180deg, #3a2f7a, #241c52); color: #fff; font-size: 26px; cursor: pointer; box-shadow: 0 10px 28px rgba(0,0,0,.45); transition: transform .12s, border-color .15s; }
.dock-toggle:hover { transform: scale(1.06); border-color: var(--accent); }
.dock-toggle.open { border-color: var(--accent); }
.dock-badge { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font: 900 12px var(--font); display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.dock-badge[hidden] { display: none; }
.dock-panel { width: min(380px, calc(100vw - 28px)); height: min(520px, calc(100vh - 110px)); background: rgba(18, 13, 46, .96); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.6); backdrop-filter: blur(14px); display: flex; flex-direction: column; overflow: hidden; animation: rise .2s both; }
.dock-panel[hidden] { display: none; }
.dock-tabs { display: flex; align-items: center; gap: 4px; padding: 8px 8px 0; border-bottom: 1px solid var(--line); }
.dock-tab { position: relative; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font: 800 13px var(--font); padding: 8px 12px; cursor: pointer; }
.dock-tab:hover { color: var(--text); }
.dock-tab.on { color: #fff; border-bottom-color: var(--accent); }
.dock-tb { position: absolute; top: 2px; right: 0; background: var(--accent); color: #fff; border-radius: 999px; font: 900 10px var(--font); padding: 1px 5px; }
.dock-x { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; padding: 6px 8px; }
.dock-x:hover { color: #fff; }
.dock-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-pane, .dm-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
.cm { max-width: 100%; }
.cm-head { display: flex; align-items: baseline; gap: 6px; }
.cm-name { background: none; border: 0; padding: 0; font: 800 13px var(--font); cursor: pointer; color: #cfc8ee; }
.cm-name:hover { text-decoration: underline; }
.cm-time { margin-left: auto; font-size: 10px; color: var(--muted); }
.cm-text { font-size: 14px; line-height: 1.4; word-break: break-word; overflow-wrap: anywhere; white-space: pre-wrap; }
.cm-text.big { font-size: 30px; line-height: 1.2; }
.cm.mine .cm-text { color: #fff0c2; }
.cm.sys { text-align: center; font-size: 12px; color: var(--muted); font-style: italic; }
.cm.sys.empty { padding: 24px 12px; font-style: normal; line-height: 1.5; }
.composer { position: relative; border-top: 1px solid var(--line); padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.quick { display: flex; gap: 4px; flex-wrap: wrap; }
.quick-b { background: rgba(255,255,255,.07); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; color: #fff; font: 800 13px var(--font); cursor: pointer; }
.quick-b:hover { border-color: var(--accent); background: rgba(255,84,112,.15); }
.cmp-row { display: flex; gap: 6px; align-items: center; }
.cmp-input { flex: 1; min-width: 0; background: rgba(8,5,28,.7); border: 2px solid var(--line); color: var(--text); border-radius: 10px; padding: 8px 10px; font: 600 14px var(--font); outline: none; }
.cmp-input:focus { border-color: var(--accent); }
.emo-btn, .cmp-send { background: rgba(255,255,255,.08); border: 1px solid var(--line); border-radius: 10px; width: 38px; height: 38px; color: #fff; font-size: 18px; cursor: pointer; flex: none; }
.cmp-send { background: var(--accent); border-color: var(--accent); font-size: 15px; }
.emo-btn:hover { border-color: var(--accent2); }
.emo-picker { position: absolute; left: 8px; right: 8px; bottom: 100%; margin-bottom: 4px; background: #1c1646; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.6); overflow: hidden; z-index: 5; }
.emo-picker[hidden] { display: none; }
.emo-cats { display: flex; border-bottom: 1px solid var(--line); }
.emo-cats button { flex: 1; background: none; border: 0; padding: 7px 0; font-size: 18px; cursor: pointer; opacity: .6; }
.emo-cats button.on { opacity: 1; background: rgba(255,255,255,.08); }
.emo-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 6px; max-height: 170px; overflow-y: auto; }
.emo { background: none; border: 0; font-size: 22px; padding: 3px 0; cursor: pointer; border-radius: 8px; }
.emo:hover { background: rgba(255,255,255,.12); transform: scale(1.15); }
.name-menu { position: fixed; z-index: 60; background: #1c1646; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.6); padding: 4px; display: flex; flex-direction: column; min-width: 190px; }
.name-menu button { background: none; border: 0; color: var(--text); text-align: left; font: 700 13px var(--font); padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.name-menu button:hover { background: rgba(255,255,255,.1); }

/* friends */
.friends-pane { flex: 1; overflow-y: auto; padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.fr-me { background: rgba(255,209,102,.08); border: 1px solid rgba(255,209,102,.3); border-radius: 12px; padding: 8px 12px; }
.fr-me-l { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.fr-me-r { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.fr-code { font-family: var(--display); font-size: 22px; letter-spacing: 3px; color: var(--accent2); }
.fr-add { display: flex; gap: 6px; margin: 4px 0 6px; }
.fr-sec { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); font-weight: 800; margin-top: 8px; }
.fr { display: flex; align-items: center; gap: 8px; background: rgba(8,5,28,.5); border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px; }
.fr-dot { width: 9px; height: 9px; border-radius: 50%; background: #5b5780; flex: none; }
.fr-dot.home { background: #06d6a0; } .fr-dot.lobby { background: #ffd166; } .fr-dot.playing { background: #ff5470; }
.fr-av { width: 34px; height: 34px; border-radius: 50%; background: #3a2f7a; display: grid; place-items: center; font-weight: 900; flex: none; overflow: hidden; }
.fr-av img { width: 100%; height: 100%; object-fit: cover; }
.fr-info { flex: 1; min-width: 0; }
.fr-name { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fr-sub { font-size: 11px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fr-sub.home { color: #06d6a0; } .fr-sub.lobby { color: #ffd166; } .fr-sub.playing { color: #ff8a9a; }
.fr-acts { display: flex; gap: 4px; flex: none; }
.fr-b { position: relative; background: rgba(255,255,255,.08); border: 1px solid var(--line); color: #fff; border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 13px; }
.fr-b:hover { border-color: rgba(255,255,255,.5); }
.fr-b.go { background: rgba(6,214,160,.2); border-color: rgba(6,214,160,.6); }
.fr-b.del:hover { border-color: #ff5470; color: #ff8a9a; }
.fr-unread { position: absolute; top: -6px; right: -6px; background: var(--accent); color: #fff; border-radius: 999px; font: 900 10px var(--font); padding: 1px 5px; }
.dm-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.dm-title { font-family: var(--display); font-size: 15px; }
.chat-pane.grow { flex: 1; }

/* in-game party chat */
.ig-chat { position: fixed; left: 14px; bottom: 120px; width: min(340px, 60vw); z-index: 12; pointer-events: none; display: flex; flex-direction: column; gap: 4px; }
.ig-list { display: flex; flex-direction: column; gap: 3px; }
.ig-line { background: rgba(8,5,24,.72); border-radius: 10px; padding: 4px 10px; font-size: 13px; line-height: 1.35; word-break: break-word; transition: opacity 1.4s; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.ig-line.sys { color: var(--muted); font-style: italic; font-size: 12px; }
.ig-line.fade { opacity: 0; }
.ig-input { pointer-events: auto; background: rgba(8,5,28,.9); border: 2px solid var(--accent); color: var(--text); border-radius: 10px; padding: 8px 10px; font: 600 14px var(--font); outline: none; }
.ig-input[hidden] { display: none; }

/* invite */
.invite { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 70; background: rgba(28, 22, 70, .97); border: 2px solid var(--accent2); border-radius: 16px; padding: 12px 16px; box-shadow: 0 16px 50px rgba(0,0,0,.6); text-align: center; animation: toastin .25s cubic-bezier(.2,.9,.3,1.3) both; }
.invite-t { font-family: var(--display); font-size: 16px; }
.invite-s { color: var(--muted); font-size: 12px; margin: 2px 0 8px; }
.invite-b { display: flex; gap: 8px; justify-content: center; }
@media (max-width: 560px) { .dock { right: 8px; bottom: 8px; } .dock-panel { height: min(70vh, 560px); } }

/* ---------- Trading Floor ---------- */
.tf { max-width: 1240px; margin: 0 auto; padding: 12px 14px 90px; display: flex; flex-direction: column; gap: 10px; }
.tf-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tf-title { font-family: var(--display); letter-spacing: 3px; font-size: 13px; color: var(--muted); margin-right: auto; }
.tf-chip { background: rgba(8,5,28,.7); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font: 800 13px var(--font); }
.tf-time { font-family: var(--display); font-size: 18px; min-width: 64px; text-align: center; color: var(--accent2); }
.tf-main { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(280px, 1fr); gap: 12px; align-items: start; }
@media (max-width: 920px) { .tf-main { grid-template-columns: 1fr; } }
.tf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.tf-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; backdrop-filter: blur(10px); }
.tf-ch { display: flex; align-items: baseline; gap: 8px; }
.tf-icon { font-size: 20px; }
.tf-name { font-weight: 800; font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-price { font-family: var(--display); font-size: 22px; transition: color .6s; }
.tf-price.flash-up { animation: fup .7s; } .tf-price.flash-dn { animation: fdn .7s; }
@keyframes fup { 0% { color: #06d6a0; transform: scale(1.12); } 100% { color: inherit; transform: none; } }
@keyframes fdn { 0% { color: #ff5470; transform: scale(1.12); } 100% { color: inherit; transform: none; } }
.tf-chg { font: 800 12px var(--font); min-width: 62px; text-align: right; }
.tf-chg.up { color: #06d6a0; } .tf-chg.dn { color: #ff5470; }
.tf-spark { width: 100%; height: 70px; border-radius: 10px; background: rgba(0,0,0,.25); display: block; }
.tf-own { font-size: 12px; color: var(--muted); font-weight: 700; }
.tf-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tf-buy, .tf-sell { border: 0; border-radius: 10px; padding: 9px 4px; font: 900 13px var(--font); color: #fff; cursor: pointer; transition: transform .08s, filter .15s; }
.tf-buy { background: linear-gradient(180deg, #14c98f, #0a9a6c); box-shadow: 0 3px 0 #06694a; }
.tf-sell { background: linear-gradient(180deg, #ff6b83, #e0364f); box-shadow: 0 3px 0 #9d1f33; }
.tf-buy:hover:not(:disabled), .tf-sell:hover:not(:disabled) { filter: brightness(1.1); }
.tf-buy:active:not(:disabled), .tf-sell:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.tf-buy:disabled, .tf-sell:disabled { opacity: .35; cursor: not-allowed; }
.tf-ctrl { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.tf-ctrl-l { color: var(--muted); font-weight: 800; font-size: 13px; margin-right: 4px; }
.tf-q { background: rgba(255,255,255,.07); border: 2px solid var(--line); color: #fff; border-radius: 10px; padding: 7px 14px; font: 900 13px var(--font); cursor: pointer; }
.tf-q.on { border-color: var(--accent2); background: rgba(255,209,102,.16); color: var(--accent2); }
.tf-status { margin-left: 8px; font: 800 13px var(--font); }
.tf-status.ok { color: #8dffc8; } .tf-status.bad { color: #ff8a9a; }
.tf-right { display: flex; flex-direction: column; gap: 10px; }
.tf-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; }
.tf-panel h3 { margin: 0 0 8px; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.tf-list { display: flex; flex-direction: column; gap: 6px; max-height: 230px; overflow-y: auto; }
.tf-empty { color: var(--muted); font-size: 12px; font-style: italic; padding: 6px 2px; }
.tf-tip { border-radius: 12px; padding: 8px 10px; border: 1px solid var(--line); background: rgba(8,5,28,.6); animation: rise .3s both; }
.tf-tip.up { border-color: rgba(6,214,160,.55); } .tf-tip.dn { border-color: rgba(255,84,112,.55); }
.tf-tip.old { opacity: .6; }
.tf-tip-h { display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; }
.tf-stars { color: var(--accent2); letter-spacing: 1px; }
.tf-tip-eta { color: var(--muted); }
.tf-tip-t { font-weight: 800; margin: 3px 0 6px; font-size: 14px; }
.tf-tip-b { display: flex; gap: 6px; flex-wrap: wrap; }
.tf-share { background: rgba(255,255,255,.08); border: 1px solid var(--line); color: #fff; border-radius: 8px; padding: 4px 9px; font: 800 11px var(--font); cursor: pointer; }
.tf-share:hover { border-color: rgba(255,255,255,.5); } .tf-share.lie:hover { border-color: #ff5470; }
.tf-news { font-size: 13px; padding: 5px 9px; border-radius: 9px; background: rgba(8,5,28,.55); border-left: 4px solid #6d63a8; animation: rise .3s both; }
.tf-news.news.up { border-left-color: #06d6a0; font-weight: 800; background: rgba(6,214,160,.1); }
.tf-news.news.dn { border-left-color: #ff5470; font-weight: 800; background: rgba(255,84,112,.1); }
.tf-news.rumor { color: #d6d0f2; }
.tf-spread { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.tf-spread select { flex: 1 1 100%; background: rgba(8,5,28,.7); color: var(--text); border: 2px solid var(--line); border-radius: 9px; padding: 6px 8px; font: 700 13px var(--font); }
.tf-sp { flex: 1; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: #fff; border-radius: 9px; padding: 6px; font: 800 12px var(--font); cursor: pointer; }
.tf-sp.up:hover { border-color: #06d6a0; } .tf-sp.dn:hover { border-color: #ff5470; }
.tf-sp-info { flex: 1 1 100%; font-size: 11px; color: var(--muted); }
.tf-lb { display: flex; flex-direction: column; gap: 5px; }
.tf-lbr { display: grid; grid-template-columns: 18px 28px minmax(0, 1fr) 70px 70px; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 2px 4px; border-radius: 8px; }
.tf-lbr.me { background: rgba(255,209,102,.12); }
.tf-lbp { color: var(--muted); } .tf-lbav { display: grid; place-items: center; width: 28px; height: 28px; }
.tf-lbn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-lbbar { height: 7px; background: rgba(255,255,255,.1); border-radius: 4px; overflow: hidden; }
.tf-lbbar i { display: block; height: 100%; background: linear-gradient(90deg, #06d6a0, #ffd166); border-radius: 4px; transition: width .6s; }
.tf-lbw { text-align: right; color: var(--accent2); }
.tf-intro { position: fixed; inset: 0; z-index: 20; background: rgba(5,3,18,.8); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 16px; }
.tf-intro[hidden] { display: none; }
.tf-intro-card { max-width: 520px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; display: flex; flex-direction: column; gap: 4px; animation: rise .4s both; }
.tf-intro-card h2 { margin: 0 0 6px; font-family: var(--display); font-size: 22px; text-transform: none; letter-spacing: 0; color: var(--accent2); }
.tf-intro-card p { margin: 6px 0; line-height: 1.5; }

/* ---------- Warlords of WiFi ---------- */
.wl { position: absolute; inset: 0; pointer-events: none; }
.wl > * { pointer-events: auto; }
.wl-side { position: absolute; top: 12px; right: 12px; width: 280px; max-height: calc(100% - 150px); overflow-y: auto; background: rgba(10, 14, 36, .88); border: 1px solid rgba(110,150,255,.3); border-radius: 16px; padding: 10px 12px; backdrop-filter: blur(10px); display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 939px) { .wl-side { top: 60px; width: 230px; max-height: 40%; } }
.wl-h { font: 900 12px var(--font); letter-spacing: 1.5px; text-transform: uppercase; color: #9fc2ff; }
.wl-rows { display: flex; flex-direction: column; gap: 6px; }
.wl-row { display: grid; grid-template-columns: 34px minmax(0,1fr); grid-template-rows: auto auto; gap: 2px 8px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 6px 8px; }
.wl-row.me { border-color: rgba(255,209,102,.6); }
.wl-row.sel { border-color: #ff5470; box-shadow: 0 0 0 2px rgba(255,84,112,.3); }
.wl-row.dead { opacity: .45; }
.wl-av { grid-row: 1 / 3; display: grid; place-items: center; }
.wl-nm { font-weight: 900; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-hpbar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; margin: 3px 0 2px; }
.wl-hpbar i { display: block; height: 100%; transition: width .3s; }
.wl-st { font-size: 11px; color: #c0c8ee; font-weight: 700; }
.wl-st.ally { color: #ffd166; } .wl-st.dead { color: #888; }
.wl-acts { grid-column: 1 / 3; display: flex; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
.wl-act { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.2); color: #fff; border-radius: 8px; padding: 4px 8px; font: 800 12px var(--font); cursor: pointer; }
.wl-act.wide { flex: 1; }
.wl-act:hover:not(:disabled) { border-color: #fff; background: rgba(255,255,255,.16); }
.wl-act:disabled { opacity: .45; cursor: default; }
.wl-act.go { background: rgba(6,214,160,.25); border-color: rgba(6,214,160,.7); }
.wl-act.danger { background: rgba(255,84,112,.35); border-color: #ff5470; }
.wl-act[hidden] { display: none; }
.wl-offers { display: flex; flex-direction: column; gap: 6px; }
.wl-offer { background: rgba(255,209,102,.12); border: 1px solid rgba(255,209,102,.6); border-radius: 12px; padding: 8px 10px; font-weight: 800; font-size: 13px; animation: rise .25s both; }
.wl-orow { display: flex; gap: 6px; margin-top: 6px; }
.wl-log { display: flex; flex-direction: column; gap: 3px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 6px; }
.wl-lg { font-size: 12px; border-left: 3px solid #889; padding: 2px 8px; background: rgba(255,255,255,.04); border-radius: 0 8px 8px 0; line-height: 1.35; }
.wl-bar { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
@media (min-width: 940px) { .wl-bar { right: 306px; } }
.wl-grp { background: rgba(10,14,36,.88); border: 1px solid rgba(110,150,255,.3); border-radius: 14px; padding: 8px 12px 10px; backdrop-filter: blur(10px); display: flex; flex-direction: column; gap: 6px; }
.wl-gl { font: 900 11px var(--font); letter-spacing: 1.2px; text-transform: uppercase; color: #9fc2ff; }
.wl-target { font: 800 13px var(--font); }
.wl-brow { display: flex; gap: 6px; }
.wl-btn { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 78px; padding: 6px 8px; background: rgba(255,255,255,.07); border: 2px solid rgba(255,255,255,.18); border-radius: 12px; color: #fff; cursor: pointer; font: inherit; }
.wl-btn b { font-size: 12px; } .wl-btn small { color: #8ee3ff; font-weight: 800; } .wl-ic { font-size: 18px; }
.wl-btn:hover:not(:disabled) { border-color: #fff; }
.wl-btn:disabled { opacity: .4; cursor: not-allowed; }
.wl-btn.tower.on { border-color: #ffd166; background: rgba(255,209,102,.15); }
.wl-btn.poor small { color: #ff8a9a; }
.wl-q { background: rgba(255,255,255,.07); border: 2px solid rgba(255,255,255,.18); color: #fff; border-radius: 9px; padding: 3px 12px; font: 900 12px var(--font); cursor: pointer; }
.wl-q.on { border-color: #ffd166; color: #ffd166; }
.wl-hint { max-width: 300px; font-size: 11px; color: #9fa8d8; line-height: 1.35; }
.wl-pop { position: absolute; width: 220px; background: rgba(12,16,40,.96); border: 1px solid rgba(255,255,255,.35); border-radius: 12px; padding: 10px 12px; box-shadow: 0 14px 40px rgba(0,0,0,.6); }
.wl-pop[hidden] { display: none; }
.wl-pop-t { font-weight: 900; } .wl-pop-s { font-size: 12px; color: #aab; margin-top: 2px; }
.wl-intro { position: absolute; left: 50%; top: 66px; transform: translateX(-50%); max-width: 560px; width: calc(100% - 340px); min-width: 300px; background: rgba(10,14,36,.92); border: 1px solid rgba(255,209,102,.6); border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.4; text-align: center; }
.wl-intro[hidden] { display: none; }

/* ---------- top bar, connection ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 25; height: 46px; padding: 0 14px;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, rgba(11, 8, 32, .92), rgba(11, 8, 32, .6)); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar[hidden] { display: none; }
.tb-logo { font-family: var(--display); font-size: 17px; letter-spacing: 3px; }
.tb-logo span { color: var(--accent); }
.screen { padding-top: 66px; }
.conn-banner {
  position: fixed; top: 52px; left: 50%; transform: translateX(-50%); z-index: 60; background: rgba(60, 40, 8, .96); border: 2px solid var(--accent2);
  color: #fff; padding: 9px 18px; border-radius: 999px; font-weight: 800; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.conn-banner[hidden] { display: none; }
.connect-box { margin: 18vh auto 0; text-align: center; color: var(--muted); font-weight: 700; }
.spin { width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 50%; border: 5px solid rgba(255,255,255,.12); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- lobby action bar (ready / start) ---------- */
.action-bar {
  position: sticky; top: 54px; z-index: 12; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 18px;
  border-color: rgba(255, 209, 102, .45); background: linear-gradient(90deg, rgba(48, 36, 100, .94), rgba(30, 24, 70, .94));
}
.ab-info { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 3px; }
.ab-title { font-family: var(--display); font-size: 15px; letter-spacing: 1.4px; }
.action-bar .btn.big { min-width: 190px; }
.btn.ready { background: linear-gradient(180deg, #19e3b0, #06b88a); border-color: #8bf5d9; color: #04211a; box-shadow: 0 6px 0 #04745a, 0 10px 22px rgba(6, 214, 160, .3); }
.btn.ready:hover:not(:disabled) { filter: brightness(1.07); }
.btn.ready:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 #04745a; }
.btn.ready.on { background: rgba(6, 214, 160, .16); color: var(--ok); border-color: var(--ok); box-shadow: none; }
.btn.primary.force { background: linear-gradient(180deg, #ffd166, #f0a830); border-color: #ffe9b0; color: #2a1a00; box-shadow: 0 6px 0 #9c6a10, 0 10px 22px rgba(255, 190, 80, .3); }
.players .rdy { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .5px; }
.players .rdy.ok { color: var(--ok); }
.players .away { font-size: 11px; font-weight: 800; color: var(--accent2); }
.players li:has(.away) { opacity: .6; }

.card-help {
  position: absolute; right: 10px; bottom: 10px; z-index: 3; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.12); border: 1px solid var(--line); color: var(--text); font-weight: 900; font-size: 13px; cursor: pointer; transition: background .15s, transform .12s;
}
.card-help:hover { background: var(--accent); transform: scale(1.12); }
.card .meta { padding-right: 32px; }

/* ---------- custom rules ---------- */
.rules-box { margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(8,5,28,.35); padding: 0 16px 4px; }
.rules-box > summary { cursor: pointer; padding: 13px 0; font-weight: 800; display: flex; align-items: center; gap: 10px; list-style: none; }
.rules-box > summary::-webkit-details-marker { display: none; }
.rules-box > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.rules-box[open] > summary::after { transform: rotate(180deg); }
.rules-box[open] > summary { border-bottom: 1px dashed var(--line); margin-bottom: 8px; }
.rules-badge { font-size: 11px; font-weight: 900; letter-spacing: .5px; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--muted); }
.rules-badge.mod { background: rgba(255, 209, 102, .18); color: var(--accent2); }
.rule-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.rule-row:last-of-type { border-bottom: 0; }
.rule-lab { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 190px; }
.rule-lab b { font-size: 14px; }
.rule-lab span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(8,5,28,.55); }
.seg-btn { background: transparent; color: var(--muted); border: 0; border-right: 1px solid var(--line); padding: 8px 13px; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; transition: background .15s, color .15s; }
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover:not(:disabled):not(.on) { background: rgba(255,255,255,.08); color: var(--text); }
.seg-btn.on { background: var(--accent); color: #fff; }
.seg-btn:disabled { cursor: default; }
.seg-btn:disabled:not(.on) { opacity: .7; }
.rules-box .btn { margin: 8px 0 12px; }

/* ---------- wiki ---------- */
.wiki-card { width: min(1020px, 100%); height: min(780px, 94vh); max-height: none; display: flex; flex-direction: column; overflow: hidden; }
.wiki-card .modal-head { gap: 12px; }
.wiki-search { flex: 1; max-width: 320px; margin-left: auto; padding: 9px 14px; font-size: 14px; }
.wiki-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 220px 1fr; gap: 18px; }
.wiki-nav { overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding-right: 6px; border-right: 1px solid var(--line); }
.wiki-page { overflow-y: auto; padding: 4px 8px 24px 2px; }
.wk-group { margin: 12px 0 4px; font-size: 11px; font-weight: 900; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.wk-group:first-child { margin-top: 0; }
.wk-item { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.wk-item:hover { background: rgba(255,255,255,.07); }
.wk-item.on { background: rgba(255, 84, 112, .16); border-color: rgba(255, 84, 112, .5); }
.wk-ic { width: 22px; text-align: center; flex: none; }
.wk-empty { color: var(--muted); padding: 10px; }
.wk-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.wk-head h1 { margin: 0; font-family: var(--display); font-size: clamp(22px, 4vw, 32px); letter-spacing: 1.5px; }
.wk-big { font-size: 40px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); }
.wk-meta { display: flex; gap: 8px; margin: 4px 0 10px; flex-wrap: wrap; }
.wk-pill { background: rgba(255,255,255,.08); border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: 12px; }
.wk-pill.live { background: rgba(6, 214, 160, .16); color: var(--ok); }
.wk-pill.soon { background: rgba(255, 209, 102, .16); color: var(--accent2); }
.wk-intro { font-size: 16px; line-height: 1.55; color: #e6e0ff; margin: 6px 0 18px; }
.wk-sec { margin: 0 0 18px; }
.wk-sec h2 { margin: 0 0 8px; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent2); }
.wk-sec p { margin: 0 0 8px; line-height: 1.55; }
.wk-sec ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }
.wk-sec li::marker { color: var(--accent); }
.wk-kv { display: grid; grid-template-columns: minmax(130px, 220px) 1fr; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.wk-k, .wk-v { padding: 8px 12px; line-height: 1.45; border-bottom: 1px solid rgba(255,255,255,.06); }
.wk-k { font-weight: 800; background: rgba(255,255,255,.04); }
.wk-kv > :nth-last-child(-n+2) { border-bottom: 0; }
.wk-tip { margin-top: 12px; padding: 12px 16px; border-radius: 12px; border: 1px dashed rgba(255, 209, 102, .5); background: rgba(255, 209, 102, .07); }
.wk-tip b { display: block; margin-bottom: 6px; color: var(--accent2); }
.wk-see { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; color: var(--muted); font-size: 13px; }
.wk-link { background: rgba(255,255,255,.07); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.wk-link:hover { border-color: var(--accent); }
.wiki-page mark { background: rgba(255, 209, 102, .35); color: inherit; border-radius: 3px; padding: 0 2px; }
@media (max-width: 720px) {
  .wiki-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 10px; }
  .wiki-nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 8px; }
  .wiki-nav .wk-group { display: none; }
  .wk-item { white-space: nowrap; width: auto; flex: none; }
  .wk-kv { grid-template-columns: 1fr; }
  .wk-k { border-bottom: 0; padding-bottom: 0; background: transparent; }
}
.wk-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.wiki-card { background: rgba(20, 15, 54, .985); }

/* ---------- long names slide, friend status colours ---------- */
[data-mq] { overflow: hidden; white-space: nowrap; min-width: 0; }
.mq { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mq.run { animation: mq var(--t, 6s) ease-in-out infinite alternate; }
@keyframes mq { 0%, 18% { transform: translateX(0); } 82%, 100% { transform: translateX(var(--d, 0)); } }
[data-mq]:hover .mq.run { animation-play-state: paused; }
.fr-name { display: block; }
.players .nm { min-width: 0; text-overflow: clip; }
.fr-dot.home { background: #8ab4ff; } .fr-sub.home { color: #8ab4ff; }
.fr-dot.lobby { background: #06d6a0; box-shadow: 0 0 8px #06d6a0; } .fr-sub.lobby { color: #06d6a0; font-weight: 800; }
.fr-dot.playing { background: #ff5470; } .fr-sub.playing { color: #ff8a9a; }
.fr.joinable { background: rgba(6, 214, 160, .08); box-shadow: inset 0 0 0 1px rgba(6, 214, 160, .45); }
.fr-b.go { animation: gopulse 2.2s ease-in-out infinite; }
@keyframes gopulse { 50% { box-shadow: 0 0 0 4px rgba(6, 214, 160, .22); } }
@media (prefers-reduced-motion: reduce) { .mq.run, .fr-b.go { animation: none; } }

.wk-note { margin: -8px 0 16px; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.05); color: var(--muted); font-size: 13px; line-height: 1.45; }

/* ---------- profile ---------- */
.tb-right { display: flex; align-items: center; gap: 8px; }
.tb-profile { display: inline-flex; align-items: center; gap: 8px; max-width: 200px; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px 3px 4px; color: var(--text); font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; }
.tb-profile[hidden] { display: none; }
.tb-profile:hover { border-color: var(--accent); }
.tb-av { width: 28px; height: 28px; border-radius: 50%; background: #3a2f7a; display: grid; place-items: center; overflow: hidden; flex: none; font-size: 13px; }
.tb-av img { width: 100%; height: 100%; object-fit: cover; }
.tb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-card { width: min(880px, 100%); height: min(840px, 94vh); max-height: none; overflow-y: auto; background: rgba(20, 15, 54, .985); transition: box-shadow .15s; }
.profile-card.drop { box-shadow: 0 0 0 4px var(--accent2), 0 18px 50px rgba(0,0,0,.35); }
.prof-body { display: flex; flex-direction: column; gap: 22px; padding-bottom: 8px; }
.prof-head { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.prof-av { border-radius: 50%; background: linear-gradient(160deg, #4b3d99, #2b2260); display: grid; place-items: center; overflow: hidden; flex: none; font-weight: 900; border: 3px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.prof-av.big { border-color: var(--accent2); }
.prof-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prof-info { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.prof-name { font-family: var(--display); font-size: clamp(22px, 4vw, 30px); letter-spacing: 1px; overflow-wrap: anywhere; }
.prof-lv { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prof-lv .pf-bar { flex: 1; min-width: 120px; }
.prof-hint { margin: 0; }
.prof-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.prof-sec h3 { margin: 0 0 10px; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent2); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { background: rgba(8, 5, 28, .5); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-ic { font-size: 22px; line-height: 1; }
.stat-l { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); font-weight: 800; margin-top: 4px; }
.stat-v { font-family: var(--display); font-size: 21px; overflow-wrap: anywhere; }
.stat-s { font-size: 12px; color: var(--muted); }
.pg-list { display: flex; flex-direction: column; gap: 8px; }
.pg-row { display: grid; grid-template-columns: 30px minmax(110px, 170px) minmax(60px, 1fr) auto auto auto auto; align-items: center; gap: 12px; background: rgba(8, 5, 28, .45); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.pg-ic { font-size: 22px; text-align: center; }
.pg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.pg-bar > div { height: 100%; border-radius: 99px; background: var(--accent); }
.pg-n { font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; }
@media (max-width: 720px) {
  .pg-row { grid-template-columns: 28px 1fr; }
  .pg-bar { grid-column: 1 / -1; }
  .pg-n { grid-column: 1 / -1; }
}
.prof-danger { border: 1px solid rgba(255, 84, 112, .4); border-radius: 14px; background: rgba(255, 84, 112, .05); padding: 0 16px; }
.prof-danger > summary { cursor: pointer; padding: 13px 0; font-weight: 800; color: #ff9aa9; }
.prof-danger[open] > summary { border-bottom: 1px dashed rgba(255, 84, 112, .35); margin-bottom: 8px; }
.dz { padding: 10px 0 14px; display: flex; flex-direction: column; gap: 4px; }
.dz + .dz { border-top: 1px solid rgba(255,255,255,.06); }
.dz p { margin: 0 0 6px; font-size: 13px; line-height: 1.5; }
.dz-row { display: flex; gap: 8px; flex-wrap: wrap; }
.dz-row input { flex: 1; min-width: 200px; padding: 9px 12px; font-size: 14px; }
.btn.danger:not(:disabled) { border-color: #ff3b3b; color: #ff9a9a; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 720px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .prof-head { gap: 14px; } }

/* ---------- Counterfeit ---------- */
.cf { --cwb: clamp(44px, calc((100vw - 44px) / 8), 82px); max-width: 1180px; margin: 0 auto; padding: 8px 12px 0; min-height: 100%; display: flex; flex-direction: column; gap: 8px; }
.cf button { font-family: inherit; -webkit-tap-highlight-color: transparent; }
.cf-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cf-title { font-family: var(--display); letter-spacing: 3px; font-size: 13px; color: var(--muted); }
.cf-round { font-weight: 800; font-size: 13px; color: var(--accent2); min-width: 90px; }
.cf-mute { background: none; border: 0; color: var(--text); font-size: 18px; cursor: pointer; min-width: 90px; text-align: right; }
.cf-pbar { height: 8px; border-radius: 6px; background: rgba(255,255,255,.1); overflow: hidden; }
.cf-pbar-f { height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #06d6a0, #ffd166); transition: width .1s linear; }
.cf-pbar-f.low { background: linear-gradient(90deg, #ff5470, #ffb347); animation: tdpulse .5s infinite alternate; }

/* scoreboard */
.cf-board { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 6px; padding-top: 6px; }
.cf-chip { position: relative; flex: 1 1 150px; max-width: 232px; min-width: 0; display: flex; align-items: center; gap: 7px; padding: 5px 9px 5px 6px; background: rgba(8,5,28,.62); border: 2px solid var(--line); border-radius: 14px; transition: opacity .25s, border-color .2s, box-shadow .2s, background .2s; }
.cf-chip.me { background: rgba(255,209,102,.08); }
.cf-chip.turn { border-color: var(--accent2); background: rgba(255,209,102,.13); box-shadow: 0 0 0 2px rgba(255,209,102,.3), 0 0 24px rgba(255,209,102,.4); animation: cfglow 1.2s ease-in-out infinite alternate; }
.cf-chip.last { border-style: dashed; border-color: #4cc9f0; }
.cf-chip.out, .cf-chip.empty { opacity: .45; filter: saturate(.55); }
.cf-chip.low .cf-cn b { color: #ff8a9a; }
@keyframes cfglow { to { box-shadow: 0 0 0 3px rgba(255,209,102,.45), 0 0 34px rgba(255,209,102,.6); } }
.cf-ring { --p: 0; position: relative; width: 38px; height: 38px; flex: none; display: grid; place-items: center; }
.cf-ring::before { content: ""; position: absolute; inset: 0; border-radius: 50%; opacity: 0; background: conic-gradient(var(--accent2) calc(var(--p) * 1%), rgba(255,255,255,.14) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); }
.cf-chip.turn .cf-ring::before { opacity: 1; }
.cf-av { display: grid; place-items: center; width: 32px; height: 32px; }
.cf-ci { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cf-nm { font-weight: 800; font-size: 13px; }
.cf-st { display: flex; align-items: center; flex-wrap: wrap; gap: 0 8px; font: 800 12px var(--font); }
.cf-cn { display: inline-flex; align-items: center; }
.cf-cn b { font-family: var(--display); font-size: 13px; display: inline-block; }
.cf-cn b.pop { animation: starpop .35s; }
.cf-stack { display: inline-block; width: 9px; height: 12px; margin-right: 6px; border-radius: 2px; background: #3a2f7a; border: 1px solid #c3b8ff; box-shadow: 2px -2px 0 -1px #6a5cc0, 4px -4px 0 -1px #8c7ee0; }
.cf-pen { color: #ff8a9a; }
.cf-win { color: var(--accent2); }
.cf-pen.zero, .cf-win.zero { color: var(--muted); opacity: .7; }
.cf-tag { position: absolute; top: -8px; right: 8px; padding: 1px 8px; border-radius: 999px; font: 900 10px var(--font); letter-spacing: .5px; white-space: nowrap; background: #3a2f7a; color: #fff; }
.cf-tag.t-turn { background: var(--accent2); color: #2a1a00; }
.cf-tag.t-last { background: #4cc9f0; color: #04202c; }
.cf-tag.t-call { background: var(--accent); }
.cf-tag.t-out { background: #55507a; color: #cfc8ee; }

/* table */
.cf-mid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 8px; align-items: stretch; }
.cf-table { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; border-radius: 22px; background: radial-gradient(ellipse at 50% 30%, #21705f 0%, #144842 55%, #0b2a2c 100%); border: 2px solid rgba(255,209,102,.3); box-shadow: inset 0 0 70px rgba(0,0,0,.5), 0 14px 40px rgba(0,0,0,.4); }
.cf-table::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.5px); background-size: 12px 12px; }
.cf-banner, .cf-stage { position: relative; }
.cf-table.shake { animation: cfshake .5s; }
@keyframes cfshake { 20% { transform: translateX(-7px) rotate(-.4deg); } 40% { transform: translateX(7px) rotate(.4deg); } 60% { transform: translateX(-5px); } 80% { transform: translateX(4px); } }
.cf-banner { min-height: 58px; display: grid; place-items: center; text-align: center; }
.cf-phase { font: 900 clamp(16px, 3.8vw, 24px)/1.2 var(--display); letter-spacing: .5px; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.cf-phase.mine { color: var(--accent2); text-shadow: 0 0 18px rgba(255,209,102,.7); }
.cf-phase.call { color: #ff9aa9; animation: tdpulse .6s infinite alternate; }
.cf-phase.calm { color: #a8f0d8; font-size: clamp(14px, 3.2vw, 19px); }
.cf-phase-s { color: var(--accent2); margin-left: 6px; white-space: nowrap; }
.cf-verdict { width: 100%; max-width: 720px; padding: 6px 14px 8px; border-radius: 14px; animation: cfverdict .5s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes cfverdict { from { transform: scale(.6); opacity: 0; } }
.cf-verdict.ok { background: rgba(6,214,160,.2); border: 2px solid var(--ok); box-shadow: 0 0 28px rgba(6,214,160,.35); }
.cf-verdict.bad { background: rgba(255,84,112,.22); border: 2px solid var(--accent); box-shadow: 0 0 28px rgba(255,84,112,.4); }
.cf-verdict.me-lose { animation: cfverdict .5s cubic-bezier(.2,1.5,.4,1) both, cfshake .5s .15s; }
.cf-verdict.me-win { box-shadow: 0 0 40px rgba(255,209,102,.55); }
.cf-vt { font: 900 clamp(24px, 5.5vw, 38px)/1.05 var(--display); letter-spacing: 2px; }
.cf-verdict.ok .cf-vt { color: #8dffc8; }
.cf-verdict.bad .cf-vt { color: #ff9aa9; }
.cf-vs { font-weight: 800; font-size: clamp(13px, 2.8vw, 17px); }

.cf-stage { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 2.1fr) minmax(130px, 1fr); gap: 10px; align-items: center; min-height: 168px; }
.cf-pilebox { display: flex; flex-direction: column; align-items: center; gap: 6px; --cw: clamp(44px, 12vw, 70px); }
.cf-pile { position: relative; width: calc(var(--cw) * 1.5); height: calc(var(--cw) * 1.42 + 34px); transition: opacity .5s, transform .5s; }
.cf-pile.taken { opacity: .35; transform: translateY(14px) scale(.94); }
.cf-pc { position: absolute; left: 50%; bottom: calc(var(--i) * 2.4px); margin-left: calc(var(--cw) / -2); transform: rotate(var(--r)); }
.cf-pc.drop { animation: cfdrop .35s cubic-bezier(.2,.9,.3,1) both; }
@keyframes cfdrop { from { transform: translateY(-70px) rotate(calc(var(--r) * 3)) scale(1.25); opacity: 0; } }
.cf-pile-empty { position: absolute; left: 50%; bottom: 0; margin-left: calc(var(--cw) / -2); width: var(--cw); height: calc(var(--cw) * 1.42); display: grid; place-items: center; border: 2px dashed rgba(255,255,255,.3); border-radius: 8px; color: rgba(255,255,255,.5); font-weight: 800; font-size: 12px; }
.cf-pile-n { font: 900 15px var(--display); color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,.6); }
.cf-claimbox { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 120px; min-width: 0; }
.cf-bubble { position: relative; display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 14px; border-radius: 18px; background: rgba(255,255,255,.95); color: #1a1030; font-weight: 800; font-size: clamp(14px, 3.2vw, 19px); box-shadow: 0 8px 22px rgba(0,0,0,.4); }
.cf-bubble::after { content: ""; position: absolute; left: -8px; top: 50%; margin-top: -8px; border: 8px solid transparent; border-left: 0; border-right-color: rgba(255,255,255,.95); }
.cf-bubble.mine { background: #fff3c9; }
.cf-bubble.mine::after { border-right-color: #fff3c9; }
.cf-bubble.pop { animation: cfpop .4s cubic-bezier(.2,1.5,.4,1); }
.cf-bubble.idle { background: rgba(8,5,28,.55); color: #cfeee5; box-shadow: none; font-weight: 700; font-size: 13px; text-align: center; }
.cf-bubble.idle::after { display: none; }
.cf-bn { font: 900 1.35em var(--display); color: #d11f43; }
.cf-b-av { display: grid; place-items: center; width: 28px; height: 28px; flex: none; }
@keyframes cfpop { 0% { transform: scale(.5); opacity: 0; } 100% { transform: none; opacity: 1; } }
.cf-valbox { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.cf-val-l { font: 900 11px var(--font); letter-spacing: 1.5px; text-transform: uppercase; color: #cfeee5; opacity: .85; }
.cf-val { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.cf-val.pop .cf-note { animation: cfpop .5s cubic-bezier(.2,1.5,.4,1); }
.cf-val-s { font-size: 11.5px; font-weight: 700; color: #cfeee5; opacity: .85; }
.cf-rv { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; --cw: clamp(46px, 11.5vw, 74px); }
.cf-flip { width: var(--cw); height: calc(var(--cw) * 1.42); perspective: 700px; }
.cf-flip-i { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3,1.35,.5,1); }
.cf-flip.flipped .cf-flip-i { transform: rotateY(180deg); }
.cf-flip-i > .cf-card { position: absolute; left: 0; top: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cf-flip-i > .cf-ff { transform: rotateY(180deg); }
.cf-flip.flipped .cf-ff.ok { box-shadow: 0 0 0 .04em #06d6a0, 0 0 .3em rgba(6,214,160,.8); }
.cf-flip.flipped .cf-ff.bad { box-shadow: 0 0 0 .05em #ff5470, 0 0 .4em rgba(255,84,112,.9); }
.cf-ff::after { position: absolute; right: .06em; top: .04em; font-size: .2em; font-weight: 900; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.cf-ff.ok::after { content: "✓"; color: #c7ffe6; }
.cf-ff.bad::after { content: "✗"; color: #fff; }
.cf-flash { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 0 12px; pointer-events: none; opacity: 0; text-align: center; color: #fff; font: 900 clamp(26px, 7vw, 54px)/1.1 var(--display); letter-spacing: 2px; text-shadow: 0 0 24px #ff3d63, 0 4px 0 #7d1228; background: radial-gradient(ellipse at center, rgba(255,61,99,.55), rgba(255,61,99,0) 70%); }
.cf-flash.on { animation: cfflash 1.7s both; }
@keyframes cfflash { 0% { opacity: 0; transform: scale(.4); } 12% { opacity: 1; transform: scale(1.12); } 22% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1.05); } }

/* banknotes (cards and the landscape value note) */
.cf-card.v0, .cf-note.v0 { --c1: #3ddc84; --c2: #17804f; }
.cf-card.v1, .cf-note.v1 { --c1: #52a9ff; --c2: #2155c4; }
.cf-card.v2, .cf-note.v2 { --c1: #ffae42; --c2: #d4581a; }
.cf-card.v3, .cf-note.v3 { --c1: #bb86ff; --c2: #6a35c2; }
.cf-card.v4, .cf-note.v4 { --c1: #ffe27a; --c2: #d9a012; --ink: #3a2800; }
.cf-card.v5, .cf-note.v5 { --c1: #ff6279; --c2: #b01530; }
.cf-card { --c1: #888; --c2: #555; --ink: #fff; position: relative; flex: none; width: var(--cw, 56px); height: calc(var(--cw, 56px) * 1.42); font-size: var(--cw, 56px); border-radius: .11em; color: var(--ink); background: linear-gradient(155deg, var(--c1), var(--c2)); border: 1px solid rgba(255,255,255,.55); box-shadow: 0 .04em .1em rgba(0,0,0,.45), inset 0 0 0 .03em rgba(255,255,255,.18); overflow: hidden; user-select: none; -webkit-user-select: none; }
.cf-card::before { content: ""; position: absolute; inset: .05em; border-radius: .07em; border: .02em solid rgba(255,255,255,.4); background: repeating-radial-gradient(circle at 0% 100%, transparent 0 .05em, rgba(255,255,255,.17) .05em .06em), repeating-radial-gradient(circle at 100% 0%, transparent 0 .05em, rgba(255,255,255,.14) .05em .06em); }
.cf-cv { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: .04em .08em; border-radius: 999px; background: rgba(0,0,0,.22); font: 900 .33em/1 var(--display); letter-spacing: -.02em; text-shadow: 0 .015em 0 rgba(0,0,0,.35); }
.cf-tl, .cf-br { position: absolute; font-weight: 900; font-size: max(.14em, 8px); line-height: 1; text-shadow: 0 1px 0 rgba(0,0,0,.35); }
.cf-tl { top: .08em; left: .08em; }
.cf-br { bottom: .08em; right: .08em; }
.cf-card.jk { color: #1a0f2e; background: linear-gradient(115deg, #ff5470, #ffd166, #06d6a0, #4cc9f0, #b388ff, #ff5470); background-size: 300% 100%; animation: cfholo 5s linear infinite; }
.cf-card.jk::before { border-color: rgba(255,255,255,.7); background: repeating-linear-gradient(120deg, rgba(255,255,255,.35) 0 .03em, transparent .03em .09em); }
.cf-card.jk .cf-cv { top: 42%; font-size: .46em; background: rgba(255,255,255,.35); text-shadow: none; }
.cf-cl { position: absolute; left: 0; right: 0; bottom: .1em; text-align: center; font-weight: 900; font-size: max(.125em, 8px); letter-spacing: .04em; text-transform: uppercase; color: #2a1448; }
@keyframes cfholo { to { background-position: 300% 0; } }
.cf-card.back { background: repeating-linear-gradient(45deg, #1d1650 0 .06em, #2a2070 .06em .12em); border-color: rgba(190,170,255,.55); }
.cf-card.back::before { border-color: rgba(255,209,102,.5); background: repeating-linear-gradient(-45deg, rgba(255,255,255,.07) 0 .02em, transparent .02em .07em); }
.cf-bk { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: .5em; height: .5em; display: grid; place-items: center; border-radius: 50%; border: .025em solid rgba(255,209,102,.7); background: rgba(10,6,34,.7); color: var(--accent2); font: 900 .17em var(--display); }
.cf-note { --nw: 84px; --c1: #888; --c2: #555; --ink: #fff; position: relative; flex: none; width: 1em; height: .6em; font-size: var(--nw); border-radius: .06em; color: var(--ink); background: linear-gradient(155deg, var(--c1), var(--c2)); border: 1px solid rgba(255,255,255,.55); box-shadow: 0 .03em .08em rgba(0,0,0,.45), inset 0 0 0 .02em rgba(255,255,255,.18); overflow: hidden; user-select: none; -webkit-user-select: none; }
.cf-note::before { content: ""; position: absolute; inset: .03em; border-radius: .04em; border: .012em solid rgba(255,255,255,.4); background: repeating-radial-gradient(circle at 0% 100%, transparent 0 .03em, rgba(255,255,255,.17) .03em .036em), repeating-radial-gradient(circle at 100% 0%, transparent 0 .03em, rgba(255,255,255,.14) .03em .036em); }
.cf-nv { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: .03em .1em; border-radius: 999px; background: rgba(0,0,0,.22); font: 900 .27em/1 var(--display); letter-spacing: -.01em; text-shadow: 0 .01em 0 rgba(0,0,0,.35); }
.cf-n1, .cf-n2 { position: absolute; top: .06em; left: .07em; font: 900 .09em/1 var(--font); }
.cf-n2 { top: auto; left: auto; bottom: .06em; right: .07em; }
.cf-nt { position: absolute; left: 0; right: 0; bottom: .04em; text-align: center; font: 800 .036em var(--font); letter-spacing: .14em; opacity: .8; }
.cf-note.big { --nw: clamp(104px, 22vw, 160px); }
.cf-note.mini { --nw: clamp(44px, calc((100vw - 70px) / 6.4), 82px); }
.cf-note.tiny { --nw: 44px; }
.cf-note.mini .cf-nt, .cf-note.mini .cf-n1, .cf-note.mini .cf-n2, .cf-note.tiny .cf-nt, .cf-note.tiny .cf-n1, .cf-note.tiny .cf-n2 { display: none; }
.cf-note.blank { --nw: clamp(104px, 22vw, 160px); display: grid; place-items: center; background: rgba(0,0,0,.25); border: 2px dashed rgba(255,255,255,.4); color: rgba(255,255,255,.6); box-shadow: none; font-weight: 900; }
.cf-note.blank::before { display: none; }
.cf-note.blank .cf-nv { background: none; text-shadow: none; }

/* event log */
.cf-log { display: flex; flex-direction: column; min-width: 0; padding: 4px 10px 6px; background: rgba(8,5,28,.55); border: 1px solid var(--line); border-radius: 14px; }
.cf-log-h { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; background: none; border: 0; color: var(--muted); font: 900 11px var(--font); letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; }
.cf-log-l { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; max-height: 230px; }
.cf-lg { padding: 1px 0 1px 8px; border-left: 3px solid #6d63a8; font-size: 12.5px; line-height: 1.35; }
.cf-lg.play { border-left-color: #8e84d8; }
.cf-lg.call { border-left-color: var(--accent); color: #ffb3c0; font-weight: 800; }
.cf-lg.good { border-left-color: var(--ok); }
.cf-lg.bad { border-left-color: #ff5470; }
.cf-lg.round { border-left-color: var(--accent2); color: var(--accent2); font-weight: 800; }
.cf-lg.sys { color: var(--muted); font-style: italic; }
@media (min-width: 901px) { .cf-log-c { display: none; } .cf-log-h { cursor: default; pointer-events: none; } }

/* my side: value picker, hand, buttons */
.cf-me { position: sticky; bottom: 0; z-index: 6; display: flex; flex-direction: column; gap: 6px; margin: auto -12px 0; padding: 16px 12px calc(2px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(10,8,22,0), rgba(10,8,22,.9) 28px, rgba(10,8,22,.96)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.cf-me.nope { animation: cfnope .35s; }
@keyframes cfnope { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.cf-mine { display: flex; flex-direction: column; gap: 6px; }
.cf-me-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cf-me-t { font: 900 12px var(--font); letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.cf-warn { padding: 2px 10px; border-radius: 999px; background: var(--accent); color: #fff; font: 900 12px var(--font); animation: tdpulse .5s infinite alternate; }
.cf-hint { text-align: center; color: #d9d2ff; font-size: 12.5px; line-height: 1.35; }
.cf-pick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 6px; padding-top: 4px; }
.cf-pk { position: relative; padding: 3px; border: 2px solid transparent; border-radius: 10px; background: rgba(255,255,255,.05); cursor: pointer; transition: transform .1s, border-color .15s, background .15s; }
.cf-pk:hover { transform: translateY(-2px); }
.cf-pk.on { transform: translateY(-3px); border-color: var(--accent2); background: rgba(255,209,102,.15); box-shadow: 0 0 14px rgba(255,209,102,.5); }
.cf-pk-n { position: absolute; top: -7px; right: -5px; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 999px; background: #3a2f7a; border: 1px solid var(--line); color: #fff; font: 900 11px/16px var(--font); text-align: center; }
.cf-hand { --cw: var(--cwb); --ov: .16; display: flex; flex-wrap: wrap; justify-content: center; row-gap: 4px; min-height: calc(var(--cw) * 1.42 + 26px); padding: 20px 6px 4px; touch-action: manipulation; }
.cf-hand[data-size="m"] { --cw: calc(var(--cwb) * .92); --ov: .36; }
.cf-hand[data-size="l"] { --cw: calc(var(--cwb) * .84); --ov: .5; }
.cf-hand[data-size="x"] { --cw: calc(var(--cwb) * .76); --ov: .58; }
.cf-hand .cf-card { margin-left: calc(var(--cw) * var(--ov) * -1); cursor: pointer; transition: transform .14s, box-shadow .14s; touch-action: manipulation; }
.cf-hand .cf-card.grp { margin-left: calc(var(--cw) * var(--ov) * -1 + 4px); }
.cf-hand .cf-card:hover { transform: translateY(-6px); }
.cf-hand .cf-card.sel, .cf-hand .cf-card.sel:hover { transform: translateY(-18px); z-index: 4; box-shadow: 0 0 0 .035em var(--accent2), 0 0 .28em rgba(255,209,102,.85), 0 .1em .2em rgba(0,0,0,.5); }
.cf-hand .cf-card.fresh { animation: cfdeal .45s cubic-bezier(.2,.9,.3,1) backwards; animation-delay: calc(var(--k, 0) * 50ms); }
@keyframes cfdeal { from { transform: translateY(-90px) rotate(-10deg); opacity: 0; } }
.cf-mk { display: none; position: absolute; left: 50%; top: .07em; width: .1em; height: .1em; margin-left: -.05em; border-radius: 50%; background: #9bffd6; box-shadow: 0 0 .06em #06d6a0; }
.cf-card.match .cf-mk { display: block; }
.cf-empty, .cf-outbox { padding: 14px 10px; border: 1px dashed var(--line); border-radius: 14px; background: rgba(8,5,28,.55); color: #d9d2ff; font-weight: 700; font-size: 14px; text-align: center; }
.cf-outbox { display: flex; flex-direction: column; gap: 4px; }
.cf-outbox b { font-family: var(--display); font-size: 18px; color: var(--accent2); }
.cf-acts { display: grid; grid-template-columns: 1.45fr 1fr 1.15fr; gap: 8px; margin-bottom: 5px; }
.cf-call, .cf-pass, .cf-play { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 58px; padding: 6px 8px; border: 0; border-radius: 14px; color: #fff; line-height: 1.1; cursor: pointer; transition: transform .08s, filter .15s; }
.cf-call { background: linear-gradient(180deg, #ff5d78, #d11f43); box-shadow: 0 5px 0 #7d1228, 0 10px 26px rgba(255,61,99,.4); font: 900 clamp(15px, 4vw, 21px) var(--display); letter-spacing: 1px; }
.cf-pass { background: linear-gradient(180deg, #5b4fb8, #3a3088); border: 2px solid rgba(190,180,255,.6); box-shadow: 0 5px 0 #231b5c; font-weight: 900; font-size: clamp(13px, 3.6vw, 17px); }
.cf-play { background: linear-gradient(180deg, #19e3b0, #06b88a); box-shadow: 0 5px 0 #04745a, 0 10px 22px rgba(6,214,160,.3); color: #04211a; font: 900 clamp(14px, 3.8vw, 20px) var(--display); letter-spacing: 1px; }
.cf-call:active:not(:disabled), .cf-pass:active:not(:disabled), .cf-play:active:not(:disabled) { transform: translateY(4px); box-shadow: none; }
.cf-call:disabled, .cf-pass:disabled, .cf-play:disabled { cursor: not-allowed; filter: grayscale(.75) brightness(.55); box-shadow: 0 5px 0 rgba(0,0,0,.35); }
.cf-pass.done:disabled { filter: none; background: rgba(6,214,160,.16); border-color: var(--ok); color: #9bffd6; }
.cf-call.hot { animation: cfhot .55s ease-in-out infinite alternate; }
@keyframes cfhot { to { filter: brightness(1.14); box-shadow: 0 5px 0 #7d1228, 0 0 34px rgba(255,61,99,.9); } }
.cf-call-s, .cf-key { font: 800 10.5px var(--font); letter-spacing: .5px; text-transform: none; opacity: .85; }
.cf-key { padding: 0 6px; border-radius: 5px; background: rgba(0,0,0,.28); opacity: .7; }
.cf-call-bar { position: absolute; left: 0; bottom: 0; width: 0; height: 6px; background: var(--accent2); transition: width .1s linear; }
.cf-foot { min-height: 40px; display: flex; flex-direction: column; justify-content: center; gap: 1px; padding-right: 104px; }
.cf-prev { font: 800 14px var(--font); color: #d9d2ff; }
.cf-prev.ok { color: #9bffd6; }
.cf-status { font: 800 12.5px var(--font); }
.cf-status.bad { color: #ff8a9a; }
.cf-status.ok { color: #8dffc8; }
@media (hover: none) { .cf-key { display: none; } }

/* overlays */
.cf-intro { position: fixed; left: 50%; top: 34%; transform: translate(-50%, -50%); z-index: 20; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.cf-intro-card { padding: 18px 22px; border: 2px solid rgba(255,209,102,.6); border-radius: 20px; background: rgba(20,14,54,.94); box-shadow: 0 20px 60px rgba(0,0,0,.6); text-align: center; animation: rise .4s both; backdrop-filter: blur(8px); }
.cf-intro-card h2 { margin: 2px 0 8px; font: 900 clamp(26px, 6vw, 38px) var(--display); letter-spacing: 1px; text-transform: none; color: var(--accent2); }
.cf-intro-card p { margin: 4px 0; font-size: 14px; line-height: 1.45; }
.cf-intro-s { color: var(--muted); }
.cf-ov-k { font: 900 11px var(--font); letter-spacing: 3px; text-transform: uppercase; color: var(--muted); }
.cf-ov { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(5,3,18,.78); backdrop-filter: blur(5px); pointer-events: none; }
.cf-ov-card { width: min(520px, 100%); max-height: 92vh; overflow: auto; padding: 18px 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); text-align: center; animation: rise .4s both; }
.cf-ov-card h2 { margin: 2px 0 4px; font: 900 clamp(22px, 5vw, 30px) var(--display); letter-spacing: 1px; text-transform: none; color: var(--accent2); }
.cf-ov-s { margin: 4px 0 10px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.cf-ov-t { margin: 8px 0 0; font-weight: 800; color: var(--accent2); }
.cf-rr-list { display: flex; flex-direction: column; gap: 5px; margin: 8px 0; text-align: left; }
.cf-rr { display: grid; grid-template-columns: 32px minmax(0, 1fr) 52px 56px 40px; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(8,5,28,.5); font-weight: 800; }
.cf-rr.head { padding-top: 0; padding-bottom: 0; border-color: transparent; background: none; color: var(--muted); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.cf-rr.head span:nth-child(n+3) { text-align: right; }
.cf-rr.win { border: 2px solid var(--accent2); background: rgba(255,209,102,.12); box-shadow: 0 0 22px rgba(255,209,102,.25); }
.cf-rr.me .cf-rr-n { color: var(--accent2); }
.cf-rr.out { opacity: .5; }
.cf-rr-av { display: grid; place-items: center; width: 28px; height: 28px; }
.cf-rr-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-rr-a, .cf-rr-t, .cf-rr-w { text-align: right; }
.cf-rr-a.bad { color: #ff8a9a; }
.cf-rr-a.ok { color: #8dffc8; }
.cf-rr-t { font-family: var(--display); font-size: 18px; }
.cf-rr-w { color: var(--accent2); }

/* narrow screens: one column, compact chips, the log collapses to its latest line */
@media (max-width: 900px) {
  .cf-mid { grid-template-columns: 1fr; }
  .cf-log.collapsed .cf-lg:not(:last-child) { display: none; }
  .cf-log-l { max-height: 140px; }
}
@media (max-width: 640px) {
  .cf-stage { grid-template-columns: 1fr 1fr; grid-template-areas: "pile val" "claim claim"; gap: 6px; min-height: 0; }
  .cf-pilebox { grid-area: pile; --cw: 44px; }
  .cf-claimbox { grid-area: claim; min-height: 0; gap: 6px; }
  .cf-valbox { grid-area: val; }
  .cf-pile { height: calc(var(--cw) * 1.42 + 24px); }
  .cf-bubble::after { display: none; }
  .cf-banner { min-height: 46px; }
  .cf-note.big, .cf-note.blank { --nw: 104px; }
}
@media (max-width: 560px) {
  .cf { padding-left: 8px; padding-right: 8px; }
  .cf-me { margin-left: -8px; margin-right: -8px; padding-left: 8px; padding-right: 8px; }
  .cf-chip { flex-basis: calc(50% - 4px); padding: 4px 7px 4px 5px; gap: 5px; }
  .cf-board.dense .cf-chip { flex-basis: calc(33.33% - 4px); }
  .cf-nm { font-size: 12px; }
  .cf-st { gap: 0 6px; font-size: 11px; }
  .cf-acts { gap: 6px; }
  .cf-pick { gap: 8px 4px; }
  .cf-pk { padding: 2px; }
  .cf-call, .cf-pass, .cf-play { padding: 6px 4px; }
  .cf-rr { grid-template-columns: 30px minmax(0, 1fr) 40px 44px 34px; }
}

/* ---------- top bar: players / leaderboard buttons ---------- */
.tb-co[hidden] { display: none; }
.tb-co { white-space: nowrap; }
@media (max-width: 560px) { .tb-lbl { display: none; } .tb-co { padding: 8px 10px; } .tb-name { display: none; } .tb-profile { padding-right: 4px; } }

/* ---------- Google login + linked accounts ---------- */
.btn.google { background: #fff; color: #202124; border-color: #dadce0; box-shadow: 0 5px 0 #b9bcc2; display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; }
.btn.google:hover { filter: brightness(.97); }
.btn.google .g-mark { font-weight: 900; font-size: 20px; background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-panel .btn.big { margin-top: 10px; }
.pl-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.pl-row { display: flex; align-items: center; gap: 12px; background: rgba(8, 5, 28, .45); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.pl-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; flex: none; background: #3a2f7a; }
.pl-ic.discord { background: #5865f2; }
.pl-ic.google { background: #fff; color: #4285f4; }
.pl-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pl-txt span { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.btn.small { text-decoration: none; }

/* ---------- weekend XP boost ---------- */
.boost-banner { max-width: 540px; width: 100%; margin: 0 auto 10px; display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 12px; font-size: 13px; line-height: 1.35; background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--muted); }
.boost-banner.on { color: #fff; background: linear-gradient(90deg, rgba(255,159,67,.28), rgba(255,84,112,.24)); border-color: rgba(255,159,67,.6); box-shadow: 0 0 18px rgba(255,159,67,.2); }
.boost-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.boost-text { font-weight: 600; }
.boost-count { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.boost-label { font-size: 12px; opacity: .8; text-transform: uppercase; letter-spacing: .06em; }
.boost-timer { font-family: var(--display); font-size: 22px; letter-spacing: .03em; font-variant-numeric: tabular-nums; color: var(--accent2); }
.boost-banner.on .boost-timer { color: #fff; text-shadow: 0 0 12px rgba(255,159,67,.8); }
.boost-bolt { font-size: 22px; flex: none; }
.boost-banner.on .boost-bolt { animation: boostPulse 1.6s ease-in-out infinite; }
@keyframes boostPulse { 50% { transform: scale(1.25) rotate(-8deg); } }

/* ---------- skin editor with hundreds of items ---------- */
.skin-filter { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: -4px 0 10px; font-size: 12px; }
.skin-edit .opts { max-height: min(58vh, 520px); overflow-y: auto; padding: 4px 6px 4px 2px; }
@media (min-width: 721px) { .skin-preview { position: sticky; top: 0; } }

/* ---------- skin showcase in profiles ---------- */
.skin-show { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 190px; flex: none; margin-left: auto; }
.skin-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.skin-chip { font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid var(--line); color: var(--text); white-space: nowrap; }
.skin-chip.muted { color: var(--muted); }
@media (max-width: 640px) { .skin-show { margin: 0 auto; } }

/* ---------- skin viewer ---------- */
.sv-card { width: min(560px, 100%); display: flex; flex-direction: column; gap: 12px; }
#sv-canvas { width: 100%; height: min(60vh, 380px); border-radius: 16px; background: linear-gradient(180deg, rgba(8,5,28,.7), rgba(30,22,80,.7)); border: 1px solid var(--line); display: block; touch-action: none; }
.skin-thumb { position: relative; display: block; padding: 0; border: 1px solid var(--line); border-radius: 18px; cursor: pointer; background: radial-gradient(circle at 50% 74%, rgba(120,100,255,.28), rgba(8,5,28,.6) 70%); transition: transform .12s, border-color .15s; }
.skin-thumb:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.5); }
.skin-thumb canvas { display: block; }
.skin-thumb-hint { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(8,5,28,.85); border: 1px solid var(--line); color: var(--accent2); opacity: 0; transition: opacity .15s; white-space: nowrap; }
.skin-thumb:hover .skin-thumb-hint, .skin-thumb:focus-visible .skin-thumb-hint { opacity: 1; }
.skin-link { cursor: pointer; transition: transform .12s; }
.skin-link:hover { transform: scale(1.12); }

#modal-skinview { z-index: 70; } /* above the profile and the community windows it is opened from */

/* ---------- crawlable description on the login screen ---------- */
.login-about { margin: 18px 0 4px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.55; color: var(--muted); text-align: left; }
.login-about h2 { margin: 0 0 6px; font-size: 14px; letter-spacing: .05em; color: var(--text); }
.login-about p { margin: 0 0 8px; }
.login-about .login-games { color: var(--text); opacity: .85; }
