@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,400;0,700;0,900;1,900&family=Barlow+Condensed:ital,wght@0,400;0,700;0,900;1,900&family=Share+Tech+Mono&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --yellow: #eab308;
  --green:  #10b981;
  --red:    #ef4444;
  --bg:     #080808;
  --panel:  #0f0f0f;
  --border: rgba(255,255,255,0.06);
}

body {
  background: var(--bg);
  background-image: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  color: #fff;
  font-family: 'Barlow', sans-serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
select, select option { background: #111 !important; color: #fff !important; }
select:focus { outline: none; border-color: var(--yellow) !important; }

/* ── TOP BAR ── */
#topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 24px;
  height: 54px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 100;
}
.topbar-left  { display: flex; align-items: center; justify-content: flex-start; min-width: 0; overflow: hidden; }
.topbar-right { display: flex; align-items: center; justify-content: flex-end;   min-width: 0; }
.topbar-center { display: flex; align-items: center; justify-content: center;    min-width: 0; overflow: hidden; }

.logo {
  font-size: clamp(18px, 1.5vw, 26px); font-weight: 900; font-style: italic;
  letter-spacing: -0.02em; color: var(--yellow); text-transform: uppercase;
  font-family: 'Barlow Condensed', sans-serif;
}
.logo span { color: #fff; }

.mode-tabs {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border-radius: 10px; padding: 3px; gap: 2px;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
  flex-shrink: 1; max-width: 100%;
}
.mode-tabs::-webkit-scrollbar { display: none; }
.mode-tab {
  padding: 6px 16px;
  font-size: 11px; font-weight: 900; font-style: italic;
  letter-spacing: 0.1em; text-transform: uppercase;
  border-radius: 6px; cursor: pointer; border: none;
  color: rgba(255,255,255,0.85);
  background: transparent;
  transition: all 0.15s;
  font-family: 'Barlow Condensed', sans-serif;
}
.mode-tab.active { background: var(--yellow); color: #000; }
.mode-tab:hover:not(.active) { color: #fff; background: rgba(255,255,255,0.06); }

.hud-cluster { display: flex; gap: 24px; align-items: center; letter-spacing: normal; font-size: revert; }
.hud-hidden { display: none; }

/* ── Topbar UI Elements ── */
.topbar-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  font-size: 11px; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.08em; color: rgba(255,255,255,0.85);
  padding: 4px 12px; line-height: 1; border-radius: 6px;
  transition: color 0.15s;
}
.topbar-btn:hover { color: #fff; }

.notif-btn {
  background: none; border: none; cursor: pointer;
  font-size: 16px; color: rgba(255,255,255,0.85);
  padding: 4px; line-height: 1; transition: color 0.15s;
}
.notif-btn:hover { color: #fff; }

.notif-badge {
  display: none; position: absolute; top: 0; right: -6px;
  background: var(--red); color: #000; font-size: 8px; font-weight: 900;
  min-width: 14px; height: 14px; border-radius: 6px;
  align-items: center; justify-content: center; padding: 0 3px; line-height: 1;
}

.notif-dropdown {
  display: none; position: absolute; top: 100%; right: 0;
  width: 320px; max-height: 360px; overflow-y: auto;
  background: #111; border: 1px solid var(--border); border-radius: 10px;
  z-index: 300; box-shadow: 0 8px 32px rgba(0,0,0,0.6); padding: 8px 0;
}
.notif-dropdown-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-bottom: 1px solid var(--border);
}
.notif-dropdown-title {
  font-size: 10px; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.12em; color: rgba(255,255,255,0.85);
}
.notif-clear-btn {
  background: none; border: none; cursor: pointer;
  font-size: 9px; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.08em; color: rgba(255,255,255,0.85);
  padding: 2px 4px; transition: color 0.15s;
}
.notif-clear-btn:hover { color: var(--yellow); }

.friend-req-badge {
  display: none; cursor: pointer; font-size: 9px; font-weight: 900;
  text-transform: uppercase; color: #000; background: var(--red);
  padding: 2px 8px; border-radius: 10px; letter-spacing: 0.05em; line-height: 1.4;
  position: relative; top: -3px;
}

.friends-badge {
  display: none; position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #000; font-size: 8px; font-weight: 900;
  min-width: 14px; height: 14px; border-radius: 6px;
  align-items: center; justify-content: center; padding: 0 3px; line-height: 1;
}

.tab-divider-v {
  width: 1px; height: 18px; background: rgba(255,255,255,0.1);
  border-radius: 1px; margin: 0 3px; flex-shrink: 0;
}

/* ── Donation Bar ── */
#donation-bar {
  display: none; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 0 8px; flex-shrink: 0;
  background: #eab308; border-bottom: 1px solid rgba(0,0,0,0.1); z-index: 200;
}
.donation-row {
  display: flex; justify-content: space-between;
  width: 100%; max-width: 400px; font-weight: 900; text-transform: uppercase;
}
.donation-label { color: #000; }
.donation-total { color: rgba(0,0,0,0.75); }
.donation-track {
  width: 100%; max-width: 400px; height: 6px;
  background: rgba(0,0,0,0.1); border-radius: 3px; overflow: hidden;
}
.donation-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #d97706, #f59e0b); border-radius: 3px;
  transition: width 0.6s ease;
}
.donation-btn {
  font-size: 10px; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.08em; text-decoration: none; padding: 6px 18px;
  border-radius: 6px; display: inline-block;
  background: #000; color: #eab308; transition: all 0.15s;
}
.donation-btn:hover { background: #1a1a1a; color: #fbbf24; }

/* ── Toast ── */
#toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}

/* ── Main Menu / Overlay buttons ── */
.exit-btn {
  display: none; position: absolute; bottom: 16px; left: 16px;
  background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.25);
  cursor: pointer; font-size: 10px; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--red); padding: 6px 14px;
  line-height: 1; border-radius: 6px; transition: all 0.15s; z-index: 50;
}
.exit-btn:hover { background: rgba(239,68,68,0.2); border-color: rgba(239,68,68,0.4); }

.share-btn {
  background: var(--yellow); border: none; cursor: pointer;
  font-size: 10px; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.15em; color: #000; padding: 8px 20px;
  border-radius: 10px; transition: all 0.15s;
}

/* ── Name Popup ── */
.popup-or { margin: 10px 0; font-size: 10px; font-weight: 900; text-transform: uppercase; color: rgba(255,255,255,0.85); letter-spacing: 0.12em; }
.popup-status { font-size: 10px; font-weight: 900; text-transform: uppercase; color: rgba(255,255,255,0.85); min-height: 16px; text-align: center; margin-top: 8px; }

/* ── Challenge Overlay ── */
.challenge-body { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 420px; text-align: center; }
.challenge-msg { font-size: 15px; font-weight: 700; color: rgba(255,255,255,0.85); line-height: 1.5; letter-spacing: 0.02em; font-family: 'Barlow Condensed', sans-serif; }
.challenge-best { font-family: 'Share Tech Mono', monospace; font-size: 26px; font-weight: 900; color: var(--yellow); }
.challenge-sub { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.85); font-family: 'Barlow Condensed', sans-serif; }
.challenge-actions { display: flex; gap: 12px; margin-top: 6px; }
.challenge-reject-btn {
  background: none; border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer; font-size: 10px; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.12em; color: rgba(255,255,255,0.85);
  padding: 10px 24px; border-radius: 10px; transition: 0.15s;
}
.challenge-reject-btn:hover { color: #fff; border-color: rgba(255,255,255,0.3); }
.challenge-dismiss-btn {
  background: none; border: none; cursor: pointer;
  font-size: 9px; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.15em; color: rgba(255,255,255,0.85);
  padding: 6px; transition: color 0.15s;
}
.challenge-dismiss-btn:hover { color: rgba(255,255,255,0.85); }

/* ── Share Modal ── */
.share-preview {
  border-radius: 10px; overflow: hidden; max-height: 220px;
  background: rgba(255,255,255,0.02); display: flex; align-items: center;
  justify-content: center; font-size: 11px; color: rgba(255,255,255,0.85);
  text-transform: uppercase; letter-spacing: 0.15em; font-weight: 900; min-height: 100px;
}
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-row { display: flex; gap: 10px; }
.share-btn-twitter { background: rgba(29,161,242,0.12); color: #1da1f2; border: 1px solid rgba(29,161,242,0.15); display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; }
.share-btn-discord { background: rgba(88,101,242,0.12); color: #5865F2; border: 1px solid rgba(88,101,242,0.15); display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; }
.share-btn-copy { background: rgba(234,179,8,0.1); color: var(--yellow); border: 1px solid rgba(234,179,8,0.12); display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; flex: 1; }
.share-btn-save { background: transparent; border: 1px solid var(--border); color: rgba(255,255,255,0.85); display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; }

/* ── Notification Dropdown ── */
#notif-list { min-height: 60px; }

/* ── MAIN ── */
#main { flex: 1; display: flex; position: relative; overflow: hidden; }

/* ── SIDEBARS ── */
.side-panel {
  width: clamp(200px, 16vw, 320px); background: var(--panel);
  display: flex; flex-direction: column;
  padding: 14px; gap: 12px;
  overflow-y: auto; flex-shrink: 0; z-index: 10;
}
#left-panel { border-right: none; }
#right-panel { border-left: none; gap: 8px; padding: 10px; }
.sec-title {
  font-weight: 900; letter-spacing: 0.3em;
  text-transform: uppercase; color: rgba(255,255,255,0.85);
  margin-bottom: 8px;
  font-family: 'Barlow Condensed', sans-serif;
}

/* Auth section */
#auth-section {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(234,179,8,0.15);
  background: rgba(234,179,8,0.03);
}
#auth-section:has(#auth-btn:hover) { border-color: var(--yellow); }
#auth-section .profile-pic {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15); object-fit: cover;
  display: none;
}
.auth-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
}
#auth-btn {
  cursor: pointer; font-size: 11px; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 8px 14px; border-radius: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: rgba(255,255,255,0.85);
  transition: all 0.15s; flex: 1;
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 6px;
  line-height: 1;
  font-family: 'Barlow', sans-serif;
}
#auth-btn:hover { background: var(--yellow); color: #000; border-color: var(--yellow); }
#auth-btn svg { width: 14px; height: 14px; flex: 0 0 auto; }
#bp-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: rgba(255,255,255,0.85);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  font-family: 'Barlow', sans-serif;
  white-space: nowrap;
}
#bp-btn:hover { background: var(--yellow); color: #000; border-color: var(--yellow); }

