/* gamification-boss.css - Boss Battle System UI (loaded after redesign.css) */
#bossBattleDisplay {
  background: var(--bg-app);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 480px;
  color: var(--color-text);
  font-family: var(--font-body);
}
.boss-battle-container {
  display: grid;
  grid-template-columns: 300px 1fr 320px;
  gap: 16px;
  padding: 16px;
  min-height: 480px;
}
.boss-battle-container.bb-profile {
  grid-template-columns: 1fr;
}
.boss-battle-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.bb-panel {
  background: var(--bg-card);
  border: 1px solid #4A3B2C;
  border-radius: var(--border-radius-card);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.bb-panel-header {
  text-align: center;
  padding: 10px;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid #4A3B2C;
}
.bb-team-list {
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bb-team {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bb-team-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bb-team-name {
  font-weight: 800;
  font-size: 13px;
}
.bb-team-hp {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
}
.bb-player-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 10px;
  border-left: 2px solid #4A3B2C;
}
.bb-player-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
}
.bb-player-class {
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: 11px;
}
.bb-player-badge {
  background: rgba(197,139,43,0.15);
  border: 1px solid #C58B2B;
  color: #C58B2B;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.bb-player-badge.ko {
  background: rgba(139,38,38,0.2);
  border-color: #8B2626;
  color: #E0645A;
}
.bb-stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
}
.bb-stat-label {
  width: 20px;
  text-align: right;
  color: var(--color-text-muted);
  font-size: 10px;
  flex: 0 0 auto;
}
.bb-bar-wrap {
  flex: 1;
  height: 8px;
  background: rgba(0,0,0,0.4);
  border: 1px solid #4A3B2C;
  border-radius: 4px;
  overflow: hidden;
}
.bb-bar-fill {
  height: 100%;
  transition: width 0.3s ease;
}
.bb-bar-fill.hp { background: #E0645A; }
.bb-bar-fill.ap { background: #3F8F86; }
.bb-bar-fill.team { background: #C58B2B; }
.bb-role-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  justify-content: center;
}
.bb-role-btn {
  background: transparent;
  border: 1px solid #4A3B2C;
  color: var(--color-text);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 11px;
}
.bb-role-btn.active {
  border-color: #3B7A57;
  color: #3B7A57;
}
.bb-arena {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-height: 0;
}
.bb-boss-plate {
  margin-top: 10px;
  border: 2px solid #8B2626;
  border-radius: 8px;
  width: 84%;
  max-width: 420px;
  text-align: center;
  box-shadow: var(--shadow-modal);
  position: relative;
  background: var(--bg-card);
}
.bb-boss-name {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  padding: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.bb-phase-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 6px;
}
.bb-boss-hp-wrap {
  padding: 10px 10px 20px;
  position: relative;
}
.bb-boss-hp-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  text-shadow: 1px 1px 2px #000;
  z-index: 2;
  color: #fff;
}
.bb-boss-hp-track {
  height: 18px;
  background: rgba(0,0,0,0.6);
  border-radius: 4px;
  border: 1px solid #4A3B2C;
  overflow: hidden;
}
.bb-boss-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #8B2626, #E0645A);
  transition: width 0.3s ease;
}
.bb-phase-markers {
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
  pointer-events: none;
}
.bb-phase-pin {
  background: #2B2E33;
  border: 1px solid #C58B2B;
  color: #C58B2B;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
}
.bb-scene {
  flex: 1;
  width: 100%;
  min-height: 140px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bb-float-text {
  position: absolute;
  font-weight: 800;
  font-size: 24px;
  text-shadow: 2px 2px 0 #000;
  pointer-events: none;
  z-index: 5;
  animation: bbFloatUp 2s ease-out forwards;
}
.bb-float-text.damage-boss { color: #E0645A; top: 40%; left: 40%; }
.bb-float-text.damage-class { color: #8B2626; top: 50%; right: 40%; }
.bb-float-text.attack-name { color: #C58B2B; top: 30%; font-size: 18px; }
@keyframes bbFloatUp {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-40px) scale(1.1); }
}
.bb-question-area {
  width: 90%;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bb-timer {
  background: rgba(0,0,0,0.7);
  border: 1px solid #C58B2B;
  color: #C58B2B;
  padding: 3px 16px;
  border-radius: 12px 12px 0 0;
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 13px;
}
.bb-scroll {
  background: #F8F7F2;
  color: #1C2024;
  border: 2px solid #8B2626;
  border-radius: 4px;
  padding: 14px;
  width: 100%;
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.bb-class-bars {
  width: 100%;
  display: flex;
  gap: 16px;
  background: var(--bg-card);
  padding: 10px 16px;
  border: 1px solid #4A3B2C;
  border-radius: var(--border-radius-card);
}
.bb-class-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bb-class-bar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
}
.bb-log-panel { flex: 1; min-height: 0; }
.bb-log-list {
  padding: 12px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
}
.bb-log-entry {
  padding: 6px 8px;
  border-left: 3px solid #4A3B2C;
  background: rgba(0,0,0,0.12);
  border-radius: 4px;
}
.bb-log-entry.student { border-left-color: #3B7A57; }
.bb-log-entry.boss { border-left-color: #8B2626; }
.bb-log-entry.system { border-left-color: #C58B2B; }
.bb-actions-panel { flex: 0 0 auto; }
.bb-action-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  flex-wrap: wrap;
}
.bb-btn {
  background: rgba(0,0,0,0.3);
  border: 1px solid #4A3B2C;
  color: var(--color-text);
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.bb-btn:hover { background: rgba(255,255,255,0.1); border-color: #C58B2B; }
.bb-btn.primary { border-color: #3B7A57; color: #3B7A57; }
.bb-btn.danger { border-color: #8B2626; color: #E0645A; }
.bb-btn.warning { border-color: #C58B2B; color: #C58B2B; }
.bb-btn.block { width: 100%; }
.bb-mc-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bb-mc-btn {
  background: rgba(0,0,0,0.3);
  border: 1px solid #4A3B2C;
  color: var(--color-text);
  padding: 11px;
  border-radius: 8px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 13px;
}
.bb-mc-btn:hover { background: rgba(255,255,255,0.1); border-color: #3B7A57; }
.bb-mc-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--color-text-muted);
  font-weight: 700;
  font-size: 12px;
  flex: 0 0 auto;
}
.bb-ko-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
}
.bb-ko-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(139,38,38,0.15);
  border: 1px solid #8B2626;
  color: #E0645A;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
}
.bb-revive-btn {
  background: transparent;
  border: 1px solid #3B7A57;
  color: #3B7A57;
  border-radius: 8px;
  font-size: 11px;
  padding: 2px 8px;
  cursor: pointer;
}
.bb-builder {
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
}
.bb-builder-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bb-form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.bb-form-row label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
}
.bb-form-row input,
.bb-form-row select,
.bb-form-row textarea {
  background: var(--bg-card);
  border: 1px solid #4A3B2C;
  color: var(--color-text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}
.bb-form-row textarea { resize: vertical; }
.bb-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.bb-hp-formula {
  text-align: center;
  font-size: 13px;
  background: rgba(197,139,43,0.08);
  border: 1px dashed #C58B2B;
  border-radius: 8px;
  padding: 8px;
}
.bb-attack-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 6px;
}
.bb-attack-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
}
.bb-attack-check input { accent-color: #8B2626; }
.bb-monster-preview {
  text-align: center;
  font-size: 44px;
  line-height: 1.2;
}
.bb-primary-btn {
  background: #3B7A57;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.bb-primary-btn:hover { filter: brightness(1.1); }
.bb-desc-note {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 0;
}
@media (max-width: 1080px) {
  .boss-battle-container { grid-template-columns: 1fr; }
  .bb-center { order: 1; }
  .bb-left { order: 2; }
  .bb-right { order: 3; }
}
.bb-fb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  line-height: 1;
}
.bb-load {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 13px;
}

/* ═══ READY TO PLAY (launcher) ══════════════════════════════════════════
   One column, because the launcher is a choice rather than a battle: pick a boss,
   pick a game style, pick the questions, press start. */
.boss-battle-container.bb-launcher { grid-template-columns: 1fr; max-width: 1100px; margin: 0 auto; }
.bb-launcher-body { padding: 6px 4px 4px; }
.bb-launcher-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.bb-random-btn { font-size: 16px; padding: 12px 20px; }
.bb-section-title {
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-secondary, #556); margin: 18px 0 8px;
}
.bb-boss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.bb-boss-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer;
  padding: 12px; border: 1px solid var(--border-light, #ccd); border-radius: 10px;
  background: var(--surface, #fff); color: inherit; font: inherit;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.bb-boss-card:hover { transform: translateY(-2px); border-color: var(--warning-color, #d99a00); }
.bb-boss-card.is-picked { border-color: var(--success-color, #1f8a4c); box-shadow: 0 0 0 3px rgba(31,138,76,.18); }
.bb-boss-card__icon { font-size: 26px; line-height: 1; }
.bb-boss-card__name { font-weight: 800; font-size: 15px; }
.bb-boss-card__tag { font-size: 12px; color: var(--text-muted, #667); }
.bb-boss-card__meta { font-size: 11px; color: var(--text-secondary, #556); margin-top: 4px; }
.bb-style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.bb-style-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer;
  padding: 12px; border: 1px solid var(--border-light, #ccd); border-radius: 10px;
  background: var(--surface, #fff); color: inherit; font: inherit;
}
.bb-style-card.is-picked { border-color: var(--success-color, #1f8a4c); box-shadow: 0 0 0 3px rgba(31,138,76,.18); }
.bb-style-card__icon { font-size: 22px; }
.bb-style-card__name { font-weight: 800; font-size: 14px; }
.bb-style-card__blurb { font-size: 12px; color: var(--text-muted, #667); line-height: 1.4; }
.bb-question-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.bb-question-row select { min-width: 280px; padding: 8px; }
.bb-import { border: 1px dashed var(--border-light, #ccd); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.bb-import summary { cursor: pointer; font-weight: 700; }
.bb-import input, .bb-import textarea {
  width: 100%; margin: 8px 0; padding: 8px; border: 1px solid var(--border-light, #ccd);
  border-radius: 8px; font: inherit; box-sizing: border-box;
}
/* The import panel's labelled rows (set name, separator). A label WRAPS its own
   control, so the caption is clickable and the two can never drift apart. */
.bb-import__row { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.bb-import__label { font-size: 12px; font-weight: 700; color: var(--text-muted, #667); }
.bb-import select {
  width: 100%; margin: 0; padding: 8px; border: 1px solid var(--border-light, #ccd);
  border-radius: 8px; font: inherit; box-sizing: border-box;
}
.bb-import__rule { border: 0; border-top: 1px dashed var(--border-light, #ccd); margin: 14px 0 10px; }
.bb-import input[type="file"] { padding: 6px; background: transparent; }
/* The AI draft, shown between "Generate" and "Save" so the questions are read before they
   are stored. A visible box (not just text) because approving it is a real decision. */
.bb-import__preview {
  margin: 10px 0; padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(197, 139, 43, 0.45); background: rgba(197, 139, 43, 0.08);
}
/* Why a Generate click produced no draft. Shown where the teacher clicked, not only in the
   corner toast, so a refusal (a PDF on a non-Gemini key, an empty file) cannot pass for
   "nothing happened". */
.bb-import__error {
  margin: 10px 0; padding: 8px 12px; border-radius: 10px;
  border: 1px solid rgba(224, 100, 90, 0.55); background: rgba(224, 100, 90, 0.12);
  color: #E0645A; font-size: 12px;
}
/* Capped height: a 20-question draft must not push the Start button out of view. */
.bb-import__list {
  margin: 8px 0; padding-left: 20px; max-height: 240px; overflow: auto;
  font-size: 13px; line-height: 1.45;
}
.bb-import__list li { margin-bottom: 3px; }
.bb-run-sheet {
  margin: 14px 0; padding: 12px 14px; border-radius: 10px;
  background: var(--surface, #fff); border-left: 4px solid var(--warning-color, #d99a00);
  font-size: 14px; line-height: 1.5;
}

/* ═══ A round: the question and the class's answers ═════════════════════ */
.bb-question { text-align: center; padding: 6px 0; }
.bb-question__term { font-size: 22px; font-weight: 800; line-height: 1.3; margin-bottom: 8px; }
.bb-question__answer {
  font-size: 18px; margin: 8px 0; padding: 8px; border-radius: 8px;
  background: rgba(31,138,76,.12); color: var(--success-color, #1f8a4c); font-weight: 700;
}
.bb-verdict-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.bb-verdict {
  cursor: pointer; font: inherit; font-weight: 700; padding: 10px 14px;
  border: 2px solid var(--border-light, #ccd); border-radius: 10px;
  background: var(--surface, #fff); color: inherit;
}
.bb-verdict.is-correct { border-color: var(--success-color, #1f8a4c); background: rgba(31,138,76,.14); }
.bb-verdict__mark { font-size: 16px; }

/* ═══ The fight on screen ═══════════════════════════════════════════════
   One fighter slot beside the boss. Whatever is mounted there is the student who is
   ACTING: the champion who earned the hit, then the champion the boss turns on. */
.bb-fighter-mount {
  position: absolute; right: 8px; bottom: 0; width: 240px; height: 300px;
  pointer-events: none;
}
.bb-scene { position: relative; }

/* ═══ The answer board (student devices) and the question on the projector ═══ */
.bb-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.bb-option {
  display: flex; gap: 8px; align-items: center; text-align: left;
  padding: 10px 12px; border: 1px solid var(--border-light, #ccd); border-radius: 8px;
  background: var(--surface, #fff); font-size: 14px;
}
.bb-option.is-correct { border-color: var(--success-color, #1f8a4c); background: rgba(31,138,76,.12); font-weight: 700; }
.bb-option__key {
  flex: 0 0 auto; width: 22px; height: 22px; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; border-radius: 50%;
  border: 1px solid var(--border-light, #ccd);
}
.bb-option__tick { margin-left: auto; }
.bb-question__answer {
  margin: 8px 0; padding: 8px 10px; border-radius: 8px; font-weight: 700;
  background: rgba(31,138,76,.12); color: var(--success-color, #1f8a4c);
}
.bb-answers { display: grid; gap: 4px; margin: 8px 0; }
.bb-answer-row {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center;
  padding: 6px 10px; border-radius: 8px; font-size: 13px;
  background: var(--surface, #fff); border: 1px solid var(--border-light, #ccd);
}
.bb-answer-row.is-in { border-color: var(--success-color, #1f8a4c); background: rgba(31,138,76,.1); }
.bb-answer-team { font-weight: 700; }
.bb-answer-who { color: var(--text-muted, #667); }
.bb-answer-state { white-space: nowrap; }

/* =====================================================================
   SQUAD ASSAULT — the cinematic stage, arena overlay and student pad.
   Namespaced so none of it collides with the champion screen's .bb-* rules.
   ===================================================================== */
.boss-stage{display:grid;grid-template-rows:auto 1fr auto auto auto;height:100%;gap:.5rem;background:radial-gradient(ellipse at 60% 30%,#2b3557,#0e1220 70%);color:#fff;padding:.4rem}
.boss-arena{position:relative;min-height:300px;aspect-ratio:16/7;border-radius:14px;overflow:hidden}
.arena-canvas{position:absolute;inset:0;width:100%!important;height:100%!important}
.arena-overlay{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.arena-float{position:absolute;transform:translate(-50%,-50%);font:900 2rem/1 system-ui;color:#ffe066;text-shadow:0 2px 0 #000,0 0 12px #000;animation:floatUp 1.1s ease-out forwards}
.arena-float.crit{color:#ff4d6d;font-size:2.8rem;animation:floatUp 1.1s ease-out forwards,pulse .3s 2}
@keyframes floatUp{to{transform:translate(-50%,-160%);opacity:0}}
@keyframes pulse{50%{scale:1.25}}
.arena-banner{position:absolute;left:50%;top:18%;transform:translateX(-50%);padding:.4em 1.2em;border-radius:999px;background:#000c;font:800 1.6rem system-ui;letter-spacing:.04em;animation:bannerIn 1.6s ease forwards;white-space:nowrap}
.arena-banner.phase{background:#b3001bcc}.arena-banner.streak{background:#ff7a00cc}.arena-banner.victory{background:#1f9d55cc;font-size:2.4rem}.arena-banner.ko{background:#444c}
@keyframes bannerIn{0%{opacity:0;scale:.6}15%{opacity:1;scale:1.05}25%{scale:1}80%{opacity:1}100%{opacity:0}}

.hpbar{position:relative;height:14px;border-radius:7px;background:#000a;overflow:hidden}
.hpbar .fill,.hpbar .lag{position:absolute;inset:0 auto 0 0;border-radius:7px}
.hpbar .fill{background:linear-gradient(#ff5a5a,#b30000);transition:width .35s ease-out}
.hpbar .lag{background:#ffd166;transition:width 1.1s ease-in}
.hpbar.team .fill{background:linear-gradient(#5ad0ff,#0069b3)}
.stage-hud{display:flex;align-items:center;gap:1.5rem;padding:.5rem 1rem}.hud-boss{flex:1}
.hud-name{font-weight:800;font-size:1.3rem}
.hud-streak{opacity:.35;font-weight:800}.hud-streak.on{opacity:1;animation:pulse .6s infinite alternate}
.timer{font:800 1.4rem system-ui}.timer::after{content:attr(data-locked);margin-left:.6em;font-size:.8rem;opacity:.7}
.stage-teams{display:flex;gap:.6rem;padding:0 1rem}
.team-card{flex:1;background:#ffffff14;border-radius:10px;padding:.5rem;transition:transform .2s}
.team-card.ko{filter:grayscale(1);opacity:.5}
/* The squad stage is ALWAYS dark, so its bottom stat cards must keep their dark
   look in LIGHT mode too. style.css defines `html[data-theme="light"] .team-card
   {background:var(--surface)}` (specificity 0,1,1) which outranks the plain
   `.team-card` above and would repaint these cards with the light surface colour
   (plus a light border/shadow). This scoped rule (0,2,1) wins it back — dark mode
   is left untouched. */
html[data-theme="light"] .boss-stage .team-card{background:#ffffff14;border-color:#ffffff14;box-shadow:none}
.team-name{font-weight:700;margin-bottom:.25rem}
.lockins{display:flex;gap:4px;margin:.3rem 0}.pip{width:10px;height:10px;border-radius:50%;background:#555;transition:background .2s,transform .2s}
.pip.in{background:#5cf27a;transform:scale(1.25)}
.spot{font-size:.85rem;opacity:.8}
.choices{display:grid;grid-template-columns:1fr 1fr;gap:.5rem;list-style:none;padding:0 1rem;margin:0}
.choices li{padding:.6rem .9rem;border-radius:8px;background:#ffffff1a;font-size:1.2rem;transition:background .3s}
.choices li.correct{background:#1f9d55;box-shadow:0 0 0 3px #5cf27a}
.stage-question{padding:.2rem 0}
.stage-question .q{font-size:1.5rem;font-weight:800;text-align:center;margin:.2rem 0}
.phase-resolving .stage-question,.phase-boss_attack .stage-question{opacity:.55}
.stage-controls{display:flex;gap:.5rem;justify-content:center;padding:.4rem;position:relative}
.stage-controls button{background:#ffffff1a;color:#fff;border:0;border-radius:8px;padding:.5rem .9rem;font-weight:700;cursor:pointer}
.stage-controls[data-intermission]::after{content:attr(data-intermission);position:absolute;right:1rem;top:.7rem;font-weight:800;color:#ffd166}

.bb-mode-row{display:flex;flex-wrap:wrap;gap:1rem;padding:.4rem .2rem;font-size:.9rem}
.bb-mode-row label{display:flex;align-items:center;gap:.35rem;cursor:pointer}

/* student answer pad (boss-controller.js) */
.ctrl{padding:1rem;color:#fff}
.ctrl.spotlight{box-shadow:inset 0 0 0 4px #ffd166;border-radius:14px}
.ctrl-q{font-size:1.4rem;font-weight:800;text-align:center}
.ctrl .hint{text-align:center;opacity:.8}
.pad{display:grid;grid-template-columns:1fr 1fr;gap:.6rem;margin-top:.6rem}
.pad-btn{min-height:92px;border:0;border-radius:12px;color:#fff;font:700 1.1rem system-ui;display:flex;flex-direction:column;gap:.3rem;align-items:center;justify-content:center;cursor:pointer}
.pad-btn.red{background:#e21b3c}.pad-btn.blue{background:#1368ce}.pad-btn.yellow{background:#d89e00}.pad-btn.green{background:#26890c}
.pad-btn.hidden{background:#333;color:#888}.pad-btn.locked{outline:4px solid #fff}
.pad-btn span{font-size:1.6rem}
.spot-tag{text-align:center;font-weight:800;color:#ffd166;margin-bottom:.4rem}
.locked-msg{text-align:center;font-weight:700;color:#5cf27a;margin-top:.6rem}
.result.hit{background:#1f9d5533}.result.miss{background:#b3001b33}
.result h2{text-align:center;margin:.4rem 0}
.result .ouch{color:#ff8a8a}
.avatar-bounce{font-size:4rem;text-align:center;animation:bounce .5s 3}@keyframes bounce{50%{translate:0 -18px}}
.waiting{text-align:center;opacity:.8;padding:1rem}
.arena-nameplate{position:absolute;transform:translate(-50%,-100%);padding:.1em .5em;border-radius:999px;background:#000000b3;color:#fff;font:700 .72rem/1.2 system-ui;white-space:nowrap;text-align:center;text-shadow:0 1px 2px #000;pointer-events:none;box-shadow:0 1px 4px #0006;max-width:16ch;overflow:hidden;text-overflow:ellipsis}


/* Squad stage team cards: label the meters so it is clear WHAT they show and WHO. */
.team-card .team-name{display:flex;justify-content:space-between;align-items:baseline;gap:.4rem}
.team-card .team-name>span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.team-card .team-hp-num{font:700 .72rem system-ui;opacity:.85;white-space:nowrap}
.team-card .spot-tag{opacity:.7;font-size:.72rem}
.team-card .spot-stats{display:flex;gap:.5rem;font:700 .72rem system-ui;opacity:.9;margin-top:.15rem}
.team-card .lockins{display:flex;align-items:center;gap:4px}
.team-card .lockins-label{margin-left:.35rem;font:700 .68rem system-ui;opacity:.7}


/* ══════════════════════════════════════════════════════════════════════
   ANCIENTS SKIN — the Boss Battle tab wears the same dark-ink + gold, serif
   skin as the Gamified → Avatar tab (src/themes/ancients.css).

   HOW: `gamification-boss.css` loads AFTER `ancients.css`, and this block is
   scoped under `.theme-ancients` (the class now on #bossBattleDisplay in
   index.html), so every rule here outranks its `.bb-*` / `.boss-stage`
   counterpart by specificity. Layout is untouched — only colour + type are
   re-pointed at the Ancients custom properties (--cq-gold / --cq-ink /
   --cq-text / --cq-muted / --cq-font-*), which means the tab stays dark in
   LIGHT mode too, exactly like the avatar view.
   ══════════════════════════════════════════════════════════════════════ */

#bossBattleDisplay.theme-ancients {
  background: linear-gradient(180deg, var(--cq-ink-2), #060504);
  color: var(--cq-text);
  font-family: var(--cq-font-body);
}

/* ── Panels ─────────────────────────────────────────────────────────── */
.theme-ancients .bb-panel,
.theme-ancients .bb-class-bars,
.theme-ancients .bb-boss-plate {
  background: linear-gradient(180deg, var(--cq-ink), var(--cq-ink-2));
  border-color: var(--cq-gold-dim);
  box-shadow: none;
}
.theme-ancients .bb-panel-header {
  font-family: var(--cq-font-display);
  color: var(--cq-gold);
  letter-spacing: .14em;
  border-bottom-color: var(--cq-gold-dim);
}
.theme-ancients .bb-section-title {
  color: var(--cq-gold);
  font-family: var(--cq-font-display);
  letter-spacing: .14em;
}
.theme-ancients .bb-desc-note,
.theme-ancients .bb-load,
.theme-ancients .bb-fb { color: var(--cq-muted); }

/* ── Buttons ────────────────────────────────────────────────────────── */
.theme-ancients .bb-btn,
.theme-ancients .bb-mc-btn,
.theme-ancients .bb-role-btn,
.theme-ancients .stage-controls button {
  background: linear-gradient(180deg, #2a2118, #120d09);
  border: 1px solid var(--cq-gold-dim);
  color: var(--cq-text);
  font-family: var(--cq-font-display);
  letter-spacing: .03em;
}
.theme-ancients .bb-btn:hover,
.theme-ancients .bb-mc-btn:hover,
.theme-ancients .bb-role-btn:hover {
  border-color: var(--cq-gold);
  color: var(--cq-gold);
  background: rgba(214,184,108,.12);
  filter: none;
}
.theme-ancients .bb-btn.primary  { border-color: #3B7A57; color: #8fd6ab; }
.theme-ancients .bb-btn.danger   { border-color: #8B2626; color: #e08a80; }
.theme-ancients .bb-btn.warning  { border-color: var(--cq-gold); color: var(--cq-gold); }
.theme-ancients .bb-role-btn.active {
  border-color: var(--cq-gold); color: var(--cq-gold); background: rgba(214,184,108,.12);
}
.theme-ancients .bb-primary-btn {
  background: linear-gradient(180deg, var(--cq-gold), var(--cq-gold-dim));
  color: #16110a;
  font-family: var(--cq-font-display);
}
.theme-ancients .bb-revive-btn { border-color: #3B7A57; color: #8fd6ab; }
.theme-ancients .bb-mc-letter { border-color: var(--cq-gold-dim); color: var(--cq-gold); }

/* ── Lists, logs, tags, meters ──────────────────────────────────────── */
.theme-ancients .bb-log-entry {
  background: rgba(0,0,0,.28);
  border-left-color: var(--cq-gold-dim);
  color: var(--cq-text);
}
.theme-ancients .bb-log-entry.system { border-left-color: var(--cq-gold); }
.theme-ancients .bb-player-card { border-left-color: var(--cq-gold-dim); }
.theme-ancients .bb-team-hp,
.theme-ancients .bb-player-class,
.theme-ancients .bb-stat-label,
.theme-ancients .bb-class-bar-label { color: var(--cq-muted); }
.theme-ancients .bb-player-badge {
  background: rgba(214,184,108,.12);
  border-color: var(--cq-gold);
  color: var(--cq-gold);
}
.theme-ancients .bb-ko-tag {
  background: rgba(139,38,38,.22); border-color: #8B2626; color: #e08a80;
}
.theme-ancients .bb-bar-wrap { background: #0a0806; border-color: var(--cq-gold-dim); }
.theme-ancients .bb-bar-fill.team { background: var(--cq-gold); }
.theme-ancients .bb-boss-hp-track { background: #0a0806; border-color: var(--cq-gold-dim); }
.theme-ancients .bb-phase-pin {
  background: #14100c; border-color: var(--cq-gold); color: var(--cq-gold);
}
.theme-ancients .bb-timer {
  background: rgba(0,0,0,.6);
  border-color: var(--cq-gold);
  color: var(--cq-gold);
  font-family: var(--cq-font-display);
}
.theme-ancients .bb-scroll {           /* the question parchment */
  background: #f0e4c4;
  color: #23180a;
  border-color: var(--cq-gold-dim);
  font-family: var(--cq-font-display);
  box-shadow: 0 6px 18px rgba(0,0,0,.55);
}
.theme-ancients .bb-float-text.attack-name { color: var(--cq-gold); }
.theme-ancients .bb-monster-preview { color: var(--cq-text); }

/* ── Forms (profile builder) ────────────────────────────────────────── */
.theme-ancients .bb-form-row label { color: var(--cq-muted); font-family: var(--cq-font-display); }
.theme-ancients .bb-form-row input,
.theme-ancients .bb-form-row select,
.theme-ancients .bb-form-row textarea {
  background: #14100c; border-color: var(--cq-gold-dim); color: var(--cq-text);
  font-family: var(--cq-font-body);
}
.theme-ancients .bb-hp-formula {
  background: rgba(214,184,108,.08); border-color: var(--cq-gold); color: var(--cq-text);
}
.theme-ancients .bb-attack-check input { accent-color: var(--cq-gold); }

/* ── Launcher cards (boss pick, style pick, answer rows) ────────────── */
.theme-ancients .bb-boss-card,
.theme-ancients .bb-style-card,
.theme-ancients .bb-answer-row {
  background: linear-gradient(180deg, rgba(20,16,12,.92), rgba(8,6,4,.96));
  border-color: var(--cq-gold-dim);
  color: var(--cq-text);
}
.theme-ancients .bb-boss-card:hover,
.theme-ancients .bb-style-card:hover { border-color: var(--cq-gold); }
.theme-ancients .bb-boss-card.is-picked,
.theme-ancients .bb-style-card.is-picked {
  border-color: var(--cq-gold); box-shadow: 0 0 0 3px var(--cq-gold-glow);
}
.theme-ancients .bb-boss-card__name,
.theme-ancients .bb-style-card__name { font-family: var(--cq-font-display); color: var(--cq-text); }
.theme-ancients .bb-boss-card__tag,
.theme-ancients .bb-style-card__tag,
.theme-ancients .bb-boss-card__meta,
.theme-ancients .bb-style-card__meta,
.theme-ancients .bb-answer-who { color: var(--cq-muted); }
.theme-ancients .bb-answer-row.is-in { border-color: #3B7A57; background: rgba(59,122,87,.18); }

/* ── Squad Assault cinematic stage (always dark) ────────────────────── */
.theme-ancients .boss-stage {
  background: radial-gradient(ellipse at 60% 30%, #2a2419, #0b0906 70%);
}
.theme-ancients .hud-name,
.theme-ancients .timer { font-family: var(--cq-font-display); color: var(--cq-text); }
.theme-ancients .team-card { background: rgba(214,184,108,.06); border: 1px solid var(--cq-gold-dim); }
.theme-ancients .hpbar { background: #0a0806; border: 1px solid var(--cq-gold-dim); }
.theme-ancients .hpbar .fill { background: linear-gradient(#e0645a, #8b2626); }
.theme-ancients .hpbar .lag  { background: var(--cq-gold); }
.theme-ancients .hpbar.team .fill { background: linear-gradient(#e0c07a, #8a7340); }
.theme-ancients .arena-banner { font-family: var(--cq-font-display); }
.theme-ancients .arena-float { font-family: var(--cq-font-display); color: var(--cq-gold); }
.theme-ancients .pip { background: #4a3b2c; }
.theme-ancients .pip.in { background: var(--cq-gold); }
.theme-ancients .spot { color: var(--cq-muted); }

/* ── Student answer pad (boss-controller.js) ────────────────────────── */
.theme-ancients .ctrl { color: var(--cq-text); }
.theme-ancients .ctrl.spotlight { box-shadow: inset 0 0 0 4px var(--cq-gold); }
.theme-ancients .ctrl-q { font-family: var(--cq-font-display); }
.theme-ancients .spot-tag { color: var(--cq-gold); font-family: var(--cq-font-display); }
.theme-ancients .result .ouch { color: #e08a80; }

/* Light mode: the boss tab opts out of the app's light palette entirely, the way
   the avatar view does — the squad stage's cards must not turn white. */
html[data-theme="light"] .boss-stage .team-card {
  background: rgba(214,184,108,.06);
  border-color: var(--cq-gold-dim);
  box-shadow: none;
}

