@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --background: #070b0e;
  --surface: #0e171c;
  --surface-raised: #142128;
  --text: #f3f7f8;
  --muted: #91a0a7;
  --accent: #05d8eb;
  --accent-soft: rgba(5, 216, 235, 0.12);
  --border: rgba(177, 213, 221, 0.12);
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% -18%, rgba(0, 174, 205, 0.19), transparent 42rem),
    radial-gradient(ellipse at 5% 55%, rgba(126, 54, 29, 0.07), transparent 30rem),
    var(--background);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.page-shell {
  width: min(100% - 40px, 1060px);
  margin: 0 auto;
  padding: 22px 0 28px;
}

.brandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid rgba(5, 216, 235, 0.48);
  border-radius: 12px;
  color: var(--accent);
  background: linear-gradient(145deg, rgba(5, 216, 235, 0.18), rgba(5, 216, 235, 0.035));
  font-family: "Barlow Condensed", sans-serif;
  font-size: 19px;
  font-weight: 800;
  box-shadow: 0 0 24px rgba(5, 216, 235, 0.09);
}

.brand-name {
  display: grid;
  gap: 1px;
  color: #a9b7bc;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.brand-name strong {
  color: var(--text);
}

.brand-name small {
  color: #6f8087;
  font-size: 8px;
  letter-spacing: 0.16em;
}

.brand-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #b6c3c7;
  background: rgba(14, 23, 28, 0.7);
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(37, 199, 222, 0.27);
  border-radius: 16px;
  background: #061116;
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.36), 0 0 36px rgba(0, 206, 230, 0.08);
}

.hero::after {
  position: absolute;
  inset: auto 0 0;
  height: 18%;
  background: linear-gradient(transparent, rgba(3, 10, 13, 0.45));
  content: "";
  pointer-events: none;
}

.hero-banner {
  display: block;
  width: 100%;
  height: auto;
}