/* Sidebar action buttons (Profile, Social, Shortcuts, etc.) */
.side-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: rgba(255,255,255,0.85);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Barlow', sans-serif;
  white-space: nowrap;
  position: relative;
}
.side-btn:hover { background: var(--yellow); color: #000; border-color: var(--yellow); }

.side-btn.full { width: 100%; }

/* Name input */
#name-row {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; background: rgba(255,255,255,0.06);
  border-radius: 6px; border: 1px solid var(--border);
}
/* Leaderboard */
.lb-wrap {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}
.lb-scroll {
  overflow-y: auto; flex: 1;
  background: rgba(255,255,255,0.02);
  border-radius: 10px; border: 1px solid var(--border);
}
#lb-hof, #lb-daily, #lb-friends-list,
#right-panel > .lb-wrap { flex: 0 0 auto; }
.lb-entry {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-bottom: 1px solid rgba(255,255,255,0.04);
}
  .lb-entry:last-child { border-bottom: none; }
  .lb-entry.highlight { animation: lbFlash 1.5s ease-out forwards; }
  @keyframes lbFlash { 0%{background:rgba(234,179,8,0.15)} 100%{background:transparent} }
.lb-rank {
  font-weight: 900; color: rgba(255,255,255,0.85); width: 24px; text-align: right;
}
.lb-name {
  font-weight: 700; text-transform: uppercase; flex: 1;
  color: rgba(255,255,255,0.85); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lb-score {
  font-family: 'Share Tech Mono', monospace;
  color: var(--yellow);
}


.lb-empty {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px; font-weight: 900; text-transform: uppercase;
  color: rgba(255,255,255,0.85); letter-spacing: 0.12em;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; gap: 8px; flex-direction: column;
}
.lb-empty::before {
  content: '\2014'; font-size: 18px; color: rgba(255,255,255,0.85);
  letter-spacing: normal;
}

/* Session stats row in side panel */
.sess-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; font-weight: 700;
  text-transform: uppercase;
}
.sess-row .sn { color: rgba(255,255,255,0.85); }
.sess-row .sv { font-family: 'Share Tech Mono', monospace; }
.sess-row .sv.y { color: var(--yellow); }
.sess-row .sv.g { color: var(--green); }
.sess-row .sv.r { color: var(--red); }

