:root {
  --bg1: #0b1d39;
  --bg2: #0f4b73;
  --bg3: #f7a656;
  --cream: #fff4dd;
  --gold: #f2c66d;
  --gold-2: #ff9d70;
  --teal-1: #4be7d2;
  --teal-2: #1293ab;
  --red-1: #ec5a4e;
  --red-2: #af2826;
  --ink: #0c1630;
  --line: rgba(255, 225, 157, 0.26);
  --glass: rgba(6, 17, 36, 0.58);
  --glass-2: rgba(7, 21, 43, 0.8);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: Inter, Arial, sans-serif;
  color: var(--cream);
  background: linear-gradient(180deg, var(--bg1), var(--bg2) 55%, var(--bg3));
}
.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 15%, rgba(255, 234, 136, 0.16), transparent 18%),
    radial-gradient(circle at 80% 20%, rgba(73, 255, 230, 0.13), transparent 16%),
    radial-gradient(circle at 55% 85%, rgba(255, 190, 111, 0.18), transparent 18%);
}
.app-shell, .admin-shell {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 16px 32px;
}
body.public-game-view .app-shell {
  max-width: 460px;
  min-height: 100vh;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.glass-panel {
  background: var(--glass);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.hero-block {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 22px;
}
.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 800;
  color: #dcfff8;
}
h1, h2 { margin: 0; }
h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.02; }
h2 { font-size: 20px; }
.subtitle { margin-top: 10px; line-height: 1.45; opacity: 0.93; }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-badge {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}
.hero-badge.gold { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #5d2e00; }
.hero-badge.teal { background: linear-gradient(180deg, var(--teal-1), var(--teal-2)); color: #ecfffd; }
.hero-badge.motion {
  background: linear-gradient(180deg, #f8b4ff, #8757ff);
  color: #fff5ff;
  box-shadow: 0 0 18px rgba(206, 116, 255, 0.35);
}
.layout-grid {
  display: grid;
  grid-template-columns: minmax(300px, 430px) 1fr;
  gap: 18px;
  margin-top: 18px;
}
.phone-panel, .control-panel, .admin-panel { padding: 18px; }
body.public-game-view .hero-block,
body.public-game-view .control-panel,
body.public-game-view .footer-note {
  display: none !important;
}
body.public-game-view .layout-grid {
  grid-template-columns: 1fr;
  margin-top: 0;
}
body.public-game-view .phone-panel {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.phone-shell {
  border-radius: 34px;
  padding: 10px;
  background: linear-gradient(180deg, #14284b, #08111e);
  border: 2px solid rgba(255, 225, 157, 0.18);
}
.screen-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 6px 10px;
  font-size: 12px;
  font-weight: 800;
}
.screen-frame {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  aspect-ratio: 9/16;
  background: #000;
}
.screen-frame img,
.screen-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#screenImage { position: relative; z-index: 1; }
.screen-video {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  background: transparent;
}
.screen-video.active { opacity: 1; }
.screen-frame.has-live-video { box-shadow: inset 0 0 0 2px rgba(95, 248, 234, 0.18); }
.screen-frame.is-motion::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), transparent 24%, transparent 76%, rgba(255,255,255,0.04));
  z-index: 3;
  pointer-events: none;
}
.screen-frame.is-spinning {
  box-shadow: inset 0 0 0 2px rgba(255, 220, 132, 0.35), 0 0 30px rgba(246, 180, 96, 0.35);
  animation: slotShake 0.4s ease-in-out 0s 10;
}
.screen-frame.is-reveal { box-shadow: inset 0 0 0 2px rgba(95, 248, 234, 0.32), 0 0 36px rgba(95, 248, 234, 0.26); }
.screen-tap {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 7;
  border: 0;
  cursor: pointer;
}
.screen-overlay-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 10px 12px;
  border-radius: 999px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  background: rgba(4, 12, 24, 0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  z-index: 8;
}
.spin-flash {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,236,160,0.45), transparent 26%),
    radial-gradient(circle at 50% 50%, rgba(255,104,104,0.3), transparent 45%),
    linear-gradient(115deg, transparent 0%, rgba(255,255,255,0.34) 45%, transparent 60%);
  opacity: 0;
}
.spin-flash.play { animation: flashSweep 1.1s ease-in-out 0s 3; }
.combo-badge {
  position: absolute;
  top: 56px;
  left: 16px;
  right: 16px;
  z-index: 6;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(6, 20, 42, 0.82);
  border: 1px solid rgba(255, 222, 140, 0.28);
  text-align: center;
  box-shadow: 0 14px 32px rgba(0,0,0,0.28);
  backdrop-filter: blur(8px);
}
.combo-title { font-size: 12px; font-weight: 900; letter-spacing: 0.05em; color: #ffe7a6; }
.combo-symbols { margin-top: 4px; font-size: 20px; }
.combo-reward { margin-top: 4px; font-size: 12px; font-weight: 800; color: #9ffdf2; }
.screen-form-overlay {
  position: absolute;
  inset: 0;
  z-index: 9;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(4, 17, 36, 0.16), rgba(6, 14, 28, 0.72)),
    url('/static/assets/form_v2.png') center/cover no-repeat;
}
.form-screen-shell {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 16px 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(6, 26, 54, 0.18), rgba(4, 15, 30, 0.78) 52%, rgba(3, 10, 22, 0.9));
  border: 1px solid rgba(255, 214, 123, 0.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.form-screen-top {
  color: #fff3d7;
  text-align: center;
  margin-bottom: 4px;
}
.form-brand {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #ffd989;
  text-transform: uppercase;
}
.form-screen-top h3 {
  margin: 6px 0 6px;
  font-size: 26px;
  line-height: 1.06;
  color: #fff5df;
  text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.form-screen-top p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255, 244, 221, 0.88);
}
.form-trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.trust-card {
  padding: 10px 8px;
  border-radius: 16px;
  text-align: center;
  background: rgba(9, 28, 55, 0.72);
  border: 1px solid rgba(255, 216, 127, 0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.trust-card strong {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  color: #ffd989;
  letter-spacing: 0.05em;
}
.trust-card span {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.25;
  color: rgba(255,244,221,0.86);
}
.form-fields-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 2px;
}
.field-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 14px;
  border-radius: 20px;
  background: rgba(255, 247, 234, 0.98);
  border: 2px solid rgba(170, 120, 40, 0.44);
  box-shadow: 0 8px 18px rgba(0,0,0,0.16), inset 0 1px 0 rgba(255,255,255,0.95);
}
.field-text-label {
  font-size: 12px;
  font-weight: 900;
  color: #846a49;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.real-input {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 0;
  outline: none;
  background: transparent;
  color: #6d4b1b;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  appearance: none;
  -webkit-appearance: none;
  padding: 0 8px 0 0;
}
.real-input::placeholder {
  color: #b69d7e;
  font-weight: 500;
}
.field-row:focus-within {
  border-color: rgba(95, 248, 234, 0.58);
  box-shadow: 0 0 0 3px rgba(95, 248, 234, 0.18), 0 8px 18px rgba(0,0,0,0.16);
}
.terms-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: start;
  gap: 10px;
  padding: 4px 2px 0;
  color: #fff2d8;
  cursor: pointer;
}
.terms-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.terms-check-visual {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid rgba(240, 197, 108, 0.95);
  background: rgba(8, 18, 34, 0.82);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35);
  position: relative;
  margin-top: 2px;
}
.terms-row input:checked + .terms-check-visual::after {
  content: '✓';
  position: absolute;
  inset: -1px 0 0;
  text-align: center;
  color: #fff1b8;
  font-size: 18px;
  font-weight: 900;
}
.terms-copy {
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 244, 221, 0.94);
}
.terms-copy b {
  color: #7edcff;
}
.screen-marketing-check {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.screen-submit-btn {
  margin-top: 2px;
  height: 62px;
  border: 0;
  border-radius: 24px;
  background: linear-gradient(180deg, #0e5f89, #083f64);
  color: #ffe8a0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 22px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.25);
  border: 2px solid rgba(246, 196, 97, 0.6);
  cursor: pointer;
}
.screen-submit-btn span {
  display: inline-block;
  transform: translateY(1px);
}
.form-foot-note {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 233, 178, 0.92);
}
.screen-form-status {
  min-height: 34px;
  padding: 9px 12px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.54);
  color: #fff3d7;
  font-size: 11px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.stat-card { padding: 12px; border-radius: 18px; background: rgba(255, 255, 255, 0.07); text-align: center; }
.stat-card.stat-wide { grid-column: span 4; }
.stat-card span { display: block; font-size: 12px; opacity: 0.85; }
.stat-card strong { display: block; font-size: 24px; margin-top: 6px; }
.progress-block {
  margin-top: 14px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
}
.progress-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.progress-track { height: 14px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, 0.12); }
.progress-fill { width: 0; height: 100%; background: linear-gradient(90deg, #ffe88f, #ff9fb8, #5af8ea); transition: width 0.35s ease; }
.actions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.btn {
  padding: 14px 16px;
  border: 0;
  border-radius: 18px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-gold { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #602f00; }
.btn-teal { background: linear-gradient(180deg, var(--teal-1), var(--teal-2)); color: #effffb; }
.btn-red { background: radial-gradient(circle at 50% 35%, var(--red-1), var(--red-2)); color: #fff5df; }
.btn-ghost { background: rgba(255, 255, 255, 0.08); color: var(--cream); border: 1px solid var(--line); }
.btn-spin.pulse { animation: pulseSpin 1.2s ease-in-out infinite; box-shadow: 0 0 0 rgba(255, 95, 95, 0.2); }
.journal-block { margin-top: 16px; }
.log-box {
  margin-top: 10px;
  min-height: 60px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  line-height: 1.45;
}
.hidden { display: none !important; }
.footer-note { text-align: center; font-size: 12px; opacity: 0.82; padding-top: 16px; }
.admin-actions { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; margin-top: 14px; }
.admin-actions input {
  width: 100%;
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid rgba(255, 225, 157, 0.25);
  background: #fff5e5;
  color: #4b2810;
  font-size: 15px;
}
.admin-table-wrap { margin-top: 16px; overflow: auto; border-radius: 18px; background: var(--glass-2); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 860px; }
.admin-table th, .admin-table td { padding: 12px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); font-size: 13px; text-align: left; }
.admin-table thead th { position: sticky; top: 0; background: rgba(10, 24, 46, 0.95); }
@keyframes pulseSpin {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 95, 95, 0.15); }
  50% { transform: scale(1.04); box-shadow: 0 0 28px rgba(255, 95, 95, 0.4); }
}
@keyframes slotShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-2px, 0, 0); }
  50% { transform: translate3d(2px, 0, 0); }
  75% { transform: translate3d(-1px, 0, 0); }
}
@keyframes flashSweep {
  0% { opacity: 0; transform: translateX(-24%) scale(1); }
  20% { opacity: 0.9; }
  55% { opacity: 0.5; }
  100% { opacity: 0; transform: translateX(24%) scale(1.04); }
}
@media (max-width: 1020px) {
  .layout-grid { grid-template-columns: 1fr; }
  .phone-panel { max-width: 430px; margin: 0 auto; }
}
@media (max-width: 760px) {
  .hero-block { flex-direction: column; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card.stat-wide { grid-column: span 2; }
  .actions-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-actions { grid-template-columns: 1fr; }
  .form-screen-shell { padding: 16px 12px 12px; }
  .form-screen-top h3 { font-size: 22px; }
  .field-row { grid-template-columns: 72px 1fr; padding-left: 12px; }
  .field-text-label { font-size: 11px; }
  .real-input { font-size: 14px; height: 40px; }
  .screen-submit-btn { height: 58px; font-size: 16px; }
}
