:root {
  --sky: #00AEEF;
  --navy: #00395D;
  --ink: #04283f;
  --snow: #f6fbff;
  --paper: #ffffff;
  --gold: #c9a45a;
  --mist: rgba(246, 251, 255, 0.72);
  --line: rgba(0, 174, 239, 0.28);
  --shade: rgba(4, 40, 63, 0.18);
  --dock: 76px;
  --font: "Outfit", "Segoe UI", sans-serif;
  --display: "Cormorant Garamond", Georgia, serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  background: var(--navy);
  color: var(--ink);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}

body {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
  color: inherit;
  border: 0;
  outline: none;
  -webkit-text-decoration-skip: none;
}

button {
  cursor: pointer;
  background: none;
}

input {
  background: var(--paper);
  caret-color: var(--sky);
}

.bbx-root {
  position: relative;
  width: min(100vw, 560px);
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(0, 174, 239, 0.35), transparent 55%),
    var(--navy);
}

.bbx-veil,
.bbx-shell {
  position: absolute;
  inset: 0;
}

.bbx-veil[hidden],
.bbx-shell[hidden] {
  display: none !important;
}

.bbx-splash {
  z-index: 40;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(0, 57, 93, 0.42), rgba(0, 57, 93, 0.78)),
    url("bg-hall.webp") center / cover no-repeat;
}

.bbx-splash-sky,
.bbx-coffer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bbx-coffer {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 72px 72px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 72px 72px;
  mask-image: radial-gradient(circle at 50% 40%, #000 20%, transparent 72%);
}

.bbx-splash-core {
  position: relative;
  text-align: center;
  color: var(--paper);
  padding: 24px;
}

.bbx-halo {
  position: absolute;
  width: 220px;
  height: 220px;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 174, 239, 0.45), transparent 68%);
  animation: bbxGlow 1.5s ease-in-out infinite alternate;
}

.bbx-splash-crest {
  position: relative;
  margin: 0 auto 16px;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.35));
}

.bbx-word {
  font-family: var(--display);
  font-size: clamp(42px, 10vw, 58px);
  letter-spacing: 0.02em;
  line-height: 0.92;
}

.bbx-whisper {
  margin-top: 8px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
}

.bbx-pulse {
  display: block;
  width: 42px;
  height: 2px;
  margin: 22px auto 0;
  background: linear-gradient(90deg, transparent, var(--sky), transparent);
  animation: bbxPulse 1.5s linear infinite;
}

.bbx-vault {
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: #01253d;
}

.bbx-vault-room {
  position: relative;
  flex: 1.15;
  overflow: hidden;
  perspective: 980px;
}

.bbx-vault-table {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 57, 93, 0.18), rgba(0, 57, 93, 0.55)),
    url("bg-vault.webp") center / cover no-repeat;
  transform: scale(1.04);
}

.bbx-iris {
  position: absolute;
  inset: -8%;
  pointer-events: none;
}

