/* ============ TOKENS ============ */
:root{
  --bg:#0a0c14;
  --bg2:#0f1220;
  --surface:#12162a;
  --surface2:#171c34;
  --line:#262c4a;
  --text:#e9edf7;
  --muted:#8891ac;
  --cyan:#00e6d0;
  --magenta:#ff2f9e;
  --amber:#ffb020;
  --danger:#ff4d5e;
  --font-display:'Orbitron',sans-serif;
  --font-head:'Rajdhani',sans-serif;
  --font-body:'Sora',sans-serif;
  --radius:16px;
}
[data-theme="light"]{
  --bg:#ffffff;
  --bg2:#f8fafc;
  --surface:rgba(255, 255, 255, 0.82);
  --surface2:rgba(248, 250, 252, 0.9);
  --line:rgba(15, 23, 42, 0.08);
  --text:#0f172a;
  --muted:#64748b;
  --cyan:#2563eb;
  --magenta:#4f46e5;
  --amber:#d97706;
  --danger:#ef4444;
  --radius:18px;
}
*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  background:radial-gradient(1200px 800px at 20% -10%,#151a33 0%,var(--bg) 55%),var(--bg);
  color:var(--text);
  font-family:var(--font-body);
  overflow-x:hidden;
  -webkit-tap-highlight-color:transparent;
}
h1,h2{font-family:var(--font-display);letter-spacing:.02em;margin:0;}
b,strong{font-family:var(--font-head);}
button{font-family:var(--font-head);cursor:pointer;}
.hidden{display:none !important;}

