:root {
  color-scheme: light;
  --font-primary: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #16283c;
  --brand: #10243a;
  --brand-soft: #2a5070;
  --paper: #ffffff;
  --paper-deep: #f7f8fa;
  --accent: #9c3e2e;
  --accent-soft: #bf6d4e;
  --muted: #5d6772;
  --line: rgba(16, 36, 58, 0.14);
  --glass: rgba(255, 255, 255, 0.74);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --glass-muted: rgba(255, 255, 255, 0.56);
  --shadow-soft: 0 10px 28px rgba(16, 36, 58, 0.06);
  --shadow-glass: 0 18px 56px rgba(16, 36, 58, 0.11);
  --radius-card: 8px;
  --radius-shell: 22px;
  --green: #4b8f67;
  --blue: #2f728e;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-primary);
  background:
    linear-gradient(160deg, rgba(156, 62, 46, 0.08) 0%, rgba(255, 255, 255, 0) 32%),
    linear-gradient(215deg, rgba(42, 80, 112, 0.12) 0%, rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, #ffffff 0%, #f7f8fa 44%, #eef3f6 100%);
}

button,
input,
select {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

p {
  line-height: 1.65;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  color: var(--brand);
}

.app-shell {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 18px 16px calc(42px + env(safe-area-inset-bottom));
}

.app-header {
  position: sticky;
  top: 10px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-shell);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(24px) saturate(1.22);
  -webkit-backdrop-filter: blur(24px) saturate(1.22);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-picture {
  flex: 0 1 210px;
  min-width: 136px;
}

.brand-logo {
  width: clamp(136px, 18vw, 210px);
  height: auto;
}

.brand-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding-left: 14px;
  border-left: 1px solid rgba(16, 36, 58, 0.14);
}

.brand-copy strong,
.brand-copy small,
.brand small,
.muted {
  display: block;
}

.brand-copy strong {
  color: var(--brand);
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.12;
}

.brand-copy small,
.brand small,
.muted {
  color: var(--muted);
}

.brand-copy small {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  white-space: nowrap;
}

.profile-area {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 44px;
  min-width: 0;
}

.profile-chip {
  max-width: min(34vw, 280px);
  overflow: hidden;
  padding: 9px 11px;
  border: 1px solid rgba(16, 36, 58, 0.12);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.app-main {
  display: grid;
  gap: 16px;
}

.panel,
.game-card,
.stat-card {
  border: 1px solid rgba(16, 36, 58, 0.13);
  border-radius: var(--radius-card);
  background: var(--glass);
  box-shadow: var(--shadow-glass), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(22px) saturate(1.18);
  -webkit-backdrop-filter: blur(22px) saturate(1.18);
}

.panel {
  padding: clamp(18px, 3vw, 32px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(280px, 0.84fr);
  gap: 16px;
  align-items: stretch;
}

.hero-grid > .panel:first-child {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.64)),
    linear-gradient(180deg, rgba(16, 36, 58, 0.04), rgba(156, 62, 46, 0.04));
}

.hero-title {
  max-width: 12ch;
  margin: 8px 0 14px;
  color: var(--brand);
  font-size: clamp(2.35rem, 5.7vw, 4.55rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-head {
  margin-bottom: 16px;
}

.section-head h2,
.panel h1,
.panel h2 {
  margin: 0 0 10px;
  line-height: 1.12;
  letter-spacing: 0;
}

.panel > p:last-child,
.game-card p:last-child,
.stat-card p:last-child {
  margin-bottom: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgba(16, 36, 58, 0.15);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.7);
  color: var(--brand);
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(16, 36, 58, 0.22);
  box-shadow: 0 10px 24px rgba(16, 36, 58, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(156, 62, 46, 0.28);
  outline-offset: 2px;
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(16, 36, 58, 0.18);
}

.button.amber {
  border-color: rgba(156, 62, 46, 0.74);
  background: var(--accent);
  color: #ffffff;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.32);
  color: var(--brand);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.game-card {
  min-height: 184px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.game-card.is-planned {
  background: var(--glass-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.game-card strong {
  display: block;
  color: var(--brand);
  font-size: 1.08rem;
  line-height: 1.24;
}

.status-pill {
  align-self: flex-start;
  padding: 5px 8px;
  border: 1px solid rgba(47, 114, 142, 0.18);
  border-radius: var(--radius-card);
  background: rgba(47, 114, 142, 0.12);
  color: #1f5f76;
  font-size: 0.75rem;
  font-weight: 800;
}

.status-pill.planned {
  border-color: rgba(156, 62, 46, 0.2);
  background: rgba(156, 62, 46, 0.1);
  color: var(--accent);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.hero-grid .stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card {
  min-width: 0;
  padding: 14px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.stat-card small {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 4px;
  color: var(--brand);
  font-size: 1.58rem;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.auth-panel {
  max-width: 580px;
  margin: clamp(24px, 7vh, 70px) auto 0;
}

.auth-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(16, 36, 58, 0.15);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

input::placeholder {
  color: rgba(93, 103, 114, 0.76);
}

.is-hidden {
  display: none !important;
}

.status-line {
  min-height: 24px;
  color: var(--brand-soft);
  font-weight: 800;
}

.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 16px;
}

.question-card {
  min-height: 430px;
  display: grid;
  align-content: start;
  gap: 16px;
}

.progress-line {
  height: 10px;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: rgba(16, 36, 58, 0.1);
}

.progress-line span {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--brand-soft), var(--green));
}

.question-prompt {
  margin: 0;
  color: var(--brand);
  font-size: clamp(1.55rem, 4.6vw, 2.9rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0;
}

.answer-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.result-box {
  padding: 11px 12px;
  border: 1px solid rgba(47, 114, 142, 0.18);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-card);
  background: rgba(47, 114, 142, 0.1);
  color: var(--ink);
}

.result-box strong {
  display: block;
  color: var(--brand);
}

.result-box p {
  margin: 6px 0 0;
}

.lost-list {
  display: grid;
  gap: 10px;
}

.lost-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(156, 62, 46, 0.24);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.62);
}

.lost-item strong {
  color: var(--brand);
}

.admin-note {
  padding: 0 0 0 12px;
  border-left: 4px solid var(--accent-soft);
}

.disclaimer-panel {
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.disclaimer-panel h2 {
  margin-top: 0;
}

.source-list {
  margin: 12px 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.58;
}

.source-list li + li {
  margin-top: 7px;
}

@media (max-width: 860px) {
  .game-grid,
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .app-shell {
    padding: 10px 9px calc(32px + env(safe-area-inset-bottom));
  }

  .app-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .brand {
    justify-content: space-between;
    width: 100%;
  }

  .brand-picture {
    flex-basis: auto;
  }

  .brand-copy {
    justify-items: end;
    text-align: right;
  }

  .profile-area {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .profile-chip {
    max-width: 100%;
  }

  .hero-grid,
  .watch-layout {
    grid-template-columns: 1fr;
  }

  .hero-title {
    max-width: 100%;
  }

  .auth-form,
  .answer-row {
    grid-template-columns: 1fr;
  }

  .question-card {
    min-height: 360px;
  }
}

@media (max-width: 560px) {
  .brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .brand-copy {
    justify-items: start;
    padding-left: 0;
    border-left: 0;
    text-align: left;
  }

  .game-grid,
  .stat-grid,
  .hero-grid .stat-grid {
    grid-template-columns: 1fr;
  }

  .actions,
  .profile-area {
    align-items: stretch;
  }

  .button {
    width: 100%;
  }
}