/* Shot log */
.shot-entry {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
  font-weight: 700;
  text-transform: uppercase;
}
.shot-entry .se-type { color: rgba(255,255,255,0.85); }
.shot-entry .se-ms   { font-family: 'Share Tech Mono', monospace; color: var(--yellow); }
.shot-entry .se-hs   { color: var(--red); }

/* Streak counter */
#streak-display {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 25; pointer-events: none;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px; font-weight: 900; font-style: italic;
  color: var(--yellow); text-shadow: 0 0 20px rgba(234,179,8,0.5);
  transition: opacity 0.3s, transform 0.3s;
  display: flex; align-items: center; gap: 6px;
}
#streak-display.streak-hidden { opacity: 0; transform: translateX(-50%) translateY(-10px); }
#streak-display.streak-show { opacity: 1; transform: translateX(-50%) translateY(0); }
#streak-display.streak-pop {
  animation: streakPop 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes streakPop {
  0% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.2); }
  100% { transform: translateX(-50%) scale(1); }
}

/* ── CANVAS ── */
#canvas-wrap {
  flex: 1; position: relative; cursor: default;
  background-color: #080808;
  background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  font-size: inherit;
  letter-spacing: normal;
}
#canvas-wrap * {
  letter-spacing: normal;
}
#canvas-wrap::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(234,179,8,0.03) 1px, transparent 1px);
  background-size: 32px 32px;
}
#canvas-wrap.playing { cursor: none; }
#canvas-wrap.playing.reaction-cursor { cursor: default !important; }
#canvas-wrap.playing.reaction-cursor #crosshair { display: none; }
#canvas-wrap canvas { display: block; width: 100% !important; height: 100% !important; }

/* Crosshair */
#crosshair {
  --ch-color: #ffffff;
  --ch-size: 28px;
  --ch-opacity: 0.85;
  --ch-gap: 0px;
  position: absolute; pointer-events: none; z-index: 20;
  width: var(--ch-size); height: var(--ch-size);
  transform: translate(-50%, -50%);
  transition: opacity 0.1s;
  opacity: 0;
}
#canvas-wrap.playing #crosshair { opacity: 1; }
#crosshair.firing { opacity: 0.5; }
.ch-hl, .ch-hr, .ch-vt, .ch-vb {
  position: absolute; background: var(--ch-color);
  border-radius: 1px; opacity: var(--ch-opacity);
}
.ch-hl { width: calc(var(--ch-size) / 2 - var(--ch-gap)); height: 2px; top: calc(var(--ch-size) / 2 - 1px); left: 0; }
.ch-hr { width: calc(var(--ch-size) / 2 - var(--ch-gap)); height: 2px; top: calc(var(--ch-size) / 2 - 1px); right: 0; }
.ch-vt { height: calc(var(--ch-size) / 2 - var(--ch-gap)); width: 2px; top: 0; left: calc(var(--ch-size) / 2 - 1px); }
.ch-vb { height: calc(var(--ch-size) / 2 - var(--ch-gap)); width: 2px; bottom: 0; left: calc(var(--ch-size) / 2 - 1px); }
.ch-dot { position: absolute; border-radius: 50%;
  background: var(--ch-color); opacity: var(--ch-opacity);
  width: clamp(3px, calc(var(--ch-size) * 0.18), 8px);
  height: clamp(3px, calc(var(--ch-size) * 0.18), 8px);
  top: calc(var(--ch-size) / 2 - clamp(1.5px, calc(var(--ch-size) * 0.09), 4px));
  left: calc(var(--ch-size) / 2 - clamp(1.5px, calc(var(--ch-size) * 0.09), 4px));
}
.ch-circle { display: none; position: absolute; border-radius: 50%;
  border: 2px solid var(--ch-color); opacity: var(--ch-opacity); pointer-events: none;
  width: calc(var(--ch-size) - 8px); height: calc(var(--ch-size) - 8px);
  top: 4px; left: 4px;
}
#crosshair.ch-style-cross-only .ch-dot { display: none; }
#crosshair.ch-style-dot .ch-hl,
#crosshair.ch-style-dot .ch-hr,
#crosshair.ch-style-dot .ch-vt,
#crosshair.ch-style-dot .ch-vb { display: none; }
#crosshair.ch-style-circle .ch-hl,
#crosshair.ch-style-circle .ch-hr,
#crosshair.ch-style-circle .ch-vt,
#crosshair.ch-style-circle .ch-vb,
#crosshair.ch-style-circle .ch-dot { display: none; }
#crosshair.ch-style-circle .ch-circle { display: block; }
/* ── Crosshair Style/Color Buttons ── */
.ch-style-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 11px 6px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.85);
  font-size: 11px; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 72px;
  flex: 1;
}
.ch-style-btn:hover {
  border-color: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.05);
}
.ch-style-btn.active {
  border-color: var(--yellow) !important;
  color: var(--yellow) !important;
  background: rgba(234,179,8,0.1) !important;
  box-shadow: 0 0 12px rgba(234,179,8,0.08);
}
.ch-style-preview {
  display: block;
  width: 24px; height: 24px;
  border-radius: 50%;
  position: relative;
  box-sizing: border-box;
  flex-shrink: 0;
}
/* Cross + Dot */
.ch-style-btn[data-style="cross"] .ch-style-preview {
  border: 1.5px solid currentColor;
  background: radial-gradient(circle, currentColor 2.5px, transparent 2.5px);
}
.ch-style-btn[data-style="cross"] .ch-style-preview::before {
  content: ''; position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 16px; height: 1.5px;
  background: currentColor;
}
.ch-style-btn[data-style="cross"] .ch-style-preview::after {
  content: ''; position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 1.5px; height: 16px;
  background: currentColor;
}
/* Cross Only */
.ch-style-btn[data-style="cross-only"] .ch-style-preview {
  border: 1.5px solid currentColor;
  background: transparent;
}
.ch-style-btn[data-style="cross-only"] .ch-style-preview::before {
  content: ''; position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 16px; height: 1.5px;
  background: currentColor;
}
.ch-style-btn[data-style="cross-only"] .ch-style-preview::after {
  content: ''; position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 1.5px; height: 16px;
  background: currentColor;
}
/* Dot Only */
.ch-style-btn[data-style="dot"] .ch-style-preview {
  border: none;
  background: radial-gradient(circle, currentColor 4px, transparent 4px);
}
/* Circle */
.ch-style-btn[data-style="circle"] .ch-style-preview {
  border: 1.5px solid currentColor;
  background: transparent;
}
.ch-style-btn[data-style="circle"] .ch-style-preview::before,
.ch-style-btn[data-style="circle"] .ch-style-preview::after { display: none; }

