/* ── Fast Money Contestant Board ─────────────────────────────────────────── */

/* Prevent author display:flex from overriding the hidden attribute */
.fm-screen[hidden] { display: none; }

.fm-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #020b2e;
  padding: 16px;
  overflow: hidden;
}

.fm-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 8px 8px, rgba(255,255,255,.55) 0 2.5px, transparent 3px);
  background-size: 28px 28px;
  opacity: 0.18;
  pointer-events: none;
}

.fm-title-img {
  max-height: clamp(180px, 32vh, 340px);
  max-width: 90%;
  object-fit: contain;
  margin-bottom: 16px;
  position: relative;
}

/* Outer neon border frame */
.fm-frame {
  position: relative;
  width: 100%;
  max-width: 1100px;
  border-radius: 2rem;
  border: 10px solid #3b82f6;
  background: linear-gradient(180deg, #0c1a6e 0%, #071040 50%, #0c1a6e 100%);
  box-shadow: 0 0 40px rgba(56,189,248,.6), inset 0 0 30px rgba(0,0,0,.8);
  overflow: hidden;
}

.fm-frame::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 1.5rem;
  border: 1px solid rgba(125,211,252,.35);
  pointer-events: none;
  z-index: 1;
}

/* 2-column grid — no gap, columns divided by a line */
.fm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.fm-column {
  display: flex;
  flex-direction: column;
}

.fm-column:first-child {
  border-right: 2px solid rgba(100, 160, 255, .35);
}

/* Each answer row — classic fast money strip */
.fm-row {
  display: grid;
  grid-template-columns: 1fr 68px;
  align-items: center;
  padding: 0 20px;
  min-height: clamp(42px, 6.5vh, 66px);
  background: #000;
  border-bottom: 1px solid rgba(100, 140, 255, .25);
}

.fm-column .fm-row:last-child {
  border-bottom: none;
}

.fm-answer-text {
  font-family: "Arial Black", "Arial Bold", Impact, sans-serif;
  font-size: clamp(.9rem, 1.65vw, 1.5rem);
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.9);
  padding-right: 10px;
  border-right: 2px solid rgba(255,255,255,.25);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fm-score-text {
  font-family: "Arial Black", "Arial Bold", Impact, sans-serif;
  font-size: clamp(.95rem, 1.75vw, 1.55rem);
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.9);
  text-align: center;
  padding-left: 8px;
}

/* Total bar — mirrors the left column row layout so the number aligns under scores */
.fm-total-bar {
  padding: 14px 0;
  display: flex;
  justify-content: flex-start;
  border-top: 2px solid rgba(100, 160, 255, .35);
  background: rgba(0, 5, 40, .7);
}

.fm-total-display {
  width: 50%;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr 68px;
  align-items: center;
  padding: 0 20px;
}

.fm-total-label {
  font-family: "Arial Black", "Arial Bold", Impact, sans-serif;
  font-size: clamp(1rem, 2vw, 1.8rem);
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #fff;
  text-shadow: 0 1px 0 #000;
  text-align: right;
  padding-right: 10px;
  border-right: 2px solid rgba(255,255,255,.25);
}

.fm-total-value {
  font-family: "Arial Black", "Arial Bold", Impact, sans-serif;
  font-size: clamp(1.2rem, 2.4vw, 2.2rem);
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.9);
  text-align: center;
  padding-left: 8px;
  background: #000;
}

/* ── Host Fast Money Controls ───────────────────────────────────────────── */
.fm-host-panel[hidden] { display: none; }
.fm-game-panel[hidden] { display: none; }
.fm-question-picker[hidden] { display: none; }

.fm-host-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fm-host-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fm-host-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto 60px auto;
  gap: 6px;
  align-items: center;
}

.fm-host-row .control {
  width: auto;
  white-space: nowrap;
  min-width: 0;
}

.fm-host-row-num {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.45);
  text-align: right;
  line-height: 1;
}

.fm-host-answer-input,
.fm-host-score-input {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
}

.fm-host-answer-input.fm-revealed,
.fm-host-score-input.fm-revealed {
  border-color: #22c55e !important;
  background: rgba(34,197,94,.12) !important;
}

.fm-host-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(71,85,105,.5);
  flex-wrap: wrap;
}

.fm-host-total {
  font-size: 14px;
  font-weight: 700;
  color: #facc15;
}

/* ── Contestant: Player column headers ──────────────────────────────────── */
.fm-col-header {
  font-family: "Arial Black", "Arial Bold", Impact, sans-serif;
  font-size: clamp(.9rem, 1.8vw, 1.3rem);
  color: #facc15;
  text-transform: uppercase;
  letter-spacing: .1em;
  text-align: center;
  padding: 4px 0 10px;
}

