:root {
  --eazo-safe-area-top: max(56px, env(safe-area-inset-top, 0px));
  --eazo-safe-area-bottom: max(34px, env(safe-area-inset-bottom, 0px));
  --ink: #10100f;
  --charcoal: #1A1A1A;
  --coal: #080706;
  --cream: #fff8eb;
  --paper: #f9f2e4;
  --orange: #D86018;
  --burnt: #C04800;
  --oxblood: #781800;
  --gold: #eeb96f;
  --blue: #183078;
  --shadow: rgba(0, 0, 0, .42);
  --stage-w: min(100%, 430px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--cream);
  background: var(--coal);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--coal); }
body { overflow-x: hidden; }
button { font: inherit; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.app-container {
  min-height: 100svh;
  padding-top: var(--eazo-safe-area-top);
  padding-bottom: var(--eazo-safe-area-bottom);
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 6%, rgba(216,96,24,.62), transparent 22rem),
    radial-gradient(circle at 12% 32%, rgba(238,185,111,.18), transparent 14rem),
    radial-gradient(circle at 88% 42%, rgba(24,48,120,.25), transparent 13rem),
    linear-gradient(180deg, #050403 0%, #17100c 46%, #090706 100%);
}

.app-container::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background-image:
    radial-gradient(circle at 18% 25%, rgba(255,248,235,.18) 0 2px, transparent 3px),
    radial-gradient(circle at 84% 30%, rgba(255,248,235,.14) 0 1.5px, transparent 3px),
    radial-gradient(circle at 8% 61%, rgba(216,96,24,.16) 0 2px, transparent 3px),
    radial-gradient(circle at 91% 66%, rgba(238,185,111,.16) 0 2px, transparent 3px);
  background-size: 96px 130px, 124px 142px, 112px 120px, 90px 108px;
  filter: blur(.3px);
  opacity: .95;
}

.app {
  width: var(--stage-w);
  margin: 0 auto;
  padding: 10px 14px 18px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.brand { display: grid; gap: 0; min-width: 0; flex: 1 1 auto; }

.kicker {
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255,248,235,.72);
  font-weight: 700;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 7.2vw, 40px);
  line-height: .9;
  margin: 0;
  letter-spacing: -.055em;
  color: var(--cream);
  text-shadow: 0 1px 0 rgba(255,255,255,.08), 0 14px 32px rgba(0,0,0,.58);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid rgba(238,185,111,.42);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,248,235,.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  flex: 0 0 auto;
}

.lang-toggle button {
  min-width: 46px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  color: rgba(255,248,235,.72);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.lang-toggle button.active {
  color: var(--ink);
  background: linear-gradient(180deg, #fff0c9, var(--gold) 48%, #c8792f);
}

.wheel-block {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 0 auto 8px;
}

.wheel-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 16px 20px rgba(0,0,0,.34));
}

.wheel-pointer {
  position: absolute;
  top: -2px;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 18px solid var(--cream);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.3));
  z-index: 2;
}

svg.wheel {
  width: 100%;
  height: 100%;
  transform: rotate(var(--wheel-rot, 0deg));
  transition: transform 3.1s cubic-bezier(.13,.82,.09,1);
  border-radius: 50%;
}

.wheel.spinning { filter: blur(.15px) drop-shadow(0 0 24px rgba(216,96,24,.55)); }

.spin-btn {
  position: absolute;
  min-width: 62px;
  min-height: 62px;
  border-radius: 999px;
  border: 1px solid rgba(255,248,235,.7);
  background: radial-gradient(circle at 35% 24%, #fff7e8, #eeb96f 42%, #C04800 78%);
  color: var(--ink);
  font-weight: 900;
  letter-spacing: .08em;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0,0,0,.32), inset 0 3px 1px rgba(255,255,255,.42);
  text-transform: uppercase;
  z-index: 3;
}

.spin-btn:disabled { opacity: .62; cursor: not-allowed; }

