:root {
  color: #261f3b;
  background: #fff8fb;
  font-family:
    Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% -8%, rgba(255, 209, 102, 0.38), transparent 30%),
    radial-gradient(circle at 86% 4%, rgba(39, 224, 178, 0.22), transparent 28%),
    radial-gradient(circle at 50% 104%, rgba(151, 92, 255, 0.18), transparent 34%),
    linear-gradient(180deg, #fffdf7 0%, #fff8fb 48%, #f2fbff 100%);
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  align-items: stretch;
}

.screen {
  width: 100%;
  min-height: calc(100svh - 32px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  animation: screenIn 260ms ease both;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  gap: 8px;
}

.brand {
  color: rgba(38, 31, 59, 0.6);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.hunter-level {
  margin-top: 3px;
  color: #7b4dff;
  font-size: 12px;
  font-weight: 950;
}

.progress-pill,
.mini-pill {
  border: 2px solid rgba(123, 77, 255, 0.12);
  border-radius: 999px;
  background: #ffffff;
  color: rgba(38, 31, 59, 0.72);
  font-size: 12px;
  font-weight: 800;
  padding: 8px 11px;
}

.sound-toggle {
  width: 38px;
  height: 38px;
  border: 2px solid rgba(123, 77, 255, 0.12);
  border-radius: 16px;
  background: #ffffff;
  color: #261f3b;
  box-shadow: 0 10px 24px rgba(123, 77, 255, 0.1);
}

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

.eyebrow {
  color: #7b4dff;
  font-size: 12px;
  font-weight: 900;
}

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

h1 {
  font-size: clamp(38px, 12vw, 56px);
  line-height: 0.94;
  text-shadow: 0 4px 0 rgba(255, 209, 102, 0.52);
}

h2 {
  font-size: 27px;
  line-height: 1.14;
}

.subtitle,
.muted {
  color: rgba(38, 31, 59, 0.58);
}

.subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.card-grid,
.option-list,
.ranking-list,
.result-grid {
  display: grid;
  gap: 10px;
}

.feature-card,
.option-button,
.ranking-card,
.stat-card,
.match-card,
.admin-panel,
.notice-card {
  border: 2px solid rgba(123, 77, 255, 0.1);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 44px rgba(123, 77, 255, 0.12), inset 0 -4px 0 rgba(123, 77, 255, 0.04);
  animation: cardIn 280ms ease both;
}

.feature-card {
  min-height: 58px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 17px;
  font-weight: 900;
  position: relative;
  overflow: hidden;
}

.feature-card.done {
  border-color: rgba(255, 209, 102, 0.8);
  background: linear-gradient(135deg, rgba(255, 246, 204, 0.98), rgba(237, 229, 255, 0.96));
}

.quest-blocks {
  display: flex;
  gap: 6px;
}

.quest-blocks span {
  width: 30px;
  height: 14px;
  border: 2px solid rgba(123, 77, 255, 0.16);
  border-radius: 4px;
  background: rgba(123, 77, 255, 0.08);
}

.quest-blocks span.filled {
  background: linear-gradient(135deg, #ffd166, #27e0b2);
  box-shadow: 0 0 18px rgba(39, 224, 178, 0.24);
}

.level-card {
  border: 2px solid rgba(123, 77, 255, 0.1);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  padding: 14px;
  display: grid;
  gap: 10px;
  box-shadow: 0 18px 44px rgba(123, 77, 255, 0.12);
}

.level-card div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.level-card strong {
  color: #7b4dff;
  font-size: 18px;
  font-weight: 950;
}

.level-card span {
  color: rgba(38, 31, 59, 0.58);
  font-size: 12px;
  font-weight: 800;
}

.xp-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(123, 77, 255, 0.08);
  overflow: hidden;
}

.xp-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #975cff, #27e0b2, #ffd166);
}

.badge-rack {
  display: flex;
  gap: 7px;
  overflow: hidden;
}

.badge-rack.expanded {
  flex-wrap: wrap;
}

.badge-rack span {
  flex: 0 0 auto;
  border: 2px solid rgba(123, 77, 255, 0.1);
  border-radius: 999px;
  background: #ffffff;
  color: rgba(38, 31, 59, 0.52);
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 900;
}

.badge-rack span.earned {
  border-color: rgba(255, 209, 102, 0.46);
  background: rgba(255, 209, 102, 0.14);
  color: #ffd166;
}

.battle-arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.battle-card {
  min-height: 190px;
  border: 2px solid rgba(123, 77, 255, 0.12);
  border-radius: 30px;
  background:
    linear-gradient(160deg, rgba(237, 229, 255, 0.98), rgba(255, 255, 255, 0.98) 58%),
    #ffffff;
  color: #261f3b;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  box-shadow: 0 22px 44px rgba(123, 77, 255, 0.13);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.battle-card:nth-child(3) {
  background:
    linear-gradient(160deg, rgba(220, 255, 247, 0.98), rgba(255, 255, 255, 0.98) 58%),
    #ffffff;
}

.battle-card span {
  font-size: 21px;
  font-weight: 950;
}

.battle-card small {
  color: rgba(38, 31, 59, 0.5);
  font-size: 10px;
  font-weight: 950;
}

.battle-card.selected {
  transform: translateY(-10px) scale(1.04);
  border-color: rgba(255, 209, 102, 0.66);
  box-shadow: 0 0 34px rgba(255, 209, 102, 0.28), 0 24px 48px rgba(123, 77, 255, 0.16);
}

.vs-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ffd166, #975cff);
  color: #261f3b;
  font-weight: 950;
  box-shadow: 0 12px 28px rgba(151, 92, 255, 0.28);
}

