:root {
  color-scheme: dark;
  --navy: #04283f;
  --navy-2: #073650;
  --blue: #008bd2;
  --teal: #27b5bc;
  --lime: #82c83e;
  --paper: #f7fbfd;
  --ink: #082d43;
  --danger: #ff5d57;
  --gold: #ffcf53;
  font-family: Inter, ui-rounded, "Arial Rounded MT Bold", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #031c2c; }
body { min-height: 100svh; color: white; overflow-x: hidden; }
html.game-active, html.game-active body { height: 100%; overflow: hidden; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.site-shell { min-height: 100svh; background: radial-gradient(circle at 50% -10%, #11678b 0, #052d45 34rem, #031c2c 80rem); }

.entry-screen {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 52px);
  overflow: hidden;
}

.entry-scene { position: fixed; inset: 0; overflow: hidden; opacity: .72; pointer-events: none; }
.entry-glow { position: absolute; inset: -20%; background: radial-gradient(circle at 75% 26%, rgba(130,200,62,.24), transparent 22%), radial-gradient(circle at 10% 72%, rgba(39,181,188,.28), transparent 26%); filter: blur(10px); }
.entry-rack {
  position: absolute;
  inset: 6% 5% 5%;
  border: clamp(8px, 1.3vw, 18px) solid rgba(0,139,210,.26);
  background: repeating-linear-gradient(to bottom, transparent 0 17%, rgba(0,139,210,.3) 17% 18.5%, transparent 18.5% 34%), repeating-linear-gradient(to right, transparent 0 15%, rgba(39,181,188,.2) 15% 16.5%, transparent 16.5% 31%);
  transform: perspective(900px) rotateY(-7deg) rotateX(3deg) scale(1.08);
  box-shadow: inset 0 0 80px rgba(0,0,0,.48), 0 40px 100px rgba(0,0,0,.35);
}
.entry-package { position: absolute; color: #f4ba61; font-size: clamp(54px, 8vw, 110px); filter: drop-shadow(0 16px 9px rgba(0,0,0,.35)); animation: float-package 4.6s ease-in-out infinite; }
.package-one { top: 14%; left: 10%; transform: rotate(-9deg); }
.package-two { top: 24%; right: 7%; color: #f1ddac; animation-delay: -1.7s; }
.package-three { bottom: 6%; right: 20%; color: #d5964a; animation-delay: -3.1s; }
@keyframes float-package { 0%, 100% { translate: 0 0; rotate: -3deg; } 50% { translate: 0 -22px; rotate: 5deg; } }

.entry-card {
  position: relative;
  width: min(100%, 650px);
  padding: clamp(24px, 5vw, 54px);
  border: 1px solid rgba(255,255,255,.19);
  border-radius: 36px;
  background: linear-gradient(145deg, rgba(4,40,63,.92), rgba(3,28,44,.95));
  box-shadow: 0 30px 90px rgba(0,0,0,.45), inset 0 1px rgba(255,255,255,.12);
  backdrop-filter: blur(24px);
}
.entry-card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(130deg, rgba(130,200,62,.55), transparent 25%, transparent 70%, rgba(39,181,188,.5)); mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; pointer-events: none; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand-row img { width: 152px; height: 48px; }
.brand-row span { padding-left: 16px; border-left: 1px solid rgba(255,255,255,.22); color: #b8d8e7; font-size: 12px; font-weight: 900; line-height: 1.15; letter-spacing: .13em; }
.eyebrow, .overlay-kicker { margin: 28px 0 10px; color: #9fdc56; font-size: 13px; font-weight: 950; letter-spacing: .19em; }
h1 { margin: 0; font-size: clamp(44px, 8vw, 74px); line-height: .93; letter-spacing: -.055em; }
h1 em { color: #6fe1df; font-style: normal; }
.lead { max-width: 54ch; margin: 23px 0 28px; color: #d8e9f1; font-size: 17px; line-height: 1.55; }

.registration-form { display: grid; gap: 14px; }
.registration-form label { display: grid; gap: 7px; }
.registration-form label > span { color: #cfe4ee; font-size: 14px; font-weight: 750; }
.registration-form label b { margin-left: 6px; color: #80cce7; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input:not([type="checkbox"]) { width: 100%; min-height: 51px; padding: 0 16px; border: 1px solid rgba(168,217,235,.22); border-radius: 15px; outline: none; background: rgba(255,255,255,.07); color: white; font-size: 16px; transition: border-color .18s, background .18s, box-shadow .18s; }
input::placeholder { color: #8ea9b7; }
input:focus { border-color: #5cdbd9; background: rgba(255,255,255,.1); box-shadow: 0 0 0 4px rgba(39,181,188,.15); }
.consent-row { display: grid !important; grid-template-columns: 22px 1fr; align-items: start; gap: 11px !important; margin-top: 5px; }
.consent-row input { width: 21px; height: 21px; margin: 1px 0 0; accent-color: var(--lime); }
.consent-row span { color: #bcd2dc !important; font-size: 12px !important; font-weight: 500 !important; line-height: 1.45; }
a { color: #78dfe2; }
.form-note { margin: -1px 0 0 33px; color: #8fafbd; font-size: 12px; line-height: 1.45; }
.form-error, .verification-message { margin: 0; padding: 12px 14px; border-radius: 13px; font-size: 13px; line-height: 1.4; }
.form-error { background: rgba(255,93,87,.15); color: #ffd1cf; }
.verification-message { background: rgba(130,200,62,.15); color: #dff7c4; }

.primary-button, .secondary-button {
  border: 0;
  border-radius: 17px;
  min-height: 55px;
  padding: 0 8px 0 21px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-weight: 950;
  transition: transform .14s, filter .14s;
}
.primary-button { width: 100%; margin-top: 4px; background: linear-gradient(135deg, #91d64b, #61b936); color: #062b3d; box-shadow: 0 14px 32px rgba(103,190,58,.25), inset 0 1px rgba(255,255,255,.45); }
.primary-button i { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 13px; background: #062d42; color: white; font-size: 20px; font-style: normal; }
.primary-button:hover { filter: brightness(1.08); transform: translateY(-2px); }
.primary-button:active, .secondary-button:active { transform: translateY(1px) scale(.99); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.primary-button.compact { width: auto; min-width: 220px; }
.secondary-button { justify-content: center; padding: 0 20px; color: white; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); }

.game-screen { min-height: 100svh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; padding: 10px; }
.game-header, .game-footer { width: min(100%, 590px); margin: 0 auto; display: flex; align-items: center; }
.game-header { min-height: 55px; justify-content: space-between; gap: 12px; padding: 4px 8px 10px; }
.game-logo { width: 104px; height: auto; }
.player-line { min-width: 0; display: flex; align-items: center; gap: 5px; color: #a8c0cc; font-size: 12px; }
.player-line strong { max-width: 92px; overflow: hidden; text-overflow: ellipsis; color: white; white-space: nowrap; }
.status-pill { padding: 5px 7px; border-radius: 999px; background: rgba(130,200,62,.17); color: #b8e784; font-size: 9px; font-weight: 900; letter-spacing: .05em; }
.header-actions { display: flex; gap: 7px; }
.header-actions button { width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.15); border-radius: 12px; color: white; background: rgba(255,255,255,.08); font-size: 18px; }

.game-stage {
  position: relative;
  align-self: center;
  width: min(100%, 540px, calc((100svh - 190px) * .5625));
  aspect-ratio: 9 / 16;
  margin: auto;
  overflow: hidden;
  border-radius: clamp(18px, 4vw, 32px);
  background: #0a3a4c;
  box-shadow: 0 22px 70px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.12), inset 0 1px rgba(255,255,255,.16);
  touch-action: none;
  user-select: none;
}
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.game-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), inset 0 -70px 90px rgba(1,22,33,.28); }

.hud { position: absolute; z-index: 4; top: 13px; left: 13px; right: 13px; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 7px; pointer-events: none; }
.hud > div { min-height: 50px; padding: 8px 11px; border: 1px solid rgba(255,255,255,.18); border-radius: 15px; background: rgba(3,30,43,.73); box-shadow: inset 0 1px rgba(255,255,255,.1); backdrop-filter: blur(11px); }
.hud small { display: block; color: #90b3c2; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.hud strong { display: block; margin-top: 2px; font-size: clamp(18px, 4.7vw, 24px); line-height: 1; }
.hud-score strong { color: #baf274; }
.lives { position: absolute; z-index: 4; top: 74px; left: 50%; translate: -50% 0; display: flex; gap: 5px; padding: 6px 10px; border-radius: 999px; background: rgba(3,30,43,.72); backdrop-filter: blur(9px); pointer-events: none; }
.lives span { color: #ff6560; font-size: 18px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); transition: opacity .2s, scale .2s, filter .2s; }
.lives span.lost { opacity: .2; scale: .72; filter: grayscale(1); }
.catch-callout { position: absolute; z-index: 5; top: 28%; left: 50%; translate: -50% -50%; padding: 11px 18px; border: 2px solid rgba(255,255,255,.55); border-radius: 999px; background: #8fd64a; color: #062f43; box-shadow: 0 9px 25px rgba(0,0,0,.25); font-size: 14px; font-weight: 1000; letter-spacing: .08em; white-space: nowrap; animation: callout .8s ease both; pointer-events: none; }
@keyframes callout { 0% { opacity: 0; scale: .5; translate: -50% -30%; } 25% { opacity: 1; scale: 1.12; } 100% { opacity: 0; scale: .94; translate: -50% -85%; } }

.stage-overlay { position: absolute; z-index: 8; inset: 0; display: grid; place-items: end center; padding: 18px; background: linear-gradient(to bottom, rgba(0,24,34,.07), rgba(0,25,38,.3) 34%, rgba(1,18,29,.87) 69%, rgba(1,18,29,.96)); }
.overlay-card { width: 100%; padding: clamp(20px, 5vw, 30px); border: 1px solid rgba(255,255,255,.16); border-radius: 27px; background: linear-gradient(145deg, rgba(5,48,68,.93), rgba(3,30,45,.96)); box-shadow: 0 18px 52px rgba(0,0,0,.42), inset 0 1px rgba(255,255,255,.1); backdrop-filter: blur(15px); }
.overlay-kicker { display: block; margin: 0 0 8px; font-size: 10px; }
.overlay-card h2 { margin: 0; font-size: clamp(31px, 8vw, 43px); line-height: 1; letter-spacing: -.04em; }
.overlay-card > p { margin: 13px 0; color: #c5dae3; font-size: 14px; line-height: 1.46; }
.rule-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 15px 0 9px; }
.rule-strip span { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; align-items: center; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.07); color: #bad0d9; font-size: 10px; }
.rule-strip i { grid-row: 1 / 3; display: grid; place-items: center; width: 25px; height: 25px; margin-right: 6px; border-radius: 9px; color: #052c3f; font-style: normal; font-weight: 1000; }
.rule-strip b { color: white; font-size: 12px; }
.good-swatch { background: #8bd34a; }
.bad-swatch { background: #ff6861; }
.five-lives { padding: 10px 12px; border-radius: 13px; background: rgba(255,207,83,.09); color: #d9e7ed !important; font-size: 11px !important; }
.five-lives strong { color: #ffd96f; }
.result-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 15px 0; }
.result-stats span { padding: 12px; border-radius: 14px; background: rgba(255,255,255,.07); color: #a9c1cb; font-size: 11px; }
.result-stats b { display: block; color: white; font-size: 22px; }
.result-actions { display: grid; gap: 8px; }
.result-actions .primary-button { width: 100%; }

.touch-controls { position: relative; z-index: 5; width: min(100%, 540px, calc((100svh - 190px) * .5625)); margin: 8px auto 2px; display: grid; gap: 3px; padding: 7px 13px 10px; border: 1px solid rgba(255,255,255,.24); border-radius: 18px; background: rgba(4,40,63,.92); box-shadow: inset 0 1px rgba(255,255,255,.15), 0 8px 24px rgba(0,0,0,.22); backdrop-filter: blur(9px); }
.touch-controls span { color: rgba(255,255,255,.72); font-size: 8px; font-weight: 900; letter-spacing: .15em; text-align: center; pointer-events: none; }
.touch-controls .worker-slider { width: 100%; height: 40px; min-height: 40px; margin: 0; padding: 0; border: 0; border-radius: 0; appearance: none; -webkit-appearance: none; background: transparent; box-shadow: none; cursor: grab; touch-action: none; }
.worker-slider:active { cursor: grabbing; }
.worker-slider::-webkit-slider-runnable-track { height: 9px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: linear-gradient(90deg, #27b5bc, #82c83e); box-shadow: inset 0 2px 4px rgba(0,25,38,.38); }
.worker-slider::-webkit-slider-thumb { width: 44px; height: 44px; margin-top: -18px; -webkit-appearance: none; border: 4px solid #fff; border-radius: 50%; background: #008bd2; box-shadow: 0 5px 16px rgba(0,0,0,.48), inset 0 0 0 6px rgba(255,255,255,.13); }
.worker-slider::-moz-range-track { height: 9px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: linear-gradient(90deg, #27b5bc, #82c83e); box-shadow: inset 0 2px 4px rgba(0,25,38,.38); }
.worker-slider::-moz-range-thumb { width: 36px; height: 36px; border: 4px solid #fff; border-radius: 50%; background: #008bd2; box-shadow: 0 5px 16px rgba(0,0,0,.48); }
.touch-controls .worker-slider:focus { background: transparent; box-shadow: none; }
.worker-slider:focus-visible { outline: 3px solid rgba(130,200,62,.65); outline-offset: 4px; border-radius: 999px; }
.game-footer { min-height: 44px; justify-content: center; gap: 18px; color: #7fa3b3; font-size: 11px; }
.game-footer button, .game-footer a { border: 0; padding: 0; background: none; color: #a8d8e5; font-size: 11px; text-decoration: underline; }

.leaderboard-dialog { width: min(calc(100% - 24px), 500px); max-height: min(720px, calc(100svh - 30px)); padding: 0; border: 1px solid rgba(255,255,255,.17); border-radius: 27px; color: white; background: linear-gradient(145deg, #073a52, #032638); box-shadow: 0 25px 100px rgba(0,0,0,.62); overflow: hidden; }
.leaderboard-dialog::backdrop { background: rgba(0,17,28,.75); backdrop-filter: blur(7px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 23px 23px 15px; }
.dialog-head h2 { margin: 0; font-size: 34px; }
.dialog-head button { width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.15); border-radius: 13px; color: white; background: rgba(255,255,255,.08); font-size: 27px; }
#leaderboard-list { display: grid; gap: 7px; margin: 0; padding: 0 16px 20px; list-style: none; counter-reset: rank; overflow: auto; }
#leaderboard-list li { counter-increment: rank; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 8px; min-height: 54px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 15px; background: rgba(255,255,255,.055); }
#leaderboard-list li::before { content: counter(rank); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(0,139,210,.18); color: #77d8ed; font-weight: 900; }
#leaderboard-list li:nth-child(1)::before { background: #ffd35f; color: #523400; }
#leaderboard-list li:nth-child(2)::before { background: #d6e4e8; color: #213943; }
#leaderboard-list li:nth-child(3)::before { background: #d79b64; color: #4a230a; }
#leaderboard-list li.current { border-color: rgba(130,200,62,.7); background: rgba(130,200,62,.11); }
#leaderboard-list small { display: block; color: #769aab; font-size: 10px; }
#leaderboard-list strong { color: #c7f58f; font-size: 18px; }
#leaderboard-empty { margin: 0; padding: 0 23px 26px; color: #9bb5c0; }

@media (max-width: 620px) {
  .entry-screen { align-items: start; padding: 12px; overflow: visible; }
  .entry-card { padding: 23px 18px; border-radius: 26px; }
  .brand-row img { width: 126px; }
  .brand-row span { font-size: 10px; }
  .eyebrow { margin-top: 20px; }
  h1 { font-size: clamp(43px, 13vw, 61px); }
  .lead { margin: 16px 0 22px; font-size: 15px; }
  .contact-grid { grid-template-columns: 1fr; }
  .game-screen { padding: 4px; }
  .game-header { min-height: 49px; padding: 3px 5px 6px; }
  .game-logo { width: 88px; }
  .status-pill { display: none; }
  .game-stage { width: min(100%, calc((100svh - 190px) * .5625)); border-radius: 20px; }
  .touch-controls { width: min(100%, calc((100svh - 190px) * .5625)); margin-top: 6px; }
  .game-footer { min-height: 36px; gap: 14px; }
  .game-footer span { display: none; }
}

@media (max-height: 700px) and (orientation: landscape) {
  .game-stage { width: min(310px, calc((100svh - 88px) * .5625)); }
  .game-screen { grid-template-rows: minmax(0, 1fr) auto; }
  .touch-controls { grid-row: 2; width: min(310px, calc(100% - 24px)); margin-top: 5px; }
  .game-header, .game-footer { position: fixed; left: 10px; width: calc(50vw - 185px); min-width: 180px; flex-wrap: wrap; }
  .game-header { top: 18px; justify-content: flex-start; }
  .game-footer { bottom: 18px; justify-content: flex-start; }
}

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