.instruction {
  margin: 0;
  max-width: 340px;
  text-align: center;
  font-size: 12px;
  line-height: 1.333;
  color: rgba(255,248,235,.78);
}

.runway-shell {
  position: relative;
  height: clamp(360px, 52svh, 540px);
  min-height: 360px;
  max-height: 575px;
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid rgba(238,185,111,.30);
  box-shadow: 0 24px 60px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.11);
  background: var(--charcoal);
}

.audience {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 13% 22%, rgba(255,248,235,.20) 0 2px, transparent 5px),
    radial-gradient(circle at 88% 30%, rgba(216,96,24,.20) 0 2px, transparent 5px),
    radial-gradient(circle at 9% 63%, rgba(238,185,111,.13) 0 2px, transparent 5px),
    radial-gradient(circle at 91% 69%, rgba(255,248,235,.12) 0 2px, transparent 5px),
    linear-gradient(90deg, #090706 0 19%, transparent 28% 72%, #090706 81% 100%);
  background-size: 82px 96px, 100px 110px, 90px 102px, 76px 92px, auto;
  filter: blur(.2px);
  opacity: .96;
}

.stage-lights {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 4%, rgba(255,248,235,.86), rgba(238,185,111,.18) 24%, transparent 45%),
    radial-gradient(ellipse at 24% 16%, rgba(216,96,24,.45), transparent 36%),
    radial-gradient(ellipse at 78% 17%, rgba(238,185,111,.36), transparent 34%);
  mix-blend-mode: screen;
  opacity: .85;
}

.catwalk {
  position: absolute;
  left: 50%;
  top: 18%;
  bottom: -6%;
  width: 84%;
  transform: translateX(-50%);
  clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%);
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(16,16,15,.13) 13%, transparent 18% 82%, rgba(16,16,15,.13) 87%, transparent 88%),
    linear-gradient(180deg, #fffdf7 0%, #fff6e4 42%, #f0d3aa 100%);
  box-shadow: inset 0 0 32px rgba(216,96,24,.22), inset 0 -30px 80px rgba(120,24,0,.22);
}

.catwalk::after {
  content: "";
  position: absolute;
  left: 9%; right: 9%; bottom: 2%; height: 42%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(120,24,0,.18), transparent 68%);
  filter: blur(8px);
}