.option-button {
  width: 100%;
  min-height: 62px;
  padding: 16px 18px;
  color: #261f3b;
  text-align: left;
  font-size: 18px;
  font-weight: 900;
  transition:
    transform 140ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.option-button:active,
.primary-button:active,
.secondary-button:active,
.icon-button:active {
  transform: scale(1.05);
}

.option-button.selected {
  border-color: rgba(151, 92, 255, 0.95);
  background: linear-gradient(135deg, rgba(237, 229, 255, 0.98), rgba(220, 255, 247, 0.98));
  box-shadow: 0 0 28px rgba(151, 92, 255, 0.26), inset 0 0 24px rgba(255, 255, 255, 0.04);
}

.pop-selected {
  animation: popCard 300ms cubic-bezier(0.2, 1.4, 0.35, 1) both;
}

.option-button.compact {
  min-height: 52px;
  font-size: 15px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-button,
.secondary-button,
.icon-button {
  border: 0;
  border-radius: 999px;
  min-height: 58px;
  padding: 0 18px;
  font-weight: 950;
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    box-shadow 160ms ease;
}

.primary-button {
  color: #261f3b;
  background: linear-gradient(135deg, #ffd166, #27e0b2 48%, #975cff);
  box-shadow: 0 16px 44px rgba(151, 92, 255, 0.28);
}

.secondary-button {
  color: #261f3b;
  background: #ffffff;
  border: 2px solid rgba(123, 77, 255, 0.14);
}

.icon-button {
  min-height: 40px;
  border-radius: 999px;
  color: #261f3b;
  background: #ffffff;
}

.feedback {
  min-height: 28px;
  color: #ffd166;
  font-weight: 950;
  text-align: center;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.feedback.show {
  opacity: 1;
  transform: translateY(0);
}

.input-wrap {
  display: grid;
  gap: 10px;
}

.profile-card {
  display: grid;
  gap: 12px;
  border: 2px solid rgba(123, 77, 255, 0.1);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  padding: 16px;
  box-shadow: 0 18px 44px rgba(123, 77, 255, 0.12);
}

.profile-card label {
  display: grid;
  gap: 7px;
  color: rgba(38, 31, 59, 0.72);
  font-size: 12px;
  font-weight: 950;
}

.gender-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cute-radio {
  min-height: 46px;
  display: grid !important;
  place-items: center;
  border: 2px solid rgba(123, 77, 255, 0.12);
  border-radius: 999px;
  background: #ffffff;
  color: #261f3b !important;
  font-size: 13px !important;
  box-shadow: inset 0 -3px 0 rgba(123, 77, 255, 0.05);
}

.cute-radio input {
  position: absolute;
  opacity: 0;
}

.cute-radio.checked,
.cute-radio:has(input:checked) {
  border-color: rgba(123, 77, 255, 0.44);
  background: linear-gradient(135deg, #fff2bd, #e9fff9);
}

.text-input,
.admin-input,
.admin-textarea {
  width: 100%;
  border: 2px solid rgba(123, 77, 255, 0.12);
  border-radius: 20px;
  background: #ffffff;
  color: #261f3b;
  outline: 0;
}

.text-input {
  min-height: 58px;
  padding: 0 16px;
  font-weight: 850;
}

.ranking-card {
  min-height: 56px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ranking-screen {
  gap: 10px;
}

.school-form {
  display: grid;
  grid-template-columns: 1fr 84px;
  gap: 8px;
}

.school-input {
  min-height: 48px;
}

.school-save {
  min-height: 48px;
  border-radius: 18px;
}

.compact-rankings {
  gap: 7px;
}

.compact-rankings .ranking-card {
  min-height: 48px;
  padding: 10px 12px;
}

.ranking-card.podium {
  border-color: rgba(255, 209, 102, 0.5);
  background: linear-gradient(135deg, rgba(151, 92, 255, 0.22), rgba(255, 209, 102, 0.12));
}

.ranking-card.rank-1 {
  box-shadow: 0 0 28px rgba(255, 209, 102, 0.24), 0 18px 44px rgba(123, 77, 255, 0.12);
}

.ranking-card.rank-2 {
  border-color: rgba(220, 230, 255, 0.38);
}

.ranking-card.rank-3 {
  border-color: rgba(211, 148, 86, 0.44);
}

.ranking-card.current {
  border-color: rgba(216, 188, 114, 0.72);
  background: rgba(216, 188, 114, 0.13);
}

.pinned-school {
  box-shadow: 0 0 0 3px rgba(216, 188, 114, 0.12), 0 18px 44px rgba(123, 77, 255, 0.12);
}

.rank-title {
  font-size: 16px;
  font-weight: 950;
}

.rank-points {
  color: #ffd166;
  font-size: 14px;
  font-weight: 950;
}

.rising-section {
  border: 2px solid rgba(123, 77, 255, 0.1);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.section-title {
  color: #27e0b2;
  font-size: 14px;
  font-weight: 950;
}

.rising-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 8px;
  align-items: center;
  color: rgba(38, 31, 59, 0.7);
  font-size: 13px;
}

.rising-row strong,
.rising-row em {
  color: #261f3b;
  font-style: normal;
  font-weight: 950;
}

.notice-card {
  padding: 14px;
  color: rgba(38, 31, 59, 0.7);
  font-size: 14px;
  line-height: 1.4;
}

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

.stat-card {
  padding: 14px;
}

.stat-label {
  color: rgba(38, 31, 59, 0.54);
  font-size: 12px;
}

.stat-value {
  margin-top: 6px;
  color: #261f3b;
  font-size: 20px;
  font-weight: 950;
}

.match-card {
  padding: 20px;
  display: grid;
  gap: 13px;
}

.swipe-card {
  min-height: 330px;
  align-content: center;
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(237, 229, 255, 0.98), transparent 48%),
    #ffffff;
}

.swipe-card::before,
.swipe-card::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 209, 102, 0.8), transparent);
}

.swipe-card::before {
  top: 18px;
}

.swipe-card::after {
  bottom: 18px;
}

.swipe-card h3 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
}

.type-chip {
  width: fit-content;
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(39, 224, 178, 0.12);
  color: #27e0b2;
  font-weight: 950;
}

.stock-stack {
  display: grid;
  gap: 7px;
}

.stock-stack span {
  color: rgba(38, 31, 59, 0.54);
  font-size: 12px;
  font-weight: 900;
}

.stock-stack strong {
  width: fit-content;
  border-radius: 12px;
  padding: 7px 10px;
  background: rgba(123, 77, 255, 0.08);
}

.pass-button {
  color: rgba(38, 31, 59, 0.76);
}

.match-button {
  color: #261f3b;
}

.match-score {
  width: fit-content;
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(151, 92, 255, 0.18);
  color: #7b4dff;
  font-weight: 950;
}

.match-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: rgba(38, 31, 59, 0.64);
  font-size: 14px;
}

