@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  font-family: 'DM Sans', sans-serif;
  background: #10121e;
  color: #f4f1ec;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
  font-weight: 400;
  --muted: #858697;
  --lime: #d4f274;
  --panel: #1a1c2a;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 43%, rgba(76, 74, 116, 0.2), transparent 48%),
    #10121e;
}

button,
a {
  font: inherit;
}

.page-shell {
  display: flex;
  width: min(100% - 64px, 1120px);
  min-height: 100vh;
  flex-direction: column;
  margin: 0 auto;
}

.site-header,
.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header {
  min-height: 96px;
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid rgba(212, 242, 116, 0.62);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(212, 242, 116, 0.2), rgba(212, 242, 116, 0.06));
  color: var(--lime);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0;
  cursor: pointer;
}

.profile-avatar:hover {
  background: rgba(212, 242, 116, 0.18);
}

.profile-avatar:focus-visible,
.profile-drawer-close:focus-visible,
.profile-drawer-nav a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.profile-backdrop {
  position: fixed;
  z-index: 8;
  inset: 0;
  background: rgba(5, 6, 12, 0.68);
  backdrop-filter: blur(3px);
}

.profile-drawer {
  position: fixed;
  z-index: 9;
  top: 0;
  right: 0;
  width: min(390px, calc(100% - 24px));
  height: 100vh;
  height: 100dvh;
  padding: 44px 28px 28px;
  overflow-y: auto;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  background: #1a1c2a;
  box-shadow: -20px 0 70px rgba(0, 0, 0, 0.42);
  animation: profile-drawer-in 220ms ease both;
}

.profile-drawer h2 {
  margin: 8px 0 5px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 500;
}

.profile-drawer-name {
  margin: 0;
  color: #a1a1ae;
  font-size: 14px;
}

.profile-drawer-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: #f4f1ec;
  cursor: pointer;
  font-size: 24px;
}

.profile-drawer-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin: 14px 0 16px;
}

.profile-drawer-nav a {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(212, 242, 116, 0.35);
  border-radius: 10px;
  color: var(--lime);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.profile-drawer-nav a:hover {
  background: rgba(212, 242, 116, 0.08);
}

.profile-settings {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.profile-settings h3 {
  margin: 0 0 20px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 600;
}

.profile-input {
  width: 100%;
  min-height: 50px;
  margin-bottom: 18px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  color: #f4f1ec;
  font: inherit;
}

.profile-input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(212, 242, 116, 0.14);
}

.profile-save-button {
  width: 100%;
  justify-content: center;
}

.profile-status,
.profile-guest-note {
  min-height: 20px;
  margin: 12px 0 0;
  color: #a1a1ae;
  font-size: 12px;
}

@keyframes profile-drawer-in {
  from {
    opacity: 0.7;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.leaderboard-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(212, 242, 116, 0.42);
  border-radius: 10px;
  color: var(--lime);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.leaderboard-link:hover {
  border-color: var(--lime);
  background: rgba(212, 242, 116, 0.08);
}

.leaderboard-link:focus-visible,
.leaderboard-play-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f4f1ec;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-decoration: none;
}

.wordmark-accent {
  color: var(--lime);
}

.wordmark-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(212, 242, 116, 0.52);
  border-radius: 10px;
  color: var(--lime);
  font-size: 17px;
}

.header-note {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #a1a1ae;
  font-size: 13px;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 12px rgba(212, 242, 116, 0.6);
}

.photo-carousel {
  width: min(100%, 760px);
  margin: 0 auto 28px;
}

.photo-slide {
  position: relative;
  height: 210px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: #1a1c2a;
}

.photo-slide::after {
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(10, 11, 18, 0.76));
  content: '';
  pointer-events: none;
}

.photo-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: slide-image-in 300ms ease both;
}

.photo-credits {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.photo-credits summary {
  width: max-content;
  cursor: pointer;
}

.photo-credits summary:hover,
.photo-credits a:hover {
  color: var(--lime);
}

.photo-credits ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 8px 0 0;
  padding-left: 18px;
}

.photo-credits a {
  color: #a1a1ae;
}

.slide-indicator:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.slide-indicators {
  position: absolute;
  z-index: 2;
  right: 22px;
  bottom: 25px;
  display: flex;
  gap: 7px;
}

.slide-indicator {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  transition: width 160ms ease, background-color 160ms ease;
}

.slide-indicator.is-active {
  width: 22px;
  background: var(--lime);
}

@keyframes slide-image-in {
  from {
    opacity: 0.65;
  }
  to {
    opacity: 1;
  }
}

