* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

:root {
  --ink: #06222a;
  --blue: #1478ff;
  --teal: #00c2c0;
  --green: #14d07a;
  --paper: #f6f1e7;
  --gold: #f0b429;
  --live: linear-gradient(100deg, #1478ff 0%, #00c2c0 52%, #14d07a 100%);
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(820px 420px at 0% 0%, #d7fff6 0%, transparent 58%),
    radial-gradient(720px 380px at 100% 0%, #d6e8ff 0%, transparent 55%),
    var(--paper);
  color: var(--ink);
  font-family: Outfit, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }

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

.fit {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 18px 12px 32px;
}

.bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

button.replay {
  border: 0;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  border-radius: 999px;
  padding: 0.55rem 1.3rem;
  cursor: pointer;
}

button.replay:active { transform: scale(0.98); }

.note {
  margin: 0;
  color: #3d6570;
  font-size: 13px;
}

.pair {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 28px;
  width: 100%;
}

figure { margin: 0; }

figcaption {
  margin: 0 0 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0a8f86;
}

.slot { position: relative; }

.phone {
  width: 390px;
  height: 844px;
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  border-radius: 32px;
  background: #1a1410;
  box-shadow: 0 0 0 10px #221e1a, 0 30px 70px rgba(0, 0, 0, 0.45);
  transform-origin: top left;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
}

.phone.full {
  border-radius: 0;
  box-shadow: none;
}

.room {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.05) 16%, rgba(0, 0, 0, 0.02) 46%, rgba(0, 0, 0, 0.28) 72%, rgba(0, 0, 0, 0.5));
}

.status {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  padding: 14px 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 650;
}

.status-right { display: flex; align-items: center; gap: 6px; }

.battery {
  width: 22px;
  height: 11px;
  border: 1.5px solid #fff;
  border-radius: 3px;
  position: relative;
}

.battery::before {
  content: "";
  position: absolute;
  inset: 1.5px;
  width: 14px;
  background: #fff;
  border-radius: 1px;
}

.battery::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 2px;
  width: 2px;
  height: 5px;
  background: #fff;
  border-radius: 0 1px 1px 0;
}

.topbar {
  position: absolute;
  z-index: 5;
  top: 54px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.seller { display: flex; align-items: center; gap: 8px; min-width: 0; }

.avatar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #f6d7c4, #c4886c);
  color: #3d261c;
  font-weight: 750;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
  flex: none;
}

.plus {
  position: absolute;
  left: -3px;
  bottom: -3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(30, 18, 16, 0.45);
}

.seller-name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.seller-sub {
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 550;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

.clock {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.watch { display: flex; align-items: center; gap: 6px; flex: none; }

.pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--live);
  border-radius: 999px;
  padding: 6px 10px 6px 8px;
  font-size: 13px;
  font-weight: 750;
}

.chev {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(18, 14, 12, 0.55);
  backdrop-filter: blur(8px);
}

.tools {
  position: absolute;
  z-index: 5;
  top: 108px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(16, 14, 14, 0.72);
  backdrop-filter: blur(10px);
  font-size: 14px;
  font-weight: 650;
}

.gold {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #ffe7a6, var(--gold) 46%, #c9922e);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 4px 10px rgba(0, 0, 0, 0.28);
}

.gold:active { transform: scale(0.94); }

.moment {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  top: 196px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.crown {
  position: relative;
  width: 292px;
  height: 161px;
  opacity: 0;
  isolation: isolate;
}

.crown img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.42));
}

.bloom {
  position: absolute;
  z-index: 0;
  left: 6%;
  right: 6%;
  top: 28%;
  bottom: -6%;
  background: radial-gradient(ellipse at center, rgba(255, 214, 140, 0.7), rgba(255, 170, 50, 0.12) 46%, transparent 72%);
  filter: blur(8px);
}