.bbx-iris i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 78%;
  height: 46%;
  background:
    linear-gradient(180deg, #14557a, #00395D 55%, #012337);
  border: 1px solid rgba(201, 164, 90, 0.35);
  transform-origin: 0 0;
  clip-path: polygon(0 0, 100% 8%, 86% 100%, 6% 92%);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.bbx-iris i:nth-child(1) { transform: rotate(0deg) translate(-6%, -8%); }
.bbx-iris i:nth-child(2) { transform: rotate(60deg) translate(-6%, -8%); }
.bbx-iris i:nth-child(3) { transform: rotate(120deg) translate(-6%, -8%); }
.bbx-iris i:nth-child(4) { transform: rotate(180deg) translate(-6%, -8%); }
.bbx-iris i:nth-child(5) { transform: rotate(240deg) translate(-6%, -8%); }
.bbx-iris i:nth-child(6) { transform: rotate(300deg) translate(-6%, -8%); }

.bbx-iris[data-open="1"] i:nth-child(1) { transform: rotate(-18deg) translate(-6%, -38%); }
.bbx-iris[data-open="1"] i:nth-child(2) { transform: rotate(42deg) translate(-6%, -38%); }
.bbx-iris[data-open="1"] i:nth-child(3) { transform: rotate(102deg) translate(-6%, -38%); }
.bbx-iris[data-open="1"] i:nth-child(4) { transform: rotate(162deg) translate(-6%, -38%); }
.bbx-iris[data-open="1"] i:nth-child(5) { transform: rotate(222deg) translate(-6%, -38%); }
.bbx-iris[data-open="1"] i:nth-child(6) { transform: rotate(282deg) translate(-6%, -38%); }

.bbx-iris[data-open="2"] i:nth-child(1) { transform: rotate(-32deg) translate(-8%, -72%); }
.bbx-iris[data-open="2"] i:nth-child(2) { transform: rotate(28deg) translate(-8%, -72%); }
.bbx-iris[data-open="2"] i:nth-child(3) { transform: rotate(88deg) translate(-8%, -72%); }
.bbx-iris[data-open="2"] i:nth-child(4) { transform: rotate(148deg) translate(-8%, -72%); }
.bbx-iris[data-open="2"] i:nth-child(5) { transform: rotate(208deg) translate(-8%, -72%); }
.bbx-iris[data-open="2"] i:nth-child(6) { transform: rotate(268deg) translate(-8%, -72%); }

.bbx-iris[data-open="3"] { opacity: 0; }

.bbx-door {
  position: absolute;
  width: min(58vw, 240px);
  aspect-ratio: 1;
  left: 8%;
  top: 18%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 30%, rgba(255, 255, 255, 0.16), transparent 28%),
    conic-gradient(from 20deg, #1b6c93, #00395D, #0a4d73, #00395D);
  box-shadow: inset 0 0 0 10px #03283f, 0 18px 40px rgba(0, 0, 0, 0.4);
  transform-origin: 8% 50%;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.8s ease;
}

.bbx-vault[data-step="1"] .bbx-door { transform: rotateY(-42deg) translateX(-8%); }
.bbx-vault[data-step="2"] .bbx-door { transform: rotateY(-78deg) translateX(-18%); }
.bbx-vault[data-step="3"] .bbx-door { transform: rotateY(-108deg) translateX(-30%); opacity: 0.2; }

.bbx-door-ring,
.bbx-door-hub,
.bbx-door-bolt {
  position: absolute;
  inset: 16%;
  border-radius: 50%;
  border: 2px solid rgba(201, 164, 90, 0.7);
}

.bbx-door-hub {
  inset: 36%;
  background: radial-gradient(circle, #00AEEF, #00395D);
}

.bbx-door-bolt {
  inset: auto;
  width: 18px;
  height: 18px;
  left: 72%;
  top: 46%;
  background: var(--gold);
}

.bbx-brief {
  position: relative;
  min-height: 210px;
  padding: 0 22px;
}

.bbx-step {
  display: none;
  color: var(--paper);
  text-align: center;
}

.bbx-step.is-live {
  display: block;
  animation: bbxRise 0.45s ease;
}

.bbx-step img {
  width: 88px;
  height: 88px;
  margin: 0 auto 10px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
}

.bbx-step h2 {
  font-family: var(--display);
  font-size: 32px;
  margin: 4px 0 8px;
}

.bbx-step p {
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.45;
  font-size: 14px;
}

.bbx-kicker {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--sky);
  font-weight: 600;
}

.bbx-brief-foot {
  display: grid;
  gap: 10px;
  padding: 8px 22px calc(18px + env(safe-area-inset-bottom));
}

.bbx-pips {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.bbx-pips i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
}

.bbx-pips i.is-live {
  background: var(--sky);
  box-shadow: 0 0 0 4px rgba(0, 174, 239, 0.18);
}

.bbx-cta,
.bbx-ghost,
.bbx-quiet,
.bbx-mini {
  min-height: 48px;
  border-radius: 999px;
  padding: 0 22px;
}

.bbx-cta {
  background: linear-gradient(180deg, #1bc0ff, var(--sky));
  color: #003047;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0, 174, 239, 0.28);
}

.bbx-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.bbx-quiet {
  color: rgba(255, 255, 255, 0.7);
  min-height: 36px;
}

.bbx-mini {
  min-height: 38px;
  padding: 0 14px;
  background: var(--navy);
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
}

.bbx-shell {
  display: flex;
  flex-direction: column;
  background: var(--snow);
}

.bbx-shell-sky {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 220px;
  background:
    linear-gradient(180deg, rgba(0, 57, 93, 0.55), rgba(246, 251, 255, 0.92)),
    url("bg-hall.webp") center / cover no-repeat;
  pointer-events: none;
}

.bbx-mast {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 10px;
  color: var(--paper);
}

.bbx-mast img {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
}

.bbx-mast strong {
  display: block;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
}

.bbx-mast span {
  font-size: 12px;
  opacity: 0.78;
}

.bbx-marks {
  margin-left: auto;
  font-style: normal;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
}

.bbx-stage {
  position: relative;
  z-index: 2;
  flex: 1;
  overflow: auto;
  padding: 8px 16px calc(var(--dock) + 18px + env(safe-area-inset-bottom));
}

.bbx-lane {
  display: none;
}

.bbx-lane.is-live {
  display: block;
  animation: bbxRise 0.35s ease;
}

.bbx-hero {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  background: var(--paper);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 12px 30px var(--shade);
  border: 1px solid rgba(0, 174, 239, 0.16);
}

.bbx-hero-mark {
  width: 72px;
  height: 72px;
}

.bbx-hero h2 {
  font-family: var(--display);
  font-size: 28px;
  color: var(--navy);
}

.bbx-hero p:last-child {
  margin-top: 4px;
  font-size: 13px;
  color: #3d6074;
}

.bbx-doors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0 16px;
}

.bbx-door-tile {
  position: relative;
  min-height: 128px;
  padding: 16px 14px 12px;
  border-radius: 22px 22px 14px 14px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(0, 174, 239, 0.18), transparent 46%),
    var(--paper);
  box-shadow: 0 10px 24px var(--shade);
  border: 1px solid var(--line);
  text-align: left;
  overflow: hidden;
}