.grain{position:fixed;inset:0;pointer-events:none;z-index:1;opacity:.035;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");}
.scanlines{position:fixed;inset:0;pointer-events:none;z-index:1;opacity:.05;
  background:repeating-linear-gradient(to bottom,#fff 0px,#fff 1px,transparent 1px,transparent 3px);}

.eyebrow{display:inline-block;font-family:var(--font-head);font-weight:600;letter-spacing:.18em;
  font-size:12px;color:var(--cyan);margin-bottom:10px;}

/* ============ SCREENS & TRANSITIONS ============ */
.screen{
  position:fixed;inset:0;display:flex;flex-direction:column;z-index:2;
  opacity:0;pointer-events:none;transform:scale(0.98) translateY(10px);
  transition:opacity .35s ease, transform .35s ease;
}
.screen.active{
  opacity:1;pointer-events:auto;transform:scale(1) translateY(0);
}

.gate, .hub {
  transition: opacity .3s ease, transform .3s ease;
}
.gate.hidden, .hub.hidden {
  display: none !important;
  opacity: 0;
  transform: translateY(14px);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.danger-icon:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* ============ LEADERBOARD CARD (MENU GATE) ============ */
.leaderboard-card {
  width: min(480px, 92vw);
  margin: 20px auto 12px;
  background: linear-gradient(160deg, var(--surface), var(--surface2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-align: left;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.lb-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.lb-badge {
  font-size: 22px;
  background: rgba(255,176,32,0.15);
  padding: 8px;
  border-radius: 10px;
  line-height: 1;
}
.lb-header h3 {
  font-size: 14px;
  margin: 0;
  color: var(--text);
  letter-spacing: .05em;
}
.lb-sub {
  display: block;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 2px;
}
.lb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg2);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.03);
  font-size: 13px;
}
.lb-rank {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  width: 28px;
  color: var(--cyan);
}
.lb-rank.gold { color: #ffb020; }
.lb-rank.silver { color: #e0e0e0; }
.lb-rank.bronze { color: #cd7f32; }
.lb-game {
  flex: 1;
  font-weight: 600;
  margin-left: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-score {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  color: var(--amber);
}
.lb-empty {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 12px 0;
}
.danger-btn {
  margin-top: 8px;
  color: var(--danger);
}
.danger-btn:hover {
  border-color: var(--danger) !important;
  background: rgba(255,77,94,0.1) !important;
}

/* ============ HUB TABS & ACHIEVEMENTS ============ */
.hub-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.hub-tab {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 9px 18px;
  border-radius: 10px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  cursor: pointer;
}
.hub-tab:hover {
  color: var(--text);
  border-color: var(--cyan);
}
.hub-tab.active {
  background: var(--surface2);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 4px 14px rgba(0,230,208,0.15);
}
.badge-count {
  background: var(--line);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
  margin-left: 4px;
  color: var(--text);
}
.hub-tab.active .badge-count {
  background: rgba(0,230,208,0.2);
  color: var(--cyan);
}

.achievements-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: left;
}
.achievements-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.achievements-header h3 {
  font-size: 18px;
  margin: 0 0 4px;
}
.achievements-header p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.achieve-pct {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  color: var(--cyan);
  background: rgba(0,230,208,0.1);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0,230,208,0.2);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.achievement-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  transition: transform 0.15s ease, border-color 0.15s ease, opacity 0.2s ease;
  opacity: 0.5;
  filter: grayscale(0.8);
}
.achievement-badge.unlocked {
  opacity: 1;
  filter: none;
  border-color: rgba(0,230,208,0.4);
  background: linear-gradient(135deg, var(--surface), var(--surface2));
  box-shadow: 0 4px 16px rgba(0,230,208,0.08);
}
.badge-icon {
  font-size: 24px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.achievement-badge.unlocked .badge-icon {
  background: rgba(0,230,208,0.15);
}
.badge-info h4 {
  margin: 0 0 2px;
  font-family: var(--font-head);
  font-size: 15px;
  color: var(--text);
}
.badge-info p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}
.badge-status {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.05em;
  font-weight: 700;
}
.achievement-badge.unlocked .badge-status {
  color: var(--cyan);
}

/* ============ TOAST NOTIFICATIONS ============ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(18, 22, 42, 0.95);
  border: 1px solid var(--cyan);
  box-shadow: 0 10px 30px rgba(0, 230, 208, 0.3);
  backdrop-filter: blur(8px);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 12px;
  animation: toastIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(50px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
.toast-icon { font-size: 24px; }
.toast-title { font-family: var(--font-head); font-weight: 700; font-size: 14px; color: var(--cyan); margin: 0; }
.toast-desc { font-size: 12px; color: var(--text); margin: 2px 0 0; }

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,6,12,0.85);
  backdrop-filter: blur(8px);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.25s ease;
}
.modal-overlay.hidden {
  display: none !important;
  opacity: 0;
}
.modal-card {
  width: min(400px, 92vw);
  background: var(--surface);
  border: 1px solid var(--danger);
  box-shadow: 0 16px 40px rgba(255, 77, 94, 0.25);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
}
.modal-icon { font-size: 40px; margin-bottom: 12px; }
.modal-card h2 { font-size: 20px; margin-bottom: 10px; color: var(--danger); }
.modal-card p { font-size: 13px; color: var(--muted); margin: 0 0 22px; line-height: 1.5; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }
.btn-danger {
  background: var(--danger);
  border: none;
  color: #fff;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: 0 6px 20px rgba(255, 77, 94, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn-danger:hover {
  transform: translateY(-2px);
  background: #ff2d42;
}

/* ---- Loading ---- */
#screen-loading{align-items:center;justify-content:center;}
.load-wrap{width:min(420px,86vw);text-align:center;}
.load-mark{position:relative;width:110px;height:110px;margin:0 auto 22px;display:flex;align-items:center;justify-content:center;}
.hex-spin{position:absolute;inset:0;width:100%;height:100%;fill:none;stroke:var(--cyan);stroke-width:2;
  filter:drop-shadow(0 0 10px rgba(0,230,208,.55));animation:spin 3.2s linear infinite;}
.load-mark span{font-family:var(--font-display);font-weight:800;font-size:20px;color:var(--text);}
@keyframes spin{to{transform:rotate(360deg);}}
.load-title{font-size:32px;margin-bottom:26px;}
.load-title em{font-style:normal;color:var(--cyan);}
.load-bar{height:6px;border-radius:99px;background:var(--surface2);overflow:hidden;border:1px solid var(--line);}
.load-fill{height:100%;width:0%;background:linear-gradient(90deg,var(--cyan),var(--magenta));
  box-shadow:0 0 12px rgba(0,230,208,.6);transition:width .18s linear;}
.load-row{display:flex;justify-content:space-between;margin-top:10px;font-size:12px;color:var(--muted);letter-spacing:.05em;}

/* ---- Ready ---- */
#screen-ready{align-items:center;justify-content:center;text-align:center;}
.ready-wrap{width:min(460px,86vw);}
.ready-title{font-size:56px;background:linear-gradient(90deg,var(--cyan),var(--magenta));
  -webkit-background-clip:text;background-clip:text;color:transparent;margin-bottom:12px;
  animation:pulseGlow 2s ease-in-out infinite;}
@keyframes pulseGlow{0%,100%{filter:drop-shadow(0 0 6px rgba(0,230,208,.35))}50%{filter:drop-shadow(0 0 18px rgba(255,47,158,.45))}}
.ready-wrap p{color:var(--muted);margin-bottom:28px;}

/* ---- buttons ---- */
.btn-primary{background:linear-gradient(90deg,var(--cyan),#00b7ff);border:none;color:#04121a;
  font-weight:700;letter-spacing:.06em;padding:14px 26px;border-radius:12px;font-size:14px;
  box-shadow:0 8px 24px rgba(0,230,208,.25);transition:transform .15s ease,box-shadow .15s ease;}
.btn-primary:hover{transform:translateY(-2px);box-shadow:0 12px 28px rgba(0,230,208,.35);}
.btn-primary:active{transform:translateY(0);}
.btn-ghost{background:transparent;border:1px solid var(--line);color:var(--text);
  padding:13px 24px;border-radius:12px;font-size:14px;letter-spacing:.05em;font-weight:600;
  transition:border-color .15s ease,background .15s ease;}
.btn-ghost:hover{border-color:var(--cyan);background:rgba(0,230,208,.06);}
.btn-ghost.small{padding:9px 16px;font-size:12px;}
.btn-ghost:disabled,.btn-primary:disabled{opacity:.4;cursor:not-allowed;transform:none;}

/* ---- Menu Gate ---- */
#screen-menu{align-items:stretch;}
.topbar{display:flex;align-items:center;justify-content:space-between;padding:18px 26px;}
.brand{display:flex;align-items:center;gap:8px;font-family:var(--font-display);font-size:16px;}
.brandmark{color:var(--cyan);}
.brand em{font-style:normal;color:var(--magenta);}
.icon-btn{width:38px;height:38px;border-radius:10px;border:1px solid var(--line);background:var(--surface);
  color:var(--text);display:flex;align-items:center;justify-content:center;font-size:15px;}
.icon-btn:hover{border-color:var(--cyan);}

.gate{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:20px;}
.gate h1{font-size:40px;margin-bottom:26px;}
.gate-actions{display:flex;gap:14px;flex-wrap:wrap;justify-content:center;}
.gate-hint{margin-top:16px;color:var(--muted);font-size:13px;}

/* ---- Hub ---- */
.hub{flex:1;padding:6px 26px 30px;overflow-y:auto;}
.hub-head{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:22px;}
.hub-head h2{font-size:26px;}
.game-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:16px;}
.game-card{background:linear-gradient(160deg,var(--surface),var(--surface2));border:1px solid var(--line);
  border-radius:var(--radius);padding:18px;position:relative;overflow:hidden;transition:transform .18s ease,border-color .18s ease;text-align:left;}
.game-card:hover{transform:translateY(-4px);border-color:var(--cyan);}
.game-card .g-icon{width:44px;height:44px;border-radius:12px;display:flex;align-items:center;justify-content:center;
  font-size:20px;margin-bottom:14px;background:rgba(0,230,208,.12);color:var(--cyan);}
.game-card h3{font-family:var(--font-head);font-size:18px;margin:0 0 6px;}
.game-card p{color:var(--muted);font-size:13px;margin:0 0 14px;line-height:1.5;min-height:38px;}
.game-card .g-meta{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:var(--muted);letter-spacing:.04em;}
.game-card .g-meta b{color:var(--amber);}
.game-card button{width:100%;margin-top:12px;background:var(--surface2);border:1px solid var(--line);
  color:var(--text);padding:10px;border-radius:9px;font-size:13px;font-weight:600;letter-spacing:.04em;}
.game-card button:hover{border-color:var(--cyan);color:var(--cyan);}
.footer{text-align:center;color:var(--muted);font-size:12px;padding:14px;}

/* ============ PLAY SCREEN ============ */
#screen-play{position:fixed;inset:0;}
.playbar{display:flex;align-items:center;gap:14px;padding:12px 16px;border-bottom:1px solid var(--line);
  background:var(--bg2);}
.play-id{flex:1;min-width:0;}
.play-id .kicker{display:block;font-size:10px;letter-spacing:.15em;color:var(--cyan);}
.play-id b{font-family:var(--font-head);font-size:16px;}
.play-stats{display:flex;gap:16px;}
.play-stats div{text-align:center;}
.play-stats small{display:block;font-size:9px;color:var(--muted);letter-spacing:.08em;}
.play-stats b{font-family:var(--font-head);font-size:16px;}

.stage{position:relative;flex:1;display:flex;align-items:center;justify-content:center;overflow:hidden;
  background:#05060c;}
.game-area{width:100%;height:100%;position:relative;display:flex;align-items:center;justify-content:center;}
.game-area canvas{max-width:100%;max-height:100%;touch-action:none;background:#070a14;border-radius:10px;}
.game-area .dom-game{width:min(94%,520px);height:100%;max-height:640px;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:14px;}

.overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;
  background:rgba(5,6,12,.86);backdrop-filter:blur(6px);z-index:5;padding:20px;}
.overlay > div{width:min(420px,92vw);}
.overlay .kicker{display:block;font-size:11px;letter-spacing:.18em;color:var(--cyan);margin-bottom:10px;}
.overlay h2{font-size:28px;margin-bottom:10px;}
.overlay p{color:var(--muted);margin:0 0 22px;font-size:14px;line-height:1.6;}
.overlay button{display:block;width:100%;margin-bottom:10px;}

.pause-strip{display:none;}

/* touch controls */
.touch-controls {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px 12px;
  background: #070914;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
  flex-shrink: 0;
  z-index: 10;
  box-sizing: border-box;
}

.touch-controls.hidden {
  display: none !important;
}

.touch-controls button,
.touch-btn {
  pointer-events: auto !important;
  min-width: 60px;
  height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #182038 0%, #0e1424 100%) !important;
  border: 1.5px solid rgba(0, 230, 208, 0.5) !important;
  color: #00e6d0 !important;
  font-family: var(--font-head), system-ui, -apple-system, sans-serif !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.08s ease, border-color 0.08s ease;
}

.touch-btn-wide {
  min-width: 110px !important;
  flex: 1 1 auto;
  max-width: 170px;
  font-size: 15px !important;
  letter-spacing: 0.04em;
}

.touch-controls button:active,
.touch-btn:active {
  background: linear-gradient(180deg, #00e6d0 0%, #00bfa5 100%) !important;
  color: #031018 !important;
  border-color: #00e6d0 !important;
  transform: scale(0.94);
  box-shadow: 0 0 16px rgba(0, 230, 208, 0.6) !important;
}

.tc-spacer{flex:1;max-width:120px;}

@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .touch-controls {
    display: none !important;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .touch-controls {
    padding: 6px 12px 8px;
    gap: 8px;
  }
  .touch-controls button,
  .touch-btn {
    height: 40px !important;
    min-width: 50px;
    font-size: 18px !important;
    border-radius: 10px;
  }
  .touch-btn-wide {
    min-width: 85px !important;
    font-size: 13px !important;
  }
}

/* Screen shake / feedback */
.shake{animation:shakeAnim .3s ease;}
@keyframes shakeAnim{0%,100%{transform:translate(0,0)}20%{transform:translate(-4px,2px)}40%{transform:translate(4px,-2px)}60%{transform:translate(-3px,-2px)}80%{transform:translate(3px,2px)}}

/* ==========================================================================
   PREMIUM SAAS LIGHT MODE SYSTEM (Universal Transformation)
   Dark mode remains 100% untouched above; all overrides scoped to [data-theme="light"]
   ========================================================================== */

/* ---- Ambient Glow Blobs Engine ---- */
.bg-blobs {
  display: none;
}
[data-theme="light"] .bg-blobs {
  display: block;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
[data-theme="light"] .blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
}
[data-theme="light"] .blob-1 {
  top: -12%;
  left: -8%;
  width: min(580px, 62vw);
  height: min(580px, 62vw);
  background: radial-gradient(circle, #4F8CFF 0%, rgba(79, 140, 255, 0) 70%);
  opacity: 0.18;
  filter: blur(120px);
  animation: blobFloat1 18s ease-in-out infinite alternate;
}
[data-theme="light"] .blob-2 {
  top: 10%;
  right: -10%;
  width: min(620px, 65vw);
  height: min(620px, 65vw);
  background: radial-gradient(circle, #6E7BFF 0%, rgba(110, 123, 255, 0) 70%);
  opacity: 0.16;
  filter: blur(140px);
  animation: blobFloat2 22s ease-in-out infinite alternate;
}
[data-theme="light"] .blob-3 {
  bottom: 2%;
  left: 15%;
  width: min(520px, 55vw);
  height: min(520px, 55vw);
  background: radial-gradient(circle, #7FD8FF 0%, rgba(127, 216, 255, 0) 70%);
  opacity: 0.19;
  filter: blur(115px);
  animation: blobFloat3 20s ease-in-out infinite alternate;
}
[data-theme="light"] .blob-4 {
  bottom: -15%;
  right: 12%;
  width: min(540px, 58vw);
  height: min(540px, 58vw);
  background: radial-gradient(circle, #A78BFA 0%, rgba(167, 139, 250, 0) 70%);
  opacity: 0.15;
  filter: blur(130px);
  animation: blobFloat4 24s ease-in-out infinite alternate;
}

@keyframes blobFloat1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(45px, 35px) scale(1.06); }
  100% { transform: translate(-25px, 50px) scale(0.96); }
}
@keyframes blobFloat2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, 40px) scale(1.05); }
  100% { transform: translate(35px, -30px) scale(0.94); }
}
@keyframes blobFloat3 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(35px, -45px) scale(1.07); }
  100% { transform: translate(-40px, 25px) scale(0.95); }
}
@keyframes blobFloat4 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-35px, -35px) scale(1.06); }
  100% { transform: translate(45px, 30px) scale(0.93); }
}

/* Keyframe Animations for SaaS Entrance & Micro-motion */
@keyframes saasFadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes saasModalIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes cardStagger {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes microFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* ---- Base Canvas & Global Texture Overrides ---- */
[data-theme="light"] body {
  background: #ffffff;
  color: #0f172a;
}
[data-theme="light"] .grain {
  opacity: 0.015;
}
[data-theme="light"] .scanlines {
  display: none;
}

/* ---- Section Eyebrow Label Cards (SaaS Anchor Pill) ---- */
[data-theme="light"] .eyebrow {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(37, 99, 235, 0.22);
  color: #2563eb;
  padding: 5px 15px;
  border-radius: 9999px;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.09), 0 1px 3px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-bottom: 14px;
}
[data-theme="light"] #screen-ready .eyebrow {
  animation: microFloat 5s ease-in-out infinite;
  transform-origin: center;
}

/* ---- Typography Hierarchy ---- */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4 {
  color: #0f172a;
}
[data-theme="light"] .gate h1 {
  color: #0f172a;
  letter-spacing: -0.01em;
  font-weight: 700;
}
[data-theme="light"] .gate-hint {
  color: #64748b;
  font-size: 14px;
}

/* ---- Buttons & Interactive Elements ---- */
[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  color: #ffffff;
  border: none;
  font-weight: 700;
  letter-spacing: .06em;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28), 0 1px 3px rgba(37, 99, 235, 0.15);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="light"] .btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.36), 0 2px 6px rgba(37, 99, 235, 0.2);
}
[data-theme="light"] .btn-primary:active {
  transform: translateY(0) scale(0.99);
}