.quiz-panel {
  position: relative;
  overflow: hidden;
  margin-top: 18px;
  padding: 25px clamp(22px, 5vw, 58px) 36px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 100% 0, rgba(5, 216, 235, 0.07), transparent 28rem),
    linear-gradient(145deg, rgba(20, 33, 40, 0.96), rgba(10, 17, 21, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.quiz-panel::before {
  position: absolute;
  top: 0;
  left: 8%;
  width: 190px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  content: "";
}

.eyebrow,
.kicker,
.progress-meta,
.score-caption {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #a6b5ba;
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.screen {
  padding-top: 32px;
}

.welcome-screen {
  max-width: 790px;
  margin: 0 auto;
}

.kicker {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 12px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-weight: 800;
  letter-spacing: 0.015em;
}

.section-heading h1,
.result-screen h1 {
  margin-bottom: 13px;
  font-size: clamp(44px, 6vw, 68px);
  line-height: 0.97;
}

.section-heading h1 span {
  color: var(--accent);
  text-shadow: 0 0 28px rgba(5, 216, 235, 0.16);
}

.intro {
  max-width: 590px;
  margin-bottom: 28px;
  color: #aab8bd;
  font-size: 15px;
  line-height: 1.75;
}

.nickname-form label {
  display: block;
  margin-bottom: 9px;
  color: #e4edef;
  font-size: 13px;
  font-weight: 700;
}

.input-row {
  display: flex;
  gap: 10px;
}

.input-row input {
  min-width: 0;
  height: 54px;
  flex: 1;
  padding: 0 16px;
  border: 1px solid rgba(169, 199, 207, 0.2);
  border-radius: 9px;
  outline: none;
  color: var(--text);
  background: rgba(4, 11, 14, 0.72);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-row input::placeholder {
  color: #718087;
}

.input-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(5, 216, 235, 0.11);
}

.button {
  min-height: 49px;
  padding: 0 20px;
  border: 0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button-primary {
  color: #031114;
  background: linear-gradient(110deg, #24e6f0, #00c6dc);
  box-shadow: 0 8px 26px rgba(5, 216, 235, 0.17);
}

.button-primary:hover:not(:disabled) {
  background: linear-gradient(110deg, #67f4f8, #14dcec);
  box-shadow: 0 10px 30px rgba(5, 216, 235, 0.25);
}

.button:disabled {
  color: #718187;
  background: #202c31;
  box-shadow: none;
  cursor: not-allowed;
}

.input-row .button {
  min-width: 180px;
}

.privacy-note {
  margin: 9px 0 0;
  color: #78878d;
  font-size: 11px;
}

.form-status {
  min-height: 17px;
  margin: 8px 0 0;
  color: #ff958d;
  font-size: 11px;
}

.form-status:empty {
  display: none;
}

.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  margin-top: 32px;
  padding-top: 21px;
  border-top: 1px solid var(--border);
}

.feature {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #aab8bd;
  font-size: 12px;
}

.feature-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(5, 216, 235, 0.34);
  border-radius: 8px;
  color: var(--accent);
  background: rgba(5, 216, 235, 0.055);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.question-screen {
  max-width: 790px;
  margin: 0 auto;
}

.quiz-topline,
.progress-meta,
.question-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.text-button {
  padding: 8px 0;
  border: 0;
  color: #9cabb0;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.text-button:hover {
  color: var(--accent);
}

.player-label {
  overflow: hidden;
  max-width: 50%;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-meta {
  margin-top: 26px;
  color: #a5b3b8;
  font-size: 12px;
}

#progress-percent {
  color: var(--accent);
}

.progress-track,
.score-track {
  overflow: hidden;
  height: 5px;
  margin-top: 10px;
  border-radius: 999px;
  background: #28373d;
}

.progress-fill,
.score-fill {
  width: 4%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00aebe, #44eff8);
  box-shadow: 0 0 14px rgba(5, 216, 235, 0.48);
  transition: width 250ms ease;
}

.timer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 13px 15px;
  border: 1px solid rgba(5, 216, 235, 0.15);
  border-radius: 12px;
  background: linear-gradient(100deg, rgba(5, 216, 235, 0.055), rgba(4, 12, 16, 0.3));
}

.timer-copy .kicker {
  margin-bottom: 3px;
  font-size: 10px;
}

.timer-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.timer-copy strong {
  color: #dce6e9;
  font-size: 12px;
  font-weight: 600;
}

.timer-display {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timer-ring {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--timer-angle, 360deg), #2b3a40 0);
  transition: background 100ms linear;
}

.timer-ring::before {
  position: absolute;
  width: 39px;
  height: 39px;
  border-radius: inherit;
  background: #10191e;
  content: "";
}

.timer-ring span {
  position: relative;
  color: var(--text);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.timer-ring.urgent {
  background: conic-gradient(#ff705f var(--timer-angle, 360deg), #2b3a40 0);
  animation: timer-pulse 650ms ease-in-out infinite alternate;
}

.timer-ring.urgent span {
  color: #ff9587;
}

.timer-unit {
  color: #91a0a7;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.question-content {
  min-height: 265px;
  padding: 28px 0 25px;
}

.question-content h2 {
  max-width: 720px;
  margin-bottom: 21px;
  font-size: clamp(28px, 4vw, 39px);
  line-height: 1.1;
}

.answer-list {
  display: grid;
  gap: 10px;
}

.answer-option {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 57px;
  padding: 11px 15px;
  border: 1px solid rgba(169, 199, 207, 0.13);
  border-radius: 10px;
  color: #c8d2d5;
  text-align: left;
  background: rgba(5, 12, 15, 0.58);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}

.answer-option:hover {
  transform: translateX(2px);
  border-color: rgba(5, 216, 235, 0.47);
  background: rgba(5, 216, 235, 0.055);
}

.answer-option[aria-pressed="true"] {
  border-color: var(--accent);
  color: #f5feff;
  background: rgba(5, 216, 235, 0.1);
  box-shadow: inset 3px 0 var(--accent), 0 5px 20px rgba(5, 216, 235, 0.06);
}

.answer-key {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border: 1px solid rgba(169, 199, 207, 0.17);
  border-radius: 8px;
  color: #93a2a8;
  font-size: 11px;
  font-weight: 800;
}

.answer-option[aria-pressed="true"] .answer-key {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(5, 216, 235, 0.09);
}

.answer-text {
  font-size: 13px;
  line-height: 1.5;
}

.question-footer {
  gap: 14px;
  padding-top: 17px;
  border-top: 1px solid var(--border);
}

#answered-hint {
  color: #829197;
  font-size: 11px;
}

.result-screen {
  max-width: 650px;
  margin: 0 auto;
  text-align: center;
}

.result-emblem {
  display: grid;
  width: 60px;
  height: 60px;
  margin: 0 auto 18px;
  place-items: center;
  border: 1px solid rgba(5, 216, 235, 0.45);
  border-radius: 50%;
  color: var(--accent);
  background: rgba(5, 216, 235, 0.08);
  font-size: 24px;
  box-shadow: 0 0 30px rgba(5, 216, 235, 0.13);
}

.result-screen.passed .result-emblem {
  border-color: rgba(57, 224, 153, 0.55);
  color: #43e89e;
  background: rgba(57, 224, 153, 0.09);
  box-shadow: 0 0 30px rgba(57, 224, 153, 0.14);
}

.result-screen.failed .result-emblem {
  border-color: rgba(255, 104, 104, 0.5);
  color: #ff7777;
  background: rgba(255, 104, 104, 0.08);
  box-shadow: 0 0 30px rgba(255, 104, 104, 0.12);
}

.result-screen.passed .kicker {
  color: #43e89e;
}

.result-screen.failed .kicker {
  color: #ff7777;
}

.result-screen .intro {
  margin: 0 auto 25px;
}

.result-save-status {
  min-height: 18px;
  margin: -13px 0 15px;
  color: #43e89e;
  font-size: 11px;
}

.result-save-status:empty {
  display: none;
}

.score-card {
  padding: 23px 26px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(4, 12, 15, 0.55);
}

.score-number {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 60px;
  font-weight: 800;
  line-height: 1;
}

.score-number small {
  color: #708087;
  font-size: 25px;
}

.score-caption {
  margin-top: 7px;
  color: #9cabb0;
  font-size: 11px;
}

.pass-requirement {
  margin: 13px 0 0;
  color: #78878d;
  font-size: 11px;
}

.score-track {
  max-width: 390px;
  height: 6px;
  margin: 18px auto 0;
}

.score-fill {
  width: 0;
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 24px;
}

.modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 8, 0.78);
  backdrop-filter: blur(7px);
}

.exit-dialog {
  width: min(100%, 440px);
  padding: clamp(22px, 5vw, 34px);
  border: 1px solid rgba(255, 112, 95, 0.28);
  border-radius: 17px;
  background:
    radial-gradient(ellipse at 100% 0, rgba(255, 112, 95, 0.08), transparent 18rem),
    #111a1f;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
}

.exit-warning-icon {
  display: grid;
  width: 40px;
  height: 40px;
  margin-bottom: 18px;
  place-items: center;
  border: 1px solid rgba(255, 112, 95, 0.4);
  border-radius: 12px;
  color: #ff9587;
  background: rgba(255, 112, 95, 0.1);
  font-size: 19px;
  font-weight: 800;
}

.exit-dialog .kicker {
  color: #ff9587;
}

.exit-dialog h2 {
  margin-bottom: 9px;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 30px;
}

.exit-description {
  margin-bottom: 19px;
  color: #aab8bd;
  font-size: 13px;
  line-height: 1.65;
}

.exit-description strong {
  color: #ff9587;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.button-secondary {
  border: 1px solid var(--border);
  color: #d5dfe2;
  background: #18252b;
}

.button-danger {
  color: #fff5f2;
  background: #b84942;
  box-shadow: 0 7px 22px rgba(184, 73, 66, 0.18);
}

.button-danger:hover:not(:disabled) {
  background: #d15c53;
}

.exit-status {
  margin: 0 0 12px;
  color: #ff9587;
  font-size: 11px;
  line-height: 1.5;
}

.exit-status:empty {
  display: none;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 3px 0;
  color: #718087;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.site-footer span:first-child {
  color: #a1b0b5;
  font-weight: 800;
}

.site-footer a {
  color: #718087;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

[hidden] {
  display: none !important;
}

@keyframes timer-pulse {
  to {
    filter: drop-shadow(0 0 8px rgba(255, 112, 95, 0.45));
  }
}

@media (max-width: 650px) {
  .page-shell {
    width: min(100% - 20px, 520px);
    padding: max(10px, env(safe-area-inset-top)) 0 max(16px, env(safe-area-inset-bottom));
  }

  .brandbar {
    gap: 8px;
    margin-bottom: 11px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .brand-name {
    font-size: 10px;
  }

  .brand-name small {
    font-size: 7px;
  }

  .brand-chip {
    gap: 6px;
    padding: 8px 9px;
    font-size: 9px;
    letter-spacing: 0.06em;
  }

  .brand-chip .status-dot {
    width: 6px;
    height: 6px;
    flex-basis: 6px;
  }

  .hero {
    border-radius: 10px;
  }

  .quiz-panel {
    margin-top: 12px;
    padding: 18px 15px 23px;
    border-radius: 13px;
  }

  .screen {
    padding-top: 24px;
  }

  .eyebrow {
    font-size: 10px;
  }

  .section-heading h1 {
    font-size: clamp(40px, 11vw, 56px);
  }

  .result-screen h1 {
    font-size: clamp(30px, 8vw, 42px);
    overflow-wrap: anywhere;
  }

  .intro {
    font-size: 14px;
    line-height: 1.65;
  }

  .input-row {
    flex-direction: column;
  }

  .input-row input {
    height: 54px;
  }

  .input-row .button {
    width: 100%;
    min-height: 52px;
  }

  .feature-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 8px;
    margin-top: 24px;
  }

  .feature {
    min-width: 0;
    gap: 7px;
    font-size: 11px;
  }

  .feature-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
  }

  .progress-meta {
    margin-top: 22px;
    font-size: 11px;
  }

  .timer-row {
    margin-top: 15px;
    padding: 10px 11px;
    border-radius: 10px;
  }

  .timer-copy strong {
    font-size: 11px;
  }

  .timer-ring {
    width: 43px;
    height: 43px;
  }

  .timer-ring::before {
    width: 35px;
    height: 35px;
  }

  .question-content {
    min-height: 0;
    padding: 22px 0 18px;
  }

  .question-content h2 {
    margin-bottom: 17px;
    font-size: clamp(25px, 7vw, 33px);
    line-height: 1.14;
  }

  .answer-list {
    gap: 9px;
  }

  .answer-option {
    min-height: 59px;
    padding: 11px;
    gap: 10px;
    border-radius: 9px;
  }

  .answer-text {
    font-size: 12px;
  }

  .question-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  #answered-hint {
    text-align: center;
    line-height: 1.45;
  }

  .question-footer .button {
    width: 100%;
    min-height: 52px;
  }

  .score-card {
    padding: 20px 15px;
  }

  .result-actions {
    flex-direction: column;
    gap: 10px;
  }

  .result-actions .button {
    width: 100%;
    min-height: 52px;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }

  .site-footer {
    font-size: 9px;
  }
}

@media (max-width: 360px) {
  .brand-chip {
    font-size: 8px;
  }

  .feature-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
