:root {
  color: #f8fff9;
  background: #06110d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% -10%, rgba(244, 197, 66, .18), transparent 18rem),
    linear-gradient(160deg, #07130f 0%, #102b21 54%, #06110d 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 16px;
  padding: .9rem 1rem;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.app-shell {
  width: min(100% - 20px, 760px);
  margin: 0 auto;
  padding: 14px 0 92px;
}

.mobile-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px 10px;
  background: linear-gradient(180deg, rgba(6, 17, 13, .98), rgba(6, 17, 13, .82));
  backdrop-filter: blur(12px);
}

.back-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  color: #fff;
  font-size: 1.65rem;
  line-height: 1;
}

.mobile-header p {
  margin: 0 0 3px;
  color: rgba(255, 255, 255, .62);
  font-size: .78rem;
}

.mobile-header strong {
  display: block;
  font-size: 1.05rem;
}

.mobile-header span {
  border: 1px solid rgba(244, 197, 66, .45);
  border-radius: 999px;
  padding: .45rem .65rem;
  color: #f4c542;
  font-size: .78rem;
  font-weight: 900;
}

.progress {
  height: 7px;
  overflow: hidden;
  margin: 0 2px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #f4c542;
  transition: width .25s ease;
}

.screen {
  display: grid;
  gap: 16px;
}

.landing-screen {
  gap: 20px;
}

.hero-banner {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 24px;
  background: #06110d;
  box-shadow: 0 18px 70px rgba(0, 0, 0, .3);
}

.hero-banner img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.landing-content {
  display: grid;
  gap: 20px;
}

.hero-copy,
.step-card,
.summary-card {
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 22px;
  background: rgba(255, 255, 255, .075);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .24);
}

.eyebrow {
  margin: 0 0 .45rem;
  color: #9ee8b8;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

h1,
h2,
p {
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
}

.hero-copy h1,
.step-card h1,
.summary-card h1 {
  font-size: clamp(2rem, 12vw, 3.6rem);
  line-height: .98;
}

.hero-copy p,
.muted,
.rank-status,
.placeholder {
  color: rgba(255, 255, 255, .68);
  line-height: 1.65;
}

.name-field {
  display: grid;
  gap: 8px;
  margin: 24px 0 16px;
  color: rgba(255, 255, 255, .72);
  font-weight: 800;
}

.name-field input,
.name-field select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(0, 0, 0, .24);
  color: #fff;
}

.name-field select option {
  color: #102017;
}

.primary {
  background: #f4c542;
  color: #102017;
  font-weight: 950;
}

.secondary {
  border: 1px solid rgba(244, 197, 66, .34);
  background: rgba(244, 197, 66, .12);
  color: #ffe083;
  font-weight: 900;
}

.quiz-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 22px;
  background: rgba(255, 255, 255, .075);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .24);
}

.quiz-live-preview {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .76);
  font-weight: 800;
  line-height: 1.5;
}

.full {
  width: 100%;
  min-height: 56px;
}

.hero-copy button + button {
  margin-top: 10px;
}

.home-preview-card {
  display: grid;
  gap: 14px;
  width: min(100%, 330px);
  justify-self: center;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(117, 170, 219, .9), rgba(7, 19, 15, .96));
  box-shadow: 0 18px 70px rgba(0, 0, 0, .34);
}

.home-preview-card p,
.home-preview-card small {
  margin: 0;
  color: rgba(255, 255, 255, .72);
  font-weight: 800;
}

.preview-champion {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 22px 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .13);
  text-align: center;
}

.preview-champion img {
  width: 128px;
  height: 82px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
}

.preview-champion strong {
  font-size: 1.5rem;
  line-height: 1.1;
}

.preview-champion span {
  color: rgba(255, 255, 255, .68);
}

.preview-semis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.preview-semis span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 9px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .12);
  font-size: .9rem;
  font-weight: 900;
}

.preview-semis img {
  width: 30px;
  height: 22px;
  border-radius: 5px;
  object-fit: cover;
}

.final-preview svg {
  display: block;
  width: 100%;
  height: auto;
}

.group-progress,
.count-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 38px;
  margin-top: 14px;
  border-radius: 999px;
  padding: .45rem .8rem;
  background: rgba(244, 197, 66, .16);
  color: #ffe083;
  font-weight: 950;
}

.mobile-list,
.third-list,
.match-list {
  display: grid;
  gap: 12px;
}

.mobile-rank-card,
.select-card,
.match-card {
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 20px;
  background: rgba(0, 0, 0, .2);
}