[data-theme="light"] .btn-ghost {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: #1e293b;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="light"] .btn-ghost:hover {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.05);
  color: #1d4ed8;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}
[data-theme="light"] .btn-ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
[data-theme="light"] .danger-btn {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.25);
  background: rgba(255, 255, 255, 0.8);
}
[data-theme="light"] .danger-btn:hover {
  border-color: #dc2626 !important;
  background: rgba(220, 38, 38, 0.08) !important;
  color: #b91c1c;
}

/* ---- Topbar & Quick Controls ---- */
[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
[data-theme="light"] .brand {
  color: #0f172a;
}
[data-theme="light"] .brandmark {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[data-theme="light"] .brand em {
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[data-theme="light"] .icon-btn {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.1);
  color: #1e293b;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="light"] .icon-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.16);
}
[data-theme="light"] .danger-icon:hover {
  border-color: #dc2626;
  color: #dc2626;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.16);
}

/* ---- Menu Gate & Global Leaderboard Card ---- */
[data-theme="light"] .gate {
  animation: saasFadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-theme="light"] .leaderboard-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(20, 20, 50, 0.04), 0 20px 48px -10px rgba(20, 20, 50, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="light"] .leaderboard-card:hover {
  box-shadow: 0 8px 24px rgba(79, 140, 255, 0.12), 0 24px 54px -10px rgba(20, 20, 50, 0.12);
  transform: translateY(-3px);
}
[data-theme="light"] .lb-header {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .lb-badge {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(251, 191, 36, 0.26));
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
  transform: rotate(-2.5deg);
  transition: transform 0.2s ease;
}
[data-theme="light"] .leaderboard-card:hover .lb-badge {
  transform: rotate(0deg) scale(1.05);
}
[data-theme="light"] .lb-header h3 {
  color: #0f172a;
}
[data-theme="light"] .lb-sub {
  color: #64748b;
}
[data-theme="light"] .lb-row {
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02);
  transition: all 0.2s ease;
}
[data-theme="light"] .lb-row:hover {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.22);
  transform: translateX(4px);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.09);
}
[data-theme="light"] .lb-rank {
  color: #2563eb;
}
[data-theme="light"] .lb-rank.gold { color: #d97706; }
[data-theme="light"] .lb-rank.silver { color: #475569; }
[data-theme="light"] .lb-rank.bronze { color: #92400e; }
[data-theme="light"] .lb-score {
  color: #2563eb;
}
[data-theme="light"] .lb-empty {
  color: #64748b;
}

/* ---- Hub Nav Tabs & Header ---- */
[data-theme="light"] .hub-nav {
  gap: 12px;
}
[data-theme="light"] .hub-tab {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.1);
  color: #64748b;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="light"] .hub-tab:hover {
  color: #0f172a;
  border-color: #2563eb;
  transform: translateY(-1px);
}
[data-theme="light"] .hub-tab.active {
  background: #ffffff;
  border-color: #2563eb;
  color: #2563eb;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.18), 0 1px 3px rgba(37, 99, 235, 0.08);
}
[data-theme="light"] .badge-count {
  background: rgba(15, 23, 42, 0.06);
  color: #475569;
}
[data-theme="light"] .hub-tab.active .badge-count {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

/* ---- Floating Glassy Game Cards Grid ---- */
[data-theme="light"] .game-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03), 0 20px 48px -12px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: cardStagger 0.48s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease;
}
[data-theme="light"] .game-card:hover {
  transform: translateY(-6px);
  border-color: rgba(79, 140, 255, 0.38);
  box-shadow: 0 8px 24px rgba(79, 140, 255, 0.12), 0 28px 60px -12px rgba(15, 23, 42, 0.12);
}
[data-theme="light"] .game-card .g-icon {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(6, 182, 212, 0.12));
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.18);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
  border-radius: 14px;
  width: 48px;
  height: 48px;
  font-size: 22px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="light"] .game-card:hover .g-icon {
  transform: scale(1.08) rotate(3deg);
}
[data-theme="light"] .game-card h3 {
  color: #0f172a;
  font-size: 19px;
}
[data-theme="light"] .game-card p {
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}
[data-theme="light"] .game-card .g-meta {
  color: #64748b;
  font-weight: 600;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  padding-top: 12px;
}
[data-theme="light"] .game-card .g-meta b {
  color: #2563eb;
  font-weight: 700;
}
[data-theme="light"] .game-card button {
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.18);
  color: #2563eb;
  font-weight: 700;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.04);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="light"] .game-card button:hover {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.32);
  transform: translateY(-2px);
}

