:root {
  --bg-deep: #02120b;
  --bg-mid: #06301f;
  --bg-top: #0a4a2f;
  --card: rgba(255, 255, 255, 0.055);
  --card-strong: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.26);
  --text: #f1fbf5;
  --muted: #c9e2d6;
  --muted-dim: #a3c4b2;
  --green: #34d399;
  --green-deep: #059669;
  --gold: #f6c744;
  --gold-deep: #d18f0d;
  --red: #ff7a6b;
  --radius-lg: 24px;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 45px -22px rgba(0, 0, 0, 0.9);
  --shadow-soft: 0 10px 24px -16px rgba(0, 0, 0, 0.85);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", "Noto Sans Devanagari", "Noto Sans Bengali", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg-deep);
  background-image: radial-gradient(
      130% 62% at 50% -12%,
      rgba(52, 211, 153, 0.26),
      transparent 62%
    ),
    radial-gradient(90% 45% at 50% 112%, rgba(6, 94, 66, 0.9), transparent 64%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 42%, var(--bg-deep) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    118deg,
    rgba(255, 255, 255, 0.038) 0 2px,
    transparent 2px 46px
  );
  opacity: 0.55;
}

body::after {
  content: "";
  position: fixed;
  left: 50%;
  top: -18vh;
  width: min(120vw, 780px);
  height: 46vh;
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.11), transparent 72%);
  filter: blur(2px);
}

.shell {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px
    max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -120%);
  z-index: 20;
  padding: 13px 18px;
  border-radius: 0 0 12px 12px;
  background: var(--green);
  color: #02210f;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

[hidden] {
  display: none !important;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 0.82rem;
  text-transform: uppercase;
  padding: 4px 6px;
  min-height: 44px;
}

.brand__mark {
  font-size: 1.15rem;
  line-height: 1;
}

.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 4px 0;
}

.hero__title {
  margin: 0;
  font-size: clamp(2.1rem, 10vw, 3rem);
  line-height: 1.04;
  font-weight: 850;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff 12%, #cfe9dc 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.hero__sub {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 3.6vw, 1.08rem);
  line-height: 1.5;
  max-width: 32ch;
  margin-inline: auto;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: rise 0.5s var(--ease-out) both;
}

.card--ready {
  border-color: rgba(246, 199, 68, 0.4);
  background:
    radial-gradient(130% 46% at 50% -6%, rgba(246, 199, 68, 0.11), transparent 62%),
    var(--card);
}

.card--ready .card__title {
  text-align: center;
}

