/* ===================================================================
   HUFS Co-op STEPS — Campus Festival Pop
   Playful, bold, energetic — designed for a fun university quiz event
   =================================================================== */

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* STEPS Brand — refined palette */
  --green: #007A33;
  --green-bright: #8DC63F;
  --green-pale: #D4EDBA;
  --green-deep: #004D20;
  --orange: #FF6900;
  --orange-soft: #FFAB66;

  /* Surfaces */
  --bg: #F0F4E8;
  --bg-warm: #F7F5F0;
  --card: #FFFFFF;
  --card-glass: rgba(255, 255, 255, 0.78);
  --text: #1B2A13;
  --text-sub: #4A5D3E;
  --text-dim: #8B9A80;
  --border-soft: rgba(0, 122, 51, 0.08);

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(0,40,18,0.04);
  --shadow-sm: 0 2px 8px rgba(0,40,18,0.06);
  --shadow-md: 0 6px 24px rgba(0,40,18,0.08);
  --shadow-lg: 0 12px 48px rgba(0,40,18,0.10);
  --shadow-glow: 0 4px 20px rgba(0,122,51,0.2);

  /* Layout */
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --radius-pill: 100px;
  --max-w: 440px;
  --pad: 22px;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-bounce: cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== ATMOSPHERIC BACKGROUND ===== */
.bg-decoration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Animated gradient mesh */
.bg-decoration::before {
  content: '';
  position: absolute;
  inset: -50%;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(141,198,63,0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(255,105,0,0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 40% 80%, rgba(0,122,51,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 90%, rgba(141,198,63,0.10) 0%, transparent 40%);
  animation: meshFloat 30s ease-in-out infinite;
}

@keyframes meshFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(3%, -2%) rotate(1deg); }
  50% { transform: translate(-2%, 3%) rotate(-0.5deg); }
  75% { transform: translate(2%, 1%) rotate(0.5deg); }
}

.bg-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
}

.bg-circle--1 {
  width: 320px;
  height: 320px;
  background: var(--green-bright);
  top: -100px;
  right: -80px;
  animation: orbFloat 22s ease-in-out infinite;
}

.bg-circle--2 {
  width: 200px;
  height: 200px;
  background: var(--orange);
  bottom: 15%;
  left: -60px;
  opacity: 0.15;
  animation: orbFloat 28s ease-in-out infinite reverse;
}

.bg-circle--3 {
  width: 260px;
  height: 260px;
  background: var(--green);
  bottom: -80px;
  right: -40px;
  opacity: 0.12;
  animation: orbFloat 25s ease-in-out infinite 4s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -25px) scale(1.06); }
  66% { transform: translate(-15px, 18px) scale(0.94); }
}

/* Subtle grain overlay */
#app::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ===== APP LAYOUT ===== */
#app {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#page-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-w);
  padding: var(--pad);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ===== PAGE TRANSITIONS ===== */
.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: pageEnter 0.55s var(--ease) both;
}

.page--exit {
  animation: pageExit 0.3s var(--ease) both;
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pageExit {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-16px); }
}

/* ===== STAGGER ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.6); }
  60% { transform: scale(1.06); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== LANDING PAGE ===== */
.landing {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0;
  padding-top: 4dvh;
  padding-bottom: 8dvh;
}

.landing__logo {
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-bottom: 16px;
  animation: logoReveal 0.9s var(--ease-spring) 0.05s both;
  filter: drop-shadow(0 4px 12px rgba(0,80,30,0.08));
}

@keyframes logoReveal {
  from {
    opacity: 0;
    transform: scale(0.7) translateY(16px);
    filter: drop-shadow(0 0 0 rgba(0,80,30,0));
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: drop-shadow(0 4px 12px rgba(0,80,30,0.08));
  }
}

.landing__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  background: linear-gradient(135deg, rgba(141,198,63,0.15), rgba(0,122,51,0.10));
  border: 1px solid rgba(141,198,63,0.20);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.01em;
  margin-bottom: 22px;
  animation: fadeUp 0.6s var(--ease) 0.2s both;
  backdrop-filter: blur(8px);
}