/* ---- Achievements Section & Milestones ---- */
[data-theme="light"] .achievements-section {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 4px 14px rgba(20, 20, 50, 0.04), 0 20px 48px -10px rgba(20, 20, 50, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
[data-theme="light"] .achievements-header {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .achievements-header h3 {
  color: #0f172a;
}
[data-theme="light"] .achievements-header p {
  color: #64748b;
}
[data-theme="light"] .achieve-pct {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(6, 182, 212, 0.12));
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.2);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}
[data-theme="light"] .achievement-badge {
  background: rgba(248, 250, 252, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: cardStagger 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="light"] .achievement-badge:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}
[data-theme="light"] .achievement-badge .badge-icon {
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.06);
}
[data-theme="light"] .achievement-badge.unlocked {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 246, 255, 0.9));
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.09), 0 1px 3px rgba(37, 99, 235, 0.04);
}
[data-theme="light"] .achievement-badge.unlocked .badge-icon {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(6, 182, 212, 0.15));
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}
[data-theme="light"] .achievement-badge.unlocked .badge-status {
  color: #2563eb;
}

/* ---- Loading Screen (SaaS Showcase Entrance) ---- */
[data-theme="light"] #screen-loading {
  background: #ffffff;
}
[data-theme="light"] .hex-spin {
  stroke: #2563eb;
  filter: drop-shadow(0 4px 14px rgba(37, 99, 235, 0.35));
}
[data-theme="light"] .load-mark span {
  color: #0f172a;
}
[data-theme="light"] .load-title {
  color: #0f172a;
}
[data-theme="light"] .load-title em {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[data-theme="light"] .load-bar {
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .load-fill {
  background: linear-gradient(90deg, #2563eb, #4f46e5, #06b6d4);
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.45);
}
[data-theme="light"] .load-row {
  color: #64748b;
}

/* ---- Ready Screen (Brand Showcase) ---- */
[data-theme="light"] #screen-ready {
  background: #ffffff;
}
[data-theme="light"] .ready-wrap {
  animation: saasFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-theme="light"] .ready-title {
  background: linear-gradient(135deg, #1d4ed8 0%, #4f46e5 50%, #0891b2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: pulseLightGlow 2.5s ease-in-out infinite;
}
@keyframes pulseLightGlow {
  0%, 100% { filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.2)); }
  50% { filter: drop-shadow(0 8px 24px rgba(79, 70, 229, 0.32)); }
}
[data-theme="light"] .ready-wrap p {
  color: #475569;
  font-size: 16px;
}

