/* Detectives AI — player-facing game UI */

:root {
  /* Cap for case/evidence column; width is min(this, 100% of padded main) */
  --case-readable-width: 58rem;
}

.case-page {
  padding: 0 clamp(0.5rem, 2.5vw, 1.25rem) 2.5rem;
  font-size: 1.0625rem;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 15px 20px;
  background: linear-gradient(135deg, var(--dark) 0%, var(--panel-blue) 100%);
  border-bottom: 2px solid var(--gold);
}

.app-logo {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.4em;
  font-weight: 900;
  color: var(--gold);
  line-height: 1.2;
  letter-spacing: 1px;
}

.app-logo span.subtitle,
.app-logo .subtitle {
  display: block;
  font-family: "Source Sans Pro", sans-serif;
  font-size: 0.55em;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 0.15em;
}

.app-header nav,
.app-header .nav-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.app-header .nav-buttons .btn-outline {
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
}

.app-header .nav-buttons .btn-outline.is-active {
  background: var(--gold);
  color: var(--dark);
  border-color: var(--gold);
}

.app-header .nav-buttons .btn-danger {
  font-size: 0.75em;
  padding: 6px 14px;
  border-radius: 4px;
}

/* Auth screens — index.html signup-screen */
.signup-screen,
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: radial-gradient(ellipse at center, var(--panel-blue) 0%, var(--darker) 70%);
}

.auth-card {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 50px 40px;
  background: var(--dark);
  border: 1px solid var(--gold);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.auth-card form {
  text-align: left;
}

/* Detective ID — index.html detective-id-card */
.detective-id-card {
  position: relative;
  padding: 20px;
  margin: 0 auto;
  max-width: 420px;
  background: linear-gradient(145deg, var(--panel-mid), var(--panel-blue));
  border: 2px solid var(--gold);
  border-radius: 10px;
  overflow: hidden;
}

.detective-id-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(201, 168, 76, 0.03) 10px,
    rgba(201, 168, 76, 0.03) 20px
  );
  pointer-events: none;
}

.detective-id-card .id-badge-heading {
  position: relative;
  z-index: 1;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1.35;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.28);
}

.detective-id-card .id-card-header,
.detective-id-card .id-card-header h2 {
  position: relative;
  z-index: 1;
}

.detective-id-card .id-card-header {
  padding-bottom: 14px;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(42, 42, 62, 0.9);
}

.detective-id-card .id-card-header h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5em;
  color: #fff;
  margin: 0;
}

.detective-id-card .id-rank-line {
  position: relative;
  z-index: 1;
  color: rgba(200, 200, 210, 0.75);
  font-size: 0.85em;
  font-family: "Source Sans Pro", sans-serif;
  margin: 0.35rem 0 0;
}

.detective-id-card .stats-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 0;
  padding-top: 14px;
  border-top: none;
}

.detective-id-card .id-stat-cell {
  flex: 1;
  min-width: 4.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  text-align: center;
}

.detective-id-card .id-stat-value {
  order: 1;
  color: var(--gold);
  font-size: 1.35em;
  font-weight: 700;
  font-family: "Playfair Display", Georgia, serif;
  line-height: 1.1;
  transition: transform 0.3s ease, color 0.3s ease, text-shadow 0.3s ease;
}

.detective-id-card .id-stat-value.bump {
  transform: scale(1.15);
  color: var(--gold-light);
  text-shadow: 0 0 20px rgba(201, 168, 76, 0.45);
}

