:root {
  --bg-1: #0a6fd0;
  --bg-2: #0558ab;
  --panel: rgba(255, 255, 255, 0.08);
  --row: #3d8bdc;
  --row-hover: #4b97e6;
  --side: #1257a6;
  --gold-1: #ffcf3a;
  --gold-2: #f59e0b;
  --gold-edge: #fff2b8;
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.55);
  --master: #ffc928;
  --diamond: #63e3f5;
  --platinum: #b9d3e6;
  --gold: #f5b83d;
  --silver: #c9ced6;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  font-family: "Baloo 2", system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(ellipse at 50% 20%, var(--bg-1), var(--bg-2) 75%);
  background-attachment: fixed;
  overflow-x: hidden;
}

button { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; left: 14px; top: 14px;
  display: flex; flex-direction: column; gap: 10px; z-index: 5;
}
.side-btn {
  position: relative;
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--side);
  display: grid; place-items: center;
  box-shadow: 0 3px 0 rgba(0,0,0,.18);
  transition: transform .12s, background .12s;
}
.side-btn:hover { background: #1a66bd; transform: translateY(-1px); }
.side-btn svg { width: 22px; height: 22px; fill: #fff; }
.side-btn.spotify svg { fill: #1ed760; }
.badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #ef4444; font-size: 11px; font-weight: 800; line-height: 18px;
}

.online {
  position: fixed; left: 80px; top: 26px;
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px; color: rgba(255,255,255,.85);
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 8px #22c55e; }

.search {
  position: fixed; right: 18px; top: 20px; z-index: 5;
  width: 230px; height: 40px; padding: 0 16px;
  border-radius: 20px; border: 0; outline: 0;
  background: rgba(0, 40, 100, 0.35);
  color: #fff; font: 600 14px "Baloo 2", sans-serif;
}
.search::placeholder { color: rgba(255,255,255,.45); }
.search:focus { box-shadow: 0 0 0 2px rgba(255,255,255,.35); }

/* ---------- Lobby ---------- */
.lobby {
  max-width: 1060px; margin: 0 auto; padding: 22px 90px 30px;
  display: flex; flex-direction: column; align-items: center;
}

.play-btn {
  font-size: 54px; font-weight: 800; line-height: 1;
  padding: 14px 36px 10px; border-radius: 22px;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  box-shadow: inset 0 0 0 4px var(--gold-edge), 0 6px 0 #c76a00, 0 10px 24px rgba(0,0,0,.25);
  text-shadow: 0 3px 0 rgba(180, 80, 0, .55);
  transition: transform .12s, box-shadow .12s;
}
.play-btn:hover { transform: translateY(-2px) scale(1.03); }
.play-btn:active { transform: translateY(4px); box-shadow: inset 0 0 0 4px var(--gold-edge), 0 2px 0 #c76a00; }

.play-row { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.practice-btn {
  padding: 4px 18px; border-radius: 10px; color: #fff; text-decoration: none;
  font-size: 15px; font-weight: 800; background: rgba(0, 40, 100, .35);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
}
.practice-btn:hover { background: rgba(0, 40, 100, .55); }

.maps { display: flex; gap: 10px; margin: 26px 0 14px; justify-content: safe center; max-width: 100%; overflow-x: auto; padding: 2px; }
.maps .map-thumb { flex: 0 1 98px; min-width: 72px; }
.map-thumb {
  position: relative; width: 98px; height: 66px; border-radius: 12px; overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.55), 0 3px 8px rgba(0,0,0,.2);
}
.map-thumb .art { position: absolute; inset: 0; }
.map-thumb .name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 2px 4px; text-align: center;
  font-size: 11px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(transparent, rgba(30,40,120,.85));
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

.board {
  width: 100%; max-width: 860px;
  background: var(--panel); border-radius: 18px; padding: 14px 14px 6px;
}
.tabs { display: flex; gap: 6px; padding: 0 4px 10px; flex-wrap: wrap; }
.tab {
  font-size: 13px; font-weight: 700; color: var(--muted);
  padding: 4px 12px; border-radius: 999px;
}
.tab:hover { color: #fff; }
.tab.active { color: #fff; background: rgba(255,255,255,.12); }

.players {
  list-style: none; margin: 0; padding: 0 6px 0 0;
  max-height: calc(100vh - 290px); min-height: 240px; overflow-y: auto;
}
.players::-webkit-scrollbar { width: 8px; }
.players::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 4px; }

.player {
  display: flex; align-items: center; gap: 14px;
  height: 58px; padding: 0 16px; margin-bottom: 7px;
  background: var(--row); border-radius: 10px;
  font-weight: 700; font-size: 16px;
  transition: background .12s, transform .12s;
  cursor: pointer;
}
.player:hover { background: var(--row-hover); transform: translateX(2px); }
.player .pname { flex: 1; }
.player .tier { font-size: 13px; color: rgba(255,255,255,.7); }
.player .mr { font-size: 14px; width: 86px; text-align: right; }
.empty { text-align: center; padding: 30px; color: var(--muted); font-weight: 600; }

/* Rank badges */
.rank-badge { width: 34px; height: 34px; flex: none; display: grid; place-items: center; position: relative; }
.rank-badge svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rank-badge span { position: relative; font-size: 12px; font-weight: 800; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.4); }

/* ---------- Overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 20;
  display: grid; place-items: center;
  animation: fade .2s ease;
}
.overlay[hidden] { display: none; }
.overlay.dim { background: rgba(5, 25, 60, .62); backdrop-filter: blur(5px); }
.overlay.solid { background: radial-gradient(ellipse at 50% 20%, var(--bg-1), var(--bg-2) 75%); animation: none; }
.overlay.solid .center { animation: fade .25s ease; }
.center { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 16px; }
.center h2 { margin: 14px 0 0; font-size: 28px; font-weight: 800; }
.sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; font-weight: 600; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.ring { position: relative; width: 120px; height: 120px; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); animation: spin 1.4s linear infinite; }
.ring circle { fill: none; stroke-width: 5; }
.ring .track { stroke: rgba(255,255,255,.12); }
.ring .arc { stroke: var(--gold-1); stroke-linecap: round; stroke-dasharray: 180 400; }
.ring span { font-size: 22px; font-weight: 800; }
@keyframes spin { to { transform: rotate(270deg); } }

.dots::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.ghost-btn {
  margin-top: 18px; padding: 7px 18px; border-radius: 10px;
  background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
  font-size: 14px; font-weight: 700; color: rgba(255,255,255,.85);
}
.ghost-btn:hover { background: rgba(255,255,255,.16); }

.found-title {
  margin: 0 0 12px; font-size: 44px; font-weight: 800; color: var(--gold-1);
  text-shadow: 0 3px 0 rgba(150, 70, 0, .6);
  animation: pop .35s cubic-bezier(.3,1.6,.6,1);
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.opp-card {
  width: 300px; padding: 22px 20px 18px; border-radius: 18px;
  background: linear-gradient(180deg, #2d8ff0, #1666c9);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.18), 0 12px 30px rgba(0,0,0,.3);
  display: flex; flex-direction: column; align-items: center;
  animation: pop .4s cubic-bezier(.3,1.6,.6,1);
}
.avatar {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; font-size: 28px; font-weight: 800;
  background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35);
}
.avatar.you { background: rgba(255, 207, 58, .25); box-shadow: inset 0 0 0 2px var(--gold-1); }
.opp-name { margin-top: 10px; font-size: 26px; font-weight: 800; color: #7fe3ff; }
.opp-meta { margin-top: 8px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.8); }
.opp-meta b { margin-left: 10px; color: #fff; }
.mini-badge { width: 22px; height: 22px; display: inline-grid; place-items: center; position: relative; }
.mini-badge svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.gold-btn {
  margin-top: 20px; padding: 10px 26px 8px; border-radius: 12px;
  font-size: 16px; font-weight: 800;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  box-shadow: 0 4px 0 #c76a00;
}
.gold-btn:hover { transform: translateY(-1px); }
.gold-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #c76a00; }

.coin {
  width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center; font-size: 38px; font-weight: 800; color: #5a2a00;
  background: radial-gradient(circle at 35% 30%, #ffe27a, var(--gold-2));
  box-shadow: inset 0 -5px 0 rgba(160,70,0,.4), 0 8px 20px rgba(0,0,0,.25);
}
.coin.flipping { animation: flip .5s linear infinite; }
@keyframes flip { 0% { transform: rotateY(0); } 100% { transform: rotateY(360deg); } }

.map-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
.map-grid .map-thumb { width: 130px; height: 82px; transition: transform .15s, opacity .2s, box-shadow .15s; }
.map-grid.pickable .map-thumb { cursor: pointer; }
.map-grid.pickable .map-thumb:hover { transform: scale(1.06); }
.map-grid .map-thumb.hl { box-shadow: inset 0 0 0 3px var(--gold-1), 0 0 18px rgba(255,207,58,.6); transform: scale(1.06); }
.map-grid .map-thumb.faded { opacity: .35; }

.map-thumb { position: relative; }
.map-grid .map-thumb.banned { cursor: default; transform: none; }
.map-grid .map-thumb.banned .art, .map-grid .map-thumb.banned .name { filter: grayscale(1) brightness(.45); }
.map-grid .map-thumb.banned::after {
  content: "✕"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 44px; font-weight: 800; color: #ff5a5a; text-shadow: 0 2px 6px rgba(0,0,0,.5);
}
.ban-tag { position: absolute; top: 4px; left: 0; right: 0; font-size: 10px; font-weight: 800; text-align: center; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.map-grid.pickable .map-thumb.banned:hover { transform: none; }
.ban-timer { min-height: 40px; font-size: 34px; font-weight: 800; color: var(--gold-1); }
.ban-timer.urgent { color: #ff7070; }
.vs-row { display: flex; align-items: center; gap: 28px; margin: 16px 0 18px; }
.vs-side { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; }
.vs { font-size: 40px; font-weight: 800; color: var(--gold-1); text-shadow: 0 3px 0 rgba(150,70,0,.6); }
.ready-map .map-thumb { width: 240px; height: 140px; }
.ready-map .map-thumb .name { font-size: 16px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 18px; border-radius: 12px;
  background: rgba(5, 25, 60, .85); font-weight: 700; font-size: 14px;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Room handoff ---------- */
[hidden] { display: none !important; }
.room-box { display: flex; flex-direction: column; align-items: center; max-width: 420px; }
.room-box h2 { font-size: 24px; }
.steps { margin: 10px 0 0; padding-left: 22px; text-align: left; font-size: 14px; font-weight: 600; line-height: 1.6; color: rgba(255,255,255,.85); }
.steps b { color: #fff; }
.code-row { display: flex; gap: 8px; margin-top: 4px; }
.code-row .gold-btn { margin-top: 20px; }
.code-row input, .name-input {
  margin-top: 20px; width: 200px; padding: 9px 12px; border-radius: 12px; border: 0; outline: none;
  font: 800 18px 'Baloo 2', system-ui, sans-serif; letter-spacing: .04em; text-align: center;
  color: #fff; background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 2px rgba(255,255,255,.2);
}
.code-row input:focus, .name-input:focus { box-shadow: inset 0 0 0 2px var(--gold-1); }
.code-show { display: flex; align-items: center; gap: 12px; }
.code-show b { font-size: 40px; font-weight: 800; letter-spacing: .06em; color: var(--gold-1); text-shadow: 0 3px 0 rgba(150,70,0,.6); }
.code-show .ghost-btn { margin-top: 0; }
.report-row { display: flex; gap: 12px; align-items: flex-end; }
.report-row .ghost-btn { padding: 10px 26px 8px; font-size: 16px; }
.warn { margin: 12px 0 0; color: #ffb3b3; font-size: 13px; font-weight: 700; }
.end-mr { margin: 0; font-size: 28px; font-weight: 800; }
.end-mr.up { color: #7dff9a; }
.end-mr.down { color: #ff9b9b; }
.link-row input { width: 280px; font-size: 14px; letter-spacing: 0; }
.play-link { font-size: 24px; padding: 12px 40px 10px; }
.new-tab { color: rgba(255,255,255,.75); }
.play-view {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; background: #000;
}
.play-view.parked { transform: translateX(-200vw); }
.play-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 6px 12px; background: var(--side);
}
.play-bar .ghost-btn, .play-bar .gold-btn, .play-bar input { margin-top: 0; }
.play-bar .gold-btn { padding: 6px 16px 5px; font-size: 14px; box-shadow: 0 3px 0 #c76a00; }
.play-bar input { width: 260px; padding: 6px 10px; font-size: 13px; letter-spacing: 0; }
.bar-form { margin: 0; }
.bar-info { font-size: 14px; font-weight: 700; color: rgba(255,255,255,.85); }
.bar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
#skFrame { flex: 1; width: 100%; border: 0; background: #000; }
@media (max-width: 760px) { .link-row { flex-direction: column; align-items: center; } .link-row .gold-btn { margin-top: 8px; } .play-bar input { width: 100%; } }
.me-chip {
  position: fixed; right: 18px; top: 64px; z-index: 5;
  padding: 5px 12px; border-radius: 10px; background: var(--panel);
  font-size: 13px; font-weight: 700;
}
.me-chip b { color: var(--gold-1); margin-left: 6px; }
.player.me { box-shadow: inset 0 0 0 2px var(--gold-1); }
@media (max-width: 760px) { .me-chip { top: 18px; right: 16px; } }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .sidebar { top: auto; bottom: 0; left: 0; right: 0; flex-direction: row; justify-content: space-around;
    padding: 8px 10px; background: rgba(5,40,95,.8); backdrop-filter: blur(6px); }
  .online { left: 16px; top: 18px; }
  .search { position: static; display: block; width: calc(100% - 32px); margin: 48px 16px 0; }
  .lobby { padding: 20px 16px 90px; }
  .play-btn { font-size: 44px; }
  .map-thumb { width: 80px; height: 56px; }
  .map-grid .map-thumb { width: 96px; height: 64px; }
  .players { max-height: none; }
  .player .tier { display: none; }
}

/* ---------- Search dropdown ---------- */
.search-results {
  position: fixed; right: 18px; top: 66px; z-index: 15;
  width: 280px; max-height: 360px; overflow: auto; margin: 0; padding: 6px; list-style: none;
  border-radius: 14px; background: #0e4f9a; box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
.search-results li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; font-weight: 700; font-size: 14px; }
.search-results li[data-player] { cursor: pointer; }
.search-results li[data-player]:hover { background: rgba(255,255,255,.1); }
.search-results small { color: var(--muted); font-weight: 600; font-size: 12px; }

/* ---------- Side sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 30; background: rgba(5, 25, 60, .45); animation: fade .15s ease; }
.sheet {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(400px, 100%);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #1666c9, #0e4f9a); box-shadow: -10px 0 30px rgba(0,0,0,.3);
  animation: slide-in .2s ease;
}
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.sheet h3 { margin: 0; font-size: 24px; font-weight: 800; }
.sheet-x { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.1); font-size: 16px; font-weight: 800; }
.sheet-x:hover { background: rgba(255,255,255,.2); }
.sheet-body { flex: 1; overflow: auto; padding: 8px 18px 24px; }
.sheet-body h4 { margin: 20px 0 8px; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: rgba(255,255,255,.7); }
.sheet-body h4 small { text-transform: none; letter-spacing: 0; margin-left: 6px; color: var(--muted); }
.sheet-body .gold-btn, .sheet-body .ghost-btn { margin-top: 0; }
.sheet-body a { color: #fff; text-decoration: none; }
.sheet-body a:hover { text-decoration: underline; }
.hint { margin: 6px 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.danger { color: #ffb3b3 !important; }

.seg { display: flex; gap: 4px; padding: 4px; margin: 6px 0 14px; border-radius: 12px; background: rgba(0,0,0,.2); }
.seg button { flex: 1; padding: 8px; border-radius: 9px; font-weight: 800; font-size: 14px; color: rgba(255,255,255,.7); }
.seg button.on { background: rgba(255,255,255,.16); color: #fff; }

.stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.stack label, .toggle { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; color: rgba(255,255,255,.85); }
.toggle { flex-direction: row; align-items: center; gap: 10px; line-height: 1.35; }
.toggle input { width: 18px; height: 18px; accent-color: var(--gold-1); flex: none; }
.stack input, .add-row input {
  padding: 10px 12px; border: 0; outline: none; border-radius: 11px;
  font: 700 15px 'Baloo 2', system-ui, sans-serif; color: #fff;
  background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 2px rgba(255,255,255,.15);
}
.stack input:focus, .add-row input:focus { box-shadow: inset 0 0 0 2px var(--gold-1); }
.stack .gold-btn, .stack .ghost-btn { align-self: flex-start; }
.add-row { display: flex; gap: 8px; margin: 4px 0; }
.add-row input { flex: 1; min-width: 0; }
.add-row .gold-btn { padding: 8px 16px 6px; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.list li { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 11px; background: rgba(255,255,255,.08); font-size: 14px; font-weight: 700; }
.list li.hint { background: none; padding: 4px 0; }
.list small { color: var(--muted); font-weight: 600; font-size: 12px; }
.list .grow small { display: block; }
.grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mini { padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 800; background: rgba(255,255,255,.12); }
.mini:hover { background: rgba(255,255,255,.2); }
.mini.gold { background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); color: #3a1d00; }
.mini:disabled { opacity: .4; cursor: default; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.row-actions .gold-btn, .row-actions .ghost-btn { padding: 8px 16px 6px; font-size: 14px; }
.row-actions .gold-btn { box-shadow: 0 3px 0 #c76a00; }
button:disabled { cursor: default; }
.ghost-btn:disabled { opacity: .55; }

.dot-s { width: 9px; height: 9px; flex: none; border-radius: 50%; background: rgba(255,255,255,.3); }
.dot-s.on, .on-dot { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.on-dot { display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; vertical-align: middle; }

.prof-head { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.prof-name { font-size: 24px; font-weight: 800; }
.prof-status { font-size: 13px; font-weight: 700; color: var(--muted); }
.prof-status.on { color: #7dff9a; }
.prof-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 14px; }
.prof-stats div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px; border-radius: 11px; background: rgba(255,255,255,.08); text-align: center; }
.prof-stats b { font-size: 15px; font-weight: 800; }
.prof-stats small { font-size: 11px; font-weight: 700; color: var(--muted); }
.res { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 7px; font-size: 12px; font-weight: 800; }
.res.w { background: #1f9d55; }
.res.l { background: #c0392b; }
.delta { font-weight: 800; }

/* ---------- Challenge pop-ups ---------- */
.pops { position: fixed; right: 18px; bottom: 18px; z-index: 35; display: flex; flex-direction: column; gap: 10px; width: min(320px, calc(100% - 32px)); }
.pop {
  padding: 12px 14px; border-radius: 14px; font-size: 14px; font-weight: 600;
  background: linear-gradient(180deg, #2d8ff0, #1666c9); box-shadow: inset 0 0 0 2px rgba(255,255,255,.2), 0 10px 26px rgba(0,0,0,.3);
  animation: pop .3s cubic-bezier(.3,1.6,.6,1);
}
.pop small { display: block; color: rgba(255,255,255,.7); }
.pop .row-actions { margin: 8px 0 0; }

@media (max-width: 760px) {
  .search-results { position: absolute; left: 16px; right: 16px; top: 92px; width: auto; }
  .prof-stats { grid-template-columns: repeat(3, 1fr); }
  .pops { right: 16px; bottom: 84px; }
}
.me-chip { cursor: pointer; }

/* ---------- Room code ---------- */
.room-code {
  margin-top: 16px; padding: 8px 22px 6px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  background: rgba(0,0,0,.22); box-shadow: inset 0 0 0 2px rgba(255,255,255,.18);
  transition: box-shadow .12s, transform .12s;
}
.room-code:hover { box-shadow: inset 0 0 0 2px var(--gold-1); transform: translateY(-1px); }
.room-code:active { transform: translateY(1px); }
.room-code small { font-size: 11px; font-weight: 700; color: var(--muted); }
.room-code b { font-size: 30px; font-weight: 800; letter-spacing: .06em; color: var(--gold-1); line-height: 1.2; }
.bar-code b { letter-spacing: .04em; color: var(--gold-1); }
a.gold-btn, a.ghost-btn { display: inline-block; color: inherit; text-decoration: none; }

/* ---------- Screenshot result ---------- */
.judge { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sk-name { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--muted); }
.sk-name input {
  width: 220px; padding: 7px 10px; border: 0; outline: none; border-radius: 10px; text-align: center;
  font: 700 15px 'Baloo 2', system-ui, sans-serif; color: #fff;
  background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 2px rgba(255,255,255,.15);
}
.sk-name input:focus { box-shadow: inset 0 0 0 2px var(--gold-1); }
.judge .report-row .gold-btn, .judge .report-row .ghost-btn { margin-top: 12px; padding: 10px 18px 8px; font-size: 15px; }
.gold-btn:disabled { opacity: .5; transform: none; }
.upload-link { margin-top: 8px; font-size: 13px; font-weight: 700; color: rgba(255,255,255,.75); text-decoration: underline; cursor: pointer; }
.judge-status { min-height: 18px; max-width: 380px; }
.judge-preview, .result-proof img { display: block; max-width: min(380px, 90vw); max-height: 200px; margin-top: 8px; border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.result-proof { display: block; }
.manual { margin-top: 14px; font-size: 13px; font-weight: 700; color: rgba(255,255,255,.7); text-align: center; }
.manual summary { cursor: pointer; }
.manual[open] summary { margin-bottom: 4px; }
#practiceFrame { flex: 1; width: 100%; border: 0; background: #000; }
.bar-info small { font-weight: 600; color: var(--muted); }

/* ---------- Chat ---------- */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-note { margin-top: 0; }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 4px 0 10px; padding: 0 4px 0 0;
  display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg-av { width: 34px; height: 34px; flex: none; border-radius: 50%; object-fit: cover;
  display: grid; place-items: center; font-weight: 800; background: rgba(255,255,255,.15); }
.msg.discord .msg-av:not(img) { background: #5865f2; }
.msg-main { min-width: 0; flex: 1; }
.msg-head { display: flex; align-items: baseline; gap: 6px; font-size: 14px; font-weight: 800; }
.msg-head small { font-size: 11px; font-weight: 600; color: var(--muted); }
.tag-discord { padding: 1px 6px; border-radius: 6px; background: #5865f2; font-size: 10px; font-weight: 800; }
.msg-body { font-size: 14px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; color: rgba(255,255,255,.92); }
.msg-body a { color: #9fd3ff; }
.chat-form { display: flex; gap: 8px; }
.chat-form input {
  flex: 1; min-width: 0; padding: 10px 12px; border: 0; outline: none; border-radius: 11px;
  font: 600 15px 'Baloo 2', system-ui, sans-serif; color: #fff;
  background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 2px rgba(255,255,255,.15);
}
.chat-form input:focus { box-shadow: inset 0 0 0 2px var(--gold-1); }
.chat-form .gold-btn { margin-top: 0; padding: 8px 16px 6px; }

/* ---------- Full-screen chat (Discord-style) ---------- */
.chat-view {
  position: fixed; inset: 0; z-index: 28; display: flex;
  background: #0b3e7d; animation: fade .15s ease;
}
.chat-side {
  width: 280px; flex: none; display: flex; flex-direction: column; gap: 2px;
  padding: 12px 10px; background: #0a3368; overflow-y: auto;
}
.chat-side-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 10px; font-size: 17px; }
.chat-section { display: flex; align-items: center; justify-content: space-between; margin: 12px 8px 4px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.add-dm { width: 22px; height: 22px; border-radius: 6px; font-size: 18px; font-weight: 800; line-height: 1; color: rgba(255,255,255,.75); }
.add-dm:hover { background: rgba(255,255,255,.12); color: #fff; }
.chan {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border-radius: 9px;
  text-align: left; color: rgba(255,255,255,.72); font-size: 15px;
}
.chan:hover { background: rgba(255,255,255,.08); color: #fff; }
.chan.active { background: rgba(255,255,255,.16); color: #fff; }
.chan b { font-weight: 800; }
.chan small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hash { width: 22px; text-align: center; font-size: 20px; font-weight: 800; opacity: .7; }
.chan-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ef4444;
  color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.dm-av { position: relative; width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; color: #fff; background: rgba(255,255,255,.15); }
.dm-av .dot-s { position: absolute; right: -1px; bottom: -1px; box-shadow: 0 0 0 2px #0a3368; }
.dm-list { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.side-hint { padding: 4px 8px; }
.me-bar { display: flex; flex-direction: column; gap: 8px; margin: 8px -10px -12px; padding: 12px; background: #082c5a; }
.me-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.me-row small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.me-bar .hint { margin: 0; font-size: 12px; }
.me-bar .mini { align-self: flex-start; }
.gold-btn.wide { width: 100%; margin-top: 0; }
.discord-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 9px 12px 7px; border-radius: 10px; background: #5865f2; font-size: 15px; font-weight: 800;
  box-shadow: 0 3px 0 #3b44a8;
}
.discord-btn:hover { background: #6873f4; }
.discord-btn svg { width: 20px; height: 20px; fill: #fff; }
.server-link { text-decoration: none; color: #fff; }

.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-head {
  display: flex; align-items: baseline; gap: 10px; padding: 16px 22px 12px; font-size: 18px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.chat-head small { font-size: 13px; font-weight: 600; color: var(--muted); flex: 1; }
.chat-head .mini { text-decoration: none; color: #fff; }
.chat-back { display: none; font-size: 26px; font-weight: 800; line-height: 1; padding: 0 6px; }
.chat-main .chat-list { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 14px 22px;
  display: flex; flex-direction: column; gap: 14px; }
.chat-empty { margin-top: auto; }
.chat-main .chat-form { padding: 12px 22px 18px; }
.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg-av { width: 38px; height: 38px; flex: none; border-radius: 50%; object-fit: cover;
  display: grid; place-items: center; font-weight: 800; background: rgba(255,255,255,.15); }
.msg.discord .msg-av:not(img) { background: #5865f2; }
.msg-main { min-width: 0; flex: 1; }
.msg-head { display: flex; align-items: baseline; gap: 6px; font-size: 15px; font-weight: 800; }
.msg-head a { color: #fff; text-decoration: none; }
.msg-head a:hover { text-decoration: underline; }
.msg-head small { font-size: 11px; font-weight: 600; color: var(--muted); }
.tag-discord { padding: 1px 6px; border-radius: 6px; background: #5865f2; font-size: 10px; font-weight: 800; }
.msg-body { font-size: 15px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; color: rgba(255,255,255,.92); white-space: pre-wrap; }
.msg-body a { color: #9fd3ff; }
.chat-form { display: flex; gap: 8px; }
.chat-form input {
  flex: 1; min-width: 0; padding: 12px 14px; border: 0; outline: none; border-radius: 12px;
  font: 600 15px 'Baloo 2', system-ui, sans-serif; color: #fff;
  background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 2px rgba(255,255,255,.15);
}
.chat-form input:focus { box-shadow: inset 0 0 0 2px var(--gold-1); }
.chat-form .gold-btn { margin-top: 0; padding: 8px 20px 6px; }
.dm-pops { bottom: auto; top: 70px; }

@media (max-width: 760px) {
  .chat-side { width: 100%; }
  .chat-main { display: none; }
  .chat-view.in-conv .chat-side { display: none; }
  .chat-view.in-conv .chat-main { display: flex; }
  .chat-back { display: inline; }
  .chat-head { padding: 12px 14px 10px; flex-wrap: wrap; }
  .chat-main .chat-list, .chat-main .chat-form { padding-left: 14px; padding-right: 14px; }
}

/* ---------- Spotify mini player ---------- */
.spotify-player {
  position: fixed; left: 76px; bottom: 16px; z-index: 32; width: 340px;
  padding: 10px; border-radius: 16px; background: #121212;
  box-shadow: 0 12px 34px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.08);
  transition: transform .25s ease;
}
.spotify-player.tucked { transform: translateX(calc(-100% - 100px)); }
.spotify-player header { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.spotify-player header b { flex: 1; color: #1ed760; font-size: 15px; }
.spotify-form { display: flex; gap: 6px; }
.spotify-form input {
  flex: 1; min-width: 0; padding: 8px 10px; border: 0; outline: none; border-radius: 10px;
  font: 600 13px 'Baloo 2', system-ui, sans-serif; color: #fff; background: rgba(255,255,255,.1);
}
.spotify-form input:focus { box-shadow: inset 0 0 0 2px #1ed760; }
.spotify-form .gold-btn { margin-top: 0; padding: 6px 14px 4px; font-size: 14px; background: #1ed760; box-shadow: none; color: #000; }
.spotify-hint { font-size: 11px; margin: 6px 2px 0; }
#spotifyFrame { display: block; width: 100%; height: 152px; border: 0; border-radius: 12px; }
@media (max-width: 760px) {
  .spotify-player { left: 16px; right: 16px; width: auto; bottom: 84px; }
}