.how-to-play-backdrop {
  position: fixed;
  z-index: 5;
  inset: 0;
  background: rgba(5, 6, 12, 0.68);
  backdrop-filter: blur(4px);
}

.how-to-play {
  position: fixed;
  z-index: 6;
  top: 50%;
  left: 50%;
  width: min(420px, calc(100% - 36px));
  padding: 32px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: #1a1c2a;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.how-to-play h2 {
  margin: 8px 0 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.how-to-play > p:last-child {
  margin: 0;
  color: #a1a1ae;
  font-size: 14px;
  line-height: 1.6;
}

.how-to-play-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: #f4f1ec;
  cursor: pointer;
  font-size: 24px;
}

.how-to-play-close:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.question-panel {
  position: relative;
  display: flex;
  width: min(100%, 760px);
  min-height: 470px;
  flex-direction: column;
  justify-content: space-between;
  margin: auto;
  padding: 38px 48px 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(31, 33, 49, 0.98), rgba(24, 26, 40, 0.98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

.login-panel {
  min-height: 0;
  justify-content: flex-start;
  padding-bottom: 14px;
}

.login-panel .question-content {
  padding: 24px 0 14px;
}

.login-panel .name-form {
  padding-bottom: 0;
}

.login-panel .answer-label {
  margin-bottom: 4px;
}

.login-panel .name-only-control {
  margin-bottom: 6px;
}

.login-panel .login-submit {
  margin-top: 8px;
}

.reset-login-button {
  display: block;
  margin: 12px auto 0;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: #cbdc7e;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.reset-login-button:hover {
  color: #e2f39d;
}

.reset-login-button:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.panel-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow,
.question-label,
.page-footer {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--lime);
}

.sparkle {
  font-size: 17px;
}

.answer-note {
  color: #858697;
  font-size: 12px;
}

.question-content {
  padding: 52px 0 42px;
  animation: question-in 360ms ease both;
}

.question-label {
  margin: 0 0 19px;
  color: #8d8e9e;
}

h1 {
  max-width: 620px;
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(34px, 5.3vw, 54px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1.13;
}

.answer-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 30px;
}

.name-form {
  padding-bottom: 30px;
}

.login-status {
  min-height: 0;
  margin: 12px 0 0;
  color: #ff8585;
  font-size: 12px;
  text-align: center;
}

.answer-label {
  display: block;
  margin-bottom: 10px;
  color: #8d8e9e;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.name-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.name-only-control {
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 16px;
}

.difficulty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.quiz-toolbar {
  margin-bottom: 18px;
}

.sound-toggle {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(212, 242, 116, 0.35);
  border-radius: 10px;
  background: rgba(212, 242, 116, 0.06);
  color: var(--lime);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
}

.sound-toggle:hover {
  border-color: var(--lime);
  background: rgba(212, 242, 116, 0.12);
}

.sound-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.difficulty-select {
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
}

.logout-button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: #f4f1ec;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.profile-logout-button {
  width: 100%;
  margin-top: 12px;
}

.logout-button:hover {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.075);
}

.logout-button:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.name-controls input {
  min-width: 0;
  min-height: 62px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  color: #f4f1ec;
  font: inherit;
}

.auth-input {
  width: 100%;
  min-height: 62px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  color: #f4f1ec;
  font: inherit;
}

.auth-input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(212, 242, 116, 0.14);
}

.auth-input::placeholder {
  color: #858697;
}

.answer-button.login-submit {
  width: max-content;
  min-width: 112px;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  margin-top: 14px;
  margin-right: auto;
  margin-left: auto;
}

.name-controls input::placeholder {
  color: #858697;
}

.name-controls input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(212, 242, 116, 0.14);
}

.answer-button {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.answer-button:hover {
  transform: translateY(-2px);
}

.answer-button:active {
  transform: translateY(0);
}

.answer-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

.answer-yes {
  background: var(--lime);
  color: #191d12;
}

.answer-yes:hover {
  background: #e0fa91;
}

.answer-choice {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.035);
  color: #f4f1ec;
  text-align: left;
}

.answer-choice:hover {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.075);
}

.button-arrow {
  color: currentColor;
  font-size: 16px;
  opacity: 0.68;
}

.restart-button {
  width: 100%;
  margin-bottom: 30px;
}

.quiz-leaderboard-link {
  align-self: flex-start;
  margin: 0 0 24px;
}