.detective-id-card .id-stat-label {
  order: 2;
  color: rgba(200, 200, 210, 0.8);
  font-size: 0.65rem;
  font-family: "Source Sans Pro", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.detective-id-card .badge-remember {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  padding: 10px 12px;
  font-size: 0.78rem;
  font-family: "Source Sans Pro", sans-serif;
  color: rgba(232, 212, 139, 0.95);
  background: rgba(15, 15, 31, 0.55);
  border-radius: 6px;
  text-align: center;
  border: 1px solid rgba(201, 168, 76, 0.2);
}

.detective-id-card .badge-remember strong {
  color: var(--gold-light);
}

/* Case brief column — header, mission, scoring, prizes, countdown, quick stats */
.case-brief-stack {
  width: 100%;
  max-width: min(100%, var(--case-readable-width));
  margin: 0 auto;
  padding-bottom: 0.35rem;
  box-sizing: border-box;
}

.case-id-card-wrap {
  width: 100%;
  max-width: min(100%, var(--case-readable-width));
  margin: 1.35rem auto 1rem;
  box-sizing: border-box;
}

/* Case header — index.html case-header-section */
.case-header-section {
  padding: 25px 20px;
  background: linear-gradient(135deg, var(--dark), var(--panel-blue));
  border-bottom: 2px solid var(--gold);
  margin-bottom: 0;
  width: 100%;
  box-sizing: border-box;
}

.case-file-label {
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--gold);
  margin-bottom: 8px;
  font-family: "Special Elite", "Courier New", monospace;
}

.case-title-main {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.65rem, 4vw, 2.05rem);
  color: #fff;
  margin-bottom: 15px;
  line-height: 1.3;
}

.case-header-section .case-description {
  color: #bbb;
  line-height: 1.7;
  font-size: 0.95em;
  max-width: 100%;
}