.shine {
  position: absolute;
  z-index: 2;
  inset: 0;
  background: linear-gradient(105deg,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 244, 214, 0.25) 47%,
    rgba(255, 255, 255, 0.95) 50%,
    rgba(255, 244, 214, 0.25) 53%,
    rgba(255, 255, 255, 0) 60%);
  background-size: 220% 100%;
  background-position: 140% 0;
  mix-blend-mode: screen;
  -webkit-mask-image: url("assets/crown.png");
  mask-image: url("assets/crown.png");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  opacity: 0;
}

.glint {
  position: absolute;
  z-index: 3;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px 3px rgba(255, 255, 255, 0.85);
  opacity: 0;
}

.g1 { left: 26%; top: 48%; }
.g2 { left: 49%; top: 42%; }
.g3 { left: 71%; top: 48%; }
.g4 { left: 38%; top: 86%; }
.g5 { left: 62%; top: 84%; }

.winner {
  position: relative;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  isolation: isolate;
}

.winner::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -16px -48px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.38), transparent 70%);
}

.initials {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--live);
  font-size: 16px;
  font-weight: 750;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.28);
}

.user {
  margin-top: 6px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.won {
  font-size: 15px;
  font-weight: 620;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.tier {
  margin-top: 6px;
  background: var(--gold);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
}

.menu {
  position: absolute;
  z-index: 5;
  top: 418px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.bub {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(20, 16, 16, 0.42);
  backdrop-filter: blur(8px);
}

.bub b {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--live);
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  text-shadow: none;
}

.dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
}

.dock {
  position: absolute;
  z-index: 5;
  left: 12px;
  right: 12px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat {
  height: 40px;
  border-radius: 999px;
  padding: 0 14px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(22, 18, 18, 0.72);
  backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
}

.lot {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 16px;
  background: rgba(32, 24, 22, 0.84);
  backdrop-filter: blur(14px);
}

.lot img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
}

.lot strong {
  display: block;
  font-size: 14px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.lot .meta {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
}

.price {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas: "fast amount" "fast label";
  column-gap: 6px;
  align-items: center;
  justify-items: end;
}

.fast {
  grid-area: fast;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--gold);
  color: var(--ink);
  border-radius: 999px;
  padding: 2px 6px 2px 4px;
  font-size: 10px;
  font-weight: 800;
}

.price b {
  grid-area: amount;
  font-size: 20px;
  font-weight: 780;
  letter-spacing: -0.03em;
}

.price small {
  grid-area: label;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
}

.next {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 600;
}

.next span { display: flex; align-items: center; gap: 4px; }

.going {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}

.going b { font-size: 14px; font-weight: 800; white-space: nowrap; }

.track {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.28);
}

.track i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 68%;
  border-radius: inherit;
  background: var(--live);
}

.wait {
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(48, 42, 42, 0.55);
  color: rgba(255, 255, 255, 0.84);
  font-size: 14px;
}

.foot {
  margin: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

.home {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 8px;
  width: 128px;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.88);
}

.phone.full .home { display: none; }

.half-only .back,
.circle-only .back {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.phone[data-mode="half"] .circle-only,
.phone[data-mode="circle"] .half-only { display: none; }

.half-only {
  position: relative;
  width: 292px;
  height: 161px;
  perspective: 800px;
}

.circle-only {
  position: relative;
  width: 320px;
  height: 250px;
  margin-top: -46px;
}

.front,
.back {
  position: absolute;
  inset: 0;
  justify-content: center;
}

.front { opacity: 0; }
.back { opacity: 0; }

.phone[data-mode="half"] .crown,
.phone[data-mode="circle"] .crown { opacity: 1; }

.half-only .back,
.circle-only .back { z-index: 3; }

.turn-crown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
}

.half-only .turn-crown { transform-style: preserve-3d; }

.half-only .crown {
  width: 292px;
  height: 161px;
}

.circle-only .crown {
  width: 320px;
  height: 250px;
}

.spin {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.42));
}