/* Color swatches */
.ch-color-opt {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  outline: none;
  box-sizing: border-box;
}
.ch-color-opt:hover { transform: scale(1.08); border-color: rgba(255,255,255,0.2); }
.ch-color-opt.active {
  border-color: #fff !important;
  transform: scale(1.15);
  box-shadow: 0 0 18px rgba(255,255,255,0.15);
}

/* Preview box */
.ch-preview {
  width: 100px; height: 100px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 10px;
  transition: all 0.2s;
}
.ch-preview:hover { border-color: rgba(255,255,255,0.12); }
.ch-inner {
  width: var(--ch-size, 28px); height: var(--ch-size, 28px);
  position: relative;
}
.ch-preview .ch-hl, .ch-preview .ch-hr,
.ch-preview .ch-vt, .ch-preview .ch-vb,
.ch-preview .ch-dot, .ch-preview .ch-circle {
  position: absolute;
}
.ch-preview .ch-hl, .ch-preview .ch-hr {
  height: 2px; background: var(--ch-color, #fff);
  top: calc(50% - 1px); opacity: var(--ch-opacity, 0.85);
}
.ch-preview .ch-hl { right: calc(50% + var(--ch-gap, 0px)); left: 0; }
.ch-preview .ch-hr { left: calc(50% + var(--ch-gap, 0px)); right: 0; }
.ch-preview .ch-vt, .ch-preview .ch-vb {
  width: 2px; background: var(--ch-color, #fff);
  left: calc(50% - 1px); opacity: var(--ch-opacity, 0.85);
}
.ch-preview .ch-vt { bottom: calc(50% + var(--ch-gap, 0px)); top: 0; }
.ch-preview .ch-vb { top: calc(50% + var(--ch-gap, 0px)); bottom: 0; }
.ch-preview .ch-dot {
  width: clamp(3px, calc(var(--ch-size, 28px) * 0.18), 8px);
  height: clamp(3px, calc(var(--ch-size, 28px) * 0.18), 8px);
  border-radius: 50%; background: var(--ch-color, #fff);
  top: calc(50% - clamp(1.5px, calc(var(--ch-size, 28px) * 0.09), 4px));
  left: calc(50% - clamp(1.5px, calc(var(--ch-size, 28px) * 0.09), 4px));
}
.ch-preview .ch-circle {
  width: calc(var(--ch-size, 28px) - 8px);
  height: calc(var(--ch-size, 28px) - 8px);
  border: 2px solid var(--ch-color, #fff);
  border-radius: 50%;
  top: calc(50% - (var(--ch-size, 28px) - 8px) / 2 + 2px);
  left: calc(50% - (var(--ch-size, 28px) - 8px) / 2 + 2px);
  display: none;
}
.ch-preview.ch-style-cross-only .ch-dot { display: none; }
.ch-preview.ch-style-dot .ch-hl, .ch-preview.ch-style-dot .ch-hr,
.ch-preview.ch-style-dot .ch-vt, .ch-preview.ch-style-dot .ch-vb { display: none; }
.ch-preview.ch-style-circle .ch-hl, .ch-preview.ch-style-circle .ch-hr,
.ch-preview.ch-style-circle .ch-vt, .ch-preview.ch-style-circle .ch-vb,
.ch-preview.ch-style-circle .ch-dot { display: none; }
.ch-preview.ch-style-circle .ch-circle { display: block; }

/* Flashes */
.flash-layer {
  position: absolute; inset: 0; pointer-events: none; z-index: 15; opacity: 0;
  transition: opacity 0.07s;
}
#hit-flash  { background: radial-gradient(ellipse at center, rgba(245,197,66,0.22) 0%, transparent 65%); }
#miss-flash { background: radial-gradient(ellipse at center, rgba(255,59,59,0.18) 0%, transparent 65%); }
.flash-layer.on { opacity: 1; }

/* Hit numbers */
.hit-num {
  position: absolute; pointer-events: none; z-index: 20;
  font-family: 'Share Tech Mono', monospace;
  font-size: 18px; font-weight: 900;
  color: var(--yellow);
  text-shadow: 0 0 10px rgba(245,197,66,0.5);
  animation: numFly 0.55s ease-out forwards;
}
.hit-num.hs { color: var(--red); font-size: 24px; text-shadow: 0 0 12px rgba(255,59,59,0.5); }
/* Reset letter-spacing for game engine text */
.bb-val, .hit-num, #streak-display { letter-spacing: normal; }

/* Count-up animation */
@keyframes countUp { 0%{opacity:0;transform:translateY(8px)} 100%{opacity:1;transform:translateY(0)} }

/* PB title glow */
@keyframes pbGlow { 0%,100%{text-shadow:0 0 20px rgba(234,179,8,0.3)} 50%{text-shadow:0 0 40px rgba(234,179,8,0.9),0 0 80px rgba(234,179,8,0.4)} }
.res-title-pb { animation: pbGlow 1.2s ease-in-out 3 !important; }

@keyframes numFly {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-50px) scale(0.75); }
}

/* Timer bar */
#timer-bar-wrap {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: rgba(255,255,255,0.05);
  pointer-events: none; z-index: 10;
}
#timer-bar { height: 100%; width: 100%; background: var(--yellow); transition: width 0.1s linear; }

.bb-item { text-align: center; }
.bb-lbl {
  display: block; font-size: 15px; font-weight: 700; text-transform: uppercase;
  color: rgba(255,255,255,0.85); margin-bottom: 8px;
  font-family: 'Barlow Condensed', sans-serif;
}
.bb-val {
  font-family: 'Share Tech Mono', monospace;
  font-size: 22px; font-weight: 900; color: var(--yellow);
}

/* ── OVERLAYS ── */
.overlay {
  position: absolute; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(8,8,8,0.88);
  backdrop-filter: blur(10px);
  gap: 20px;
}
.overlay.hidden { display: none; }

.ov-title {
  font-size: clamp(36px, 5vw, 80px); font-weight: 900; font-style: italic;
  letter-spacing: -0.02em; text-transform: uppercase; line-height: 1;
  font-family: 'Barlow Condensed', sans-serif;
}
.ov-sub {
  font-size: 15px; font-weight: 700; letter-spacing: 0.3em;
  text-transform: uppercase; color: rgba(255,255,255,0.85);
  font-family: 'Barlow Condensed', sans-serif;
}
  .btn-play {
  padding: 12px 48px;
  background: var(--yellow); color: #000;
  font-size: 15px; font-weight: 900; font-style: italic;
  letter-spacing: 0.06em; text-transform: uppercase;
  border: none; border-radius: 10px; cursor: pointer;
  transition: all 0.12s;
  box-shadow: 0 4px 28px rgba(245,197,66,0.3);
  font-family: 'Barlow Condensed', sans-serif;
}
  .btn-play:hover { transform: scale(1.05); box-shadow: 0 6px 38px rgba(245,197,66,0.5); }

  .res-pb-badge {
    display: inline-block; font-size: 10px; font-weight: 900; text-transform: uppercase;
    padding: 3px 10px; border-radius: 6px; margin-bottom: 6px;
    background: var(--yellow); color: #000;
    font-family: 'Barlow Condensed', sans-serif;
  }
  .res-pb-badge.hidden { display: none; }

/* ── Intro animations (from index1) ── */
@keyframes intro-drop {
  0%   { opacity: 0; transform: translateY(-28px) scale(0.94); }
  60%  { opacity: 1; transform: translateY(4px)  scale(1.01); }
  100% { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes intro-rise {
  0%   { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes mode-flash {
  0%   { opacity: 0; transform: translateX(-12px) skewX(-6deg); }
  60%  { opacity: 1; transform: translateX(3px)  skewX(1deg); }
  100% { opacity: 1; transform: translateX(0)    skewX(0deg); }
}
@keyframes cta-pulse {
  0%, 100% { opacity: 0.35; }
  50%       { opacity: 0.75; }
}
.intro-title {
  animation: intro-drop 0.55s cubic-bezier(0.22,1,0.36,1) forwards;
  font-family: 'Barlow Condensed', sans-serif;
}
.intro-mode {
  animation: mode-flash 0.4s cubic-bezier(0.22,1,0.36,1) forwards;
  font-family: 'Barlow Condensed', sans-serif;
}
.intro-sub {
  animation: intro-rise 0.5s ease forwards;
  animation-delay: 0.15s;
  opacity: 0;
  font-family: 'Barlow Condensed', sans-serif;
}
.intro-cta {
  animation: intro-rise 0.5s ease forwards;
  animation-delay: 0.28s;
  opacity: 0;
  font-family: 'Barlow Condensed', sans-serif;
}
.cta-pulse { animation: cta-pulse 2.2s ease-in-out infinite; }

.res-grid {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 24px;
}
.res-cell {
  flex: 1 1 0px; min-width: 100px; text-align: center;
}
.res-cell .rv {
  font-size: 30px; font-weight: 900; font-style: italic;
  color: var(--yellow); line-height: 1;
  font-family: 'Barlow Condensed', sans-serif;
}
.res-cell .rl {
  font-size: 10px; font-weight: 900; letter-spacing: 0.22em;
  text-transform: uppercase; color: rgba(255,255,255,0.85); margin-bottom: 4px;
  font-family: 'Barlow Condensed', sans-serif;
}

/* Countdown */
#cd-overlay {
  position: absolute; inset: 0; z-index: 48;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  cursor: pointer;
}
#cd-overlay.hidden { display: none; }
#cd-wait {
  font-size: clamp(60px, 8vw, 140px); font-weight: 900; font-style: italic; line-height: 1;
  color: var(--yellow); text-shadow: 0 0 80px rgba(234,179,8,0.5);
  animation: waitSplit 2.6s ease-in-out infinite;
  letter-spacing: 0.05em;
  position: relative; display: inline-block;
  font-family: 'Barlow Condensed', sans-serif;
}
@keyframes waitSplit {
  0%, 100% { opacity: 0.2; letter-spacing: 0em;   transform: scale(0.9); }
  50%      { opacity: 1;   letter-spacing: 0.25em; transform: scale(1.1); text-shadow: 0 0 100px rgba(234,179,8,0.7); }
}

/* Reaction mode overlay */
#reaction-overlay {
  position: absolute; inset: 0; z-index: 30;
  display: none; align-items: center; justify-content: center;
  pointer-events: none;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 40px; font-weight: 900; font-style: italic;
  letter-spacing: 0.05em; text-transform: uppercase;
  transition: background 0.15s;
}
#reaction-overlay.show { display: flex; }
#reaction-overlay.waiting {
  background: rgba(245,197,66,0.12);
  color: var(--yellow); pointer-events: auto; cursor: pointer;
}
#reaction-overlay.active {
  background: rgba(34,217,120,0.20);
  color: #fff; pointer-events: auto; cursor: pointer;
}

