/* LMchess — slick blue theme */
:root {
  --bg: #060b17;
  --bg2: #0a1224;
  --card: rgba(15, 25, 47, 0.72);
  --card-solid: #0f192f;
  --border: rgba(140, 175, 255, 0.11);
  --border-strong: rgba(140, 175, 255, 0.22);
  --text: #e8efff;
  --muted: #8396bb;
  --blue: #3b82f6;
  --blue-2: #60a5fa;
  --blue-3: #2563eb;
  --cyan: #38bdf8;
  --good: #34d399;
  --bad: #f87171;
  --sq-light: #dde8fb;
  --sq-dark: #5c80c8;
  --hl-last: rgba(56, 189, 248, .42);
  --hl-sel: rgba(37, 99, 235, .55);
  --radius: 18px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
b { font-weight: 700; }
.muted { color: var(--muted); }
.tiny { font-size: 12.5px; }
.empty { padding: 18px 4px; text-align: center; }

.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(37, 99, 235, 0.28), transparent 60%),
    radial-gradient(700px 500px at 100% 10%, rgba(56, 189, 248, 0.14), transparent 60%),
    radial-gradient(800px 700px at 50% 120%, rgba(29, 78, 216, 0.22), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
}

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 12px;
  padding: 10px 16px; font: inherit; font-weight: 600; color: var(--text);
  cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap; user-select: none;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn:not(:disabled):hover { transform: translateY(-1px); }