.bbx-door-tile::before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: -28px;
  height: 56px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 80px 80px 0 0;
}

.bbx-door-tile img {
  width: 54px;
  height: 54px;
  margin-bottom: 10px;
}

.bbx-door-tile span {
  display: block;
  font-family: var(--display);
  font-size: 24px;
  color: var(--navy);
}

.bbx-door-tile small {
  color: #4a6d80;
}

.bbx-slate {
  background: var(--paper);
  border-radius: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px var(--shade);
}

.bbx-slate-head {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.bbx-slate h3 {
  font-family: var(--display);
  font-size: 26px;
  color: var(--navy);
}

.bbx-slate form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.bbx-slate label {
  grid-column: 1 / -1;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #4a6d80;
}

.bbx-slate input {
  height: 40px;
  border-radius: 12px;
  padding: 0 12px;
  border: 1px solid #d5e8f2;
}

.bbx-slate ol {
  list-style: none;
  display: grid;
  gap: 8px;
}

.bbx-slate li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f0f8fc;
  color: var(--navy);
  font-size: 14px;
}

.bbx-lead {
  color: #3d6074;
  font-size: 14px;
  margin: 6px 0 14px;
}

.bbx-lane > h2 {
  font-family: var(--display);
  font-size: 34px;
  color: var(--navy);
}

.bbx-wheel-stage {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 1;
  margin: 0 auto 12px;
}

.bbx-pointer {
  position: absolute;
  left: 50%;
  top: -2px;
  z-index: 3;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 22px solid var(--gold);
  transform: translateX(-50%);
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.2));
}

#bbxWheel,
#bbxConfetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
}

#bbxConfetti {
  pointer-events: none;
}

.bbx-wheel-meta,
.bbx-wheel-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
  color: #3d6074;
  font-size: 13px;
}

.bbx-wheel-meta strong,
.bbx-wheel-bar strong {
  display: block;
  color: var(--navy);
  font-size: 18px;
}

.bbx-wheel-bar .bbx-cta {
  min-height: 42px;
  padding: 0 16px;
  flex: 0 0 auto;
}

.bbx-quiz-bar,
.bbx-table-acts {
  display: flex;
  gap: 10px;
  margin: 10px 0 14px;
}