/* Google SVG icon */
.google-icon { width: 13px; height: 13px; flex-shrink: 0; vertical-align: middle; }

/* Stats Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.88); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; width: 100%; max-width: 520px;
  max-height: 85vh; display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-weight: 900; font-style: italic;
  text-transform: uppercase;
  font-family: 'Barlow Condensed', sans-serif;
}
.modal-close {
  cursor: pointer; font-size: 18px; color: rgba(255,255,255,0.85);
  background: none; border: none; line-height: 1;
  transition: color 0.15s;
}
.modal-close:hover { color: #fff; }
.modal-header h3 { font-size: 18px; }
.modal-body {
  padding: 20px; overflow-y: auto; flex: 1;
}
#friends-modal .modal-body {
  display: flex; flex-direction: column; justify-content: center;
}

/* ── Settings Tabs ── */
.settings-box { max-width: 480px; }
.settings-tabs {
  display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0;
  background: rgba(255,255,255,0.015);
}
.settings-tab {
  flex: 1; padding: 12px 8px 10px;
  font-size: 11px; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.08em; text-align: center; cursor: pointer;
  background: none; border: none; color: rgba(255,255,255,0.85);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  position: relative;
}
.settings-tab:hover { color: rgba(255,255,255,0.85); }
.settings-tab.active { color: var(--yellow); border-bottom-color: var(--yellow); }
.settings-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 0; }
.settings-tab-content { display: none; flex-direction: column; gap: 14px; }
.settings-tab-content.active { display: flex; }