/* Case image — contained frame */
.case-image-frame {
  position: relative;
  width: 100%;
  max-height: 200px;
  margin-bottom: 1rem;
  border-radius: 8px;
  border: 1px solid rgba(201, 168, 76, 0.35);
  background: rgba(15, 15, 31, 0.8);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.case-image-frame:hover {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(201, 168, 76, 0.18);
}

.case-image-frame img {
  display: block;
  width: 100%;
  max-height: 200px;
  object-fit: contain;
}

.case-image-zoom-hint {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 0;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-light);
  background: linear-gradient(transparent, rgba(15, 15, 31, 0.85));
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.case-image-frame:hover .case-image-zoom-hint {
  opacity: 1;
}

/* Catalogue link — index.html .catalogue-link */
.catalogue-link-btn {
  display: inline-block;
  margin-top: 15px;
  color: var(--gold);
  text-decoration: none;
  border: 1px solid var(--gold);
  padding: 8px 16px;
  border-radius: 5px;
  font-size: 0.85em;
  font-weight: 600;
  font-family: "Source Sans Pro", sans-serif;
  transition: all 0.2s ease;
}

.catalogue-link-btn:hover {
  background: var(--gold);
  color: var(--dark);
}

.case-catalogue-cta {
  margin: 1rem 0 2rem;
  padding: 0 2px;
}

.catalogue-link-btn--below-stats {
  margin-top: 0;
}

@media (max-width: 480px) {
  .case-catalogue-cta .catalogue-link-btn {
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
}

/* Lightbox overlay — visibility controlled by JS via style.display */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lightbox-content {
  position: relative;
  max-width: 95vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 95vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  background: var(--darker);
  border: 1px solid var(--gold);
  border-radius: 50%;
  cursor: pointer;
  z-index: 1;
  transition: background 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(201, 168, 76, 0.25);
}

.lightbox-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
}

.lightbox-download {
  font-size: 0.85rem;
  padding: 0.5rem 1.25rem;
}

/* Info boxes — index.html objective / scoring / prize */
.objective-box {
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 8px;
  padding: 18px;
  margin-top: 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.objective-box h2 {
  font-family: "Playfair Display", Georgia, serif;
  color: var(--gold);
  font-size: 1em;
  margin-bottom: 8px;
}

.objective-box > div {
  color: #ccc;
  font-size: 0.98em;
  line-height: 1.65;
}

.scoring-box {
  background: rgba(45, 106, 79, 0.08);
  border: 1px solid rgba(45, 106, 79, 0.3);
  border-radius: 8px;
  padding: 18px;
  margin-top: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.scoring-box h2 {
  font-family: "Playfair Display", Georgia, serif;
  color: var(--green-light);
  font-size: 1em;
  margin-bottom: 8px;
}

.scoring-box > div {
  color: #aaa;
  font-size: 0.98em;
  line-height: 1.65;
}

.prize-box {
  background: rgba(201, 168, 76, 0.05);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 8px;
  padding: 15px;
  margin-top: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.prize-box h2 {
  flex: 1 1 100%;
  width: 100%;
  font-family: "Playfair Display", Georgia, serif;
  color: var(--gold);
  font-size: 1em;
  margin: 0 0 4px;
}

.prize-box .prize-item {
  flex: 1;
  min-width: 200px;
}

.prize-box .prize-item h3 {
  color: var(--gold);
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 4px;
  font-weight: 600;
}

.prize-box .prize-item p {
  color: var(--text);
  font-size: 0.95em;
  margin: 0;
  line-height: 1.5;
}

/* Countdown — index.html boxed style */
.countdown-section {
  width: 100%;
  max-width: 100%;
  margin: 15px 0 0;
  box-sizing: border-box;
}

/* Clues / max points row — after countdown */
.case-quick-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1.25rem 2rem;
  margin-top: 1rem;
  padding: 0 4px 0.25rem;
  font-family: "Source Sans Pro", sans-serif;
  font-size: 1rem;
}

.case-quick-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.case-quick-stat-label {
  font-weight: 700;
  color: var(--gold);
}

.case-quick-stat-value {
  color: #ccc;
  font-weight: 500;
}

/* Gold rule before evidence board (matches case header bottom border) */
.evidence-board-gold-top {
  border-top: 2px solid var(--gold);
  margin-top: 2rem;
  padding-top: 1.75rem;
}

.countdown-bar {
  background: rgba(139, 37, 0, 0.15);
  border: 1px solid rgba(139, 37, 0, 0.3);
  border-radius: 8px;
  padding: 15px;
  text-align: center;
}

.countdown-bar.is-open,
.countdown-bar[data-state="open"] {
  background: rgba(45, 106, 79, 0.1);
  border-color: rgba(45, 106, 79, 0.3);
}

.countdown-label {
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 5px;
}

.countdown-time,
#countdown.typewriter {
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 1.4em;
  color: var(--text);
  margin: 0;
}

#countdown:not(.typewriter) {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.35rem;
  color: var(--gold);
  margin: 0;
}

/* Evidence board — index.html clues-section */
.evidence-board {
  padding: 25px 20px;
  max-width: min(100%, var(--case-readable-width));
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.evidence-board > h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.35em;
  color: var(--gold);
  margin-bottom: 6px;
}

.clues-progress {
  color: var(--muted);
  font-size: 0.92em;
  margin-bottom: 22px;
}

.clues-progress strong {
  color: var(--gold);
}

/* Difficulty sections — band behind each group */
.difficulty-group {
  margin-bottom: 1.5rem;
  padding: 12px 14px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.difficulty-group--easy {
  background: rgba(45, 106, 79, 0.12);
  border-color: rgba(64, 145, 108, 0.45);
  box-shadow: inset 4px 0 0 var(--green-light);
}

.difficulty-group--intermediate {
  background: rgba(201, 168, 76, 0.1);
  border-color: rgba(201, 168, 76, 0.35);
  box-shadow: inset 4px 0 0 var(--gold);
}

.difficulty-group--hard {
  background: rgba(139, 37, 0, 0.12);
  border-color: rgba(139, 37, 0, 0.4);
  box-shadow: inset 4px 0 0 var(--red);
}

.diff-group-label {
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 12px;
  padding: 0 0 10px;
  border-bottom: 2px solid var(--border-subtle);
  font-weight: 700;
}

.diff-group-label.easy {
  color: var(--green-light);
  border-bottom-color: rgba(64, 145, 108, 0.4);
}

.diff-group-label.intermediate {
  color: var(--gold);
  border-bottom-color: rgba(201, 168, 76, 0.45);
}

.diff-group-label.hard {
  color: #c45c3e;
  border-bottom-color: rgba(139, 37, 0, 0.45);
}

/* Clue slots — index.html */
.clue-slot {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 18px 20px;
  margin-bottom: 12px;
  background: var(--dark);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  border-left-width: 4px;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.clue-slot--easy:not(.is-solved):not(.is-wrong) {
  border-left-color: var(--green-light);
  background: rgba(15, 15, 31, 0.92);
}

.clue-slot--intermediate:not(.is-solved):not(.is-wrong) {
  border-left-color: var(--gold);
  background: rgba(15, 15, 31, 0.92);
}

.clue-slot--hard:not(.is-solved):not(.is-wrong) {
  border-left-color: var(--red);
  background: rgba(15, 15, 31, 0.92);
}

.clue-slot:hover:not(.is-solved):not(.is-wrong) {
  box-shadow: 0 0 0 1px rgba(201, 168, 76, 0.22);
}

.clue-slot.is-solved,
.clue-slot[data-state="solved"] {
  border-color: var(--green);
  border-left-color: var(--green);
  background: rgba(45, 106, 79, 0.18);
  animation: solvedPulse 0.6s ease;
}

.clue-slot.is-wrong,
.clue-slot[data-state="wrong"] {
  border-color: var(--red);
  border-left-color: var(--red);
  background: rgba(139, 37, 0, 0.1);
  animation: clue-shake 0.45s ease;
}

@keyframes solvedPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.01);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes clue-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}

.clue-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  margin-top: 2px;
  font-weight: 700;
  font-size: 0.9em;
  color: var(--gold);
  background: var(--darker);
  border: 1px solid var(--gold);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.clue-slot.is-solved .clue-number,
.clue-slot[data-state="solved"] .clue-number {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.clue-slot .clue-body {
  flex: 1;
  min-width: 0;
}

.clue-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.clue-difficulty-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}

.clue-difficulty-pill--easy {
  color: var(--green-light);
  border-color: rgba(64, 145, 108, 0.55);
  background: rgba(45, 106, 79, 0.2);
}

.clue-difficulty-pill--intermediate {
  color: var(--gold-light);
  border-color: rgba(201, 168, 76, 0.5);
  background: rgba(201, 168, 76, 0.12);
}

.clue-difficulty-pill--hard {
  color: #e8a090;
  border-color: rgba(139, 37, 0, 0.55);
  background: rgba(139, 37, 0, 0.18);
}

.clue-slot.is-solved .clue-difficulty-pill {
  opacity: 0.85;
}

.clue-points-earned {
  font-size: 0.88rem;
  font-weight: 600;
  font-family: "Source Sans Pro", sans-serif;
}

.clue-points-earned__value--potential {
  color: var(--muted);
}

.clue-points-earned__value--yes {
  color: var(--green-light);
}

.clue-points-earned__value--no {
  color: var(--muted);
}

.clue-prompt-text {
  margin: 0;
  font-size: 1.05em;
  color: var(--text);
  line-height: 1.5;
}

.clue-hint-text {
  margin: 0.5rem 0 0;
  font-size: 0.86em;
  color: var(--muted);
  font-style: italic;
}

.clue-lot-text {
  margin: 0.35rem 0 0;
  font-size: 0.8em;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: "Special Elite", "Courier New", monospace;
}

.clue-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.clue-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--darker);
  border: 1px solid #333;
  border-radius: 5px;
  color: var(--text);
  font-size: 1em;
  font-family: "Special Elite", "Courier New", monospace;
  transition: border-color 0.2s ease;
}