.theme-chip {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(8,7,6,.68);
  border: 1px solid rgba(238,185,111,.4);
  color: var(--cream);
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .14em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  max-width: calc(100% - 32px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-lane {
  position: absolute;
  left: 50%;
  bottom: 82px;
  width: min(64%, 245px);
  height: min(72%, 365px);
  transform: translateX(-50%);
  display: grid;
  place-items: end center;
  z-index: 4;
  pointer-events: none;
}

.look-card {
  position: relative;
  height: 100%;
  width: auto;
  aspect-ratio: 2 / 3;
  max-width: 100%;
  opacity: 0;
  transform: translateY(-132px) scale(.42);
  transform-origin: bottom center;
  transition: transform 1.35s cubic-bezier(.21,.8,.16,1), opacity .45s ease;
  filter: drop-shadow(0 24px 26px rgba(0,0,0,.36));
}

.look-card img {
  display: block;
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  aspect-ratio: 2 / 3;
  border-radius: 24px;
  border: 1px solid rgba(255,248,235,.5);
  background:
    linear-gradient(135deg, rgba(216,96,24,.55), rgba(24,48,120,.5)) ,
    #2a201a;
}

.look-card.load-failed img {
  position: relative;
}
.look-card.load-failed::after {
  content: attr(data-fallback);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
  border-radius: 24px;
  color: var(--cream);
  background: linear-gradient(135deg, rgba(24,24,23,.9), rgba(120,24,0,.72));
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  letter-spacing: .04em;
}

.look-card.walking {
  opacity: 1;
  animation: bob 1.1s ease-in-out infinite alternate;
}

.look-card.front {
  opacity: 1;
  transform: translateY(2px) scale(1);
  animation: bobFront .68s ease-in-out infinite alternate;
}

.look-card.exit {
  opacity: 0;
  transform: translate(115px, 18px) scale(.86) rotateY(32deg) rotateZ(3deg);
  transition: transform .7s cubic-bezier(.33,.01,.2,1), opacity .45s ease;
}

@keyframes bob { from { transform: translateY(-130px) scale(.43); } to { transform: translateY(-120px) scale(.44); } }
@keyframes bobFront { from { transform: translateY(0) scale(1); } to { transform: translateY(-7px) scale(1.005); } }

.score-stamp {
  position: absolute;
  right: -18px;
  top: 36px;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 5px double rgba(255,248,235,.9);
  color: var(--cream);
  background: rgba(192,72,0,.88);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 44px;
  font-weight: 900;
  transform: rotate(-13deg) scale(0);
  opacity: 0;
  text-shadow: 0 2px 0 rgba(0,0,0,.2);
  box-shadow: 0 12px 28px rgba(0,0,0,.35), inset 0 0 0 2px rgba(238,185,111,.5);
  z-index: 6;
}

.score-stamp.show { animation: stamp .42s cubic-bezier(.17,1.46,.28,1) forwards; }
@keyframes stamp { 0% { transform: rotate(-13deg) scale(2.2); opacity: 0; } 62% { transform: rotate(-13deg) scale(.84); opacity: 1; } 100% { transform: rotate(-13deg) scale(1); opacity: 1; } }

.look-caption {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 7;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 4px;
  width: calc(100% - 28px);
  pointer-events: none;
}

.look-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1;
  color: var(--ink);
  background: rgba(255,248,235,.92);
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(0,0,0,.24);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.look-status {
  min-height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(8,7,6,.65);
  color: rgba(255,248,235,.86);
  border: 1px solid rgba(238,185,111,.28);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  backdrop-filter: blur(9px);
}

.flash {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 44%, rgba(255,255,255,1), rgba(255,248,235,.8) 17%, rgba(238,185,111,.3) 35%, transparent 55%);
  mix-blend-mode: screen;
}

.flash.fire { animation: flash .5s ease-out; }
@keyframes flash { 0% { opacity: 0; } 16% { opacity: 1; } 100% { opacity: 0; } }

.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 12;
  overflow: hidden;
}

.confetti i {
  position: absolute;
  width: 7px;
  height: 14px;
  top: -20px;
  background: var(--gold);
  opacity: 0;
  animation: fall 2.8s linear forwards;
}
@keyframes fall { 0% { transform: translateY(0) rotate(0deg); opacity: 1; } 100% { transform: translateY(600px) rotate(620deg); opacity: 0; } }