/* ── Contestant: header row (logo + flanking timers) ────────────────────── */
.fm-header-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1100px;
  margin-bottom: 16px;
}

.fm-timer-slot {
  font-family: "Arial Black", "Arial Bold", Impact, sans-serif;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 900;
  color: #facc15;
  text-shadow: 0 0 20px rgba(250,204,21,.7);
  line-height: 1;
  min-width: clamp(80px, 11vw, 150px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 8px 12px;
  transition: color .25s, border-color .25s, box-shadow .25s;
}

.fm-timer-slot:not(:empty) {
  background: rgba(0, 0, 0, .75);
  border: 3px solid #facc15;
  box-shadow: 0 0 28px rgba(250,204,21,.5), inset 0 0 12px rgba(0,0,0,.6);
}

.fm-timer-slot.urgent {
  color: #ef4444;
  text-shadow: 0 0 20px rgba(239,68,68,.8);
}

.fm-timer-slot.urgent:not(:empty) {
  border-color: #ef4444;
  box-shadow: 0 0 28px rgba(239,68,68,.6), inset 0 0 12px rgba(0,0,0,.6);
}

/* ── Contestant: goal label next to total ───────────────────────────────── */
.fm-total-goal {
  color: rgba(250,204,21,.5);
  font-size: .7em;
  margin-left: 6px;
}

/* ── Host: question picker ──────────────────────────────────────────────── */
.fm-category-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.fm-category-label {
  width: 112px;
  font-size: .8rem;
  font-weight: 700;
  color: #facc15;
  flex-shrink: 0;
}

.fm-category-select {
  flex: 1;
  min-width: 0;
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #475569;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: .8rem;
}

.fm-cat-random-btn {
  width: auto !important;
  flex-shrink: 0;
  padding-inline: 10px;
}

.fm-picker-footer {
  padding-top: 8px;
  border-top: 1px solid rgba(71,85,105,.5);
  margin-top: 6px;
}

/* ── Host: timer section ────────────────────────────────────────────────── */
.fm-timer-section {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 10px;
  border-bottom: 1px solid rgba(71,85,105,.5);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.fm-host-timer {
  font-size: 2rem;
  font-weight: 900;
  color: #facc15;
  width: 48px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Host: player group section headers ─────────────────────────────────── */
.fm-player-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: "Arial Black", "Arial Bold", Impact, sans-serif;
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #facc15;
  background: rgba(59, 130, 246, .2);
  border: 1px solid rgba(59, 130, 246, .4);
  border-radius: 4px;
  padding: 5px 5px 5px 10px;
  margin: 4px 0;
}

.fm-player-group-header--p2 {
  margin-top: 14px;
  border-color: rgba(250, 204, 21, .35);
  background: rgba(250, 204, 21, .08);
}

.fm-inline-timer-btn {
  width: auto !important;
  min-height: 30px !important;
  font-size: .75rem !important;
  padding: 2px 10px !important;
  flex-shrink: 0;
}

/* ── Host: question blocks ──────────────────────────────────────────────── */
.fm-question-block {
  border: 1px solid rgba(71,85,105,.4);
  border-radius: 6px;
  margin-bottom: 8px;
  padding: 8px 10px;
  background: rgba(15,23,42,.4);
}

.fm-question-block-header {
  font-size: .78rem;
  color: rgba(255,255,255,.55);
  margin-bottom: 6px;
  line-height: 1.3;
}

.fm-player-section {
  margin-bottom: 2px;
}

.fm-player-section + .fm-player-section {
  padding-top: 6px;
  border-top: 1px solid rgba(71,85,105,.3);
  margin-top: 6px;
}

.fm-player-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #60a5fa;
  margin-bottom: 3px;
}

/* ── Host: suggestion chips ─────────────────────────────────────────────── */
.fm-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 2px;
}

.fm-chip {
  font-size: .72rem;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #3b82f6;
  background: rgba(59,130,246,.15);
  color: #e0e7ff;
  cursor: pointer;
  line-height: 1.6;
  transition: background .15s;
}

.fm-chip em {
  font-style: normal;
  opacity: .65;
  margin-left: 3px;
}

.fm-chip:hover:not(:disabled) {
  background: rgba(59,130,246,.35);
}

.fm-chip:disabled,
.fm-chip.greyed {
  opacity: .3;
  cursor: not-allowed;
  text-decoration: line-through;
}
