/* ==========================================================================
   REAL BRAVE (RB) — styles
   ========================================================================== */
:root {
  --gold: #ffb703; --teal: #06d6a0; --red: #ef476f;
  --ink: #0b1020; --panel: rgba(13, 19, 40, .92); --line: #2e3d75;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; background: var(--ink); font-family: 'Segoe UI', system-ui, sans-serif; color: #eef2ff; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }

/* ------------------------ full screens ------------------------ */
.screen {
  position: fixed; inset: 0; z-index: 50; overflow-y: auto;
  display: flex; align-items: flex-start; justify-content: center;
  background: radial-gradient(ellipse at 50% -10%, #1c2c5e 0%, #0b1020 65%);
  padding: 24px 14px;
}
.menu-card {
  width: 100%; max-width: 460px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 22px; padding: 28px 26px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6); backdrop-filter: blur(8px);
  margin: auto;
}
.title { font-size: 44px; text-align: center; letter-spacing: 3px; text-shadow: 0 4px 24px rgba(255,183,3,.35); }
.title span { color: var(--gold); }
.subtitle { text-align: center; color: #93a0c4; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; margin: 4px 0 22px; }
.step h3 { margin-bottom: 12px; font-size: 18px; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--line);
  background: transparent; color: #93a0c4; font-size: 14px;
}
.tab.active { background: rgba(255,183,3,.14); color: var(--gold); border-color: var(--gold); }
.menu-card input {
  width: 100%; padding: 13px 15px; margin-bottom: 10px; font-size: 16px;
  border-radius: 12px; border: 1px solid var(--line); background: #0d1430; color: #fff; outline: none;
}
.menu-card input:focus { border-color: var(--teal); }
.hint { font-size: 12.5px; color: #93a0c4; margin: 6px 0 14px; line-height: 1.5; }
.err { font-size: 13px; color: var(--red); margin-bottom: 8px; min-height: 16px; }
.big-btn {
  width: 100%; padding: 15px; font-size: 17px; font-weight: 700; border: none;
  border-radius: 14px; background: linear-gradient(135deg, var(--gold), #fb8500);
  color: #1a1200; box-shadow: 0 8px 26px rgba(255,183,3,.35); transition: transform .12s;
}
.big-btn:active { transform: scale(.97); }
.big-btn:disabled { filter: grayscale(1) brightness(.6); cursor: not-allowed; }
.credits { text-align: center; font-size: 11.5px; color: #6b7699; margin-top: 18px; }
.credits a { color: var(--teal); text-decoration: none; }

/* character grid */
.char-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.char {
  border: 2px solid var(--line); border-radius: 14px; padding: 10px 6px; text-align: center;
  background: #0d1430; color: #eef2ff; transition: transform .12s, border-color .12s;
}
.char.active { border-color: var(--gold); transform: scale(1.05); background: rgba(255,183,3,.08); }
.char .swatch { width: 38px; height: 38px; border-radius: 10px; margin: 0 auto 6px; box-shadow: 0 4px 12px rgba(0,0,0,.5); }
.char b { display: block; font-size: 13px; }
.char i { font-size: 10px; color: #93a0c4; font-style: normal; }
.char.locked { opacity: .45; }

/* difficulty */
.diff-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.diff {
  border: 2px solid var(--line); border-radius: 14px; padding: 14px 6px; text-align: center;
  background: #0d1430; color: #eef2ff; transition: transform .12s, border-color .12s; cursor: pointer;
}
.diff.active { transform: scale(1.05); }
.diff.active[data-d="easy"] { border-color: var(--teal); background: rgba(6,214,160,.1); }
.diff.active[data-d="normal"] { border-color: var(--gold); background: rgba(255,183,3,.1); }
.diff.active[data-d="hard"] { border-color: var(--red); background: rgba(239,71,111,.12); }
.diff .ic { font-size: 30px; line-height: 1; margin-bottom: 6px; }
.diff b { display: block; font-size: 14px; }
.diff i { font-size: 10.5px; color: #93a0c4; font-style: normal; }

/* skin tone picker */
.skin-row { display: flex; gap: 10px; margin-bottom: 8px; }
.skin-row button { width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; transition: transform .12s; cursor: pointer; }
.skin-row button.active { border-color: #fff; transform: scale(1.12); }

/* location */
.loc-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.loc-presets button {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: #0d1430; color: #c9d4f5; font-size: 13px;
}
.loc-presets button.active { border-color: var(--teal); color: var(--teal); background: rgba(6,214,160,.1); }
.loc-search { display: flex; gap: 8px; }
.loc-search input { flex: 1; margin-bottom: 0; }
.loc-search button { width: 52px; border-radius: 12px; border: 1px solid var(--line); background: #0d1430; font-size: 18px; }
.loc-preview { display: flex; gap: 14px; margin-top: 14px; align-items: center; }
.loc-preview img { width: 110px; height: 110px; border-radius: 14px; border: 1px solid var(--line); object-fit: cover; }
.loc-preview b { display: block; font-size: 15px; }
.loc-preview span { font-size: 12px; color: #93a0c4; display: block; margin: 4px 0; }
.loc-preview em { font-size: 10px; color: #6b7699; font-style: normal; }
.lobby { margin: 14px 0; }
.lobby .world-row {
  display: flex; justify-content: space-between; padding: 9px 13px; border-radius: 10px;
  background: #0d1430; border: 1px solid var(--line); margin-bottom: 6px; font-size: 13px;
  cursor: pointer;
}
.lobby .world-row:hover { border-color: var(--teal); }
.lobby .world-row span { color: var(--teal); }
.lobby-title { font-size: 12px; color: #93a0c4; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }

/* ------------------------ HUD ------------------------ */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud button { pointer-events: auto; }
.hud-top { display: flex; justify-content: space-between; padding: max(10px, env(safe-area-inset-top)) 12px 0; gap: 10px; }
.hud-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px; font-size: 13px; min-width: 180px;
}
.hud-right { text-align: right; }
.hud-line { margin: 2px 0; white-space: nowrap; }
.hud-line.stage { color: var(--gold); font-size: 11.5px; }
.hp-bar { position: relative; height: 16px; background: #321; border-radius: 8px; overflow: hidden; margin-bottom: 6px; }
#hpFill { height: 100%; width: 100%; background: linear-gradient(90deg, #ef476f, #ff8fa3); transition: width .25s; }
#hpText { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 16px; font-weight: 700; }
.xp-bar { height: 5px; background: #1a2348; border-radius: 3px; overflow: hidden; margin-top: 5px; }
#xpFill { height: 100%; width: 0; background: var(--teal); transition: width .3s; }

.hotbar {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: max(12px, env(safe-area-inset-bottom)); display: flex; gap: 7px;
  z-index: 2;
}
.slot {
  position: relative; width: 58px; height: 58px; border-radius: 13px;
  border: 2px solid var(--line); background: var(--panel); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  cursor: pointer; padding: 0; transition: border-color .12s, box-shadow .12s, transform .1s, background .12s;
}
.slot:hover { border-color: var(--gold); background: #1b2547; transform: translateY(-2px); }
.slot:active { transform: translateY(0) scale(.95); }
.slot .slot-ic { font-size: 24px; line-height: 1; pointer-events: none; }
/* shortcut badge in the top-left corner */
.slot .slot-key {
  position: absolute; top: 3px; left: 4px; font-size: 10px; font-weight: 800; line-height: 1;
  padding: 2px 4px; border-radius: 5px; background: rgba(0,0,0,.5); color: var(--gold);
  border: 1px solid rgba(255,183,3,.4); pointer-events: none; letter-spacing: .3px;
}
/* small name under the icon so kids know what each tool is */
.slot .slot-name {
  font-size: 9px; line-height: 1; margin-top: 3px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px; pointer-events: none;
}
.slot.active {
  border-color: var(--gold); box-shadow: 0 0 16px rgba(255,183,3,.5); background: #1d2647;
}
.slot.active .slot-name { color: var(--gold); }
/* brief flash when a slot is triggered (click or shortcut) for clear feedback */
.slot.slot-flash { animation: slotFlash .35s ease; }
@keyframes slotFlash {
  0% { box-shadow: 0 0 0 0 rgba(6,214,160,.7); border-color: var(--teal); }
  100% { box-shadow: 0 0 18px 4px rgba(6,214,160,0); }
}

/* mobile joystick & actions */
#joyZone { position: absolute; left: 0; bottom: 0; width: 45%; height: 55%; pointer-events: auto; display: none; }
#lookZone { position: absolute; right: 0; bottom: 0; width: 55%; height: 70%; pointer-events: auto; display: none; }
#joyBase {
  position: absolute; left: 36px; bottom: 110px; width: 116px; height: 116px;
  border-radius: 50%; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.25);
}
#joyStick {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px;
  border-radius: 50%; background: rgba(255,255,255,.35);
}
.mob-actions { position: absolute; right: 18px; bottom: 110px; display: none; flex-direction: column; gap: 14px; align-items: center; }
.act {
  width: 62px; height: 62px; border-radius: 50%; font-size: 26px;
  background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.3); color: #fff;
}
.act.big { width: 84px; height: 84px; font-size: 36px; background: rgba(255,183,3,.25); border-color: var(--gold); }
body.touch #joyZone, body.touch #lookZone { display: block; }
body.touch .mob-actions { display: flex; }
body.touch #crosshair { display: none; }

#crosshair {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 22px; color: rgba(255,255,255,.7); text-shadow: 0 1px 4px #000;
}

#chatLog {
  position: absolute; left: 12px; bottom: 84px; max-width: 64vw; font-size: 12.5px;
  display: flex; flex-direction: column; gap: 3px;
}
#chatLog div { background: rgba(0,0,0,.45); padding: 4px 9px; border-radius: 8px; max-width: 100%; }
#chatLog b { color: var(--gold); }
#chatLog .sys { color: var(--teal); }
#chatBox {
  position: absolute; left: 12px; bottom: 84px; display: flex; gap: 6px; pointer-events: auto;
}
#chatBox input { width: min(300px, 60vw); padding: 10px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: #fff; outline: none; }
#chatBox button { width: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--teal); font-size: 17px; }

#toast {
  position: absolute; left: 50%; top: 16%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--gold); color: var(--gold);
  padding: 10px 22px; border-radius: 999px; font-size: 15px; font-weight: 600;
  opacity: 0; transition: opacity .3s; white-space: nowrap; max-width: 92vw; text-overflow: ellipsis; overflow: hidden;
}
#toast.show { opacity: 1; }

/* shop */
.shop-card h2 { margin-bottom: 4px; }
.shop-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px; margin-bottom: 8px;
  background: #0d1430; border: 1px solid var(--line); border-radius: 13px;
}
.shop-item .ic { font-size: 28px; }
.shop-item .nm { flex: 1; }
.shop-item .nm b { display: block; font-size: 14px; }
.shop-item .nm i { font-size: 11.5px; color: #93a0c4; font-style: normal; }
.shop-item button {
  padding: 8px 14px; border-radius: 10px; border: none; font-weight: 700; font-size: 13px;
  background: linear-gradient(135deg, var(--gold), #fb8500); color: #1a1200;
}
.shop-item button:disabled { filter: grayscale(1) brightness(.55); }
.shop-item.owned button { background: var(--teal); }

/* block storage */
.storage-card { max-width: 540px; }
.storage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 12px 0; }
.storage-cell {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
  background: #0d1430; border: 2px solid var(--line); border-radius: 13px; transition: border-color .12s, transform .12s;
}
.storage-cell:hover { transform: translateY(-2px); }
.storage-cell.active { border-color: var(--gold); }
.storage-cell .swatch { width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0; border: 1px solid rgba(255,255,255,.25); box-shadow: inset 0 0 0 2px rgba(0,0,0,.18); }
.storage-cell .info { flex: 1; min-width: 0; }
.storage-cell .info b { display: block; font-size: 13px; }
.storage-cell .info span { font-size: 12px; color: #93a0c4; }
.storage-cell .count { font-weight: 800; font-size: 16px; color: var(--teal); }

/* armory */
.armor-card { max-width: 560px; }
.armor-card h3 { font-size: 14px; margin: 6px 0; color: #cdd6f0; }
.armor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.armor-cell {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
  background: #0d1430; border: 2px solid var(--line); border-radius: 13px; transition: border-color .12s, transform .12s;
}
.armor-cell:hover { transform: translateY(-2px); }
.armor-cell.active { border-color: var(--gold); }
.armor-cell .ic { font-size: 26px; }
.armor-cell .info { flex: 1; min-width: 0; }
.armor-cell .info b { display: block; font-size: 13px; }
.armor-cell .info span { font-size: 11.5px; color: #93a0c4; }
.armor-cell .buy { padding: 6px 12px; border-radius: 9px; border: none; font-weight: 700; font-size: 12.5px; background: linear-gradient(135deg, var(--gold), #fb8500); color: #1a1200; }
.armor-cell .buy:disabled { filter: grayscale(1) brightness(.55); }
.armor-cell.owned .buy { background: var(--teal); }
.armor-color-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.armor-color-row button { width: 38px; height: 38px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; transition: transform .12s; }
.armor-color-row button.active { border-color: #fff; transform: scale(1.12); }

/* help widget */
.help-card { max-width: 520px; }
.help-card h2 { margin-bottom: 12px; }
.help-goal {
  background: rgba(255,183,3,.08); border: 1px solid rgba(255,183,3,.35);
  border-radius: 12px; padding: 12px 14px; font-size: 13.5px; line-height: 1.55; margin-bottom: 14px;
}
.help-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.help-table th {
  text-align: left; font-size: 11px; color: #93a0c4; text-transform: uppercase;
  letter-spacing: 1px; padding: 8px 10px 4px;
}
.help-table td { padding: 6px 10px; font-size: 13.5px; border-top: 1px solid #1d2a55; }
.help-table td:first-child { white-space: nowrap; }
.key {
  display: inline-block; background: #1b2547; border: 1px solid #34406b; border-bottom-width: 3px;
  border-radius: 7px; padding: 2px 9px; font-size: 12px; font-weight: 700; margin: 1px;
}
.help-tips { font-size: 13px; color: #c9d4f5; margin-bottom: 16px; }
.help-tips ul { margin: 8px 0 0 20px; line-height: 1.7; }
/* place info / naming + facts */
.hud-line.places { color: var(--teal); font-size: 11.5px; }
.big-btn.ghost { background: #1b2547; color: #eef2ff; box-shadow: none; margin-top: 8px; }

#placePrompt {
  position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--gold); border-radius: 999px;
  padding: 8px 8px 8px 16px; display: none; align-items: center; gap: 10px;
  font-size: 13.5px; pointer-events: auto; max-width: 92vw; z-index: 2;
}
#placePrompt.show { display: flex; }
#placePrompt button { background: linear-gradient(135deg, var(--gold), #fb8500); color: #1a1200; border: none; border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 13px; }

.place-card { text-align: center; max-width: 440px; }
.place-card h2 { font-size: 46px; margin-bottom: 2px; }
.place-card h3 { font-size: 21px; margin-bottom: 2px; }
.place-cat { color: var(--gold); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.place-fact {
  background: rgba(6,214,160,.08); border: 1px solid rgba(6,214,160,.35);
  border-radius: 12px; padding: 13px 15px; font-size: 13.5px; line-height: 1.6; text-align: left; margin-bottom: 16px;
}
.place-fact b { color: var(--teal); }
.place-name-box { text-align: left; }
.place-name-box input { width: 100%; padding: 12px 14px; margin-bottom: 10px; border-radius: 12px; border: 1px solid var(--line); background: #0d1430; color: #fff; outline: none; font-size: 15px; }
.place-name-box input:focus { border-color: var(--gold); }

#factCard {
  position: absolute; left: 50%; top: 14%; transform: translateX(-50%);
  width: min(440px, 92vw); z-index: 30; pointer-events: auto;
}
#factCard.show { animation: factIn .4s ease; }
@keyframes factIn { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translateX(-50%); } }
.fact-inner {
  background: var(--panel); border: 1px solid var(--teal); border-radius: 16px;
  padding: 16px 18px; box-shadow: 0 16px 50px rgba(0,0,0,.55);
}
.fact-inner b { color: var(--teal); font-size: 16px; }
.fact-inner p { font-size: 13.5px; line-height: 1.6; color: #d6deff; margin: 8px 0 12px; }
.fact-inner button { background: linear-gradient(135deg, var(--teal), #04a07a); color: #042; border: none; border-radius: 10px; padding: 8px 18px; font-weight: 700; font-size: 13px; cursor: pointer; }

/* save & exit + music */
.slot.exit { border-color: #ef476f; }
.slot.exit:hover { box-shadow: 0 0 14px rgba(239,71,111,.5); }
.exit-card { text-align: center; }
.exit-card h2 { margin-bottom: 12px; }

.music-card { text-align: left; }
.music-card h2 { margin-bottom: 4px; }
.track {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px; margin-bottom: 8px;
  background: #0d1430; border: 1px solid var(--line); border-radius: 13px; cursor: pointer;
}
.track:hover { border-color: var(--teal); }
.track.active { border-color: var(--gold); background: rgba(255,183,3,.08); }
.track .ic { font-size: 26px; }
.track .nm { flex: 1; }
.track .nm b { display: block; font-size: 14px; }
.track .nm i { font-size: 11.5px; color: #93a0c4; font-style: normal; }
.track .play { font-size: 18px; color: var(--teal); }
.vol-row { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; }
.vol-row input[type=range] { flex: 1; accent-color: var(--gold); }
.sfx-toggle { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: #c9d4f5; margin-bottom: 14px; cursor: pointer; }
.sfx-toggle input { width: 18px; height: 18px; accent-color: var(--teal); }

/* Professor quiz */
.quiz-card { text-align: center; }
.quiz-reward { color: var(--gold); font-size: 13px; margin-bottom: 12px; }
.quiz-q { font-size: 18px; line-height: 1.5; margin-bottom: 16px; font-weight: 600; }
.quiz-answers { display: flex; flex-direction: column; gap: 9px; margin-bottom: 12px; }
.quiz-answers button {
  padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: #0d1430;
  color: #eef2ff; font-size: 15px; cursor: pointer; text-align: left; transition: border-color .12s;
}
.quiz-answers button:hover { border-color: var(--gold); }
.quiz-answers button.correct { border-color: var(--teal); background: rgba(6,214,160,.14); }
.quiz-answers button.wrong { border-color: var(--red); background: rgba(239,71,111,.14); }
.quiz-answers button:disabled { cursor: default; }
.quiz-clue { background: rgba(255,183,3,.1); border: 1px solid rgba(255,183,3,.4); border-radius: 10px; padding: 10px 13px; font-size: 13.5px; color: #ffe3a0; margin-bottom: 12px; }
.quiz-result { font-size: 16px; font-weight: 700; padding: 12px; border-radius: 12px; margin-bottom: 12px; }
.quiz-result.win { background: rgba(6,214,160,.14); color: var(--teal); }
.quiz-result.lose { background: rgba(239,71,111,.14); color: var(--red); }

.death-card { text-align: center; }
.death-card h2 { font-size: 30px; margin-bottom: 10px; }
.death-card p { color: #93a0c4; margin-bottom: 20px; }

@media (max-width: 560px) {
  .hud-card { min-width: 0; font-size: 11.5px; padding: 8px 10px; }
  .hotbar { gap: 4px; flex-wrap: wrap; justify-content: center; max-width: 96vw; }
  .slot { width: 46px; height: 46px; border-radius: 11px; }
  .slot .slot-ic { font-size: 21px; }
  .slot .slot-key { font-size: 8px; top: 2px; left: 2px; padding: 1px 3px; }
  .slot .slot-name { display: none; } /* save space on phones — badge + icon are enough */
  .title { font-size: 36px; }
}

/* Duel popups */
#duelPopup, #duelPickPopup, #duelWaitPopup, #duelQuestionPopup {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  z-index: 30; background: rgba(0,0,0,.6);
}
#duelPopup.hidden, #duelPickPopup.hidden, #duelWaitPopup.hidden, #duelQuestionPopup.hidden { display: none; }
.duel-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px 24px; max-width: 360px; width: 92%; text-align: center;
}
.duel-pick-box, .duel-q-box { max-width: 400px; text-align: left; }
.duel-box p { font-size: 16px; margin-bottom: 12px; line-height: 1.4; }
.duel-box .big-btn { margin-bottom: 9px; }
.duel-fight-pick { background: rgba(239,71,111,.2) !important; border-color: var(--red) !important; }
.duel-quiz-pick { background: rgba(255,183,3,.15) !important; border-color: var(--gold) !important; }
.duel-timer-bar {
  height: 6px; background: #1a2348; border-radius: 3px; margin-bottom: 14px; overflow: hidden;
}
.duel-timer-bar div { height: 100%; background: var(--gold); border-radius: 3px; transition: width .25s linear; }
.duel-countdown { font-size: 28px; font-weight: 900; color: var(--gold); margin-bottom: 14px; line-height: 1; }
/* question pick list */
#duelPickList { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.duel-pick-btn {
  padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: #0d1430;
  color: #eef2ff; font-size: 14px; cursor: pointer; text-align: left; line-height: 1.4;
}
.duel-pick-btn:hover, .duel-pick-btn:active { border-color: var(--gold); background: rgba(255,183,3,.1); }
/* opponent question */
.duel-q-text { font-size: 17px; font-weight: 600; margin-bottom: 14px; line-height: 1.5; }
#duelQAnswers { display: flex; flex-direction: column; gap: 9px; margin-bottom: 10px; }
#duelQAnswers button {
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #0d1430;
  color: #eef2ff; font-size: 15px; cursor: pointer; text-align: left;
}
#duelQAnswers button.correct { border-color: var(--teal); background: rgba(6,214,160,.14); }
#duelQAnswers button.wrong   { border-color: var(--red);  background: rgba(239,71,111,.14); }
#duelQAnswers button:disabled { cursor: default; }
.duel-clue { font-size: 13px; color: #ffe3a0; background: rgba(255,183,3,.1); border-radius: 8px; padding: 8px 12px; }

/* Leaderboard HUD */
#leaderHud {
  position: absolute; top: 80px; right: 8px; width: 200px;
  background: rgba(10,12,30,.88); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; z-index: 5; color: #eef2ff;
}
#leaderHud.hidden { display: none; }
.leader-title { font-size: 13px; font-weight: 700; color: var(--gold); margin-bottom: 8px; }
#leaderList { padding-left: 18px; margin: 0; font-size: 12.5px; line-height: 1.8; }
#leaderList li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#leaderList li.me { color: var(--gold); font-weight: 700; }

/* Stale-connection / reload banner */
#staleBanner {
  position: absolute; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: rgba(10,12,30,.96); border-bottom: 2px solid var(--gold);
  padding: 10px 16px; font-size: 13px; color: #eef2ff;
}
#staleBanner.hidden { display: none; }
#staleBanner span { flex: 1; min-width: 180px; }
#staleBanner button {
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: #0d1430; color: #eef2ff; font-size: 12px; cursor: pointer; white-space: nowrap;
}
#staleBanner #staleSave { border-color: var(--gold); color: var(--gold); }
#staleBanner #staleReload { border-color: var(--teal); color: var(--teal); }