.landing__badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-bright);
  box-shadow: 0 0 6px rgba(141,198,63,0.6);
  animation: beaconPulse 2s ease-in-out infinite;
}

@keyframes beaconPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(141,198,63,0.6); }
  50% { opacity: 0.5; box-shadow: 0 0 12px rgba(141,198,63,0.3); }
}

.landing__title {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-weight: 900;
  font-size: 2rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 12px;
  animation: fadeUp 0.6s var(--ease) 0.3s both;
}

.landing__title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--green), var(--green-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.landing__subtitle {
  font-size: 0.88rem;
  color: var(--text-sub);
  line-height: 1.65;
  margin-bottom: 40px;
  font-weight: 400;
  animation: fadeUp 0.6s var(--ease) 0.4s both;
}

.landing__count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 14px;
  animation: fadeUp 0.6s var(--ease) 0.5s both;
  font-variant-numeric: tabular-nums;
}

.landing__count-number {
  font-weight: 800;
  color: var(--green);
  font-size: 0.9rem;
}

/* Closed / Full notice */
.landing__notice {
  padding: 14px 20px;
  background: linear-gradient(135deg, rgba(255,105,0,0.08), rgba(255,105,0,0.04));
  border: 1px solid rgba(255,105,0,0.15);
  border-radius: var(--radius-sm);
  color: var(--orange);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 18px;
  animation: fadeUp 0.5s var(--ease) 0.5s both;
  text-align: center;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 17px 40px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background: linear-gradient(145deg, var(--green), var(--green-deep));
  color: white;
  box-shadow: var(--shadow-glow), inset 0 1px 0 rgba(255,255,255,0.15);
  animation: fadeUp 0.6s var(--ease) 0.55s both;
}

.btn--primary:active {
  transform: scale(0.96);
  box-shadow: 0 2px 10px rgba(0,122,51,0.15);
}

.btn--primary:disabled {
  background: linear-gradient(145deg, #A0A89A, #8A9284);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.7;
}

.btn--secondary {
  background: var(--card-glass);
  color: var(--text);
  border: 1.5px solid var(--border-soft);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.btn--secondary:active {
  transform: scale(0.97);
  background: rgba(255,255,255,0.9);
}

.btn--orange {
  background: linear-gradient(145deg, var(--orange), #E55D00);
  color: white;
  box-shadow: 0 4px 18px rgba(255,105,0,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn--orange:active {
  transform: scale(0.96);
}

.btn--full {
  width: 100%;
}

/* ===== QUIZ PAGE ===== */
.quiz {
  gap: 0;
  padding-top: 14px;
}

.quiz__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.quiz__progress-text {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--green);
  font-variant-numeric: tabular-nums;
  background: rgba(0,122,51,0.06);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.quiz__back-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.quiz__back-btn:active {
  background: rgba(0,0,0,0.04);
  transform: translateX(-2px);
}

.quiz__back-btn svg {
  width: 16px;
  height: 16px;
}

/* Progress bar */
.quiz__progress-bar {
  height: 5px;
  background: rgba(0,122,51,0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 30px;
}

.quiz__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--green-bright));
  border-radius: var(--radius-pill);
  transition: width 0.6s var(--ease);
  position: relative;
}

.quiz__progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: white;
  border: 3px solid var(--green-bright);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(141,198,63,0.4);
}

.quiz__logo {
  display: block;
  width: 140px;
  height: auto;
  margin: 16px auto 0;
}

/* Question card area */
.quiz__card-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.quiz__card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 12px;
  overflow-y: auto;
  transition: all 0.45s var(--ease);
}

.quiz__card--enter {
  opacity: 0;
  transform: translateX(70px);
}

.quiz__card--active {
  opacity: 1;
  transform: translateX(0);
}

.quiz__card--exit {
  opacity: 0;
  transform: translateX(-70px);
}

.quiz__card--enter-back {
  opacity: 0;
  transform: translateX(-70px);
}

.quiz__question {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-weight: 900;
  font-size: 1.35rem;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--text);
  padding: 4px 0 10px;
}