/* ── Settings Groups ── */
.set-group {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 10px;
}
.set-group-title {
  font-size: 11px; font-weight: 900; text-transform: uppercase;
  color: rgba(255,255,255,0.85); letter-spacing: 0.12em;
  display: flex; align-items: center; gap: 6px;
}
.set-bp-lock { font-size: 11px; color: rgba(255,255,255,0.85); }
.set-row { display: flex; align-items: center; gap: 10px; }
.set-label { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.85); min-width: 48px; }
.set-slider-row { flex: 1; display: flex; align-items: center; gap: 10px; }
.set-slider { flex: 1; max-width: 180px; height: 4px; accent-color: var(--yellow); cursor: pointer; }
.set-slider-val { font-size: 11px; font-weight: 700; color: var(--yellow); font-family: 'Share Tech Mono', monospace; min-width: 34px; text-align: right; }

/* Master mute button */
.set-mute-btn {
  width: 32px; height: 32px; border-radius: 10px;
  border: none; cursor: pointer; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.set-mute-btn:hover { filter: brightness(1.2); }

/* Generic set button (Name Glow etc.) */
.set-btn {
  font-size: 11px; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 7px 16px; border-radius: 6px;
  border: none; cursor: pointer; transition: all 0.2s;
  background: var(--green); color: #000;
}
.set-btn:hover { filter: brightness(1.15); }
.set-btn.locked {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  color: rgba(255,255,255,0.85); cursor: default; filter: none;
}

/* Per-sound row */
.set-sound-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 6px;
}
.set-mute-snd {
  width: 24px; height: 24px; border-radius: 6px;
  border: none; cursor: pointer; font-size: 12px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
  background: rgba(16,185,129,0.15);
  color: var(--green);
}
.set-mute-snd.muted { background: rgba(239,68,68,0.12); color: var(--red); }
.set-mute-snd:hover { filter: brightness(1.2); }
.set-snd-lbl {
  font-size: 11px; font-weight: 900; text-transform: uppercase;
  color: rgba(255,255,255,0.85); letter-spacing: 0.06em;
  min-width: 52px;
}
.set-snd-slider { max-width: 120px; }
.set-snd-val { min-width: 28px; font-size: 11px; }

/* Chip grid for rewards */
.set-chip-row {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.set-chip {
  padding: 5px 12px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.85);
  font-size: 11px; font-weight: 700; cursor: pointer;
  transition: all 0.15s;
}
.set-chip:hover { border-color: rgba(255,255,255,0.12); color: rgba(255,255,255,0.85); }
.set-chip.active {
  border-color: rgba(234,179,8,0.25);
  background: rgba(234,179,8,0.06);
  color: var(--yellow);
}
.set-chip.locked { opacity: 0.85; cursor: default; }

.set-select {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: #fff; padding: 5px 10px 5px 8px;
  border-radius: 6px;
  font-size: 11px; font-weight: 700; outline: none; cursor: pointer;
}
.set-select:focus { border-color: var(--yellow); }
.set-empty { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.85); font-style: italic; }

/* ── Audio tab overrides ── */
.settings-tab-content[data-tab="audio"] {
  gap: 18px;
}
.settings-tab-content[data-tab="audio"] .set-group {
  gap: 10px;
  padding: 14px 16px;
}
.settings-tab-content[data-tab="audio"] .set-group-title {
  font-size: 11px;
}
.settings-tab-content[data-tab="audio"] .set-row {
  gap: 12px;
}
.settings-tab-content[data-tab="audio"] .set-label {
  font-size: 11px;
  min-width: 52px;
}
.settings-tab-content[data-tab="audio"] .set-slider-row {
  gap: 12px;
}
.settings-tab-content[data-tab="audio"] .set-slider {
  max-width: 200px;
  height: 5px;
}
.settings-tab-content[data-tab="audio"] .set-slider-val {
  font-size: 11px;
  min-width: 36px;
}
.settings-tab-content[data-tab="audio"] .set-mute-btn {
  width: 36px;
  height: 36px;
  font-size: 18px;
}
.settings-tab-content[data-tab="audio"] .set-btn {
  font-size: 11px;
  padding: 9px 18px;
}
.settings-tab-content[data-tab="audio"] .set-sound-row {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  align-items: center;
}
.settings-tab-content[data-tab="audio"] .set-mute-snd {
  width: 28px;
  height: 28px;
  font-size: 14px;
}
.settings-tab-content[data-tab="audio"] .set-snd-lbl {
  font-size: 11px;
  min-width: 52px;
}
.settings-tab-content[data-tab="audio"] .set-snd-slider {
  max-width: 130px;
}
.settings-tab-content[data-tab="audio"] .set-snd-val {
  min-width: 30px;
  font-size: 11px;
}
/* Name popup */
.popup-btn {
  cursor: pointer; font-weight: 900;
  text-transform: uppercase;
  padding: 12px 24px; border-radius: 10px;
  width: 100%; max-width: 320px; text-align: center;
  transition: all 0.15s; border: 1px solid var(--border);
}
.popup-google {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.85);
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.popup-google .google-icon { width: 18px; height: 18px; }
.popup-google:hover { background: #fff; color: #000; border-color: #fff; }
.popup-discord {
  background: #5865F2;
  color: #fff;
  border-color: #5865F2;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.popup-discord .discord-icon { width: 18px; height: 18px; }
.popup-discord:hover { background: #4752C4; color: #fff; border-color: #4752C4; }
.popup-anon {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.85);
  border-color: var(--border);
}
.popup-anon:hover { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.85); }
.popup-input {
  flex: 1; background: rgba(255,255,255,0.08);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; color: #fff; outline: none;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; text-transform: uppercase;
}
.popup-input:focus { border-color: var(--yellow); }
.popup-input::placeholder { color: rgba(255,255,255,0.85); }
.popup-btn-small {
  cursor: pointer; font-size: 11px; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 12px 20px; border-radius: 10px;
  background: var(--yellow); color: #000; border: none;
  transition: all 0.15s;
}
.popup-btn-small:hover { transform: scale(1.05); }

/* Footer banner */
#footer-banner {
  height: 100px; background: var(--panel);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; z-index: 100;
  transition: opacity 0.4s ease, height 0.4s ease, padding 0.4s ease;
  overflow: hidden;
}
#footer-banner.hidden {
  opacity: 0; height: 0; padding: 0;
  pointer-events: none;
}
#banner-container {
  width: 728px; max-width: 90vw; height: 90px;
  display: flex; align-items: center; justify-content: center;
}
#banner-placeholder {
  font-weight: 900; letter-spacing: 0.3em;
  text-transform: uppercase; color: rgba(255,255,255,0.85); cursor: default;
  font-family: 'Barlow Condensed', sans-serif;
}