.edge {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 16%;
  width: 2px;
  height: 68%;
  transform: translateX(-50%);
  border-radius: 2px;
  background: linear-gradient(#fff, #f0b429 45%, #fff);
  box-shadow: 0 0 14px 3px rgba(255, 228, 170, 0.85);
  opacity: 0;
  pointer-events: none;
}

.who {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.mini {
  width: 74px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.4));
  flex: none;
}

.mini.royal {
  width: 62px;
  height: 52px;
}

.back { isolation: isolate; }

.back::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -18px -28px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.42), transparent 72%);
}

.back .user { margin-top: 0; font-size: 26px; }
.back .won { font-size: 14px; }

.phone.play .crown img { animation: metal 5.6s linear both; }

.phone.play .shine.a { animation: sweep 0.95s 0.28s ease-in-out both; }

.phone.play .glint { animation: glint 1.35s ease both; }
.phone.play .g2 { animation-delay: 0.1s; }
.phone.play .g3 { animation-delay: 0.18s; }
.phone.play .g4 { animation-delay: 0.32s; }
.phone.play .g5 { animation-delay: 0.42s; }

.phone[data-mode="half"].play .turn-crown {
  animation: turn-life 5.6s ease-in-out both;
}

.phone[data-mode="half"].play .edge { animation: edge-flash 5.6s ease both; }

.phone[data-mode="half"].play .back { animation: half-name 5.6s ease both; }

.phone[data-mode="circle"].play .back { animation: turn-name 5.6s ease both; }

.phone[data-mode="half"].still .back,
.phone[data-mode="circle"].still .back { opacity: 1; transform: none; }

.phone[data-mode="half"].still .turn-crown,
.phone[data-mode="circle"].still .turn-crown { opacity: 0; }

@keyframes metal {
  0% { filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.42)) brightness(2.3); }
  8% { filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.42)) brightness(1.45); }
  18%, 100% { filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.42)) brightness(1); }
}

@keyframes sweep {
  0% { background-position: 150% 0; opacity: 0; }
  18% { opacity: 1; }
  82% { opacity: 1; }
  100% { background-position: -50% 0; opacity: 0; }
}

@keyframes glint {
  0%, 14% { opacity: 0; transform: scale(0.4); }
  22% { opacity: 1; transform: scale(1); }
  34% { opacity: 0.15; transform: scale(0.6); }
  46% { opacity: 0.9; transform: scale(1); }
  62%, 100% { opacity: 0; transform: scale(0.5); }
}

@keyframes turn-life {
  0% { opacity: 0; transform: scale(0.18) rotateY(0deg); }
  8% { opacity: 1; transform: scale(1.07) rotateY(0deg); }
  14%, 27% { opacity: 1; transform: scale(1) rotateY(0deg); }
  52% { opacity: 1; transform: scale(1) rotateY(180deg); }
  63% { opacity: 1; transform: scale(1) rotateY(180deg); }
  76% { opacity: 0; transform: scale(0.98) rotateY(180deg); }
  100% { opacity: 0; transform: scale(0.98) rotateY(180deg); }
}

@keyframes edge-flash {
  0%, 34% { opacity: 0; }
  40% { opacity: 1; }
  48%, 100% { opacity: 0; }
}

@keyframes half-name {
  0%, 62% { opacity: 0; transform: translateY(8px); }
  75% { opacity: 1; transform: translateY(0); }
  86% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(4px); }
}

@keyframes turn-name {
  0%, 56% { opacity: 0; transform: translateY(8px); }
  68% { opacity: 1; transform: translateY(0); }
  88% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .phone.play .crown,
  .phone.play .crown img,
  .phone.play .winner,
  .phone.play .shine,
  .phone.play .glint,
  .phone.play .back,
  .phone.play .turn-crown,
  .phone.play .edge {
    animation: none;
  }

  .phone[data-mode="half"].play .turn-crown,
  .phone[data-mode="half"].play .edge,
  .phone[data-mode="circle"].play .turn-crown { opacity: 0; }
  .phone[data-mode="half"].play .back,
  .phone[data-mode="circle"].play .back { opacity: 1; transform: none; }
}