.leaderboard-panel {
  width: min(100%, 900px);
  margin: auto;
  padding: 42px 48px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(31, 33, 49, 0.98), rgba(24, 26, 40, 0.98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

.leaderboard-panel h1 {
  margin-bottom: 12px;
}

.leaderboard-description,
.leaderboard-note {
  color: #a1a1ae;
  font-size: 14px;
  line-height: 1.6;
}

.leaderboard-description {
  margin: 0 0 26px;
}

.leaderboard-status {
  min-height: 24px;
  margin: 0 0 10px;
  color: #a1a1ae;
  font-size: 13px;
}

.leaderboard-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.leaderboard-table th {
  color: var(--lime);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.leaderboard-table td {
  color: #e8e6e2;
  font-size: 14px;
}

.leaderboard-table tbody tr:last-child td {
  border-bottom: 0;
}

.leaderboard-rank,
.leaderboard-score {
  font-weight: 700;
}

.leaderboard-score {
  color: var(--lime) !important;
}

.leaderboard-play-button {
  width: max-content;
  gap: 20px;
  margin-top: 24px;
  text-decoration: none;
}

.leaderboard-note {
  margin: 18px 0 0;
  font-size: 12px;
}

.panel-footer {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #999aa9;
  font-size: 12px;
  text-align: center;
}

.panel-footer p {
  margin: 0;
}

.panel-footer p.answer-correct {
  color: #8ee5a1;
}

.panel-footer p.answer-wrong {
  color: #ff8585;
}

.footer-mark {
  color: #858697;
  font-size: 10px;
}

.page-footer {
  overflow: hidden;
  min-height: 82px;
  color: #777989;
  font-size: 9px;
}

.footer-marquee {
  width: 100%;
  overflow: hidden;
}

.footer-marquee-track {
  display: flex;
  width: max-content;
  animation: footer-scroll 18s linear infinite;
}

.footer-marquee-track > span {
  display: flex;
  flex: 0 0 100vw;
  align-items: center;
  justify-content: center;
  gap: 12px;
  white-space: nowrap;
}

.footer-marquee-track > span > span {
  color: var(--lime);
  font-size: 13px;
}

@keyframes footer-scroll {
  to {
    transform: translateX(-50%);
  }
}

@keyframes question-in {
  from {
    opacity: 0.45;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .page-shell {
    width: min(100% - 36px, 480px);
  }

  .site-header {
    min-height: 76px;
    gap: 10px;
  }

  .photo-slide {
    height: 170px;
  }

  .photo-carousel {
    margin-bottom: 22px;
  }

  .slide-indicators {
    right: 17px;
    bottom: 22px;
  }

  .header-note {
    font-size: 11px;
  }

  .header-actions {
    gap: 8px;
  }

  .sound-toggle {
    padding: 6px 8px;
    font-size: 11px;
  }

  .profile-avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .header-note {
    max-width: 160px;
    overflow-wrap: anywhere;
    line-height: 1.25;
    white-space: normal;
  }

  .leaderboard-link {
    min-height: 36px;
    padding: 0 9px;
    font-size: 11px;
  }

  .question-panel {
    min-height: 430px;
    padding: 26px 22px 0;
    border-radius: 16px;
  }

  .panel-topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .question-content {
    padding: 36px 0 28px;
  }

  h1 {
    font-size: clamp(34px, 10vw, 46px);
  }

  .answer-options {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding-bottom: 24px;
  }

  .answer-button {
    min-height: 58px;
    padding: 0 15px;
  }

  .answer-choice {
    min-height: 54px;
  }

  .name-form {
    padding-bottom: 24px;
  }

  .name-controls {
    gap: 8px;
  }

  .name-controls input {
    min-height: 58px;
    padding: 0 12px;
  }

  .auth-input {
    min-height: 58px;
    padding: 0 12px;
  }

  .restart-button {
    margin-bottom: 24px;
  }

  .leaderboard-panel {
    padding: 26px 16px;
    border-radius: 16px;
  }

  .leaderboard-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 11px 6px;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    font-size: 12px;
  }

  .leaderboard-table th:last-child,
  .leaderboard-table td:last-child {
    display: none;
  }

  .page-footer {
    min-height: 68px;
    font-size: 8px;
    letter-spacing: 0.09em;
  }
}

@media (max-width: 360px) {
  .page-shell {
    width: calc(100% - 28px);
  }

  .photo-slide {
    height: 150px;
  }

  .question-panel {
    padding-right: 18px;
    padding-left: 18px;
  }

  .leaderboard-panel {
    padding-right: 12px;
    padding-left: 12px;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding-right: 4px;
    padding-left: 4px;
    font-size: 11px;
  }

  .page-footer {
    font-size: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .footer-marquee-track {
    animation: none;
  }
}