/* ---- Play Screen HUD & Stage ---- */
[data-theme="light"] .playbar {
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
[data-theme="light"] .play-id .kicker {
  color: #2563eb;
  font-weight: 700;
}
[data-theme="light"] .play-id b {
  color: #0f172a;
}
[data-theme="light"] .play-stats small {
  color: #64748b;
}
[data-theme="light"] .play-stats b {
  color: #0f172a;
}

[data-theme="light"] .stage {
  background: #090c14; /* Arcade game console housing keeping retro canvas crisp */
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .overlay {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
[data-theme="light"] .overlay > div {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12), 0 30px 60px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  animation: saasModalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="light"] .overlay .kicker {
  color: #2563eb;
  font-weight: 700;
}
[data-theme="light"] .overlay h2 {
  color: #0f172a;
}
[data-theme="light"] .overlay p {
  color: #475569;
}
[data-theme="light"] .overlay p b {
  color: #2563eb;
}

/* ---- Confirmation Modal (Reset Data) ---- */
[data-theme="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
[data-theme="light"] .modal-card {
  background: #ffffff;
  border: 1px solid rgba(239, 68, 68, 0.25);
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.15), 0 25px 60px -10px rgba(15, 23, 42, 0.2);
  animation: saasModalIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="light"] .modal-card h2 {
  color: #dc2626;
}
[data-theme="light"] .modal-card p {
  color: #64748b;
}
[data-theme="light"] .btn-danger {
  background: #dc2626;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}
[data-theme="light"] .btn-danger:hover {
  background: #b91c1c;
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.4);
}

/* ---- Toast Notifications ---- */
[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(37, 99, 235, 0.3);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.18), 0 4px 12px rgba(15, 23, 42, 0.06);
  color: #0f172a;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
[data-theme="light"] .toast-title {
  color: #2563eb;
}
[data-theme="light"] .toast-desc {
  color: #475569;
}

/* ---- Footer ---- */
[data-theme="light"] .footer {
  color: #94a3b8;
}

/* ===== Responsive Breakpoint Refinements ===== */
@media (min-width: 1024px) {
  .game-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  [data-theme="light"] .blob-1 {
    width: 440px;
    height: 440px;
  }
  [data-theme="light"] .blob-2 {
    width: 460px;
    height: 460px;
  }
  [data-theme="light"] .blob-3 {
    width: 400px;
    height: 400px;
  }
  [data-theme="light"] .blob-4 {
    display: none;
  }
}

@media (max-width:640px){
  .ready-title{font-size:44px;}
  .gate h1{font-size:30px;}
  .hub{padding:6px 16px 24px;}
  .playbar{gap:8px;padding:10px;}
  .play-stats{gap:10px;}
  .overlay h2{font-size:22px;}
  .game-grid {
    grid-template-columns: 1fr;
  }
  /* Mobile-optimized blobs: light, crisp, 60fps */
  [data-theme="light"] .blob-1 {
    width: 300px;
    height: 300px;
    opacity: 0.12;
    filter: blur(80px);
  }
  [data-theme="light"] .blob-2 {
    width: 280px;
    height: 280px;
    opacity: 0.10;
    filter: blur(85px);
  }
  [data-theme="light"] .blob-3,
  [data-theme="light"] .blob-4 {
    display: none;
  }
}

/* Part 2 Embed Patches */
body.embed .grain, body.embed .scanlines,
html.embed .grain, html.embed .scanlines { pointer-events:none; }
html:has(body.embed), body.embed,
html.embed, html.embed body { height:100%; margin:0; overflow:hidden; }

/* UPGRADE 3: Suppress loading and ready screens in embed mode immediately */
html.embed #screen-loading,
html.embed #screen-ready,
body.embed #screen-loading,
body.embed #screen-ready {
  display: none !important;
}

/* UPGRADE 2: Embed mode canvas and stage fill whole frame cleanly */
html.embed,
html.embed body,
body.embed {
  --bg: #0a0c14 !important;
  --bg2: #0f1220 !important;
  --surface: #12162a !important;
  --surface2: #171c34 !important;
  --line: #262c4a !important;
  --text: #e9edf7 !important;
  --muted: #8891ac !important;
  --cyan: #00e6d0 !important;
  --magenta: #ff2f9e !important;
  --amber: #ffb020 !important;
  --danger: #ff4d5e !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #05070d !important;
  color: #e9edf7 !important;
  box-sizing: border-box;
}

html.embed #screen-play,
body.embed #screen-play {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #05070d !important;
  position: fixed !important;
  inset: 0 !important;
}

html.embed .playbar,
body.embed .playbar {
  flex: 0 0 auto !important;
  width: 100% !important;
  background: #080c18 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #e9edf7 !important;
  padding: 8px 14px !important;
  z-index: 15 !important;
}

html.embed .stage,
body.embed .stage {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  position: relative !important;
  background: #05070d !important;
}

html.embed .game-area,
body.embed .game-area {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
}

html.embed .game-area canvas,
body.embed .game-area canvas {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
  margin: auto !important;
  touch-action: none !important;
}

html.embed .game-area .dom-game,
body.embed .game-area .dom-game {
  width: min(94%, 480px) !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  box-sizing: border-box !important;
}