.btn:not(:disabled):active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, var(--blue-2), var(--blue-3));
  box-shadow: 0 10px 24px -8px rgba(37, 99, 235, .7), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn.primary:not(:disabled):hover { box-shadow: 0 14px 30px -8px rgba(37, 99, 235, .85), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn.secondary { background: rgba(59, 130, 246, .14); border-color: rgba(96, 165, 250, .35); color: #cfe0ff; }
.btn.secondary:not(:disabled):hover { background: rgba(59, 130, 246, .22); }
.btn.ghost { background: rgba(255, 255, 255, .04); border-color: var(--border); color: #cbd7f0; }
.btn.ghost:not(:disabled):hover { background: rgba(255, 255, 255, .08); border-color: var(--border-strong); }
.btn.danger { background: rgba(248, 113, 113, .16) !important; border-color: rgba(248, 113, 113, .5) !important; color: #fecaca !important; }
.btn.sm { padding: 7px 12px; font-size: 13.5px; border-radius: 10px; }
.btn.lg { padding: 14px 20px; font-size: 16px; width: 100%; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.avatar {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: linear-gradient(135deg, #1e3a8a, #2563eb); color: #fff;
}
.avatar.av-w { background: linear-gradient(135deg, #f1f5ff, #c7d7f7); color: #142347; }
.avatar.av-b { background: linear-gradient(135deg, #1b2a4d, #0d1630); color: #cfe0ff; border: 1px solid var(--border-strong); }

/* ----------------------------------------------------------------- nav */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(6, 11, 23, .65);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; letter-spacing: -.01em; }
.brand b { color: var(--blue-2); }
.logo {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--blue-2), var(--blue-3));
  box-shadow: 0 8px 20px -6px rgba(37, 99, 235, .8);
}
.logo .pc { width: 28px; height: 28px; filter: none; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.chip {
  display: flex; align-items: center; gap: 9px; padding: 4px 12px 4px 4px;
  border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--border);
}
.chip .avatar { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
.chip-name { font-weight: 600; }
.rating { font-size: 12.5px; font-weight: 700; color: var(--blue-2); background: rgba(59, 130, 246, .14); padding: 2px 7px; border-radius: 6px; }

.page { max-width: 1180px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 60px; }

/* -------------------------------------------------------------- login */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 520px);
  align-items: center; justify-content: center; gap: clamp(30px, 7vw, 90px); padding: 30px;
}
.auth-card { padding: 38px 34px 28px; }
.auth-logo {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 20px;
  background: linear-gradient(135deg, var(--blue-2), var(--blue-3));
  box-shadow: 0 16px 36px -10px rgba(37, 99, 235, .9);
}
.auth-logo .pc { width: 48px; height: 48px; filter: none; }
.auth h1 { margin: 0 0 8px; font-size: 32px; letter-spacing: -.025em; }
.auth h1 b, .hero h2 b { color: var(--blue-2); }
.auth p { margin: 0 0 22px; line-height: 1.5; }
.auth form { display: grid; gap: 14px; }
.auth label { display: grid; gap: 7px; font-size: 13px; font-weight: 600; color: #b6c5e4; }
.auth input, .chat-form input, .copy input {
  width: 100%; font: inherit; color: var(--text);
  background: rgba(5, 10, 22, .6); border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 13px 14px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.auth input:focus, .chat-form input:focus {
  border-color: var(--blue-2); box-shadow: 0 0 0 4px rgba(59, 130, 246, .18);
}
.err { min-height: 18px; color: var(--bad); font-size: 13.5px; font-weight: 500; }
.auth .tiny { margin: 16px 0 0; text-align: center; }
.auth-art { perspective: 1200px; }
.tilt {
  transform: rotateX(18deg) rotateY(-16deg) rotateZ(3deg);
  border-radius: 16px; padding: 12px;
  background: linear-gradient(135deg, rgba(96, 165, 250, .25), rgba(37, 99, 235, .08));
  box-shadow: 0 50px 80px -30px rgba(0, 0, 0, .8), 0 0 80px -10px rgba(37, 99, 235, .45);
  animation: float 6s ease-in-out infinite;
}
.tilt .board { pointer-events: none; }
@keyframes float { 50% { transform: rotateX(16deg) rotateY(-13deg) rotateZ(2deg) translateY(-10px); } }

/* -------------------------------------------------------------- lobby */
.hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin: 8px 0 26px;
}
.hero h2 { margin: 0 0 6px; font-size: clamp(24px, 3.2vw, 34px); letter-spacing: -.025em; }
.hero p { margin: 0; }
.stats { display: flex; gap: 10px; }
.stats div {
  min-width: 82px; padding: 12px 14px; border-radius: 14px; text-align: center;
  background: var(--card); border: 1px solid var(--border);
}
.stats b { display: block; font-size: 20px; }
.stats span { font-size: 12px; color: var(--muted); }

.lobby-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.lobby-grid > .card { padding: 22px; }
.card-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.card-head.row { justify-content: space-between; margin-bottom: 10px; }
.card-head h3 { margin: 0 0 3px; font-size: 18px; letter-spacing: -.01em; }
.card-head p { margin: 0; font-size: 13.5px; }
.card-head .icon {
  flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(59, 130, 246, .14); border: 1px solid rgba(96, 165, 250, .25);
}
.card-head .icon .pc { width: 36px; height: 36px; }
.field-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 8px; }
.play-card { display: flex; flex-direction: column; }
.play-card .btn.lg { margin-top: auto; }
.play-card .seg:last-of-type { margin-bottom: 22px; }
.seg[data-name="time"] { display: grid; grid-template-columns: repeat(4, 1fr); }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  flex: 1 1 0; min-width: 62px; font: inherit; font-size: 13.5px; font-weight: 600; color: #b9c8e6;
  padding: 9px 10px; border-radius: 10px; cursor: pointer;
  background: rgba(255, 255, 255, .035); border: 1px solid var(--border);
  transition: all .15s ease;
}
.seg button:hover { border-color: var(--border-strong); color: var(--text); }
.seg button.on {
  color: #fff; border-color: rgba(96, 165, 250, .7);
  background: linear-gradient(135deg, rgba(96, 165, 250, .35), rgba(37, 99, 235, .35));
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}

.badge {
  font-size: 12px; font-weight: 600; color: var(--good);
  padding: 4px 9px; border-radius: 999px; background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .25);
}
.badge::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--good); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 8px var(--good); }

.list { display: grid; gap: 6px; max-height: 340px; overflow: auto; }
.li {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .025); border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.li:hover { background: rgba(255, 255, 255, .05); border-color: var(--border); }
.li.me { border-color: rgba(96, 165, 250, .35); background: rgba(59, 130, 246, .08); }
.li-main { flex: 1; min-width: 0; }
.rank { width: 18px; text-align: center; font-weight: 700; color: var(--muted); }
.score { font-weight: 700; color: var(--blue-2); }

/* --------------------------------------------------------------- board */
.board {
  display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  aspect-ratio: 1; width: 100%; border-radius: 12px; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none;
  box-shadow: 0 0 0 1px rgba(140, 175, 255, .18), 0 30px 60px -25px rgba(0, 0, 0, .9);
}
.sq { position: relative; display: grid; place-items: center; }
.sq.light { background: var(--sq-light); }
.sq.dark { background: var(--sq-dark); }
.sq.last::before, .sq.sel::before, .sq.check::before, .sq.hover::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
}
.sq.last::before { background: var(--hl-last); }
.sq.sel::before { background: var(--hl-sel); }
.sq.hover::before { box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .75); }
.sq.check::before { background: radial-gradient(circle, rgba(248, 113, 113, .95) 0%, rgba(239, 68, 68, .55) 40%, transparent 72%); }
.sq.target::after {
  content: ''; position: absolute; width: 30%; height: 30%; border-radius: 50%;
  background: rgba(11, 24, 58, .32); pointer-events: none;
}
.sq.target.cap::after { width: 88%; height: 88%; background: transparent; box-shadow: inset 0 0 0 6px rgba(11, 24, 58, .32); }
.sq.mine { cursor: grab; }
.sq .pc { position: relative; z-index: 1; width: 88%; height: 88%; }
.pc.lifted { opacity: .3; }
.coord { position: absolute; font-size: clamp(8px, 1.1vw, 11px); font-weight: 700; pointer-events: none; z-index: 2; }
.coord.rank { top: 3px; left: 4px; }
.coord.file { bottom: 2px; right: 4px; }
.sq.light .coord { color: var(--sq-dark); }
.sq.dark .coord { color: var(--sq-light); }