/* Share modal */
#share-card-preview img { display: block; }
#share-card-preview:empty::after { content: 'No card yet'; }

/* Friends modal */
#friends-requests-wrap { display: none; }
#friends-requests-wrap .sec-title { margin-bottom: 4px; }
.fr-accept:hover { filter: brightness(1.15); }
.fr-reject:hover { background: rgba(255,255,255,0.15) !important; color: #fff !important; }
#friends-list > div { transition: all 0.15s; }
#friends-list > div:empty { display: none; }
#friend-add-input:focus { border-color: var(--yellow); }

/* Toast notifications */
.toast-el {
  pointer-events: auto;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 12px 18px;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  animation: toastIn 0.35s cubic-bezier(0.22,1,0.36,1) forwards;
}
.toast-el.out { animation: toastOut 0.3s ease forwards; }
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-msg { font-weight: 700; color: rgba(255,255,255,0.85); line-height: 1.4; }
@keyframes toastIn {
  0% { opacity: 0; transform: translateX(30px) scale(0.95); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  0% { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; transform: translateX(30px) scale(0.95); }
}

/* Profile tabs */
.profile-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0;
}
.profile-tab {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 2px solid transparent;
}
.profile-tab:hover { color: rgba(255,255,255,0.85); }
.profile-tab.active {
  color: var(--yellow);
  border-bottom-color: var(--yellow);
}
#profile-body {
  display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 12px 20px 20px;
}
#profile-body #profile-friend-status:empty {
  display: none;
}
.profile-tab-content {
  background: rgba(255,255,255,0.015);
  border-radius: 10px;
  padding: 12px;
}