.clue-input::placeholder {
  color: #444;
  font-family: "Source Sans Pro", sans-serif;
  font-style: italic;
}

.clue-input:focus {
  outline: none;
  border-color: var(--gold);
}

.clue-input-row .btn-check,
.clue-input + .btn-check {
  flex-shrink: 0;
  background: var(--gold);
  color: var(--dark);
  border: none;
  padding: 10px 18px;
  border-radius: 5px;
  font-weight: 700;
  font-size: 0.9em;
  font-family: "Source Sans Pro", sans-serif;
  cursor: pointer;
  white-space: nowrap;
}

.clue-input-row .btn-check:hover:not(:disabled),
.clue-input + .btn-check:hover:not(:disabled) {
  background: var(--gold-light);
}

.clue-input-row .btn-check:disabled,
.clue-input + .btn-check:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.clue-result {
  font-size: 0.92em;
  margin-top: 8px;
  font-weight: 600;
  min-height: 1.25rem;
}

.clue-verdict--correct {
  color: var(--green-light);
}

.clue-verdict--wrong {
  color: var(--red);
}

.clue-verdict--skipped {
  color: var(--muted);
  font-weight: 500;
}

.clue-check-msg {
  display: inline-block;
  margin-right: 8px;
}

.clue-check-msg.msg-correct {
  color: var(--green);
}

