:root {
  --ink: #111827;
  --muted: #637083;
  --line: rgba(255, 255, 255, 0.18);
  --gold: #f3c94b;
  --red: #e6493f;
  --green: #1b8f65;
  --blue: #75aadb;
  --navy: #0b1020;
  --paper: #f7fafc;
  --panel: rgba(255, 255, 255, 0.1);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.26);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #07101f;
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

body {
  background:
    radial-gradient(circle at 18% 8%, rgba(243, 201, 75, 0.2), transparent 34%),
    radial-gradient(circle at 85% 20%, rgba(230, 73, 63, 0.2), transparent 31%),
    linear-gradient(160deg, #07101f 0%, #0d2e35 46%, #1a1025 100%);
}

button {
  font: inherit;
}

.app-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  min-height: 100vh;
  padding: 18px;
}

.phone-frame {
  width: min(100%, 480px);
  min-height: calc(100vh - 36px);
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  background: var(--navy);
  box-shadow: var(--shadow);
  position: relative;
}

.hero {
  min-height: calc(100vh - 36px);
  position: relative;
  overflow: hidden;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  background: linear-gradient(160deg, #08111f 0%, #0f3b33 48%, #741b2e 100%);
}

.pitch,
.stadium-lights,
.confetti,
.crowd {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pitch {
  opacity: 0.2;
  background:
    linear-gradient(90deg, transparent 49%, rgba(255, 255, 255, 0.8) 50%, transparent 51%),
    radial-gradient(circle at 50% 62%, transparent 0 58px, rgba(255, 255, 255, 0.72) 59px 61px, transparent 62px);
}

.stadium-lights {
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 255, 255, 0.95) 0 2px, rgba(243, 201, 75, 0.5) 3px 42px, transparent 44px),
    radial-gradient(circle at 84% 10%, rgba(255, 255, 255, 0.95) 0 2px, rgba(243, 201, 75, 0.45) 3px 42px, transparent 44px),
    linear-gradient(105deg, transparent 0 16%, rgba(255, 255, 255, 0.18) 17% 28%, transparent 29%),
    linear-gradient(75deg, transparent 0 67%, rgba(255, 255, 255, 0.16) 68% 80%, transparent 81%);
}

