:root {
  --bg: #150d29; --bg2: #21143f; --panel: #2b1b52; --gold: #f2c14e; --gold2: #ffdf8a;
  --text: #efe8ff; --muted: #a99bc9; --cyan: #5fd4ff; --red: #ff5c7a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(ellipse at top, #2a1853 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text); font: 15px/1.45 "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  display: flex; flex-direction: column; min-height: 100vh;
}
.top {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: rgba(10, 5, 24, .6); border-bottom: 1px solid #3a2768; flex-wrap: wrap;
}
.brand { font-weight: 800; letter-spacing: .12em; color: var(--gold); font-size: 20px; }
.crown { color: var(--gold2); }
.room-badge {
  font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--panel); color: var(--muted);
}
.room-badge.s1 { color: #9ff0b5; } .room-badge.s2 { color: var(--red); }
.actions { margin-left: auto; display: flex; gap: 8px; }
.btn {
  background: var(--gold); color: #24133f; border: 0; border-radius: 10px; padding: 8px 14px;
  font-weight: 700; cursor: pointer; text-decoration: none; font-size: 14px; display: inline-block;
}
.btn:hover { background: var(--gold2); }
.btn.ghost { background: transparent; color: var(--gold); border: 1px solid #5a4590; }
.layout { flex: 1; display: flex; justify-content: center; gap: 16px; padding: 16px; }
.side { width: 160px; flex: none; display: flex; justify-content: center; }
.stage { flex: 1; max-width: 1280px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
#unity-container {
  position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000;
  border-radius: 14px; overflow: hidden; box-shadow: 0 10px 40px rgba(0, 0, 0, .5), 0 0 0 1px #3a2768;
}
#unity-canvas { width: 100%; height: 100%; display: block; background: #150d29; outline: none; }
#loader {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; background: var(--bg);
}
.loader-title { font-size: 42px; font-weight: 900; color: var(--gold); letter-spacing: .15em; }
.bar { width: min(60%, 420px); height: 14px; background: var(--panel); border-radius: 999px; overflow: hidden; }
#bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold2)); transition: width .2s; }
#loader-text { color: var(--muted); }
#warning {
  display: none; position: absolute; left: 10px; right: 10px; top: 10px; padding: 8px 12px;
  background: #5a1830; color: #fff; border-radius: 8px;
}
.ad-row { display: flex; justify-content: center; }
.ad-slot:empty { display: none; }
.ad-slot iframe { border: 0; display: block; }
.ad-slot[data-ad="mobileBanner"] { display: none; }
.how {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; color: var(--muted); font-size: 14px;
}
.how > div { background: rgba(43, 27, 82, .6); border-radius: 10px; padding: 10px 12px; }
.how b { color: var(--gold); }
.mobile-note {
  display: none; position: fixed; inset: 0; background: rgba(10, 5, 24, .92); z-index: 10;
  align-items: center; justify-content: center; padding: 16px;
}
.mn-box { background: var(--panel); border-radius: 16px; padding: 22px; max-width: 420px; text-align: center; }
.mn-title { font-size: 22px; font-weight: 800; color: var(--gold); margin-bottom: 8px; }
.mn-box .btn { margin: 6px; }
@media (max-width: 1100px) { .side { display: none; } }
@media (max-width: 760px) {
  .layout { padding: 8px; } .how { grid-template-columns: 1fr; }
  .ad-slot[data-ad="leaderboard"] { display: none; }
  .ad-slot[data-ad="mobileBanner"] { display: block; }
  .actions .ghost { display: none; }
}
