:root {
  --bg: #0f1115;
  --bg-raised: #181b22;
  --fg: #f0f0f2;
  --muted: #8a8e98;
  --accent: #60a5fa;
  --accent-soft: #1e2a4a;
  --wrong: #ef4444;
  --hint-bg: #1c1f26;
  --hint-active: #2a2f3a;
  --hint-border: #2a2f3a;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}

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

.session__hero {
  text-align: center;
  margin: 4px 0 12px;
}
.session__title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
}
.session__tagline {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
  letter-spacing: 0.02em;
}

.session__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--hint-border);
  padding-top: 8px;
}
.session__brand { font-weight: 600; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; font-size: 11px; }

.game { position: relative; }

.game__photo {
  width: 100%;
  height: clamp(220px, 38vh, 320px);
  object-fit: cover;
  border-radius: 12px;
  background: var(--hint-bg);
  display: block;
}

.game__timer {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.game__hints {
  list-style: none;
  padding: 0;
  margin: 16px 0 4px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.game__hint {
  background: var(--hint-bg);
  border: 1px solid var(--hint-border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--muted);
  min-height: 56px;
  transition: background 200ms ease, color 200ms ease;
}
.game__hint--revealed {
  background: var(--hint-active);
  color: var(--fg);
}
.game__hint-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 9px;
  margin-bottom: 4px;
}
.game__hint-value {
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.game__hint:nth-child(1) { grid-column: 1; grid-row: 1; }
.game__hint:nth-child(2) { grid-column: 2; grid-row: 1; }
.game__hint:nth-child(4) { grid-column: 3; grid-row: 1; }
.game__hint:nth-child(5) { grid-column: 4; grid-row: 1; }
.game__hint:nth-child(3) {
  grid-column: 1 / -1;
  grid-row: 2;
  min-height: auto;
}
.game__hint:nth-child(3) .game__hint-value { -webkit-line-clamp: unset; }

.game__hints-note {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  margin: 0 0 12px;
  letter-spacing: 0.04em;
}

.game__input {
  position: relative;
  margin-top: 8px;
}
.game__input input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--hint-border);
  border-radius: 8px;
  background: var(--bg-raised);
  color: var(--fg);
  outline: none;
  transition: border-color 150ms;
}
.game__input input::placeholder { color: var(--muted); }
.game__input input:focus { border-color: var(--accent); }
.game--wrong .game__input input { border-color: var(--wrong); animation: shake 200ms; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.game__suggestions {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  border: 1px solid var(--hint-border);
  border-top: none;
  background: var(--bg-raised);
  position: absolute;
  left: 0;
  right: 0;
  border-radius: 0 0 8px 8px;
  z-index: 10;
}
.game__suggestion {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
  color: var(--fg);
}
.game__suggestion--active { background: var(--accent-soft); }
.game__suggestion:hover { background: var(--hint-active); }

.game__legend {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}
.game__legend--hero {
  font-size: 13px;
  color: var(--fg);
  font-weight: 500;
}

.reveal { padding: 8px 0; }
.reveal__verdict {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
}
.reveal__photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.reveal__photos figure { margin: 0; }
.reveal__photos img {
  width: 100%;
  height: clamp(180px, 26vh, 240px);
  object-fit: cover;
  border-radius: 8px;
  background: var(--hint-bg);
}
.reveal__photos figcaption {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 4px;
}
.reveal__name {
  font-size: 22px;
  margin: 0 0 8px;
  text-align: center;
}
.reveal__blurb {
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg);
  opacity: 0.85;
  margin: 0 0 8px;
}
.reveal__wiki {
  font-size: 12px;
  text-align: center;
  margin: 0 0 16px;
}
.reveal__wiki a { color: var(--accent); text-decoration: none; }
.reveal__score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 18px;
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}
.reveal__continue {
  display: block;
  width: 100%;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  background: var(--fg);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.reveal__continue:hover { opacity: 0.9; }
.reveal__continue-hint {
  font-weight: 400;
  font-size: 12px;
  opacity: 0.6;
  margin-left: 6px;
}
.reveal__autoadvance {
  margin-top: 10px;
  height: 3px;
  width: 100%;
  background: var(--hint-bg);
  border-radius: 2px;
  overflow: hidden;
}
.reveal__autoadvance-bar {
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: right;
  animation: reveal-autoadvance 12s linear forwards;
}
@keyframes reveal-autoadvance {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .reveal__autoadvance-bar { animation: none; }
}

.session-done { text-align: center; padding: 24px 0; }
.session-done h1 { margin: 0 0 16px; }
.session-done__bars {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  font-size: 16px;
}
.session-done__bars li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 4px 0;
  font-variant-numeric: tabular-nums;
}
.session-done__index { color: var(--muted); font-size: 12px; }
.session-done__share {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  background: var(--fg);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.session-done__note { margin-top: 16px; color: var(--muted); }

.session__loading { text-align: center; padding: 40px; color: var(--muted); }
