/* ===================================================================
   Jeopardy Question Editor — styles
   Shares the board's blue-and-gold look with the main app.
   =================================================================== */

:root {
  --board-blue: #060ce9;
  --board-blue-dark: #030a8c;
  --gold: #d69f4c;
  --gold-bright: #ffcc00;
  --ok: #2e8b57;
  --bad: #c0392b;
  --amber: #d69f4c;
  --ink: #0b1020;
  --paper: #f4f5fb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(circle at 50% 0%, #1b2a6b, #060a2a 70%);
  color: #fff;
  min-height: 100vh;
  padding-bottom: 3rem;
}

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-weight: 600; padding: 0.5rem 0.95rem;
  border: 2px solid var(--board-blue-dark); background: #fff; color: var(--ink);
  border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn:hover { filter: brightness(0.96); }
.btn.primary { background: var(--board-blue); color: #fff; border-color: var(--gold); }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn.danger { background: transparent; color: #ff9a9a; border-color: rgba(255,120,120,.6); }
.btn.small { padding: 0.35rem 0.7rem; font-size: 0.85rem; }

/* ---------- header ---------- */
.editor-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 1rem; flex-wrap: wrap; padding: 1rem 1.2rem 0.6rem;
}
.title-label { font-size: 0.8rem; color: #cdd3ff; display: flex; flex-direction: column; gap: 0.25rem; }
#game-title {
  font: inherit; font-size: 1.3rem; font-weight: 800; color: var(--gold-bright);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px; padding: 0.4rem 0.7rem; min-width: 320px;
}
.header-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ---------- toolbar ---------- */
.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap; padding: 0.4rem 1.2rem;
}
.round-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.round-tab {
  padding: 0.4rem 0.9rem; border-radius: 999px; cursor: pointer; font-weight: 700;
  background: rgba(255,255,255,.1); color: #cdd3ff; border: 1px solid transparent;
}
.round-tab.active { background: var(--gold); color: var(--ink); }
.round-controls { display: flex; gap: 0.5rem; align-items: center; }
.round-controls label { font-size: 0.75rem; color: #cdd3ff; display: flex; align-items: center; gap: 0.4rem; }
.round-controls input {
  font: inherit; padding: 0.35rem 0.5rem; border-radius: 6px;
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff;
}

.editor-hint { color: #aeb6e6; padding: 0 1.2rem; margin: 0.3rem 0 0.6rem; font-size: 0.9rem; }
.hint { color: #aeb6e6; }

/* ---------- board ---------- */
.board {
  display: grid; gap: 6px; padding: 0 1.2rem; max-width: 1500px; margin: 0 auto;
}
.cat-input {
  background: var(--board-blue); color: #fff; text-transform: uppercase; font-weight: 800;
  text-align: center; border: 2px solid var(--board-blue-dark); min-height: 74px;
  font: inherit; font-weight: 800; padding: 0.4rem; resize: none;
  font-size: clamp(0.7rem, 1.1vw, 0.95rem); line-height: 1.15;
}
.cat-input::placeholder { color: rgba(255,255,255,.45); }
.cat-input:focus { outline: 3px solid var(--gold-bright); }

.clue-cell {
  background: var(--board-blue); color: var(--gold-bright);
  border: 2px solid var(--board-blue-dark); font-weight: 800;
  font-size: clamp(1rem, 2.2vw, 1.8rem);
  display: flex; align-items: center; justify-content: center; position: relative;
  min-height: 70px; cursor: pointer; text-shadow: 2px 2px 0 var(--board-blue-dark);
}
.clue-cell:hover { background: #1a24c9; }
.clue-cell .status {
  position: absolute; top: 4px; right: 6px; font-size: 0.7rem;
  width: 16px; height: 16px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; text-shadow: none; color: #fff;
}
.clue-cell.filled { border-color: var(--ok); }
.clue-cell.filled .status { background: var(--ok); }
.clue-cell.partial { border-color: var(--amber); }
.clue-cell.partial .status { background: var(--amber); color: var(--ink); }

/* ---------- final jeopardy ---------- */
.final-section {
  max-width: 1500px; margin: 1.4rem auto 0; padding: 0 1.2rem;
}
.switch-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.final-fields {
  display: grid; gap: 0.7rem; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.15); border-radius: 10px; padding: 1rem;
}
.final-fields label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; color: #cdd3ff; }
.final-fields input, .final-fields textarea {
  font: inherit; padding: 0.5rem 0.6rem; border-radius: 6px; border: 1px solid #c3c9de; color: var(--ink);
}

.save-status { text-align: center; margin-top: 1rem; min-height: 1.2em; }
.save-status.ok { color: #8ff0b0; }
.save-status.warn { color: #ffd27a; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(3,5,20,.85);
  display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 50;
}
.hidden { display: none !important; }
.edit-card {
  background: var(--board-blue); color: #fff; border: 4px solid var(--gold);
  border-radius: 12px; width: min(640px, 96vw); max-height: 92vh; overflow-y: auto;
  padding: 1.4rem 1.6rem; box-shadow: 0 10px 40px rgba(0,0,0,.6);
}
.edit-meta { text-transform: uppercase; font-weight: 800; color: var(--gold-bright); letter-spacing: 1px; margin-bottom: 1rem; font-size: 1.1rem; }
.edit-form { display: flex; flex-direction: column; gap: 0.9rem; }
.edit-form label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; }
.edit-form .sub { font-weight: 400; color: #cdd3ff; font-size: 0.8rem; }
.edit-form input, .edit-form textarea {
  font: inherit; padding: 0.55rem 0.7rem; border-radius: 6px; border: 1px solid #c3c9de; color: var(--ink);
}
.modal-footer { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.2rem; }
.modal-footer .spacer { flex: 1; }
