:root {
  --purple: #46178f;
  --purple-dark: #2b0a5e;
  --purple-deep: #160029;
  --yellow: #ffd400;
  --ink: #1b1233;
  --muted: #6f6685;
  --card: #ffffff;
  --soft: #f7f5fc;
  --border: #e7e2f4;
  --red: #e21b3c;
  --blue: #1368ce;
  --gold: #d89e00;
  --green: #26890c;
  --radius: 22px;
  --shadow: 0 18px 50px rgba(8, 0, 24, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(900px 500px at 10% -5%, rgba(106, 43, 191, 0.55), transparent 60%),
    radial-gradient(800px 500px at 105% 8%, rgba(42, 125, 225, 0.32), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(255, 45, 122, 0.2), transparent 60%),
    linear-gradient(160deg, #3b0f70 0%, #1c0337 55%, #0d001a 100%);
  background-attachment: fixed;
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.glow-a {
  width: 340px;
  height: 340px;
  left: -120px;
  top: -120px;
  background: rgba(106, 43, 191, 0.55);
}

.glow-b {
  width: 300px;
  height: 300px;
  right: -100px;
  top: 15%;
  background: rgba(42, 125, 225, 0.28);
}

.glow-c {
  width: 360px;
  height: 360px;
  left: 35%;
  bottom: -220px;
  background: rgba(255, 45, 122, 0.2);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1020px, 100%);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px 36px;
}

.topbar {
  margin-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--yellow);
  color: var(--purple-dark);
  font-weight: 900;
  font-size: 22px;
  transform: rotate(-6deg);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.brand-text {
  min-width: 0;
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.brand p {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.badge {
  margin-left: auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 212, 0, 0.16);
  color: var(--yellow);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.search-card,
.question-card {
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.search-card {
  padding: 18px;
}

.search-card label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.search-row {
  display: flex;
  gap: 10px;
}

.search-row input {
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--soft);
  color: var(--ink);
  font-size: 15px;
  outline: none;
}

.search-row input:focus {
  border-color: rgba(70, 23, 143, 0.5);
  box-shadow: 0 0 0 3px rgba(70, 23, 143, 0.12);
}

.search-row button {
  height: 50px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: var(--yellow);
  color: var(--purple-dark);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.search-row button:disabled {
  opacity: 0.55;
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.example-row {
  margin-top: 10px;
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--purple);
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.status {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 13px;
  background: #f1ecfb;
  color: var(--purple);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.status.show {
  display: block;
}

.status.error {
  background: #ffe9ee;
  color: #a2102c;
}

.game {
  margin-top: 16px;
}

.game-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.game-head h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.game-head p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
}

.game-head .link-btn {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
}

.question-card {
  padding: 18px;
}

.type-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.type-badge,
.question-count {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.type-badge {
  background: #efe9fb;
  color: var(--purple);
}

.question-count {
  background: #f4f2f8;
  color: var(--muted);
}

.question-card h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.question-image {
  display: block;
  width: 100%;
  max-height: 270px;
  object-fit: contain;
  margin-top: 14px;
  border-radius: 13px;
  background: var(--soft);
}

.answer-label {
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
}

.answer-hint {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 15px;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  overflow-wrap: anywhere;
}

.tile.red {
  background: var(--red);
}

.tile.blue {
  background: var(--blue);
}

.tile.yellow {
  background: var(--gold);
}

.tile.green {
  background: var(--green);
}

.tile .shape {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: 19px;
  line-height: 1;
}

.tile .tile-copy {
  flex: 1;
  min-width: 0;
}

.tile .kind {
  display: block;
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tile .answer {
  display: block;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.25;
}

.tile .answer-img {
  display: block;
  max-width: 100%;
  max-height: 120px;
  margin-top: 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
}

.tile .ordinal {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 12px;
  font-weight: 900;
}

.info-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--soft);
  color: var(--ink);
}

.info-value {
  margin: 0;
  color: var(--purple);
  font-size: 26px;
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.info-title {
  margin: 0;
  color: var(--purple);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.25;
}

.info-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.info-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.info-list li {
  margin-top: 6px;
  color: var(--purple);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.pin-svg {
  display: block;
  width: 100%;
  height: 190px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--soft);
}

.nav-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.nav-btn {
  flex: 1;
  padding: 13px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.nav-btn:disabled {
  opacity: 0.32;
}

.nav-btn:not(:disabled):active,
.search-row button:active {
  transform: translateY(1px);
}

.footer-note {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
  text-align: center;
}

.foot {
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 11px;
  text-align: center;
}

.hidden {
  display: none !important;
}

@media (max-width: 560px) {
  .shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .search-card {
    padding: 15px;
  }

  .search-row {
    flex-direction: column;
  }

  .search-row button {
    width: 100%;
  }

  .brand h1 {
    font-size: 20px;
  }

  .brand p {
    font-size: 11px;
  }

  .game-head h2 {
    font-size: 19px;
  }

  .question-card h3 {
    font-size: 19px;
  }

  .tile .answer {
    font-size: 16px;
  }
}

@media (min-width: 900px) {
  .game {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "head head"
      "question answers"
      "nav nav"
      "note note";
    gap: 0 20px;
    align-items: start;
  }

  .game-head {
    grid-area: head;
  }

  .question-card {
    grid-area: question;
  }

  .answer-panel {
    grid-area: answers;
  }

  .answer-label {
    margin-top: 0;
  }

  .nav-row {
    grid-area: nav;
  }

  .footer-note {
    grid-area: note;
  }
}