.match-line strong {
  color: #261f3b;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: rgba(38, 31, 59, 0.48);
  font-size: 11px;
}

.stale {
  color: #ffd166;
  font-weight: 900;
}

.admin-panel {
  padding: 14px;
  display: grid;
  gap: 9px;
}

.admin-panel h3 {
  margin: 0;
  font-size: 15px;
}

.admin-ranking {
  max-height: 42svh;
  overflow: auto;
}

.admin-school-row {
  border-top: 1px solid rgba(123, 77, 255, 0.1);
  padding: 11px 0;
  display: grid;
  gap: 8px;
}

.admin-school-row:first-of-type {
  border-top: 0;
}

.admin-school-row strong {
  display: block;
  font-size: 14px;
}

.admin-school-row span {
  color: rgba(38, 31, 59, 0.52);
  font-size: 11px;
}

.admin-school-row dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.admin-school-row dt {
  color: rgba(38, 31, 59, 0.5);
  font-size: 10px;
}

.admin-school-row dd {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 900;
}

.custom-badge {
  display: inline-block;
  width: fit-content;
  margin-top: 4px;
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(151, 92, 255, 0.18);
  color: #7b4dff !important;
  font-weight: 900;
}

.admin-input,
.admin-textarea {
  padding: 11px 12px;
  font-size: 13px;
}

.admin-textarea {
  min-height: 70px;
  resize: vertical;
}

.footer-link {
  align-self: center;
  border: 0;
  background: transparent;
  color: rgba(38, 31, 59, 0.48);
  font-size: 12px;
  text-decoration: underline;
}

.confetti-burst {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 20;
}

.confetti-burst i {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  background: hsl(calc(var(--i) * 31), 90%, 62%);
  transform: rotate(calc(var(--i) * 26deg));
  animation: confetti 680ms ease-out forwards;
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popCard {
  0% {
    transform: scale(1);
  }

  55% {
    transform: translateY(-8px) scale(1.06);
  }

  100% {
    transform: translateY(-4px) scale(1.02);
  }
}

@keyframes confetti {
  to {
    opacity: 0;
    transform: translate(
        calc((var(--i) - 7) * 18px),
        calc(-80px + (var(--i) % 4) * 38px)
      )
      rotate(calc(var(--i) * 55deg));
  }
}

@media (max-height: 720px) {
  .app-shell {
    padding: 12px;
  }

  .screen {
    min-height: calc(100svh - 24px);
    gap: 10px;
  }

  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 23px;
  }

  .option-button {
    min-height: 54px;
    padding: 13px 15px;
    font-size: 16px;
  }

  .feature-card,
  .ranking-card {
    min-height: 50px;
    padding: 12px 14px;
  }
}