.drag-ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; will-change: transform; }
.drag-ghost .pc { width: 100%; height: 100%; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .45)); }

/* Pieces */
.pc { display: block; filter: drop-shadow(0 2px 1.5px rgba(0, 0, 0, .35)); overflow: visible; }
.pc .f { stroke-width: 3.2; stroke-linejoin: round; stroke-linecap: round; }
.pc-w .f { fill: #f7faff; stroke: #142347; }
.pc-w .d { fill: #142347; }
.pc-b .f { fill: #1a2748; stroke: #050a17; }
.pc-b .d { fill: #8fb0ee; }
.pc.mini { width: 18px; height: 18px; margin-right: -5px; filter: none; }

.promo { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(4, 8, 18, .55); border-radius: 12px; backdrop-filter: blur(2px); }
.promo-card { background: var(--card-solid); border: 1px solid var(--border-strong); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); text-align: center; }
.promo-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.promo-row { display: flex; gap: 8px; }
.promo-row button { width: 72px; height: 72px; border-radius: 12px; cursor: pointer; background: var(--sq-light); border: 2px solid transparent; padding: 6px; transition: all .15s; }
.promo-row button:hover { border-color: var(--blue-2); transform: translateY(-2px); }
.promo-row .pc { width: 100%; height: 100%; }

/* --------------------------------------------------------------- game */
.game-page { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.board-col { display: grid; gap: 12px; width: 100%; max-width: min(720px, calc(100vh - 260px)); justify-self: center; min-width: 280px; }
.board-wrap { position: relative; }

.player { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; }
.pl-info { display: flex; align-items: center; gap: 11px; min-width: 0; }
.pl-name { font-weight: 600; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.pl-rating { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.you { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--blue-2); background: rgba(59, 130, 246, .14); padding: 2px 6px; border-radius: 5px; }
.captured { display: flex; align-items: center; min-height: 18px; margin-top: 2px; }
.lead { font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 10px; }
.clock {
  font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 700; letter-spacing: -.01em;
  padding: 8px 14px; min-width: 104px; text-align: right; border-radius: 12px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--border); color: #9fb1d4;
  transition: all .2s;
}
.clock.active { color: #fff; background: linear-gradient(135deg, rgba(96, 165, 250, .35), rgba(37, 99, 235, .4)); border-color: rgba(96, 165, 250, .6); box-shadow: 0 0 24px -6px rgba(59, 130, 246, .7); }
.clock.active.low { background: rgba(248, 113, 113, .2); border-color: rgba(248, 113, 113, .6); box-shadow: 0 0 24px -6px rgba(248, 113, 113, .7); }

.thinking { display: inline-flex; gap: 3px; margin-left: 4px; }
.thinking i { width: 5px; height: 5px; border-radius: 50%; background: var(--blue-2); animation: blink 1s infinite; }
.thinking i:nth-child(2) { animation-delay: .15s; }
.thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }

.side { padding: 18px; display: grid; gap: 14px; position: sticky; top: 86px; }
.status-main { font-size: 18px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-main .muted { font-size: 14px; font-weight: 500; }
.status-main.live::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--blue-2); box-shadow: 0 0 10px var(--blue-2); animation: blink 1.4s infinite; }
.moves {
  max-height: 200px; min-height: 100px; overflow: auto; border-radius: 12px; padding: 6px;
  background: rgba(4, 9, 20, .45); border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.mrow { display: grid; grid-template-columns: 34px 1fr 1fr; padding: 3px 6px; border-radius: 6px; font-size: 14px; }
.mrow:nth-child(odd) { background: rgba(255, 255, 255, .025); }
.mnum { color: var(--muted); }
.mv { font-weight: 600; padding: 0 6px; border-radius: 5px; }
.mv.cur { background: rgba(59, 130, 246, .28); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .btn { flex: 1 1 auto; }
.offer { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(59, 130, 246, .12); border: 1px solid rgba(96, 165, 250, .35); font-weight: 600; }

.chat { display: grid; gap: 8px; }
.chat-head { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.chat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }
.chat-head .muted { margin-left: auto; }
.chat-log { height: 210px; overflow: auto; display: flex; flex-direction: column; gap: 3px; padding: 10px; border-radius: 12px; background: rgba(4, 9, 20, .45); border: 1px solid var(--border); }
.chat-empty { margin: auto; text-align: center; color: var(--muted); font-size: 13px; padding: 0 12px; line-height: 1.5; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 85%; }
.msg.first { margin-top: 6px; }
.msg.first:first-child { margin-top: 0; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg-name { font-size: 11.5px; font-weight: 700; color: #a8c3f5; margin: 0 0 2px 4px; }
.bubble { padding: 7px 11px; border-radius: 14px 14px 14px 5px; background: rgba(255, 255, 255, .07); border: 1px solid var(--border); font-size: 13.5px; line-height: 1.35; word-wrap: break-word; overflow-wrap: anywhere; animation: pop .18s ease; }
.msg.mine .bubble { border-radius: 14px 14px 5px 14px; background: linear-gradient(135deg, var(--blue-2), var(--blue-3)); border-color: transparent; color: #fff; }
.quick { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick button { flex: none; font: inherit; font-size: 12.5px; font-weight: 600; color: #b9c8e6; cursor: pointer; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--border); transition: all .15s; }
.quick button:hover { color: #fff; border-color: rgba(96, 165, 250, .6); background: rgba(59, 130, 246, .15); }
.chat-form { display: flex; gap: 8px; }
.chat-form input { padding: 9px 12px; font-size: 14px; border-radius: 10px; }

/* premoves */
.sq.pre::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: rgba(244, 63, 94, .42); }
.sq.presel::before { background: rgba(244, 63, 94, .35) !important; }
.sq.pretarget::after { background: rgba(190, 18, 60, .35); }
.sq.pretarget.cap::after { background: transparent; box-shadow: inset 0 0 0 6px rgba(190, 18, 60, .35); }

.waiting { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(4, 8, 18, .6); border-radius: 12px; backdrop-filter: blur(3px); padding: 16px; }
.waiting-card { padding: 26px; max-width: 420px; text-align: center; background: var(--card-solid); }
.waiting-card h3 { margin: 12px 0 6px; font-size: 20px; }
.waiting-card p { margin: 0 0 14px; }
.copy { display: flex; gap: 8px; margin-bottom: 12px; }
.copy input { padding: 9px 12px; font-size: 13.5px; border-radius: 10px; }
.pulse { width: 14px; height: 14px; margin: 0 auto; border-radius: 50%; background: var(--blue-2); box-shadow: 0 0 0 0 rgba(96, 165, 250, .7); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 18px rgba(96, 165, 250, 0); } 100% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0); } }

/* -------------------------------------------------------------- modal */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(3, 6, 14, .6); backdrop-filter: blur(6px); animation: fade .2s ease; padding: 20px; }
.modal-card { padding: 30px 30px 24px; width: min(380px, 100%); text-align: center; background: var(--card-solid); animation: pop .25s cubic-bezier(.2, 1.4, .4, 1); }
.modal-card h2 { margin: 14px 0 4px; font-size: 28px; letter-spacing: -.02em; }
.modal-card p { margin: 0 0 20px; }
.modal-actions { display: grid; gap: 8px; }
.go-icon { width: 76px; height: 76px; margin: 0 auto; border-radius: 22px; display: grid; place-items: center; }
.go-icon .pc { width: 58px; height: 58px; }
.go-icon.win { background: linear-gradient(135deg, var(--blue-2), var(--blue-3)); box-shadow: 0 16px 36px -10px rgba(37, 99, 235, .9); }
.go-icon.loss { background: rgba(255, 255, 255, .06); border: 1px solid var(--border-strong); }
.go-icon.draw { background: rgba(56, 189, 248, .15); border: 1px solid rgba(56, 189, 248, .4); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 200; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px;
  background: var(--card-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  transition: all .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-color: rgba(52, 211, 153, .45); }
.toast.bad { border-color: rgba(248, 113, 113, .55); color: #fecaca; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(140, 175, 255, .18); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* --------------------------------------------------------- responsive */
@media (max-width: 960px) {
  .game-page { grid-template-columns: 1fr; }
  .board-col { max-width: 640px; }
  .side { position: static; max-width: 640px; width: 100%; justify-self: center; }
}
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .lobby-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .chip-name { display: none; }
  .stats { width: 100%; }
  .stats div { flex: 1; min-width: 0; }
  .page { padding-top: 18px; }
  .clock { font-size: 18px; min-width: 84px; padding: 6px 10px; }
}

/* ------------------------------------------------------- board themes */
body[data-board="wood"] { --sq-light: #f0d9b5; --sq-dark: #b58863; --hl-last: rgba(205, 210, 106, .7); --hl-sel: rgba(20, 85, 30, .45); }
body[data-board="green"] { --sq-light: #eeeed2; --sq-dark: #769656; --hl-last: rgba(246, 246, 105, .65); --hl-sel: rgba(186, 202, 43, .8); }
body[data-board="slate"] { --sq-light: #c9cfd8; --sq-dark: #6f7d92; --hl-last: rgba(120, 190, 255, .45); --hl-sel: rgba(59, 130, 246, .5); }
body[data-board="wood"] .sq.dark { background: var(--sq-dark) linear-gradient(115deg, rgba(255,255,255,.05), rgba(0,0,0,.06)); }

/* Classic pieces fill the square like a real set */
.sq .pc.classic { width: 100%; height: 100%; }
.pc.classic { filter: drop-shadow(0 1.5px 1px rgba(0, 0, 0, .3)); }
.pc.classic.mini { width: 20px; height: 20px; margin-right: -6px; filter: none; }
.drag-ghost .pc.classic { filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .45)); }
.card-head .icon .pc.classic { width: 40px; height: 40px; }
.go-icon .pc.classic { width: 62px; height: 62px; }
.promo-row .pc.classic { width: 100%; height: 100%; }

.icon-btn { font-size: 17px; padding: 5px 10px; line-height: 1; }

/* ------------------------------------------------------------ settings */
.modal-card.wide { width: min(460px, 100%); text-align: left; }
.modal-title { margin: 0 0 6px !important; font-size: 22px !important; }
.set-block { margin-bottom: 8px; }
.piece-pick, .board-pick { display: grid; gap: 8px; }
.piece-pick { grid-template-columns: 1fr 1fr; }
.board-pick { grid-template-columns: repeat(4, 1fr); }
.piece-pick button, .board-pick button {
  font: inherit; font-size: 13px; font-weight: 600; color: #b9c8e6; cursor: pointer;
  background: rgba(255, 255, 255, .035); border: 1px solid var(--border); border-radius: 12px; padding: 10px 8px;
  display: grid; justify-items: center; gap: 7px; transition: all .15s;
}
.piece-pick button:hover, .board-pick button:hover { border-color: var(--border-strong); color: var(--text); }
.piece-pick button.on, .board-pick button.on { color: #fff; border-color: rgba(96, 165, 250, .75); background: rgba(59, 130, 246, .16); box-shadow: 0 0 0 3px rgba(59, 130, 246, .12); }
.pp { display: flex; gap: 2px; padding: 6px 8px; border-radius: 9px; background: var(--sq-light); }
.pp .pc { width: 34px; height: 34px; }
.swatch { display: grid; grid-template-columns: 1fr 1fr; width: 44px; height: 44px; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.swatch i:nth-child(1), .swatch i:nth-child(4) { background: var(--l); }
.swatch i:nth-child(2), .swatch i:nth-child(3) { background: var(--d); }
.sw-blue { --l: #dde8fb; --d: #5c80c8; } .sw-wood { --l: #f0d9b5; --d: #b58863; }
.sw-green { --l: #eeeed2; --d: #769656; } .sw-slate { --l: #c9cfd8; --d: #6f7d92; }
.vol-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.vol-row input { flex: 1; }

/* Range sliders */
input[type="range"] {
  -webkit-appearance: none; appearance: none; height: 6px; border-radius: 6px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, var(--blue-2) 0%, var(--blue-3) var(--fill, 50%), rgba(255,255,255,.1) var(--fill, 50%));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .35), 0 2px 6px rgba(0,0,0,.4); border: none;
}
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: none; box-shadow: 0 0 0 4px rgba(59, 130, 246, .35); }

/* ------------------------------------------------------------ elo box */
.elo-box { padding: 14px 16px 12px; border-radius: 14px; background: rgba(4, 9, 20, .45); border: 1px solid var(--border); }
.elo-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.elo-num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; background: linear-gradient(135deg, #fff, var(--blue-2)); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.elo-label { color: var(--muted); font-weight: 600; font-size: 13.5px; }
.elo-box input[type="range"] { width: 100%; }
.elo-presets { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-top: 12px; }
.elo-presets button {
  font: inherit; font-size: 12px; font-weight: 600; color: #9fb1d4; cursor: pointer; padding: 6px 2px; border-radius: 8px;
  background: rgba(255,255,255,.03); border: 1px solid var(--border); transition: all .15s;
}
.elo-presets button:hover { color: var(--text); border-color: var(--border-strong); }
.elo-presets button.on { color: #fff; border-color: rgba(96, 165, 250, .7); background: rgba(59, 130, 246, .25); }

/* ------------------------------------------------------- music player */
.mp { position: fixed; left: 18px; bottom: 18px; z-index: 40; font-size: 14px; }
.mp-fab {
  display: flex; align-items: center; gap: 9px; max-width: 260px; cursor: pointer;
  padding: 9px 14px 9px 10px; border-radius: 999px; font: inherit; font-weight: 600; color: var(--text);
  background: rgba(15, 25, 47, .9); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: transform .15s, border-color .2s;
}
.mp-fab:hover { transform: translateY(-1px); border-color: rgba(96, 165, 250, .5); }
.mp-fab-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue-2), var(--blue-3)); flex: none; }
.mp-fab-icon svg { width: 15px; height: 15px; fill: #fff; color: #fff; }
.mp-fab-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.mp .mp-bars { display: none; align-items: flex-end; gap: 2px; height: 12px; flex: none; }
.mp.playing .mp-bars { display: inline-flex; }
.mp-bars i { width: 3px; background: var(--blue-2); border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.mp-bars i:nth-child(1) { height: 60%; } .mp-bars i:nth-child(2) { height: 100%; animation-delay: .2s; } .mp-bars i:nth-child(3) { height: 40%; animation-delay: .4s; }
@keyframes eq { 50% { transform: scaleY(.35); } }
.mp-bars i { transform-origin: bottom; }
.mp.open .mp-fab { display: none; }

.mp-panel {
  display: none; width: 320px; padding: 16px; border-radius: 18px;
  background: rgba(13, 22, 42, .94); border: 1px solid var(--border-strong); box-shadow: 0 30px 60px -20px rgba(0,0,0,.85);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); animation: pop .2s ease;
}
.mp.open .mp-panel { display: block; }
.mp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 15px; }
.mp-iconbtn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: none; cursor: pointer; background: transparent; color: #b9c8e6; position: relative; transition: background .15s, color .15s; }
.mp-iconbtn:hover { background: rgba(255,255,255,.07); color: #fff; }
.mp-iconbtn svg { width: 20px; height: 20px; fill: currentColor; }
.mp-iconbtn.sm svg { width: 17px; height: 17px; fill: none; }
.mp-iconbtn.on { color: var(--blue-2); }
.mp-one { display: none; position: absolute; right: 4px; bottom: 4px; font-size: 9px; font-weight: 800; color: var(--blue-2); }
.mp-iconbtn.one .mp-one { display: block; }
.mp-head .mp-iconbtn { width: 30px; height: 30px; }
.mp-head .mp-iconbtn svg { width: 16px; height: 16px; fill: none; }
.mp-now { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.mp-art { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #1e3a8a, var(--blue-3)); box-shadow: 0 10px 24px -10px rgba(37, 99, 235, .9); }
.mp-art svg { width: 24px; height: 24px; fill: #fff; color: #fff; }
.mp.playing .mp-art { animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 10px 30px -6px rgba(96, 165, 250, .9); } }
.mp-meta { min-width: 0; }
.mp-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.mp-seek { display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mp-seek span:last-child { text-align: right; }
.mp-seek input { width: 100%; --fill: 0%; height: 4px; }
.mp-seek input::-webkit-slider-thumb { width: 12px; height: 12px; }
.mp-ctrl { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 10px 0 6px; }
.mp-play { width: 50px; height: 50px; border-radius: 50%; border: none; cursor: pointer; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue-2), var(--blue-3)); box-shadow: 0 10px 24px -8px rgba(37, 99, 235, .85); transition: transform .12s; }
.mp-play:hover { transform: scale(1.05); }
.mp-play svg { width: 22px; height: 22px; fill: #fff; }
.mp-vol { display: flex; align-items: center; gap: 10px; color: var(--muted); margin-bottom: 12px; }
.mp-vol svg { width: 18px; height: 18px; fill: currentColor; color: currentColor; display: block; }
.mp-vol input { flex: 1; --fill: 60%; height: 4px; }
.mp-list { max-height: 190px; overflow: auto; display: grid; gap: 2px; margin-bottom: 10px; padding: 4px; border-radius: 12px; background: rgba(4, 9, 20, .45); border: 1px solid var(--border); }
.mp-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.mp-track { display: grid; grid-template-columns: 26px 1fr 26px; align-items: center; gap: 6px; padding: 6px 6px 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.mp-track:hover { background: rgba(255,255,255,.05); }
.mp-track.on { background: rgba(59, 130, 246, .18); color: #fff; }
.mp-idx { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.mp-track .mp-bars { display: inline-flex; }
.mp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-del { width: 24px; height: 24px; border: none; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.mp-track:hover .mp-del { opacity: 1; }
.mp-del:hover { color: var(--bad); background: rgba(248,113,113,.1); }
.mp-del svg { width: 13px; height: 13px; }
.mp-add { display: block; text-align: center; cursor: pointer; padding: 10px; border-radius: 11px; font-weight: 600; font-size: 13.5px; color: #cfe0ff; background: rgba(59, 130, 246, .14); border: 1px dashed rgba(96, 165, 250, .45); transition: background .15s; }
.mp-add:hover { background: rgba(59, 130, 246, .22); }
.mp-hint { margin-top: 8px; font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.4; }
.mp-drop { display: none; position: fixed; inset: 0; z-index: 300; background: rgba(4, 8, 18, .75); backdrop-filter: blur(4px); place-items: center; }
.mp-drop div { display: grid; justify-items: center; gap: 14px; padding: 40px 50px; border-radius: 22px; border: 2px dashed var(--blue-2); background: rgba(15, 25, 47, .8); font-size: 18px; }
.mp-drop svg { width: 46px; height: 46px; fill: var(--blue-2); color: var(--blue-2); }
.mp.dragging .mp-drop { display: grid; }

@media (max-width: 560px) {
  .mp { left: 10px; bottom: 10px; }
  .mp-panel { width: calc(100vw - 20px); }
  .mp-fab-title { max-width: 120px; }
  .board-pick { grid-template-columns: repeat(2, 1fr); }
}

.set-hint { margin-top: 6px; line-height: 1.4; }

/* ------------------------------------------------- right-click drawing */
.board { position: relative; }
.draw-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }
.draw-layer .arrow { opacity: .9; }
.draw-layer .arrow.preview { opacity: .6; }
.sq.mk { background-image: linear-gradient(var(--mk), var(--mk)); }

/* --------------------------------------------------------------- review */
.review-page { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.rv-col { max-width: min(740px, calc(100vh - 300px)); }
.rv-row { display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.evalbar { position: relative; border-radius: 8px; overflow: hidden; background: #1b2236; box-shadow: 0 0 0 1px rgba(140,175,255,.18); }
.eb-fill { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, #ffffff, #dfe7f5); transition: height .35s ease; }
.eb-fill.top { bottom: auto; top: 0; }
.eb-label { position: absolute; left: 0; right: 0; text-align: center; font-size: 10.5px; font-weight: 800; letter-spacing: -.02em; }
.eb-label.at-bottom { bottom: 5px; } .eb-label.at-top { top: 5px; }
.eb-label.on-white { color: #1b2236; } .eb-label.on-black { color: #e8efff; }
.rv-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.rv-arrow line { stroke: rgba(129, 191, 63, .85); }
.rv-arrow polygon { fill: rgba(129, 191, 63, .85); }
.rv-badge circle { stroke: #fff; stroke-width: 3; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
.rv-badge text { fill: #fff; font-weight: 800; font-family: Inter, system-ui, sans-serif; }
.rv-nav { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 8px; margin-left: 36px; }
.rv-nav .btn { font-size: 16px; padding: 10px; }

.rv-side { gap: 14px; }
.rv-title { display: flex; align-items: center; gap: 12px; }
.rv-title b { font-size: 18px; }
.rv-star { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; color: #fff; background: linear-gradient(135deg, #9acd5a, #4d9a2a); box-shadow: 0 10px 24px -10px rgba(127, 191, 63, .8); }
.rv-progress { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 30px 10px; }
.rv-ptext { font-weight: 700; }
.rv-bar { width: 100%; height: 8px; border-radius: 8px; background: rgba(255,255,255,.08); overflow: hidden; }
.rv-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue-2), #9acd5a); transition: width .3s; }
.rv-spin { width: 36px; height: 36px; border-radius: 50%; border: 4px solid rgba(255,255,255,.1); border-top-color: var(--blue-2); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#rv-content { display: grid; gap: 14px; }
#rv-content[hidden], #rv-progress[hidden] { display: none; }
.rv-acc { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acc-card { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 14px; background: rgba(4, 9, 20, .45); border: 1px solid var(--border); min-width: 0; }
.acc-name { font-size: 12.5px; font-weight: 600; color: #b9c8e6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-num { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.rv-comment { padding: 12px; border-radius: 14px; background: rgba(4, 9, 20, .45); border: 1px solid var(--border); min-height: 66px; }
.cm-row { display: flex; gap: 11px; align-items: flex-start; }
.cm-icon { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.cm-main { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; flex: 1; line-height: 1.35; }
.cm-eval { flex: none; font-size: 12px; font-weight: 800; padding: 3px 7px; border-radius: 6px; }
.cm-eval.ev-w { background: #eef2fa; color: #1b2236; } .cm-eval.ev-b { background: #1b2236; color: #e8efff; border: 1px solid var(--border-strong); }
.cm-best { margin: 10px 0 0 41px; font-size: 13.5px; }
.cm-best b { color: #9acd5a; }
.rv-graph { width: 100%; height: 80px; border-radius: 10px; cursor: pointer; display: block; }
.g-bg { fill: #1b2236; } .g-area { fill: #eef2fa; } .g-mid { stroke: rgba(120, 140, 180, .5); stroke-width: .6; }
.g-cur { stroke: var(--blue-2); stroke-width: 1.6; } .g-dot { stroke: #fff; stroke-width: .6; }
.rv-moves { max-height: 190px; }
.rv-mv { cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.rv-mv:hover { background: rgba(255,255,255,.07); }
.rv-mv .mk { font-style: normal; font-size: 9.5px; font-weight: 800; color: #fff; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; display: inline-grid; place-items: center; }
.rv-mv.cur { background: color-mix(in srgb, var(--mc, #3b82f6) 35%, transparent); }
.rv-counts { display: grid; gap: 2px; font-size: 13.5px; }
.ct-head, .ct-row { display: grid; grid-template-columns: 1fr 64px 64px; align-items: center; padding: 4px 6px; }
.ct-head { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ct-head span, .ct-row span:not(.ct-label) { text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.ct-row:nth-child(even) { background: rgba(255,255,255,.025); border-radius: 6px; }
.ct-label { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.ct-label i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 800; }

/* Recent games */
.recent-card { grid-column: 1 / -1; }
.recent-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 8px; }
.rg { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.025); border: 1px solid var(--border); }
.res { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.res-win { background: rgba(52, 211, 153, .16); color: var(--good); }
.res-loss { background: rgba(248, 113, 113, .16); color: var(--bad); }
.res-draw { background: rgba(148, 163, 184, .16); color: #cbd5e1; }
.rg-color { flex: none; width: 12px; height: 12px; border-radius: 3px; }
.rg-color.cw { background: #f1f5ff; } .rg-color.cb { background: #0d1630; border: 1px solid var(--border-strong); }

@media (max-width: 960px) {
  .review-page { grid-template-columns: 1fr; }
  .rv-col { max-width: 640px; justify-self: center; width: 100%; }
}

/* ------------------------------------------------------ online & invites */
.online-btn { gap: 6px; }
.on-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }
.online-btn .on-label { color: var(--muted); font-weight: 500; }
.avatar { position: relative; }
.avatar .status { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--card-solid); }
.status.free { background: var(--good); } .status.busy { background: #f59e0b; }
.free-text { color: var(--good); } .busy-text { color: #f59e0b; }
.leader-card { grid-column: 1 / -1; }
.leaders-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); max-height: none; }
.online-card .list, .open-card .list { max-height: 300px; }

.online-drop { position: fixed; top: 70px; right: clamp(16px, 4vw, 40px); z-index: 45; width: min(380px, calc(100vw - 32px)); padding: 16px; background: rgba(13, 22, 42, .97); animation: pop .18s ease; }
.online-drop .list { max-height: 60vh; }

.avatar.big { width: 52px; height: 52px; border-radius: 15px; font-size: 22px; }
.ch-head { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.ch-head .modal-title { margin: 0 !important; }
.ch-wait { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 10px 0 4px; }
.ch-wait h3 { margin: 10px 0 0; font-size: 20px; }
.ch-wait p { margin: 0; }
.ch-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; font-weight: 800; }
.ch-icon.no { background: rgba(248, 113, 113, .15); color: var(--bad); }
.ch-timer, .inv-timer { width: 100%; height: 5px; border-radius: 5px; background: rgba(255,255,255,.08); overflow: hidden; }
.ch-timer i, .inv-timer i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--blue-2), var(--blue-3)); transform-origin: left; animation: drain linear forwards; }
@keyframes drain { to { transform: scaleX(0); } }
.ch-wait .btn { margin-top: 6px; }

.invites { position: fixed; top: 78px; right: 18px; z-index: 60; display: grid; gap: 10px; width: min(340px, calc(100vw - 36px)); }
.invite-card { padding: 14px; background: rgba(13, 22, 42, .97); border-color: rgba(96, 165, 250, .45); box-shadow: 0 24px 50px -16px rgba(0,0,0,.85), 0 0 0 3px rgba(59,130,246,.12); animation: slidein .3s cubic-bezier(.2, 1.2, .4, 1); display: grid; gap: 10px; }
.invite-card.leaving { animation: slideout .25s ease forwards; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
@keyframes slideout { to { transform: translateX(30px); opacity: 0; } }
.inv-top { display: flex; gap: 11px; align-items: center; }
.inv-sword { font-size: 22px; }
.inv-meta { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: #b9c8e6; padding: 8px 10px; border-radius: 10px; background: rgba(4, 9, 20, .45); }
.inv-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 560px) { .online-btn .on-label { display: none; } }

/* Music player is opt-in (Settings) */
body:not([data-music="on"]) .mp { display: none; }
.stats em { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); opacity: .8; margin-top: 2px; white-space: nowrap; }

/* --------------------------------------------------------- auth tabs */
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 14px 0 14px; border-radius: 13px; background: rgba(4, 9, 20, .55); border: 1px solid var(--border); }
.auth-tabs button { font: inherit; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; padding: 9px; border: none; border-radius: 10px; background: transparent; transition: all .15s; }
.auth-tabs button:hover { color: var(--text); }
.auth-tabs button.on { color: #fff; background: linear-gradient(135deg, rgba(96,165,250,.35), rgba(37,99,235,.4)); box-shadow: inset 0 0 0 1px rgba(96,165,250,.5); }
.auth .auth-sub { margin: 0 0 18px; }
.auth form .hint { font-size: 12px; color: var(--muted); margin-top: -8px; min-height: 0; }
.auth form .hint:empty { display: none; }
.auth form .hint.ok { color: var(--good); }
.auth form .hint.bad { color: var(--bad); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 34px; border: none; border-radius: 9px; background: transparent; cursor: pointer; font-size: 16px; opacity: .55; filter: grayscale(1); }
.pw-eye:hover, .pw-eye.on { opacity: 1; background: rgba(255,255,255,.06); }
.auth-switch a, .err a { color: var(--blue-2); font-weight: 600; text-decoration: none; }
.auth-switch a:hover, .err a:hover { text-decoration: underline; }