.controls {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 0;
  padding: 10px;
  border-radius: 28px;
  background: rgba(255,248,235,.08);
  border: 1px solid rgba(238,185,111,.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 18px 30px rgba(0,0,0,.32);
  overflow: hidden;
}

.timer-ring {
  position: absolute;
  inset: 3px;
  pointer-events: none;
  border-radius: 25px;
  opacity: 0;
  background: conic-gradient(from -90deg, rgba(238,185,111,.95) var(--progress, 100%), transparent 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  padding: 3px;
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  transition: opacity .2s;
}

.controls.live .timer-ring { opacity: 1; }

.paddle {
  position: relative;
  min-height: 64px;
  border-radius: 22px 22px 30px 30px;
  border: 1px solid rgba(255,248,235,.42);
  color: var(--cream);
  cursor: pointer;
  background:
    radial-gradient(circle at 34% 19%, rgba(255,248,235,.55), transparent 22%),
    linear-gradient(180deg, #2a2017 0%, #11100f 45%, #C04800 46%, #781800 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.14), inset 0 -8px 12px rgba(0,0,0,.26), 0 12px 18px rgba(0,0,0,.28);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(0);
  transition: transform .16s cubic-bezier(.2,1.6,.4,1), opacity .2s, filter .2s;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}

.paddle::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -13px;
  width: 22px;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 0 0 10px 10px;
  background: linear-gradient(180deg, #C04800, #391006);
  border: 1px solid rgba(255,248,235,.22);
  border-top: 0;
}

.paddle:disabled {
  opacity: .38;
  cursor: not-allowed;
  filter: grayscale(.45);
}

.paddle.snap { animation: slap .36s cubic-bezier(.13,1.55,.34,1); }
@keyframes slap { 0% { transform: translateY(0) rotate(0); } 45% { transform: translateY(-18px) rotate(-3deg); } 100% { transform: translateY(0) rotate(0); } }

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: rgba(255,248,235,.68);
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.result-panel {
  display: none;
  margin-top: 12px;
  border-radius: 30px;
  padding: 14px;
  background:
    radial-gradient(circle at 8% 0%, rgba(216,96,24,.35), transparent 40%),
    linear-gradient(180deg, rgba(255,248,235,.13), rgba(255,248,235,.06));
  border: 1px solid rgba(238,185,111,.34);
  box-shadow: 0 18px 38px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.08);
}

.result-panel.show { display: block; animation: rise .42s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.result-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.result-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  line-height: .95;
  letter-spacing: -.04em;
}

.result-theme {
  color: var(--gold);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .15em;
  font-weight: 900;
  white-space: nowrap;
}

.winner-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.winner-card img {
  width: 104px;
  aspect-ratio: 2 / 3;
  border-radius: 20px;
  object-fit: cover;
  border: 1px solid rgba(255,248,235,.5);
  box-shadow: 0 14px 26px rgba(0,0,0,.35);
  background: #2a201a;
}

.winner-copy { min-width: 0; }
.winner-copy .label { font-size: 11px; color: rgba(255,248,235,.66); text-transform: uppercase; letter-spacing: .16em; font-weight: 900; }
.winner-copy h3 { margin: 4px 0 6px; font-family: Georgia, "Times New Roman", serif; font-size: 25px; line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.winner-score { display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--burnt); border: 4px double var(--cream); font-family: Georgia, serif; font-size: 29px; font-weight: 900; }

.persona {
  margin: 0 0 12px;
  padding: 11px 12px;
  border-radius: 20px;
  color: var(--ink);
  background: linear-gradient(180deg, #fff3d6, #eeb96f);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.58);
}
.persona strong { display: block; font-family: Georgia, serif; font-size: 21px; line-height: 1; margin-bottom: 4px; }
.persona span { font-size: 13px; line-height: 1.3; }

.leaderboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.mini-look {
  min-width: 0;
  border-radius: 16px;
  padding: 7px;
  background: rgba(8,7,6,.45);
  border: 1px solid rgba(255,248,235,.14);
}
.mini-look img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 12px; display: block; background: #2a201a; }
.mini-look b { display: block; margin-top: 5px; font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mini-look span { color: var(--gold); font-family: Georgia, serif; font-weight: 900; }

.result-actions {
  display: grid;
  grid-template-columns: 1.2fr .8fr .8fr;
  gap: 8px;
}

.action-btn {
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(238,185,111,.36);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .05em;
  color: var(--cream);
  background: rgba(255,248,235,.09);
}
.action-btn.primary { color: var(--ink); background: linear-gradient(180deg, #fff4d6, var(--gold) 50%, #C04800); }
.action-btn:disabled { opacity: .55; cursor: not-allowed; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--eazo-safe-area-bottom) + 12px);
  transform: translateX(-50%) translateY(20px);
  z-index: 99;
  padding: 10px 14px;
  max-width: calc(100% - 28px);
  border-radius: 999px;
  background: rgba(8,7,6,.86);
  color: var(--cream);
  border: 1px solid rgba(238,185,111,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  font-size: 13px;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 680px) {
  :root { --stage-w: 560px; }
  .app { padding-inline: 24px; }
  .runway-shell { height: clamp(420px, 60svh, 610px); }
  .photo-lane { width: min(58%, 280px); height: min(73%, 430px); }
  .wheel-wrap { width: 124px; height: 124px; }
  .spin-btn { min-width: 68px; min-height: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