.mobile-rank-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  padding: 14px;
}

.rank-number {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .12);
  font-size: 1.1rem;
  font-weight: 950;
}

.rank-status,
.rank-controls {
  grid-column: 2;
}

.rank-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.team-badge {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
  border-left: 5px solid var(--team-color);
  border-radius: 999px;
  padding: .54rem .75rem;
  background: rgba(255, 255, 255, .11);
  color: #fff;
  font-weight: 900;
}

.flag-img {
  flex: 0 0 auto;
  width: 34px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  background: rgba(255, 255, 255, .2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}

.team-badge small {
  color: rgba(255, 255, 255, .58);
  font-size: .72em;
}

.flag {
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 1.35em;
  line-height: 1;
}

.select-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 76px;
  padding: 12px;
  text-align: left;
}

.select-card.selected {
  border-color: rgba(244, 197, 66, .86);
  background: rgba(244, 197, 66, .18);
}

.select-card > span:last-child {
  color: rgba(255, 255, 255, .68);
  font-size: .86rem;
  font-weight: 800;
  text-align: right;
}

.match-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.match-card h2 {
  color: rgba(255, 255, 255, .7);
  font-size: .88rem;
  text-transform: uppercase;
}

.match-card button {
  display: flex;
  justify-content: flex-start;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, .08);
}

.match-card button.winner {
  border-color: #f4c542;
  background: rgba(244, 197, 66, .18);
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 10px;
  margin: 4px -10px -92px;
  padding: 12px 10px max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(6, 17, 13, 0), rgba(6, 17, 13, .98) 22%);
}

.share-actions {
  position: sticky;
  bottom: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px -10px -92px;
  padding: 12px 10px max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(6, 17, 13, 0), rgba(6, 17, 13, .98) 22%);
}

.share-actions .primary {
  grid-column: 1 / -1;
  min-height: 54px;
}

.inline-actions {
  position: static;
  margin: 0;
  padding: 0;
  background: none;
}

.summary-screen {
  padding-bottom: 12px;
}

.summary-card {
  display: grid;
  gap: 14px;
}

.summary-card h1 {
  color: #fff;
}

.semi-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0;
}

.profile-box {
  display: grid;
  gap: 8px;
  margin: 8px 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .1);
}

.profile-box h2 {
  font-size: 1rem;
}

.profile-box p {
  margin: 0;
  color: rgba(255, 255, 255, .76);
  line-height: 1.65;
}

.personality-result {
  overflow: hidden;
}

.player-card-preview {
  display: grid;
  gap: 16px;
}

.player-visual {
  overflow: hidden;
  width: min(100%, 260px);
  justify-self: center;
  border-radius: 18px;
  background: #102017;
  box-shadow: 0 16px 46px rgba(0, 0, 0, .28);
}

.player-visual svg {
  display: block;
  width: 100%;
  height: auto;
}

.player-copy {
  display: grid;
  gap: 12px;
}

.player-copy h2 {
  font-size: 1.5rem;
}

.player-copy p {
  margin: 0;
  color: rgba(255, 255, 255, .76);
  line-height: 1.65;
}

.trait-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.trait-grid span {
  border-radius: 999px;
  padding: .7rem .85rem;
  background: rgba(244, 197, 66, .14);
  color: #ffe083;
  font-weight: 900;
}

.semi-list h2 {
  flex-basis: 100%;
  font-size: 1.05rem;
}

.share-screen {
  padding-bottom: 18px;
}

.format-note {
  display: inline-flex;
  width: fit-content;
  margin-top: 14px;
  border-radius: 999px;
  padding: .55rem .8rem;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .78);
  font-size: .9rem;
  font-weight: 900;
}

.final-preview {
  width: min(82vw, 320px);
  justify-self: center;
  overflow: hidden;
  border-radius: 20px;
  background: #0b2018;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .36);
}

@media (min-width: 760px) {
  .app-shell {
    padding-top: 22px;
  }

  .landing-content {
    grid-template-columns: 1fr 320px;
    align-items: center;
  }

  .hero-banner img {
    height: auto;
    max-height: 430px;
    object-fit: contain;
  }

  .third-list {
    grid-template-columns: 1fr 1fr;
  }

  .match-list {
    grid-template-columns: 1fr 1fr;
  }

  .player-card-preview {
    grid-template-columns: 260px 1fr;
    align-items: center;
  }

  .trait-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sticky-actions {
    margin-left: 0;
    margin-right: 0;
    border-radius: 24px 24px 0 0;
  }
}
