:root {
  --navy-950: #031724;
  --navy-900: #06273c;
  --navy-800: #093a56;
  --blue-600: #0075c9;
  --blue-500: #0497e9;
  --blue-300: #54c7ff;
  --cyan-200: #a9e7ff;
  --ink: #102534;
  --muted: #647985;
  --line: #d9e7ee;
  --surface: #f6fbfe;
  --white: #ffffff;
  --success: #20b76a;
  --danger: #ef5b67;
  --warning: #ffaf37;
  --shadow: 0 28px 80px rgba(0, 32, 53, 0.18);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface);
}

* { box-sizing: border-box; }

.is-removed { display: none !important; }

html, body { margin: 0; min-width: 320px; min-height: 100%; }

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--navy-950);
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  position: relative;
  isolation: isolate;
  width: 100vw;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 79% 42%, rgba(0, 151, 233, 0.21), transparent 32%),
    linear-gradient(126deg, #041d2d 0%, #073752 52%, #041d2d 100%);
}

.app-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: .22;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.ambient {
  position: absolute;
  z-index: -1;
  width: 34vw;
  aspect-ratio: 1;
  border: 1px solid rgba(104, 210, 255, .12);
  border-radius: 50%;
  pointer-events: none;
}

.ambient::before, .ambient::after {
  content: "";
  position: absolute;
  inset: 13%;
  border: inherit;
  border-radius: inherit;
}

.ambient::after { inset: 28%; }
.ambient-one { top: -18vw; right: -8vw; }
.ambient-two { bottom: -23vw; left: -12vw; }

.brand-bar {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: clamp(78px, 8vh, 96px);
  padding: 0 clamp(28px, 4vw, 78px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--white); text-decoration: none; }
.brand-mark, .mini-mark {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border-radius: 14px;
  color: white;
  font-size: 24px;
  font-weight: 900;
  background: linear-gradient(145deg, var(--blue-300), var(--blue-600));
  box-shadow: 0 12px 25px rgba(0, 151, 233, .28), inset 0 1px rgba(255,255,255,.45);
}

.brand-copy { display: grid; line-height: 1.1; }
.brand-copy strong { font-size: 17px; letter-spacing: -.02em; }
.brand-copy small { margin-top: 4px; color: var(--blue-300); font-size: 11px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.private-note { display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.62); font-size: 13px; font-weight: 600; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(32,183,106,.12); }

.screen {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  visibility: hidden;
  padding: clamp(96px, 10vh, 118px) clamp(28px, 5vw, 96px) clamp(30px, 4vh, 50px);
  opacity: 0;
  transform: scale(.985);
  transition: opacity .35s ease, transform .35s ease, visibility .35s;
  pointer-events: none;
}

.screen.is-active { visibility: visible; opacity: 1; transform: scale(1); pointer-events: auto; }
.screen-welcome { grid-template-columns: minmax(430px, .95fr) minmax(430px, 1.05fr); gap: 5vw; max-width: 1680px; margin: 0 auto; }