.bbx-quiz-bar {
  justify-content: space-between;
  color: var(--navy);
  font-weight: 600;
}

.bbx-quiz-card {
  background: var(--paper);
  border-radius: 22px;
  padding: 18px 16px 16px;
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px var(--shade);
}

.bbx-quiz-art {
  width: 72px;
  height: 72px;
  margin-bottom: 8px;
}

.bbx-quiz-card h3 {
  font-family: var(--display);
  font-size: 28px;
  color: var(--navy);
  margin: 6px 0 14px;
  line-height: 1.15;
}

.bbx-choices {
  display: grid;
  gap: 8px;
}

.bbx-choices button {
  min-height: 46px;
  text-align: left;
  padding: 10px 14px;
  border-radius: 14px;
  background: #f0f8fc;
  border: 1px solid #d5e8f2;
  color: var(--navy);
  font-weight: 600;
}

.bbx-choices button.is-right {
  background: #d9f4ff;
  border-color: var(--sky);
}

.bbx-choices button.is-wrong {
  background: #e8eef2;
  opacity: 0.7;
}

.bbx-note {
  min-height: 22px;
  margin: 10px 0;
  color: #3d6074;
  font-size: 13px;
}

.bbx-felt {
  background:
    radial-gradient(90% 80% at 50% 0%, rgba(0, 174, 239, 0.16), transparent 50%),
    #00395D;
  border-radius: 24px;
  padding: 16px;
  color: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(201, 164, 90, 0.28);
}

.bbx-hand + .bbx-hand {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.bbx-hand p {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.bbx-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 86px;
}

.bbx-card {
  width: 58px;
  height: 82px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.18);
}

.bbx-card.is-blue {
  color: var(--sky);
}

.bbx-card.is-back {
  background:
    repeating-linear-gradient(45deg, #00AEEF 0 4px, #00395D 4px 8px);
  color: transparent;
}

.bbx-table-acts {
  flex-wrap: wrap;
}

.bbx-table-acts .bbx-cta,
.bbx-table-acts .bbx-ghost {
  flex: 1;
}

.bbx-table-acts .bbx-quiet {
  width: 100%;
  color: #3d6074;
}

.bbx-dock {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(4, 40, 63, 0.18);
  backdrop-filter: blur(12px);
}

.bbx-dock button {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 6px 2px;
  border-radius: 14px;
  color: #4a6d80;
  font-size: 11px;
  font-weight: 600;
}

.bbx-dock img {
  width: 22px;
  height: 22px;
}

.bbx-dock button.is-live {
  background: #e7f6fd;
  color: var(--navy);
}

.bbx-root[data-veil="shell"] #bbxSplash,
.bbx-root[data-veil="shell"] #bbxVault {
  display: none;
}

.bbx-root[data-veil="brief"] #bbxSplash {
  display: none;
}

@keyframes bbxGlow {
  from { opacity: 0.55; transform: translateX(-50%) scale(0.94); }
  to { opacity: 1; transform: translateX(-50%) scale(1.06); }
}

@keyframes bbxPulse {
  from { transform: scaleX(0.3); opacity: 0.3; }
  to { transform: scaleX(1); opacity: 1; }
}

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

@media (min-width: 720px) {
  .bbx-root {
    width: min(100vw, 980px);
    border-left: 1px solid rgba(0, 174, 239, 0.12);
    border-right: 1px solid rgba(0, 174, 239, 0.12);
  }

  .bbx-doors {
    grid-template-columns: repeat(4, 1fr);
  }

  .bbx-hero {
    grid-template-columns: 96px 1fr;
  }

  .bbx-wheel-stage {
    width: 400px;
  }

  .bbx-stage {
    padding-left: 28px;
    padding-right: 28px;
  }
}

@media (max-width: 360px) {
  .bbx-door-tile {
    min-height: 120px;
  }

  .bbx-word {
    font-size: 36px;
  }
}

@media (max-height: 780px) {
  .bbx-wheel-stage {
    width: min(72vw, 280px);
  }

  .bbx-lane > h2 {
    font-size: 28px;
  }

  .bbx-lead {
    margin-bottom: 8px;
  }
}