/* Option cards */
.quiz__options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz__option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 18px;
  background: var(--card);
  border: 2px solid rgba(0,122,51,0.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: all 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  text-align: left;
  width: 100%;
  min-height: 58px;
  position: relative;
  overflow: hidden;
}

/* Hover / press glow */
.quiz__option::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,122,51,0.04), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.quiz__option:active {
  transform: scale(0.98);
}

.quiz__option:active::before {
  opacity: 1;
}

.quiz__option--selected {
  border-color: var(--green);
  background: linear-gradient(135deg, rgba(0,122,51,0.04), rgba(141,198,63,0.06));
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(0,122,51,0.1);
}

.quiz__option--selected::before {
  opacity: 1;
}

.quiz__option-marker {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--bg);
  border: 2px solid rgba(0,122,51,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  transition: all 0.3s var(--ease-spring);
}

.quiz__option--selected .quiz__option-marker {
  background: var(--green);
  border-color: var(--green);
  color: white;
  transform: scale(1.08) rotate(-3deg);
  box-shadow: 0 2px 8px rgba(0,122,51,0.3);
}

.quiz__option-text {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
}

/* ===== LOADING PAGE ===== */
.loading {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 36px;
}

.loading__visual {
  position: relative;
  width: 130px;
  height: 130px;
}

.loading__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(0,122,51,0.08);
  border-top-color: var(--green);
  animation: spin 1.1s linear infinite;
}

.loading__ring:nth-child(2) {
  inset: 14px;
  border-top-color: var(--green-bright);
  animation-duration: 1.6s;
  animation-direction: reverse;
}

.loading__ring:nth-child(3) {
  inset: 28px;
  border-top-color: var(--orange);
  animation-duration: 2.1s;
}

.loading__emoji {
  position: absolute;
  inset: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  animation: emojiFloat 2s var(--ease-spring) infinite;
}

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

@keyframes emojiFloat {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.12) translateY(-4px); }
}

.loading__text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  transition: opacity 0.3s;
}

.loading__subtext {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 6px;
  font-weight: 400;
}

/* ===== RESULT PAGE ===== */
.result {
  align-items: center;
  text-align: center;
  padding-top: 8dvh;
  gap: 0;
}

.result__emoji {
  font-size: 4.5rem;
  margin-bottom: 18px;
  animation: resultPop 0.8s var(--ease-bounce) 0.1s both;
}

@keyframes resultPop {
  from {
    opacity: 0;
    transform: scale(0.2) rotate(-20deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.15) rotate(5deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

.result__type-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  animation: fadeUp 0.5s var(--ease) 0.25s both;
}

.result__type-name {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-weight: 900;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin-bottom: 22px;
  animation: slideUp 0.6s var(--ease) 0.35s both;
}

.result__description {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-soft);
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-sub);
  font-weight: 400;
  margin-bottom: 30px;
  text-align: left;
  animation: slideUp 0.6s var(--ease) 0.45s both;
  position: relative;
}

.result__description::before {
  content: '\201C';
  position: absolute;
  top: 8px;
  left: 16px;
  font-family: serif;
  font-size: 3rem;
  color: var(--green-bright);
  opacity: 0.2;
  line-height: 1;
}

.result__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  animation: slideUp 0.6s var(--ease) 0.55s both;
}

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

.result__action-row .btn {
  flex: 1;
  padding: 15px 16px;
  font-size: 0.86rem;
}

.result__retry {
  margin-top: 22px;
  font-size: 0.78rem;
  color: var(--text-dim);
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  padding: 10px 20px;
  border-radius: var(--radius-xs);
  transition: all 0.2s;
  animation: fadeUp 0.5s var(--ease) 0.65s both;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(0,0,0,0.15);
}

.result__retry:active {
  background: rgba(0,0,0,0.04);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: white;
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 600;
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s var(--ease);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== UTILITY ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
