:root {
  --bg: #090e17;
  --surface: #121c2e;
  --panel: #1a2942;
  --line: #293e61;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --gold: #f59e0b;
  --teal: #10b981;
  --cyan: #38bdf8;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Lexend", system-ui, sans-serif;
}

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

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: var(--surface);
  border-bottom: 2px solid var(--line);
  padding: 0.75rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  font-size: 2rem;
  background: linear-gradient(135deg, #d97706, #92400e);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.brand h1 {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
}

.brand p {
  font-size: 0.8rem;
  color: var(--muted);
}

.controls-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.controls-bar select {
  font-family: var(--body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: #fff;
  cursor: pointer;
  outline: none;
}

.btn-header {
  font-family: var(--body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-header:hover {
  background: var(--gold);
  color: #090e17;
}

main {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Case Banner */
.case-banner {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 0.8rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.case-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.case-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

.case-val {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
}

.rank-val {
  color: var(--gold);
}

.prompt-box {
  flex: 1;
  text-align: center;
}

.mission-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
}

.prompt-main {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.case-streak {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold);
}

/* Arena */
.investigation-arena {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Evidence Card */
.evidence-card {
  background: radial-gradient(circle at 10% 20%, #1a2f4c, var(--surface) 90%);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 1.4rem 1.8rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.magnifier-icon {
  font-size: 3rem;
  background: var(--panel);
  border: 2px solid var(--gold);
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
}

.evidence-text-box {
  display: flex;
  flex-direction: column;
}

.evidence-sub {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.evidence-word {
  font-family: var(--display);
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
}

/* Sentence Hunter Board */
.sentence-board {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 1.4rem 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.sentence-sub {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
}

.sentence-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  line-height: 2;
}

.token-btn {
  font-family: var(--body);
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.token-btn:hover {
  transform: translateY(-3px) scale(1.06);
  border-color: var(--gold);
  background: #253959;
}

.token-btn.correct {
  background: #064e3b;
  border-color: var(--teal);
  color: #a7f3d0;
}

.token-btn.wrong {
  background: #7f1d1d;
  border-color: #ef4444;
  color: #fecaca;
}

/* Choices Grid */
.choices-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.bin-btn {
  font-family: var(--body);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 1.1rem 1.4rem;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 14px;
  color: #fff;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.18s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.bin-btn:hover {
  transform: translateY(-3px);
  border-color: var(--cyan);
  background: var(--panel);
}

.bin-btn.correct {
  background: #064e3b;
  border-color: var(--teal);
  color: #a7f3d0;
}

.bin-btn.wrong {
  background: #7f1d1d;
  border-color: #ef4444;
  color: #fecaca;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 14, 23, 0.85);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 22px;
  padding: 2.2rem 2rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.modal-card h2 {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
}

.modal-card p {
  color: var(--muted);
  margin: 0.6rem 0 1.2rem;
}

.badge-award {
  background: var(--panel);
  border: 2px solid var(--gold);
  padding: 0.8rem 1.4rem;
  border-radius: 12px;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.modal-btn {
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}