/* LB tabs */
.lb-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.lb-tab {
  flex: 1; padding: 10px 4px;
  font-size: 11px; font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em; text-align: center;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 2px solid transparent;
  font-family: 'Barlow', sans-serif;
}
.lb-tab:hover { color: rgba(255,255,255,0.85); }
.lb-tab.active {
  color: var(--yellow);
  border-bottom-color: var(--yellow);
}
.lb-tab.inactive {
  color: rgba(255,255,255,0.35) !important;
  cursor: default;
  pointer-events: none;
}
.lb-challenge {
  font-size: 16px;
  cursor: pointer;
  opacity: 0.65;
  transition: all 0.15s;
  line-height: 1;
  margin-left: auto;
}
.lb-challenge:hover {
  opacity: 1;
  transform: scale(1.15);
}
.shortcut-row {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 4px; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.shortcut-row:last-child { border-bottom: none; }
/* ── Battle Pass ── */
.bp-panel {
  display: none;
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(680px, 92vw);
  max-height: 85vh;
  background: #111;
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 400;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
  overflow: hidden;
  flex-direction: column;
}
.bp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.bp-title { font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; color: var(--yellow); }
.bp-close { background: none; border: none; cursor: pointer; font-size: 20px; color: rgba(255,255,255,0.85); padding: 2px 6px; line-height: 1; }
.bp-body {
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bp-section { display: flex; flex-direction: column; gap: 6px; }
.bp-section-title {
  font-size: 9px; font-weight: 900; text-transform: uppercase;
  color: rgba(255,255,255,0.85); letter-spacing: 0.1em;
  display: flex; align-items: center; gap: 8px;
}
.bp-section-sub { font-weight: 700; color: var(--yellow); letter-spacing: 0.05em; }

/* XP Progress */
.bp-progress-section { gap: 4px; }
.bp-level-row { display: flex; justify-content: space-between; align-items: baseline; }
.bp-level-num { font-size: 18px; font-weight: 900; color: #fff; font-family: 'Share Tech Mono', monospace; }
.bp-tier-tag { font-size: 9px; font-weight: 900; text-transform: uppercase; color: var(--yellow); letter-spacing: 0.1em; }
.bp-xp-track { height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.bp-xp-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--yellow), #f59e0b); border-radius: 3px; transition: width 0.3s; }
.bp-xp-label { font-size: 9px; font-weight: 700; color: rgba(255,255,255,0.85); font-family: 'Share Tech Mono', monospace; }

/* Daily Missions */
.bp-mission { padding: 8px 10px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 6px; }
.bp-mission.bp-done { border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.05); }
.bp-mission-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.bp-mission-desc { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.85); }
.bp-mission-xp { font-size: 8px; font-weight: 900; text-transform: uppercase; color: var(--yellow); letter-spacing: 0.08em; }
.bp-mission-bar-wrap { height: 3px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.bp-mission-bar { height: 100%; background: var(--yellow); border-radius: 2px; transition: width 0.3s; }
.bp-mission-progress { font-size: 9px; font-weight: 700; color: rgba(255,255,255,0.85); margin-top: 3px; font-family: 'Share Tech Mono', monospace; }
.bp-bonus { padding: 8px; background: rgba(234,179,8,0.08); border: 1px solid rgba(234,179,8,0.2); border-radius: 6px; font-size: 10px; font-weight: 700; color: var(--yellow); text-align: center; }
.bp-bonus.bp-done { opacity: 0.65; }
.bp-empty { font-size: 9px; font-weight: 900; text-transform: uppercase; color: rgba(255,255,255,0.85); text-align: center; padding: 12px; letter-spacing: 0.1em; }

/* ── Battle Pass XP Popup (canvas top) ── */
.bp-xp-popup {
  display: none;
  position: absolute;
  top: 24px; left: 50%;
  transform: translateX(-50%);
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 28px 18px;
  background: rgba(17,17,17,0.94);
  border: 1px solid rgba(234,179,8,0.25);
  border-radius: 10px;
  z-index: 60;
  min-width: 320px;
  max-width: 92%;
  animation: bp-popup-in 0.35s ease;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
@keyframes bp-popup-in {
  0% { transform: translateX(-50%) translateY(-16px); opacity: 0; }
  100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Level row: [Lv 5] [bar] [Lv 6] */
.bp-xp-popup .bp-xp-level-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.bp-xp-popup .bp-xp-lvl-tag {
  font-size: 13px; font-weight: 900;
  font-family: 'Share Tech Mono', monospace;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 40px;
  text-align: center;
}
.bp-xp-popup .bp-xp-track {
  flex: 1; height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}
.bp-xp-popup .bp-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--yellow), #f59e0b);
  border-radius: 4px;
  transition: width 0.6s ease;
}
.bp-xp-popup .bp-xp-label {
  font-size: 12px; font-weight: 700;
  color: rgba(255,255,255,0.85);
  font-family: 'Share Tech Mono', monospace;
}

#xp-lv-badge { display: none; border-radius: 6px; }
#xp-lv-badge[style*="display"] { display: block !important; }

/* Level up section */
.bp-xp-popup .bp-xp-levelup {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 14px; font-weight: 900; color: var(--yellow);
  text-transform: uppercase; letter-spacing: 0.05em;
  animation: bp-lu-pop 0.4s ease;
  padding: 10px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 4px;
  width: 100%;
}
.bp-xp-popup .bp-xp-lu-line { display: flex; align-items: center; gap: 6px; }
.bp-xp-popup .bp-xp-lu-icon { font-size: 20px; }
.bp-xp-popup .bp-xp-lu-lvl { font-size: 20px; font-family: 'Share Tech Mono', monospace; }
.bp-xp-popup .bp-xp-lu-rewards {
  font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,0.85);
  text-transform: none; letter-spacing: 0;
  text-align: center;
  line-height: 1.5;
}
.bp-xp-popup .bp-xp-lu-reward { display: inline; }

@keyframes bp-lu-pop {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* Horizontal Level Track (Valorant style) */
.bp-track-wrap {
  padding: 4px 0;
}
.bp-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 12px 0;
}
.bp-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: all 0.3s ease;
  cursor: default;
}
.bp-node.far { width: 54px; }
.bp-node.far .bp-node-circle { width: 24px; height: 24px; font-size: 9px; border-width: 2px; }
.bp-node.far .bp-node-reward { font-size: 11px; }
.bp-node.near { width: 72px; }
.bp-node.near .bp-node-circle { width: 32px; height: 32px; font-size: 11px; }
.bp-node.near .bp-node-reward { font-size: 14px; }
.bp-node.current { width: 100px; }
.bp-node.current .bp-node-circle { width: 42px; height: 42px; font-size: 15px; border-width: 3px; }
.bp-node.current .bp-node-reward { font-size: 18px; }
.bp-node-circle {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-family: 'Share Tech Mono', monospace;
  border: 2px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.85);
  transition: all 0.3s;
}
.bp-node.completed .bp-node-circle {
  background: linear-gradient(135deg, var(--yellow), #f59e0b);
  border-color: var(--yellow);
  color: #000;
}
.bp-node.current .bp-node-circle {
  background: rgba(234,179,8,0.15);
  border-color: var(--yellow);
  color: var(--yellow);
  box-shadow: 0 0 24px rgba(234,179,8,0.35);
}
.bp-node-reward {
  line-height: 1;
  opacity: 0.4;
  transition: opacity 0.3s;
}
.bp-node.near .bp-node-reward { opacity: 0.55; }
.bp-node.current .bp-node-reward { opacity: 0.9; }
.bp-connector {
  width: 16px;
  height: 3px;
  background: rgba(255,255,255,0.08);
  flex-shrink: 0;
  border-radius: 1px;
  transition: background 0.3s;
}
.bp-connector.completed { background: var(--yellow); }

/* Glow Name */
.bp-glow-row { display: flex; align-items: center; gap: 8px; }
.bp-glow-label { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.85); min-width: 70px; }
.bp-glow-check { accent-color: var(--yellow); width: 14px; height: 14px; }
.bp-glow-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.shortcut-key {
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px; font-weight: 900;
  color: var(--yellow); min-width: 72px;
  background: rgba(255,255,255,0.05);
  padding: 5px 10px; border-radius: 4px;
  text-align: center;
}
.shortcut-desc {
  font-size: 13px; font-weight: 700;
  color: rgba(255,255,255,0.85);
  font-family: 'Barlow', sans-serif;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .side-panel { width: clamp(140px, 18vw, 220px); padding: 10px; }
  .res-grid { gap: 12px; }
}
@media (max-width: 810px) {
  #banner-container { width: 90vw; max-width: 100%; }
  #footer-banner { height: auto; min-height: 60px; padding: 8px 0; }
}
@media (max-width: 768px) {
  #left-panel, #right-panel { display: none; }
  #canvas-wrap { flex: 1 1 100%; }
  .mode-tab { padding: 6px 10px; font-size: 10px; }
}
@media (max-width: 480px) {
  #topbar { padding: 0 12px; height: 48px; }
  .overlay { padding: 16px; gap: 12px; }
  .res-grid { gap: 8px; }
  .modal-box { max-width: 95vw; }
}

