/* 🐝 Spelling Bee — honey theme */
:root {
  --honey: #f6b93b;
  --honey-dark: #e58e26;
  --ink: #2d3436;
  --paper: #fffbee;
  --card: #ffffff;
  --line: #f0e6cc;
  --green: #2ecc71;
  --red: #e74c3c;
  --easy: #6ab04c;
  --medium: #f0932b;
  --hard: #eb4d4b;
  --wildcard: #9b59b6;
  --master: #d4a017;
}

* { box-sizing: border-box; margin: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--paper);
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  min-height: 100vh;
}

.hidden { display: none !important; }

main { max-width: 760px; margin: 0 auto; padding: 16px 16px 80px; }

h1 { font-size: 2.2rem; text-align: center; margin-top: 40px; }
.tagline { text-align: center; color: #888; margin: 8px 0 28px; }

/* ---------- Scoreboard (always visible) ---------- */
#scoreboard {
  position: sticky; top: 0; z-index: 10;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.board-inner {
  max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  flex-wrap: wrap;
}
.logo { font-size: 1.5rem; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.pill {
  background: #3d4548;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 5px 14px;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  font-size: .95rem;
  color: #fff;
}
.pill:hover { border-color: var(--honey); }
.pill.leader { border-color: var(--honey); background: #4a4020; }
.pill .score {
  background: var(--honey); color: var(--ink);
  border-radius: 999px; padding: 1px 10px;
  font-weight: 700; min-width: 34px; text-align: center;
}

/* ---------- Buttons ---------- */
button { font: inherit; cursor: pointer; border: none; border-radius: 12px; }
.primary {
  background: var(--honey); color: var(--ink);
  padding: 10px 22px; font-weight: 700;
  box-shadow: 0 3px 0 var(--honey-dark);
}
.primary:active { transform: translateY(2px); box-shadow: none; }
.primary.big { font-size: 1.15rem; padding: 14px 30px; }
.ghost {
  background: transparent; color: inherit;
  border: 2px dashed #bbb; padding: 8px 16px;
}
.ghost:hover { border-color: var(--honey); }
.ghost.small { padding: 5px 12px; font-size: .85rem; border-style: solid; border-color: #555; }

/* ---------- Setup ---------- */
#team-inputs { display: flex; flex-direction: column; gap: 10px; max-width: 420px; margin: 0 auto; }
.team-row { display: flex; gap: 8px; }
.team-row input {
  flex: 1; font: inherit; padding: 12px 16px;
  border: 2px solid var(--line); border-radius: 12px;
  background: var(--card);
}
.team-row input:focus { outline: none; border-color: var(--honey); }
.team-row .remove { background: none; font-size: 1.1rem; color: #bbb; }
.team-row .remove:hover { color: var(--red); }
.setup-actions {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; margin-top: 24px;
}

/* ---------- Cards / rounds ---------- */
.card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-top: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
}
.card h2 { font-size: 1rem; color: #888; font-weight: 600; margin-bottom: 12px; }

.round-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.round-title { font-weight: 700; font-size: 1.05rem; }
.badge {
  color: #fff; border-radius: 999px; padding: 3px 12px;
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
}
.badge.easy { background: var(--easy); }
.badge.medium { background: var(--medium); }
.badge.hard { background: var(--hard); }
.badge.wildcard { background: var(--wildcard); }
.badge.master { background: var(--master); }
.round-head .delete { margin-left: auto; background: none; color: #ccc; font-size: 1rem; }
.round-head .delete:hover { color: var(--red); }

.team-line {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--line);
}
.team-line .tname { flex: 1; font-weight: 600; }
.mark {
  width: 44px; height: 40px; font-size: 1.1rem;
  border: 2px solid var(--line); background: #fafafa; border-radius: 12px;
  transition: transform .08s;
}
.mark:hover { transform: scale(1.08); }
.mark.ok.active { background: var(--green); border-color: var(--green); color: #fff; }
.mark.no.active { background: var(--red); border-color: var(--red); color: #fff; }
.wager {
  display: flex; align-items: center; gap: 2px;
  background: #fdf6e3; border: 1px solid var(--master);
  border-radius: 999px; padding: 2px;
}
.wager .step {
  width: 28px; height: 28px; border-radius: 50%;
  background: transparent; color: var(--master);
  font-size: 1.05rem; font-weight: 800; line-height: 1;
}
.wager .step:hover { background: var(--master); color: #fff; }
.wager .wval {
  min-width: 22px; text-align: center;
  font-weight: 800; color: var(--master); font-variant-numeric: tabular-nums;
}
.delta { min-width: 42px; text-align: right; font-weight: 700; font-size: .95rem; }
.delta.pos { color: var(--green); }
.delta.neg { color: var(--red); }
.delta.zero { color: #ccc; }

/* ---------- Timer (master rounds) ---------- */
.timer {
  display: flex; align-items: center; gap: 12px;
  background: #fdf6e3; border: 2px dashed var(--master);
  border-radius: 12px; padding: 8px 14px; margin-bottom: 10px;
}
.timer .clock { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 64px; }
.timer.done .clock { color: var(--red); animation: blink .5s step-start 6; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- New round picker ---------- */
.add-round { border-style: dashed; }
.diff-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.diff {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; color: #fff; font-weight: 700;
  box-shadow: 0 3px 0 rgba(0,0,0,.2);
}
.diff:active { transform: translateY(2px); box-shadow: none; }
.diff small { font-weight: 400; opacity: .9; }
.diff.easy { background: var(--easy); }
.diff.medium { background: var(--medium); }
.diff.hard { background: var(--hard); }
.diff.wildcard { background: var(--wildcard); }
.diff.master { background: var(--master); }

/* ---------- Overlay ---------- */
#overlay {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.overlay-card {
  background: var(--card); border-radius: 20px;
  padding: 32px; max-width: 420px; width: 100%; text-align: center;
}
.overlay-card h2 { font-size: 1.6rem; margin-bottom: 6px; }
.winner-name { font-size: 2rem; font-weight: 800; color: var(--honey-dark); margin: 10px 0; }
.final-list { list-style: none; padding: 0; margin: 18px 0; }
.final-list li {
  display: flex; justify-content: space-between;
  padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 1.05rem;
}
.final-list li:first-child { font-weight: 800; background: #fff8dd; border-radius: 10px; }
.overlay-actions { display: flex; gap: 12px; justify-content: center; margin-top: 8px; }

@media (max-width: 520px) {
  .pill { font-size: .85rem; padding: 4px 10px; }
  .mark { width: 40px; }
}