.clue-check-msg.msg-wrong {
  color: var(--red);
}

.clue-check-msg.msg-error {
  color: var(--red);
}

/* No active case — index.html .no-case */
.no-case-panel {
  background: var(--dark);
  border: 1px solid #2a2a3e;
  border-radius: 8px;
  margin-top: 1rem;
}

.no-case-screen {
  text-align: center;
  padding: 80px 20px;
  max-width: 700px;
  margin: 0 auto;
}

.no-case-screen h1 {
  font-family: "Playfair Display", Georgia, serif;
  color: var(--gold);
  margin-bottom: 10px;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
}

.no-case-screen p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 36ch;
  margin: 0 auto;
  line-height: 1.6;
}

/* Final submit row */
.case-submit-row {
  padding: 20px;
  max-width: min(100%, var(--case-readable-width));
  margin: 0 auto;
  text-align: center;
  box-sizing: border-box;
}

.case-submit-row .btn-green {
  padding: 14px 40px;
  font-size: 1em;
}

/* Case complete — index.html */
.case-complete-banner {
  background: linear-gradient(135deg, rgba(45, 106, 79, 0.2), rgba(201, 168, 76, 0.1));
  border: 2px solid var(--green);
  border-radius: 12px;
  padding: 30px;
  margin: 20px auto;
  max-width: min(100%, var(--case-readable-width));
  text-align: center;
  animation: fadeInBanner 0.5s ease;
  box-sizing: border-box;
}

@keyframes fadeInBanner {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.case-complete-banner .score-label {
  font-family: "Playfair Display", Georgia, serif;
  color: var(--gold);
  font-size: 1.6em;
  margin: 0 0 10px;
  line-height: 1.2;
}

.case-complete-banner .big-score {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 3em;
  font-weight: 900;
  color: var(--gold);
  line-height: 1.1;
  margin: 0;
}

.case-complete-banner .case-banner-sub {
  color: var(--muted);
  margin: 10px 0 0;
  line-height: 1.5;
  font-size: 0.95em;
}

/* Leaderboard — card layout */
.leaderboard-page {
  width: 100%;
  max-width: min(100%, var(--case-readable-width));
  margin: 0 auto;
  padding: 1.35rem clamp(0.5rem, 2.5vw, 1.25rem) 3rem;
  box-sizing: border-box;
  font-size: 1.0625rem;
}

.leaderboard-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.75rem, 4.5vw, 2.15rem);
  font-weight: 700;
  color: var(--gold);
  text-align: center;
  margin: 0 0 1.5rem;
  letter-spacing: 0.02em;
}

