/* Corporate Buzzword Bingo — navy & blue, per the mockup */

:root {
  --navy: #101c3a;
  --navy-deep: #0b142b;
  --blue: #4a7fe8;
  --blue-bright: #6ba0ff;
  --blue-pale: #cddcf7;
  --paper: #f5f4ef;
  --paper-dim: #e8e6de;
  --ink: #1a2647;
  --gold: #f4c542;
  --radius: 10px;
}

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

html, body {
  height: 100%;
}

body {
  background: var(--navy);
  color: var(--paper);
  font-family: "Avenir Next", "Segoe UI", Futura, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.view { display: flex; flex-direction: column; flex: 1; }
[hidden] { display: none !important; }

/* ---------- Masthead ---------- */

.masthead { text-align: center; padding: 28px 0 8px; }
.megaphone { font-size: 44px; transform: rotate(-12deg); display: inline-block; }

.masthead-kicker {
  font-size: clamp(26px, 6vw, 44px);
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--paper);
}

.masthead-title {
  font-size: clamp(56px, 14vw, 110px);
  font-weight: 900;
  letter-spacing: 18px;
  margin-left: 18px; /* offset trailing letter-spacing */
  color: var(--blue);
  line-height: 1;
}

.masthead-tag {
  color: var(--blue-bright);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: clamp(11px, 2.6vw, 15px);
  margin-top: 10px;
}

/* ---------- Lobby ---------- */

.lobby {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 36px 0;
}

.btn {
  font: inherit;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.06s ease, filter 0.15s ease;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--blue);
  color: white;
  padding: 14px 28px;
  font-size: 16px;
}
.btn-primary:hover { filter: brightness(1.1); }

.btn-big { font-size: 20px; padding: 18px 40px; }

.btn-secondary {
  background: transparent;
  color: var(--blue-bright);
  border: 2px solid var(--blue);
  padding: 10px 18px;
  font-size: 14px;
}
.btn-secondary:hover { background: rgba(74, 127, 232, 0.15); }

.btn-small { padding: 7px 14px; font-size: 12px; }

.lobby-divider {
  color: var(--blue-pale);
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.lobby-divider::before,
.lobby-divider::after {
  content: "";
  display: block;
  width: 60px;
  height: 1px;
  background: currentColor;
}

.join-form { display: flex; gap: 10px; }

#input-code {
  font: inherit;
  font-weight: 800;
  letter-spacing: 6px;
  text-transform: uppercase;
  text-align: center;
  width: 190px;
  padding: 10px 6px;
  border-radius: var(--radius);
  border: 2px solid var(--blue);
  background: var(--navy-deep);
  color: var(--paper);
  outline: none;
}
#input-code:focus { border-color: var(--blue-bright); }
#input-code::placeholder { color: var(--blue-pale); opacity: 0.4; letter-spacing: 3px; }

.join-error { color: #ff9a9a; font-size: 14px; }

/* ---------- Rules strip ---------- */

.rules-strip {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  border-top: 2px solid rgba(107, 160, 255, 0.25);
  padding: 20px 4px 10px;
}

.rules-col h3 {
  color: var(--blue-bright);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.rules-col ul { list-style: none; }
.rules-col li {
  font-size: 12.5px;
  color: var(--blue-pale);
  padding-left: 14px;
  position: relative;
  margin-bottom: 5px;
  line-height: 1.35;
}
.rules-col li::before { content: "•"; position: absolute; left: 0; color: var(--blue); }

@media (max-width: 620px) {
  .rules-strip { grid-template-columns: 1fr; }
}

/* ---------- Game header ---------- */

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0 14px;
}

.home-link {
  color: var(--paper);
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 15px;
}
.home-link:hover { color: var(--blue-bright); }

.game-header-right { display: flex; align-items: center; gap: 10px; }

.code-chip {
  background: var(--navy-deep);
  border: 1px solid rgba(107, 160, 255, 0.4);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--blue-pale);
}
.code-chip strong { color: white; letter-spacing: 2px; }

/* ---------- Status banner ---------- */

.status-banner {
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: clamp(11px, 2.6vw, 14px);
  color: var(--blue-bright);
  padding: 6px 0 14px;
}

/* ---------- Board ---------- */

.board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  background: var(--navy-deep);
  border: 3px solid var(--paper);
  border-radius: 6px;
  padding: 6px;
}

.board-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(20px, 5vw, 34px);
  font-weight: 900;
  color: var(--blue);
  background: var(--paper);
  border-radius: 3px;
  padding: 4px 0;
}

.cell {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px;
  background: var(--paper);
  color: var(--ink);
  border: none;
  border-radius: 3px;
  font: inherit;
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(8px, 1.9vw, 13px);
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.12s ease;
  overflow: hidden;
  word-break: break-word;
  hyphens: auto;
}
.cell:hover { background: var(--paper-dim); }

.cell.marked {
  background: var(--blue-pale);
  color: var(--navy);
}
.cell.marked::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(74, 127, 232, 0.28) 0 58%, transparent 60%);
  pointer-events: none;
}

.cell.free {
  background: var(--blue-pale);
  color: var(--navy);
  font-weight: 900;
  cursor: default;
}

.cell.in-line {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}

.cell.pop { animation: pop 0.18s ease; }
@keyframes pop {
  50% { transform: scale(1.07); }
}

/* ---------- Bonus bar ---------- */

.bonus-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 0 4px;
}

.bonus-label {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 11px;
  color: var(--blue-pale);
  opacity: 0.7;
}

.btn-bonus {
  background: transparent;
  border: 1.5px dashed var(--blue);
  color: var(--blue-pale);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}
.btn-bonus:hover { background: rgba(74, 127, 232, 0.15); }
.bonus-reward { color: var(--gold); font-weight: 800; margin-left: 4px; }

.wild-count {
  background: var(--gold);
  color: var(--navy);
  font-weight: 900;
  font-size: 12px;
  border-radius: 999px;
  padding: 6px 12px;
  animation: pop 0.18s ease;
}

/* ---------- Game actions ---------- */

.game-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px 0;
}

/* ---------- Scoring strip ---------- */

.scoring-strip {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  border-top: 2px solid rgba(107, 160, 255, 0.25);
  padding: 14px 0 6px;
}

.tier {
  font-size: 12px;
  color: var(--blue-pale);
  opacity: 0.55;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tier.achieved { opacity: 1; color: var(--gold); font-weight: 800; }
.tier.current { opacity: 0.9; color: var(--blue-bright); font-weight: 700; }

/* ---------- Win overlay ---------- */

.win-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 20, 43, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.win-box {
  background: var(--paper);
  color: var(--ink);
  border-radius: 16px;
  text-align: center;
  padding: 36px 32px 26px;
  max-width: 420px;
  width: 100%;
  animation: winpop 0.25s ease;
}
@keyframes winpop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.win-emoji { font-size: 56px; }
.win-box h2 {
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--blue);
  margin: 8px 0 4px;
}
.win-box p { font-weight: 700; margin-bottom: 20px; }
.win-flex {
  margin-top: 18px;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #6a7290;
  line-height: 1.5;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue);
  color: white;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  z-index: 60;
  animation: toast-in 0.2s ease;
}
@keyframes toast-in {
  from { transform: translate(-50%, 12px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