.confetti {
  background-image:
    linear-gradient(30deg, #f3c94b 0 7px, transparent 8px),
    linear-gradient(-20deg, #e6493f 0 7px, transparent 8px),
    linear-gradient(80deg, #75aadb 0 7px, transparent 8px),
    linear-gradient(120deg, #fff 0 6px, transparent 7px);
  background-size: 72px 82px, 88px 76px, 64px 90px, 96px 88px;
  background-position: 12px 18px, 28px 4px, 8px 42px, 44px 34px;
  opacity: 0.42;
}

.crowd {
  top: auto;
  height: 130px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.18) 18%, rgba(0, 0, 0, 0.66) 100%);
}

.crowd::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 30px;
  height: 62px;
  background:
    radial-gradient(circle at 8% 60%, #f0c08a 0 8px, transparent 9px),
    radial-gradient(circle at 20% 42%, #f0c08a 0 9px, transparent 10px),
    radial-gradient(circle at 33% 58%, #f0c08a 0 8px, transparent 9px),
    radial-gradient(circle at 47% 40%, #f0c08a 0 10px, transparent 11px),
    radial-gradient(circle at 61% 58%, #f0c08a 0 8px, transparent 9px),
    radial-gradient(circle at 76% 44%, #f0c08a 0 9px, transparent 10px),
    radial-gradient(circle at 91% 60%, #f0c08a 0 8px, transparent 9px);
}

.crowd::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  height: 36px;
  background: linear-gradient(90deg, #e6493f 0 10%, #f3c94b 10% 20%, #1b8f65 20% 32%, #75aadb 32% 45%, #fff 45% 56%, #e6493f 56% 68%, #f3c94b 68% 80%, #1b8f65 80%);
  border-radius: 40px 40px 0 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.badge {
  display: inline-flex;
  width: max-content;
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.mini-flags {
  display: flex;
  gap: 7px;
  margin-top: 14px;
}

.mini-flags i {
  width: 30px;
  height: 19px;
  border-radius: 3px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.mini-flags i:nth-child(1) { background: linear-gradient(#75aadb 0 33%, #fff 33% 66%, #75aadb 66%); }
.mini-flags i:nth-child(2) { background: linear-gradient(90deg, #009739 0 34%, #fedd00 34% 66%, #002776 66%); }
.mini-flags i:nth-child(3) { background: linear-gradient(90deg, #0055a4 0 33%, #fff 33% 66%, #ef4135 66%); }
.mini-flags i:nth-child(4) { background: linear-gradient(#fff 0 33%, #e03c31 33% 66%, #1b1b1b 66%); }

.hero h1,
.result-title {
  margin: 0;
  font-size: 42px;
  line-height: 1.06;
  font-weight: 950;
  letter-spacing: 0;
}

.hero-copy,
.muted {
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.65;
}

.mode-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.mode-card {
  width: 100%;
  min-height: 104px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  display: grid;
  grid-template-columns: 72px 1fr;
  grid-template-areas:
    "badge title"
    "badge meta"
    "badge desc";
  column-gap: 12px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.mode-card.selected {
  border-color: rgba(243, 201, 75, 0.92);
  background: rgba(243, 201, 75, 0.16);
  box-shadow: 0 0 0 2px rgba(243, 201, 75, 0.1);
}

.mode-badge {
  grid-area: badge;
  min-height: 72px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #182032;
  font-size: 13px;
  font-weight: 950;
}

.mode-card strong {
  grid-area: title;
  font-size: 19px;
  line-height: 1.18;
}

.mode-card small {
  grid-area: meta;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 800;
}

.mode-card em {
  grid-area: desc;
  display: block;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.mode-summary {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 4px solid var(--gold);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.5;
  font-size: 13px;
}

.primary,
.secondary,
.ghost {
  border: 0;
  border-radius: 12px;
  padding: 15px 16px;
  font-weight: 850;
  cursor: pointer;
  min-height: 52px;
  line-height: 1.2;
}

.primary {
  width: 100%;
  background: var(--gold);
  color: #151000;
  box-shadow: 0 10px 24px rgba(243, 201, 75, 0.28);
}

.secondary {
  background: #fff;
  color: #172033;
}

.ghost {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid var(--line);
}

.screen .ghost {
  background: #ffffff;
  color: #172033;
  border: 1px solid #dbe3ee;
  box-shadow: 0 6px 14px rgba(30, 44, 70, 0.06);
}

.screen {
  min-height: calc(100vh - 36px);
  background: var(--paper);
  color: var(--ink);
  padding: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-weight: 850;
}

.progress {
  height: 8px;
  background: #d9e2ed;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 18px;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--red);
  transition: width 0.24s ease;
}

.question-art,
.team-art {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  color: white;
  box-shadow: 0 10px 28px rgba(22, 32, 54, 0.16);
}

.question-art svg,
.team-art svg {
  width: 100%;
  display: block;
}

.question-title {
  font-size: 22px;
  line-height: 1.28;
  margin: 0 0 8px;
  font-weight: 950;
}

.question-hint {
  margin: 0 0 14px;
  color: #526176;
  line-height: 1.55;
  font-size: 14px;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  min-height: 58px;
  border: 1px solid #cfd8e6;
  background: #fff;
  border-radius: 12px;
  padding: 13px 14px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(30, 44, 70, 0.06);
}

.option-letter {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e6edf7;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #263348;
  line-height: 1;
}

.option span:last-child {
  min-width: 0;
  line-height: 1.42;
}

.option:active {
  transform: translateY(1px);
}

.loader {
  min-height: calc(100vh - 36px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 30px;
  background: #10182d;
}

.loader-ball {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 18px;
  background:
    radial-gradient(circle at 35% 35%, #fff 0 15px, transparent 16px),
    conic-gradient(#fff 0 18%, #111 18% 30%, #fff 30% 50%, #111 50% 62%, #fff 62% 82%, #111 82%);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.result {
  min-height: calc(100vh - 36px);
  background: #10182d;
  color: white;
  padding: 18px;
}

.flag {
  font-size: 54px;
}

.result-kicker {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.tag {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.1);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.sharebox,
.contact-panel,
.share-guide,
.poster-panel {
  border-radius: 16px;
  padding: 14px;
  line-height: 1.55;
}

.sharebox {
  background: white;
  color: #172033;
  margin: 14px 0;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.actions .primary {
  grid-column: 1 / -1;
}

.share-guide {
  margin-top: 12px;
  background: rgba(243, 201, 75, 0.12);
  border: 1px solid rgba(243, 201, 75, 0.34);
  color: rgba(255, 255, 255, 0.86);
}

.share-guide strong {
  display: block;
  color: var(--gold);
  margin-bottom: 6px;
}

.share-guide ol {
  margin: 0;
  padding-left: 20px;
}

.share-guide li {
  margin: 4px 0;
}

.share-guide p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.poster-panel {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
}

.poster-panel strong {
  display: block;
  color: var(--gold);
  margin-bottom: 10px;
}

.poster-panel img {
  display: block;
  width: 100%;
  border-radius: 12px;
  background: #0b1020;
  -webkit-touch-callout: default;
  user-select: auto;
}

.poster-panel p {
  margin: 10px 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
}

.contact-link {
  margin-top: 14px;
  text-align: center;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 13px;
  cursor: pointer;
}

.contact-panel {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
  color: rgba(255, 255, 255, 0.84);
}

.contact-panel strong {
  display: block;
  color: var(--gold);
  margin-bottom: 4px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: #111827;
  color: white;
  padding: 10px 14px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
}

.toast.show {
  opacity: 1;
}

@media (min-width: 860px) {
  .app-shell {
    padding: 28px;
  }

  .phone-frame {
    min-height: 720px;
  }

  .hero,
  .screen,
  .result,
  .loader {
    min-height: 720px;
  }
}

@media (max-width: 390px) {
  .app-shell {
    padding: 0;
  }

  .phone-frame,
  .hero,
  .screen,
  .result,
  .loader {
    min-height: 100vh;
    border-radius: 0;
  }

  .hero h1,
  .result-title {
    font-size: 34px;
  }
}