.lb-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem 0.75rem;
  margin-bottom: 1.25rem;
}

.lb-tabs button,
.lb-tabs a {
  background: rgba(15, 15, 31, 0.6);
  border: 1px solid rgba(90, 90, 110, 0.65);
  color: var(--muted);
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: "Source Sans Pro", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.lb-tabs button:hover,
.lb-tabs a:hover {
  color: var(--text);
  border-color: rgba(136, 136, 160, 0.7);
}

.lb-tabs button.is-active,
.lb-tabs button[aria-selected="true"],
.lb-tabs a.is-active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201, 168, 76, 0.08);
  box-shadow: 0 0 0 1px rgba(201, 168, 76, 0.15);
}

.lb-subtitle {
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
  margin: 0 0 1.25rem;
  min-height: 1.35rem;
  line-height: 1.4;
}

.lb-board-wrap {
  margin-top: 0.25rem;
}

.lb-head-row,
.lb-row {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) 4.25rem 4.5rem 5.75rem;
  gap: 0.5rem 1rem;
  align-items: center;
  padding-left: 1.1rem;
  padding-right: 1.1rem;
}

.lb-head-row {
  padding-bottom: 0.65rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid rgba(201, 168, 76, 0.22);
}

.lb-h-cell {
  font-family: "Source Sans Pro", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.lb-h-rank {
  text-align: center;
}

.lb-h-detective {
  text-align: left;
}

.lb-h-clues,
.lb-h-mid,
.lb-h-time {
  text-align: center;
}

.lb-h-points {
  text-align: right;
}

.lb-rows {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.lb-row {
  margin: 0;
  padding: 1rem 1.1rem;
  background: linear-gradient(145deg, rgba(30, 35, 58, 0.95), rgba(22, 33, 62, 0.88));
  border: 1px solid rgba(74, 74, 102, 0.5);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lb-row:hover {
  border-color: rgba(201, 168, 76, 0.28);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
}

.lb-row.is-current-user,
.lb-row[data-current="true"] {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(201, 168, 76, 0.35), 0 8px 28px rgba(0, 0, 0, 0.25);
}

.lb-cell {
  font-family: "Source Sans Pro", sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.35;
}

.lb-rank {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gold);
  text-align: center;
  line-height: 1;
}

.lb-name {
  text-align: left;
  min-width: 0;
}

.lb-det {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.88em;
  margin-right: 0.15em;
}

.lb-detective-name {
  font-weight: 700;
  color: #fff;
}

.lb-you {
  color: var(--gold-light);
  font-weight: 600;
  font-size: 0.88em;
}

.lb-clues,
.lb-mid {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.lb-mid-muted {
  color: var(--muted);
}

.lb-time {
  text-align: center;
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.lb-solved-check {
  color: var(--green-light);
  font-weight: 700;
  margin-left: 0.2em;
}

.lb-points {
  text-align: right;
}

.lb-points-value {
  font-weight: 800;
  font-size: 1.02em;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.lb-empty {
  text-align: center;
  color: var(--muted);
  padding: 2.5rem 1rem;
  font-size: 1rem;
}

@media (max-width: 640px) {
  .lb-board-wrap {
    overflow-x: auto;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
  }

  .lb-head-row,
  .lb-row {
    min-width: 32rem;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .lb-row {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
  }
}

/* Responsive — 600px */
@media (max-width: 600px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem;
  }

  .app-logo {
    font-size: 1.2em;
  }

  .case-title-main {
    font-size: 1.4em;
  }

  .clue-input-row {
    flex-direction: column;
  }

  .clue-input-row .btn-check {
    width: 100%;
    min-width: unset;
  }

  .clue-input {
    font-size: 0.9rem;
  }

  .auth-card {
    padding: 1.5rem 1.15rem;
  }

  .case-complete-banner .big-score {
    font-size: 2.25rem;
  }
}