.ready__badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 900;
  color: #03220f;
  background: linear-gradient(180deg, #ffe9a2 0%, var(--gold) 60%, var(--gold-deep) 100%);
  box-shadow: 0 12px 24px -14px rgba(246, 199, 68, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.chips {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.chip {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(246, 199, 68, 0.1);
  border: 1px solid rgba(246, 199, 68, 0.3);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 2px 4px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.step {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 0.87rem;
  line-height: 1.4;
  color: var(--muted);
}

.step__num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold);
  background: rgba(246, 199, 68, 0.12);
  border: 1px solid rgba(246, 199, 68, 0.32);
}

.card__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.field__badge {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.72rem;
  letter-spacing: 0;
  background: rgba(52, 211, 153, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: var(--green);
}

.input {
  width: 100%;
  min-height: 52px;
  padding: 13px 15px;
  font: inherit;
  font-size: 1.02rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input::placeholder {
  color: var(--muted-dim);
}

.input:hover {
  border-color: var(--line-strong);
}

.input:focus {
  outline: none;
  border-color: var(--green);
  background: rgba(0, 0, 0, 0.34);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.16);
}

.input[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 122, 107, 0.14);
}

.field__error {
  margin: 0;
  font-size: 0.83rem;
  color: var(--red);
  min-height: 1.05em;
  line-height: 1.25;
}

.field__error:empty {
  min-height: 0;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  color: var(--text);
  background: var(--card-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.14s var(--ease-out), filter 0.2s, box-shadow 0.2s,
    background 0.2s, border-color 0.2s, opacity 0.2s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.995);
}

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

.btn--primary {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #03220f;
  background: linear-gradient(180deg, #5ee3ac 0%, var(--green) 55%, #12b981 100%);
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 12px 26px -14px rgba(16, 185, 129, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn--primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn--gold {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #3a2404;
  background: linear-gradient(180deg, #ffe08a 0%, var(--gold) 52%, var(--gold-deep) 100%);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 12px 28px -14px rgba(246, 199, 68, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn--gold:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn--ghost {
  background: transparent;
}

.btn--lg {
  min-height: 60px;
  font-size: 1.08rem;
}

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

.btn--slim {
  min-height: 46px;
  font-size: 0.92rem;
  font-weight: 650;
}

.link-box {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.link-box__icon {
  flex: 0 0 auto;
  font-size: 0.95rem;
  opacity: 0.85;
}

.link-box__url {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.86rem;
  color: var(--green);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* For layouts where a card and the button under it need real air between
   them, instead of the 12px the stack normally uses. */
.stack--roomy {
  gap: 26px;
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.45;
  border: 1px solid transparent;
}

.alert--error {
  background: rgba(255, 122, 107, 0.12);
  border-color: rgba(255, 122, 107, 0.4);
  color: #ffd9d3;
}

.alert--info {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.32);
  color: #d3fbe6;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  z-index: 40;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(4, 32, 20, 0.96);
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 650;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease-out);
  max-width: calc(100vw - 32px);
  text-align: center;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sound-toggle {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  right: 12px;
  z-index: 30;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, transform 0.15s;
}

.sound-toggle[aria-pressed="true"] {
  color: var(--gold);
  border-color: rgba(246, 199, 68, 0.55);
}

.sound-toggle:active {
  transform: scale(0.94);
}

.duel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 2px 0 4px;
}

.duel__side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
}

.duel__badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
  color: #03220f;
  background: linear-gradient(180deg, #6ceab4 0%, var(--green) 58%, #10b981 100%);
  box-shadow: 0 10px 20px -12px rgba(52, 211, 153, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.duel__side:last-child .duel__badge {
  color: #3a2404;
  background: linear-gradient(180deg, #ffe9a2 0%, var(--gold) 58%, var(--gold-deep) 100%);
  box-shadow: 0 10px 20px -12px rgba(246, 199, 68, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.duel__tag {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.duel__name {
  margin: 0;
  font-size: clamp(1rem, 5.2vw, 1.26rem);
  font-weight: 800;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.duel__split {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.duel__split::before,
.duel__split::after {
  content: "";
  width: 1px;
  height: 20px;
  background: linear-gradient(180deg, transparent, var(--line-strong), transparent);
}

.page-title {
  margin: 0;
  text-align: center;
  font-size: clamp(1.05rem, 5vw, 1.3rem);
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.coin-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 6px 0 2px;
  perspective: 900px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Once the coin is spinning the tap is spent, so stop inviting it. */
.coin-stage.is-spent {
  cursor: default;
}

.coin-float {
  position: relative;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
  animation: float 4.4s ease-in-out infinite;
  will-change: transform;
}

/* A soft contact shadow so the coin feels like it is sitting in space. */
.coin-shadow {
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 74%;
  height: 14px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.62), transparent 72%);
  filter: blur(4px);
  pointer-events: none;
}

.coin {
  position: relative;
  width: clamp(150px, 43vw, 200px);
  aspect-ratio: 1 / 1;
  transform: rotateX(6deg) rotateY(0deg);
  transform-style: preserve-3d;
  will-change: transform;
}

/* Layered like real struck metal: an inner field, a milled edge, then the rim. */
.coin-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 24% 17%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background:
    radial-gradient(circle at 50% 52%, #fff3cd 0%, #fae29a 52%, #ecc55c 72%, rgba(236, 197, 92, 0) 73%),
    repeating-conic-gradient(
      from 0deg,
      rgba(255, 255, 255, 0.5) 0deg 1.5deg,
      rgba(126, 78, 6, 0.34) 1.5deg 3deg
    ),
    conic-gradient(
      from 205deg,
      #f7d576,
      #c9901c 22%,
      #fff2c2 42%,
      #cf9c27 60%,
      #f4cc62 82%,
      #f7d576
    );
  box-shadow:
    inset 0 3px 7px rgba(255, 255, 255, 0.6),
    inset 0 -7px 16px rgba(120, 74, 6, 0.42),
    0 20px 36px -16px rgba(0, 0, 0, 0.9);
}

/* The raised rim. */
.coin-face::before {
  content: "";
  position: absolute;
  inset: 5.5%;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.8),
    inset 0 0 0 5px rgba(150, 96, 8, 0.26),
    inset 0 -4px 10px rgba(120, 74, 6, 0.35),
    0 0 0 1px rgba(120, 74, 6, 0.22);
}

/* The engraved inner circle. */
.coin-face::after {
  content: "";
  position: absolute;
  inset: 13%;
  border-radius: 50%;
  border: 1px dashed rgba(122, 76, 4, 0.26);
  box-shadow: inset 0 1px 2px rgba(122, 76, 4, 0.18), 0 1px 0 rgba(255, 255, 255, 0.45);
}

.coin-face--back {
  transform: rotateY(180deg);
}

/* A green halo marks the winning face. No transform here, because the coin's
   own rotation owns that property. */
.coin-face.is-winner {
  box-shadow:
    inset 0 3px 7px rgba(255, 255, 255, 0.72),
    inset 0 -7px 16px rgba(120, 74, 6, 0.42),
    0 0 0 3px rgba(52, 211, 153, 0.6),
    0 0 44px -4px rgba(52, 211, 153, 0.6),
    0 20px 36px -16px rgba(0, 0, 0, 0.9);
  animation: coinWin 0.75s var(--ease-out);
}

/* No z-index here on purpose: inside the coin's preserve-3d context, a positive
   z-index makes Chrome sort this text behind the coin face, and it disappears. */
.coin-name {
  position: relative;
  font-size: var(--coin-fs, 1.1rem);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: 0.01em;
  text-align: center;
  text-transform: uppercase;
  color: #4a2d02;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6), 0 -1px 1px rgba(90, 55, 4, 0.18);
  overflow-wrap: anywhere;
  hyphens: none;
}

.coin-toss-hint {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  animation: pulse 1.6s ease-in-out infinite;
}

.result {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 30px 22px 26px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(246, 199, 68, 0.4);
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(246, 199, 68, 0.22), transparent 62%),
    linear-gradient(170deg, rgba(255, 255, 255, 0.06) 0%, rgba(5, 60, 38, 0.55) 100%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  overflow: hidden;
  animation: reveal 0.55s var(--ease-out) both;
}

/* The trophy sits in a gold disc so it reads as a medal rather than a loose
   emoji floating in the card. */
.result__medal {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  font-size: 2.2rem;
  line-height: 1;
  background: linear-gradient(160deg, #fff3cd 0%, #f6c744 46%, #d99a12 100%);
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 14px 28px -12px rgba(246, 199, 68, 0.85),
    inset 0 2px 6px rgba(255, 255, 255, 0.6);
  animation: rise 0.6s var(--ease-out) both;
  filter: drop-shadow(0 6px 14px rgba(246, 199, 68, 0.35));
}

.result__rule {
  width: 76px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(246, 199, 68, 0.85), transparent);
}

/* The two captains, side by side, with the winner picked out. */
.result__board {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result__entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 40, 27, 0.5);
  text-align: left;
}

.result__entry--won {
  border-color: rgba(246, 199, 68, 0.55);
  background: linear-gradient(100deg, rgba(246, 199, 68, 0.22), rgba(4, 40, 27, 0.5) 72%);
}

.result__initial {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 800;
  color: #eafaf1;
  background: rgba(255, 255, 255, 0.12);
}

.result__entry--won .result__initial {
  color: #4a2c00;
  background: linear-gradient(160deg, #ffe9a2, var(--gold));
}

.result__captain {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  overflow-wrap: anywhere;
}

.result__verdict {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-dim);
  white-space: nowrap;
}

.result__entry--won .result__verdict {
  color: #ffdf95;
}

.result__winner-label {
  margin: 2px 0 0;
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #0a3a26;
  background: linear-gradient(180deg, #ffe9a2, var(--gold));
  box-shadow: 0 8px 18px -12px rgba(246, 199, 68, 0.9);
}

.result__winner {
  margin: 0;
  font-size: clamp(1.6rem, 8.4vw, 2.3rem);
  line-height: 1.06;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  background: linear-gradient(180deg, #ffffff 18%, #ffe9a8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.result__note {
  margin: 2px 0 0;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
  background: rgba(4, 40, 27, 0.45);
}

.sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.spark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--gold);
  opacity: 0;
  animation: spark 1.1s var(--ease-out) forwards;
}

.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 30px 4px;
}

.center__emoji {
  font-size: 3rem;
  line-height: 1;
  animation: float 3.6s ease-in-out infinite;
}

.center__title {
  margin: 0;
  font-size: clamp(1.7rem, 8vw, 2.3rem);
  font-weight: 850;
  letter-spacing: -0.01em;
}

.center__text {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
  max-width: 30ch;
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--green);
  animation: spin 0.8s linear infinite;
}

.page-foot {
  margin-top: auto;
  padding: 18px 4px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  color: var(--muted-dim);
}

.page-foot__rule {
  width: 100%;
  max-width: 190px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--line-strong) 35%,
    var(--line-strong) 65%,
    transparent
  );
  margin-bottom: 4px;
}

.counter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding: 3px 4px;
  min-height: 24px;
}

.counter__value {
  color: var(--text);
  font-weight: 800;
}

.foot-tag {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted-dim);
}

@media (min-width: 480px) {
  .shell {
    padding-inline: 22px;
  }

  .card {
    padding: 24px 24px;
  }
}

@media (min-width: 1024px) {
  body {
    background-attachment: fixed;
  }

  .shell {
    max-width: 560px;
    padding-top: 28px;
  }
}

@media (max-width: 359px) {
  .shell {
    padding-inline: 12px;
    gap: 14px;
  }

  .card {
    padding: 16px 14px;
  }

  .btn-row {
    grid-template-columns: 1fr;
  }
}

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

@keyframes reveal {
  0% {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
  60% {
    opacity: 1;
    transform: scale(1.015) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@keyframes coinWin {
  0% {
    filter: brightness(1);
  }
  45% {
    filter: brightness(1.22) saturate(1.15);
  }
  100% {
    filter: brightness(1);
  }
}

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

@keyframes spark {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.9)
      rotate(var(--rot));
  }
}

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

  .coin-float,
  .center__emoji,
  .coin-toss-hint {
    animation: none !important;
  }
}