.eyebrow {
  margin: 0 0 18px;
  color: var(--blue-300);
  font-size: clamp(12px, 1vw, 15px);
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.welcome-copy { z-index: 2; align-self: center; max-width: 720px; }
.welcome-copy h1 {
  margin: 0;
  color: var(--white);
  font-size: clamp(66px, 6.5vw, 124px);
  line-height: .91;
  letter-spacing: -.065em;
}

.welcome-copy h1 span { color: var(--blue-300); }
.lede { max-width: 650px; margin: 30px 0 34px; color: rgba(255,255,255,.66); font-size: clamp(17px, 1.3vw, 22px); line-height: 1.65; }
.welcome-actions { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }

.btn {
  min-height: 58px;
  padding: 0 25px;
  border: 0;
  border-radius: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible, .tile:focus-visible, .exit-button:focus-visible, .back-button:focus-visible {
  outline: 3px solid var(--blue-300);
  outline-offset: 3px;
}

.btn-primary { color: white; background: linear-gradient(135deg, var(--blue-500), var(--blue-600)); box-shadow: 0 14px 30px rgba(0, 137, 215, .32); }
.btn-primary span { margin-left: 12px; }
.btn-secondary { color: var(--navy-800); background: #e8f2f7; }
.btn-danger { color: white; background: var(--danger); }
.round-meta { display: flex; align-items: center; gap: 15px; color: rgba(255,255,255,.63); font-size: 14px; }
.round-meta b { color: white; }
.round-meta i { width: 4px; height: 4px; border-radius: 50%; background: var(--blue-300); }

.hero-visual { position: relative; justify-self: center; width: min(48vw, 760px); aspect-ratio: 1; }
.orbit { position: absolute; inset: 9%; border: 1px solid rgba(139, 221, 255, .22); border-radius: 50%; animation: spin 22s linear infinite; }
.orbit::before, .orbit::after { content: ""; position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--blue-300); box-shadow: 0 0 24px var(--blue-300); }
.orbit::before { top: 18%; left: 7%; }
.orbit::after { right: 12%; bottom: 15%; width: 7px; height: 7px; }
.orbit-two { inset: 19%; animation-direction: reverse; animation-duration: 16s; }

.mascot { position: absolute; inset: 19% 24% 14%; animation: float 4.5s ease-in-out infinite; }
.mascot-head { position: relative; z-index: 3; width: 100%; aspect-ratio: 1.16; border: 10px solid #dff6ff; border-radius: 42% 42% 46% 46%; background: linear-gradient(145deg, #f8fdff, #a9ddf4 70%, #65b4da); box-shadow: inset -18px -16px 28px rgba(0,73,111,.18), 0 28px 55px rgba(0,0,0,.25); }
.mascot-face { position: absolute; inset: 19% 13% 24%; border-radius: 44%; background: linear-gradient(145deg, #08344d, #021722); box-shadow: inset 0 1px 9px rgba(116,215,255,.28); }
.eye { position: absolute; top: 38%; width: 12%; aspect-ratio: 1; border-radius: 50%; background: var(--blue-300); box-shadow: 0 0 18px var(--blue-300); }
.eye::after { content: ""; position: absolute; top: 15%; left: 18%; width: 28%; aspect-ratio: 1; border-radius: 50%; background: white; }
.eye-left { left: 25%; }
.eye-right { right: 25%; }
.smile { position: absolute; left: 42%; top: 62%; width: 16%; height: 9%; border-bottom: 4px solid var(--blue-300); border-radius: 50%; }
.mascot-badge { position: absolute; right: -8%; bottom: 4%; display: grid; place-items: center; width: 22%; aspect-ratio: 1; color: white; font-size: clamp(20px, 2vw, 38px); font-weight: 900; border: 5px solid white; border-radius: 50%; background: var(--blue-600); box-shadow: 0 10px 25px rgba(0,0,0,.22); }
.mascot-ear { position: absolute; z-index: 1; top: 7%; width: 29%; aspect-ratio: 1; border: 8px solid #dff6ff; border-radius: 48% 48% 12% 48%; background: #2a7fa9; transform: rotate(45deg); }
.mascot-ear-left { left: -5%; }
.mascot-ear-right { right: -5%; transform: rotate(135deg); }
.mascot-body { position: absolute; z-index: 2; left: 19%; right: 19%; bottom: -24%; height: 38%; display: grid; place-items: center; border: 8px solid #dff6ff; border-radius: 35% 35% 42% 42%; color: white; background: linear-gradient(150deg, var(--blue-500), #04598e); box-shadow: 0 25px 40px rgba(0,0,0,.22); }
.mascot-body span { font-size: clamp(12px, 1.2vw, 20px); font-weight: 900; letter-spacing: .15em; }
.mascot-shadow { position: absolute; left: 12%; right: 12%; bottom: -38%; height: 12%; border-radius: 50%; background: rgba(0,0,0,.32); filter: blur(13px); }

.floating-card { position: absolute; z-index: 6; display: grid; place-items: center; width: 15%; aspect-ratio: .88; border: 1px solid rgba(255,255,255,.45); border-radius: 18%; color: var(--navy-900); background: linear-gradient(145deg, white, #cdeeff); box-shadow: 0 20px 40px rgba(0,0,0,.23); animation: drift 5s ease-in-out infinite; }
.floating-card span { font-size: clamp(18px, 2vw, 36px); font-weight: 900; }
.card-a { left: 4%; top: 26%; transform: rotate(-13deg); }
.card-b { right: 3%; top: 17%; transform: rotate(11deg); animation-delay: -.8s; }
.card-c { right: 8%; bottom: 10%; transform: rotate(-7deg); animation-delay: -1.7s; color: var(--success); }

.screen-form { place-items: center; }
.form-card {
  position: relative;
  width: min(940px, 92vw);
  padding: clamp(30px, 3vw, 54px);
  border: 1px solid rgba(255,255,255,.58);
  border-radius: 32px;
  background: rgba(248,253,255,.97);
  box-shadow: var(--shadow);
}

.back-button { position: absolute; top: 24px; right: 26px; width: 42px; height: 42px; border: 0; border-radius: 14px; color: var(--navy-800); background: #e9f4f8; font-weight: 900; cursor: pointer; }
.form-heading { display: flex; align-items: center; gap: 20px; margin-bottom: 31px; }
.form-heading .eyebrow { margin-bottom: 5px; color: var(--blue-600); }
.form-heading h2 { margin: 0; color: var(--navy-900); font-size: clamp(28px, 2.4vw, 43px); letter-spacing: -.04em; }
.form-heading p:last-child { margin: 7px 0 0; color: var(--muted); }
.mini-mark { width: 62px; height: 62px; flex: 0 0 auto; font-size: 31px; border-radius: 19px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { display: grid; gap: 8px; }
.field-wide { grid-column: 1 / -1; }
.field > span { color: var(--ink); font-size: 13px; font-weight: 800; }
.field input { width: 100%; height: 55px; padding: 0 17px; border: 1px solid var(--line); border-radius: 14px; outline: none; color: var(--ink); background: white; transition: border .2s, box-shadow .2s; }
.field input::placeholder { color: #9aabb4; }
.field input:focus { border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(4,151,233,.11); }
.field.has-error input { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(239,91,103,.08); }
.error-message { min-height: 14px; color: var(--danger); font-size: 11px; font-weight: 700; }
.form-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 28px; }
.form-footer p { margin: 0; color: var(--muted); font-size: 12px; }
.form-footer p span { color: var(--blue-600); }

.screen-game { padding: clamp(84px, 9vh, 104px) clamp(24px, 3vw, 58px) clamp(20px, 2.7vh, 34px); }
.game-panel { width: min(1450px, 96vw); max-height: calc(100vh - 112px); margin: auto; padding: clamp(18px, 1.7vw, 28px); border: 1px solid rgba(255,255,255,.4); border-radius: 30px; background: rgba(246,251,254,.975); box-shadow: var(--shadow); }
.game-topbar { display: grid; grid-template-columns: 1fr auto 1.45fr; align-items: center; gap: 22px; }
.player-chip { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 auto; border-radius: 15px; color: white; font-weight: 900; background: linear-gradient(145deg, var(--navy-800), var(--blue-600)); }
.player-chip > span:last-child { display: grid; min-width: 0; }
.player-chip small, .stat small { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.player-chip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy-900); }
.game-title-block { text-align: center; }
.game-title-block .eyebrow { margin: 0 0 3px; color: var(--blue-600); font-size: 10px; }
.game-title-block h2 { margin: 0; color: var(--navy-900); font-size: clamp(22px, 2vw, 32px); letter-spacing: -.04em; }
.game-stats { display: flex; justify-content: flex-end; align-items: stretch; gap: 10px; }
.stat { min-width: 92px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.stat { display: grid; gap: 2px; }
.stat strong { color: var(--navy-900); font-size: 19px; font-variant-numeric: tabular-nums; }
.stat-timer { border-color: rgba(4,151,233,.35); background: #effaff; }
.stat-timer.is-urgent { border-color: rgba(239,91,103,.5); background: #fff2f3; animation: pulse 1s infinite; }
.stat-timer.is-urgent strong { color: var(--danger); }
.exit-button { min-width: 72px; padding: 0 16px; border: 0; border-radius: 14px; color: var(--navy-800); background: #e7f1f5; font-size: 13px; font-weight: 800; cursor: pointer; }
.game-message { margin: 14px auto 12px; color: var(--muted); font-size: 12px; font-weight: 650; text-align: center; }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(74px, 1fr));
  gap: clamp(8px, .7vw, 13px);
  width: min(790px, 87vw);
  margin: 0 auto;
  perspective: 1000px;
}

.tile { position: relative; aspect-ratio: 1.24; border: 0; border-radius: clamp(11px, .8vw, 16px); background: transparent; cursor: pointer; transform-style: preserve-3d; transition: transform .46s cubic-bezier(.2,.8,.2,1); }
.tile.is-flipped, .tile.is-matched { transform: rotateY(180deg); }
.tile-face { position: absolute; inset: 0; display: grid; place-items: center; border-radius: inherit; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.tile-back { color: white; border: 1px solid rgba(255,255,255,.18); background: linear-gradient(145deg, var(--navy-900), var(--blue-600)); box-shadow: 0 8px 18px rgba(0,48,76,.16); }
.tile-back::before { content: ""; position: absolute; width: 63%; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; box-shadow: 0 0 0 13px rgba(255,255,255,.035), 0 0 0 27px rgba(255,255,255,.025); }
.tile-back span { position: relative; z-index: 1; font-size: clamp(21px, 1.8vw, 33px); font-weight: 950; }
.tile-front { transform: rotateY(180deg); border: 2px solid #c8e9f8; color: var(--navy-900); background: white; box-shadow: 0 8px 22px rgba(0,58,90,.12); }
.tile-front::after { content: ""; position: absolute; inset: auto -12% -56% 22%; height: 80%; border-radius: 50%; background: var(--tile-glow, #cdf0ff); opacity: .65; }
.tile-content { position: relative; z-index: 1; display: grid; justify-items: center; gap: 3px; }
.tile-icon { display: grid; place-items: center; width: clamp(25px, 2.2vw, 39px); aspect-ratio: 1; border-radius: 11px; color: white; font-size: clamp(9px, .78vw, 13px); font-weight: 900; letter-spacing: -.02em; background: var(--tile-color, var(--blue-600)); box-shadow: 0 6px 12px color-mix(in srgb, var(--tile-color, var(--blue-600)) 28%, transparent); }
.tile-label { max-width: 95%; color: var(--navy-800); font-size: clamp(8px, .62vw, 11px); font-weight: 800; white-space: nowrap; }
.tile.is-matched .tile-front { border-color: rgba(32,183,106,.7); box-shadow: 0 0 0 3px rgba(32,183,106,.12), 0 8px 22px rgba(0,58,90,.12); }
.tile.is-matched .tile-front::before { content: "✓"; position: absolute; z-index: 3; top: 5px; right: 7px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: white; background: var(--success); font-size: 10px; font-weight: 900; }

.screen-result { place-items: center; }
.result-card { position: relative; z-index: 2; width: min(620px, 91vw); padding: clamp(34px, 3.5vw, 58px); border: 1px solid rgba(255,255,255,.7); border-radius: 34px; text-align: center; background: rgba(249,253,255,.98); box-shadow: var(--shadow); }
.result-icon { display: grid; place-items: center; width: 86px; height: 86px; margin: 0 auto 24px; border-radius: 27px; color: white; font-size: 40px; background: linear-gradient(145deg, var(--blue-300), var(--blue-600)); box-shadow: 0 16px 32px rgba(4,151,233,.25); transform: rotate(-6deg); }
.result-card.is-loss .result-icon { background: linear-gradient(145deg, #ff9d84, var(--danger)); box-shadow: 0 16px 32px rgba(239,91,103,.24); }
.result-card .eyebrow { margin-bottom: 9px; color: var(--blue-600); }
.result-card.is-loss .eyebrow { color: var(--danger); }
.result-card h2 { margin: 0; color: var(--navy-900); font-size: clamp(42px, 4vw, 68px); letter-spacing: -.055em; }
.result-message { margin: 12px 0 25px; color: var(--muted); font-size: 17px; }
.result-score-card { padding: 18px; border-radius: 20px; background: linear-gradient(135deg, var(--navy-900), var(--navy-800)); color: white; }
.result-score-card small { display: block; margin-bottom: 3px; color: var(--blue-300); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.result-score-card strong { font-size: 43px; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.result-breakdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 28px; }
.result-breakdown span { display: grid; gap: 3px; padding: 12px; border-radius: 15px; background: #edf6fa; }
.result-breakdown small { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.result-breakdown strong { color: var(--navy-900); font-size: 15px; font-variant-numeric: tabular-nums; }
.result-actions { display: flex; justify-content: center; gap: 12px; }

.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti span { position: absolute; top: -10%; width: 9px; height: 17px; border-radius: 3px; animation: confetti-fall 3.4s linear infinite; }

.confirm-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(0,19,30,.72); backdrop-filter: blur(10px); }
.confirm-modal[hidden] { display: none; }
.confirm-card { width: min(430px, 90vw); padding: 34px; border-radius: 28px; text-align: center; background: white; box-shadow: var(--shadow); }
.confirm-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 18px; border-radius: 18px; color: white; background: var(--warning); font-size: 30px; font-weight: 900; }
.confirm-card h2 { margin: 0; color: var(--navy-900); font-size: 28px; letter-spacing: -.04em; }
.confirm-card p { color: var(--muted); }
.confirm-actions { display: flex; gap: 10px; margin-top: 25px; }
.confirm-actions .btn { flex: 1; min-height: 52px; padding: 0 18px; }

@keyframes float { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-18px) rotate(1deg); } }
@keyframes drift { 0%,100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.035); } }
@keyframes confetti-fall { to { transform: translate3d(var(--drift), 120vh, 0) rotate(720deg); } }

@media (max-height: 800px) and (min-width: 900px) {
  .brand-bar { height: 68px; }
  .screen { padding-top: 70px; padding-bottom: 14px; }
  .game-panel { max-height: calc(100vh - 76px); padding: 14px 20px; }
  .game-message { margin: 7px auto; }
  .tile-grid { width: min(665px, 76vh); gap: 7px; }
  .tile { aspect-ratio: 1.35; }
  .stat { padding: 6px 11px; }
}

@media (max-width: 950px) {
  body { overflow: auto; }
  .app-shell { min-height: 100svh; overflow-y: auto; }
  .screen { position: absolute; min-height: 100svh; padding-top: 98px; overflow-y: auto; }
  .screen-welcome { grid-template-columns: 1fr; text-align: center; }
  .welcome-copy { margin: 0 auto; }
  .welcome-actions { justify-content: center; }
  .hero-visual { display: none; }
  .game-topbar { grid-template-columns: 1fr auto; }
  .game-title-block { display: none; }
  .game-stats { grid-column: 1 / -1; justify-content: center; }
  .tile-grid { width: min(720px, 88vw); }
}

@media (max-width: 600px) {
  .brand-bar { height: 74px; padding: 0 20px; }
  .private-note { font-size: 0; }
  .screen { padding: 82px 16px 24px; }
  .welcome-copy h1 { font-size: clamp(54px, 19vw, 80px); }
  .lede { margin: 24px 0; font-size: 16px; }
  .welcome-actions { gap: 18px; }
  .form-card { padding: 27px 20px; }
  .form-heading { align-items: flex-start; padding-right: 28px; }
  .mini-mark { width: 48px; height: 48px; font-size: 25px; }
  .form-grid { grid-template-columns: 1fr; gap: 10px; }
  .field-wide { grid-column: auto; }
  .field input { height: 50px; }
  .form-footer { align-items: stretch; flex-direction: column-reverse; }
  .form-footer .btn { width: 100%; }
  .game-panel { width: 100%; padding: 14px 10px; border-radius: 20px; }
  .player-chip { justify-content: center; }
  .game-stats { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .stat { min-width: 0; padding: 8px; text-align: center; }
  .exit-button { grid-column: 1 / -1; min-height: 40px; }
  .tile-grid { width: 100%; gap: 6px; }
  .tile { aspect-ratio: 1; }
  .tile-label { display: none; }
  .result-card { padding: 30px 18px; }
  .result-actions, .confirm-actions { flex-direction: column; }
}

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

/* Supplied Gallery HR UI redesign */
.app-shell {
  background: #e9f6ff;
}

.app-shell::before,
.ambient,
.brand-bar {
  display: none;
}

.screen {
  /* Keep every interactive hotspot locked to the supplied 1920×1080 artwork.
     Previously the artwork used `cover`, so it cropped on non-16:9 windows
     while the transparent buttons stayed at viewport percentages. */
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  width: min(100vw, 177.7778vh);
  height: min(100vh, 56.25vw);
  min-height: 0;
  padding: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  transform: translate(-50%, -50%);
}

.screen.is-active {
  transform: translate(-50%, -50%);
}

/* Native fragment fallback: the Start Game link still opens registration
   even if a browser extension delays or blocks the game script. */
#formScreen:target {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

body:has(#formScreen:target) #welcomeScreen {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.screen-welcome {
  display: block;
  max-width: none;
  margin: 0;
  background-image: url("assets/welcome-ui.png");
}

.screen-welcome .welcome-copy {
  position: absolute;
  inset: 0;
  display: block;
  max-width: none;
}

.screen-welcome .welcome-copy > .eyebrow,
.screen-welcome .welcome-copy > h1,
.screen-welcome .welcome-copy > .lede,
.screen-welcome .round-meta,
.screen-welcome .hero-visual {
  display: none;
}

.screen-welcome .welcome-actions {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

.screen-welcome #openFormButton {
  position: absolute;
  top: 65%;
  left: 35.2%;
  width: 29.6%;
  height: 11.5%;
  min-height: 0;
  padding: 0;
  border-radius: 3vw;
  color: transparent;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
  cursor: pointer;
  z-index: 10;
  touch-action: manipulation;
  display: block;
}

.screen-welcome #openFormButton:hover {
  transform: none;
  box-shadow: 0 0 0 .35vw rgba(255,255,255,.32), 0 0 2.2vw rgba(0,112,238,.42);
}

.screen-welcome #openFormButton:focus-visible {
  outline: .22vw solid #ffb400;
  outline-offset: .35vw;
}

.screen-form {
  display: block;
  background-image: url("assets/register-ui.png");
}

.screen-form .form-card {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.screen-form .back-button,
.screen-form .form-heading {
  display: none;
}

.screen-form #playerForm,
.screen-form .form-grid {
  position: absolute;
  inset: 0;
  display: block;
}

.screen-form .field {
  position: absolute;
  display: block;
}

.screen-form .field-name {
  top: 48.7%;
  left: 35.2%;
  width: 21.9%;
  height: 6.4%;
}

.screen-form .field-company {
  top: 48.7%;
  left: 58.9%;
  width: 21.3%;
  height: 6.4%;
}

.screen-form .field-contact {
  top: 59.8%;
  left: 35.2%;
  width: 21.9%;
  height: 6.4%;
}

.screen-form .field-designation {
  top: 59.8%;
  left: 58.9%;
  width: 21.3%;
  height: 6.4%;
}

.screen-form .field-email {
  top: 71.3%;
  left: 35.2%;
  width: 45%;
  height: 6.4%;
}

.screen-form .field > span {
  display: none;
}

.screen-form .field::before {
  content: attr(data-icon);
  position: absolute;
  top: 50%;
  left: 1.15vw;
  z-index: 2;
  color: #0d2c79;
  font-size: clamp(16px, 1.35vw, 26px);
  font-weight: 800;
  transform: translateY(-50%);
  pointer-events: none;
}

.screen-form .field input {
  width: 100%;
  height: 100%;
  padding: 0 1vw 0 3.65vw;
  border: .1vw solid #bdcbe0;
  border-radius: .75vw;
  color: #082466;
  background: rgba(255,255,255,.97);
  font-size: clamp(14px, 1.05vw, 20px);
  box-shadow: 0 .15vw .55vw rgba(15,73,129,.06);
}

.screen-form .field input:focus {
  border-color: #0878ec;
  box-shadow: 0 0 0 .24vw rgba(0,126,240,.16);
}

.screen-form .field.has-error input {
  border-color: #e74153;
  box-shadow: 0 0 0 .2vw rgba(231,65,83,.13);
}

.screen-form .error-message {
  position: absolute;
  right: .3vw;
  bottom: calc(100% + .15vw);
  z-index: 3;
  min-height: 0;
  padding: .08vw .32vw;
  border-radius: .3vw;
  color: #b51f32;
  background: rgba(255,255,255,.94);
  font-size: clamp(8px, .55vw, 11px);
}

.screen-form .form-footer {
  position: static;
  display: block;
  margin: 0;
}

.screen-form .form-footer p {
  display: none;
}

.screen-form .form-footer .btn {
  position: absolute;
  top: 81%;
  left: 45.7%;
  width: 23.9%;
  height: 7.1%;
  min-height: 0;
  padding: 0;
  border: .12vw solid rgba(255,255,255,.8);
  border-radius: 3vw;
  color: white;
  background: linear-gradient(180deg, #1594ef, #075fd3);
  box-shadow: 0 .35vw .75vw rgba(0,72,158,.28), inset 0 .08vw rgba(255,255,255,.6);
  font-size: clamp(15px, 1.25vw, 24px);
}

.screen-form .form-footer .btn:hover {
  transform: translateY(-.12vw);
  filter: brightness(1.05);
}

.screen-game {
  display: block;
  background-image: url("assets/CIPM-Game-1.jpg");
}

.screen-game .game-panel {
  position: absolute;
  inset: 0;
  width: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.screen-game .game-topbar {
  position: static;
  display: block;
}

.screen-game .player-chip,
.screen-game .game-title-block,
.screen-game .game-message {
  display: none;
}

.screen-game .game-stats {
  position: absolute;
  top: 4.8%;
  right: 4.8%;
  z-index: 8;
  display: flex;
  gap: .65vw;
}

.screen-game .stat,
.screen-game .exit-button {
  display: grid;
  place-content: center;
  min-width: 6.7vw;
  height: 5.8vw;
  padding: .55vw .8vw;
  border: 0;
  border-radius: .55vw;
  text-align: center;
  background: rgba(255,255,255,.985);
  box-shadow: 0 .3vw .55vw rgba(16,67,108,.25);
}

.screen-game .stat small {
  color: #0b3c8c;
  font-size: clamp(8px, .66vw, 13px);
  letter-spacing: .02em;
}

.screen-game .stat strong {
  color: #082d76;
  font-size: clamp(15px, 1.45vw, 28px);
}

.screen-game .stat-timer {
  border: .12vw solid rgba(0,111,237,.2);
  background: white;
}

.screen-game .stat-timer.is-urgent {
  border-color: #ef5b67;
  background: #fff3f4;
}

.screen-game .exit-button {
  min-width: 5.6vw;
  color: white;
  background: linear-gradient(180deg, #168ff0, #0761d6);
  font-size: clamp(10px, .8vw, 16px);
}

.screen-game .tile-grid {
  position: absolute;
  bottom: 2.2%;
  left: 50%;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: .55vw;
  width: 72vw;
  margin: 0;
  padding: .65vw;
  border: .12vw solid rgba(255,255,255,.82);
  border-radius: 1.05vw;
  background: rgba(238,248,255,.88);
  box-shadow: 0 .8vw 2.4vw rgba(17,80,131,.14);
  backdrop-filter: blur(.4vw);
  transform: translateX(-50%);
}

.screen-game .tile {
  aspect-ratio: .88;
  border-radius: .55vw;
}

.screen-game .tile-back {
  border: .11vw solid #258df2;
  background: linear-gradient(145deg, #168df4, #0862d6);
  box-shadow: 0 .28vw .35vw rgba(20,74,123,.22);
}

.screen-game .tile-back::before {
  display: none;
}

.screen-game .tile-back span {
  font-size: clamp(22px, 2.2vw, 42px);
}

.screen-game .tile-back img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.screen-game .tile-front {
  border: .11vw solid #268ff0;
  background: white;
  box-shadow: 0 .28vw .35vw rgba(20,74,123,.2);
}

.screen-game .tile-front::after {
  display: none;
}

.screen-game .tile-content {
  gap: .42vw;
  padding: .35vw;
}

.screen-game .tile-icon {
  width: 3.15vw;
  min-width: 34px;
  border-radius: 50%;
  font-size: clamp(9px, .72vw, 14px);
}

.screen-game .tile-label {
  max-width: 100%;
  color: #171717;
  font-size: clamp(7px, .58vw, 11px);
  line-height: 1.08;
  white-space: normal;
  text-align: center;
}

.screen-result {
  display: grid;
  place-items: center;
  background-image: linear-gradient(rgba(4,17,31,.72), rgba(4,17,31,.82)), url("assets/game-ui.png");
}

.screen-result .result-card {
  position: relative;
  width: min(46vw, 880px);
  padding: 6.5vw 4vw 2.6vw;
  border: .16vw solid rgba(255,255,255,.94);
  border-radius: 2.35vw;
  background: rgba(255,255,255,.985);
  box-shadow: 0 1.5vw 4vw rgba(0,0,0,.28);
}

.screen-result .result-icon {
  position: absolute;
  top: 0;
  left: 50%;
  width: 10vw;
  height: 10vw;
  margin: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: radial-gradient(circle, #fff1ad, #ffb400 63%, #e68100);
  box-shadow: 0 .8vw 1.6vw rgba(230,145,0,.28), 0 0 0 1.2vw rgba(255,186,0,.12);
  font-size: clamp(54px, 5.4vw, 104px);
  transform: translate(-50%, -52%);
}

.screen-result .result-card.is-loss .result-icon {
  background: radial-gradient(circle, #fff0a7, #ffc624 64%, #f59b00);
  box-shadow: 0 .8vw 1.6vw rgba(220,42,55,.2), 0 0 0 1.2vw rgba(239,91,103,.12);
}

.screen-result .result-card .eyebrow {
  display: none;
}

.screen-result .result-card h2 {
  color: #08267e;
  font-size: clamp(42px, 4.1vw, 78px);
  letter-spacing: -.045em;
}

.screen-result .result-message {
  color: #096fe2;
  font-size: clamp(15px, 1.3vw, 25px);
  font-weight: 700;
}

.screen-result .result-score-card {
  background: #e1eefc;
  color: #08267e;
}

.screen-result .result-score-card small {
  color: #0d67c9;
}

.screen-result .result-breakdown span {
  border: .08vw solid #d4e4f6;
  background: #edf5fe;
}

.screen-result .result-actions .btn {
  min-width: 10vw;
  border-radius: 2vw;
}

@media (max-aspect-ratio: 4/3) {
  .screen-welcome,
  .screen-form,
  .screen-game,
  .screen-result {
    background-size: auto 100%;
  }

  .screen-game .tile-grid {
    width: 86vw;
  }

  .screen-result .result-card {
    width: min(82vw, 760px);
  }
}
