@import url("https://fonts.googleapis.com/css2?family=Bungee&family=Nunito:wght@600;700;800;900&display=swap");

:root {
  --night: #090927;
  --night-soft: #12123a;
  --panel: rgba(20, 19, 61, .9);
  --panel-bright: rgba(34, 31, 83, .92);
  --line: rgba(127, 225, 255, .22);
  --white: #fffdfd;
  --muted: #b9b9d8;
  --pink: #ff4fa3;
  --cyan: #36ddff;
  --gold: #ffbd3f;
  --violet: #9f6bff;
  --green: #5cf0b0;
  --shadow: 0 24px 80px rgba(0, 0, 25, .48);
  --header-height: 78px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  min-width: 280px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--white);
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 79, 163, .16), transparent 27rem),
    radial-gradient(circle at 82% 18%, rgba(54, 221, 255, .13), transparent 31rem),
    linear-gradient(145deg, #080722, #11103b 60%, #090820);
  font-family: "Nunito", sans-serif;
}

button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 999; padding: 10px 14px; color: var(--night); background: white; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-height);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(14px, 2vw, 34px);
  padding: 10px clamp(14px, 3vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 7, 31, .88);
  box-shadow: 0 12px 40px rgba(0, 0, 18, .36);
  backdrop-filter: blur(18px);
}

.brand-button { display: flex; align-items: center; gap: 11px; padding: 0; color: white; border: 0; background: transparent; text-align: left; cursor: pointer; }
.brand-button strong { display: block; font-family: "Bungee", sans-serif; font-size: clamp(.9rem, 1.6vw, 1.22rem); letter-spacing: .035em; }
.brand-button small { display: block; margin-top: 1px; color: var(--muted); font-size: .65rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.brand-gem { width: 48px; height: 48px; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.72); border-radius: 15px; font-family: "Bungee", sans-serif; font-size: .82rem; background: conic-gradient(from 20deg, var(--pink), var(--gold), var(--green), var(--cyan), var(--violet), var(--pink)); box-shadow: inset 0 0 0 3px rgba(8,7,31,.5), 0 0 24px rgba(100, 104, 255, .35); }

.desktop-nav { display: flex; justify-content: center; gap: 6px; }
.desktop-nav button { min-height: 42px; padding: 8px 13px; color: var(--muted); border: 1px solid transparent; border-radius: 13px; background: transparent; font-weight: 900; cursor: pointer; }
.desktop-nav button:hover, .desktop-nav button[aria-current="page"] { color: white; border-color: var(--line); background: linear-gradient(135deg, rgba(255,79,163,.16), rgba(54,221,255,.12)); }

.header-actions { display: flex; align-items: center; gap: 7px; }
.wallet-chip, .profile-chip { min-height: 46px; color: white; border: 1px solid var(--line); background: rgba(255,255,255,.06); cursor: pointer; }
.wallet-chip { min-width: 76px; padding: 6px 12px; border-radius: 14px; }
.wallet-chip small, .wallet-chip strong { display: block; }
.wallet-chip small { color: var(--muted); font-size: .61rem; font-weight: 900; text-transform: uppercase; }
.wallet-chip strong { color: var(--cyan); font-size: 1rem; }
.wallet-chip--tickets strong { color: var(--gold); }
.profile-chip { width: 46px; display: grid; place-items: center; border-radius: 50%; }
.profile-chip span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; font-weight: 900; background: linear-gradient(135deg, var(--pink), var(--violet)); }

.app-content { min-height: calc(100dvh - var(--header-height)); }
.app-view { animation: view-in .38s ease both; }
.arcade-view { min-height: calc(100dvh - var(--header-height)); display: grid; place-items: center; overflow: hidden; }
.scene-stage { width: 100%; min-height: calc(100dvh - var(--header-height)); display: grid; place-items: center; position: relative; overflow: hidden; background: #06061d; }
.scene-frame { position: relative; width: min(100vw, calc((100dvh - var(--header-height)) * 16 / 9)); aspect-ratio: 16 / 9; flex: 0 0 auto; overflow: hidden; box-shadow: 0 0 100px rgba(51, 93, 255, .22); }
.scene-background { width: 100%; height: 100%; display: block; object-fit: contain; user-select: none; }

@media (min-width: 761px) {
  .app-header {
    position: fixed;
    right: 0;
    left: 0;
  }

  .app-content,
  .arcade-view,
  .scene-stage {
    width: 100vw;
    min-height: 100dvh;
  }

  .arcade-view,
  .scene-stage {
    height: 100dvh;
  }

  .scene-frame {
    width: 100vw;
    height: 100dvh;
    aspect-ratio: auto;
  }

  .scene-background--desktop {
    object-fit: cover;
    object-position: center;
  }

  .scene-toolbar {
    top: calc(var(--header-height) + 14px);
  }
}
.scene-toolbar { position: absolute; z-index: 12; top: 14px; left: 50%; width: min(94%, 720px); display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px 8px 13px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(7, 7, 33, .8); box-shadow: 0 10px 30px rgba(0,0,20,.28); backdrop-filter: blur(14px); transform: translateX(-50%); }
.scene-toolbar span { display: flex; align-items: center; gap: 7px; color: #e7e6fa; font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.scene-toolbar i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.scene-toolbar button { min-height: 36px; padding: 7px 13px; color: white; border: 1px solid var(--line); border-radius: 999px; background: rgba(54,221,255,.09); font-size: .72rem; font-weight: 900; cursor: pointer; }

.scene-nav { position: absolute; z-index: 7; display: block; border: 0; background: transparent; }
.scene-nav img { width: 100%; height: 100%; display: block; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0,0,18,.6)); }
button.scene-nav { padding: 0; cursor: pointer; transition: filter .2s ease, transform .2s ease; }
button.scene-nav:hover { filter: brightness(1.15); transform: translateY(-2px) scale(1.02); }
.scene-nav--ticket { left: 3.75%; top: 81.6666667%; width: 30%; height: 17.7777778%; }
.scene-nav--karaoke { left: 66.25%; top: 81.6666667%; width: 30%; height: 17.7777778%; opacity: .7; }
.scene-nav--karaoke span { position: absolute; top: 4%; right: 10%; padding: .35em .75em; border: 1px solid rgba(255,255,255,.7); border-radius: 999px; color: white; background: rgba(9,9,39,.9); font-size: clamp(.35rem, .7vw, .72rem); font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }

.machine-hotspot { position: absolute; z-index: 8; padding: 0; border: 2px solid transparent; border-radius: 12% / 6%; color: white; background: transparent; cursor: pointer; }
.machine-hotspot--prism { left: .625%; top: 20.5555556%; width: 15.9375%; height: 58.3333333%; }
.machine-hotspot::before { content: ""; position: absolute; inset: 8%; border: 2px solid rgba(54,221,255,0); border-radius: inherit; box-shadow: 0 0 0 rgba(54,221,255,0); transition: border-color .2s ease, box-shadow .2s ease; }
.machine-hotspot span { position: absolute; left: 50%; bottom: 5%; width: max-content; max-width: 90%; padding: .55em .85em; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; color: white; background: rgba(9,9,39,.9); box-shadow: 0 6px 18px rgba(0,0,20,.45); font-size: clamp(.43rem, .85vw, .84rem); font-weight: 900; opacity: 0; transform: translate(-50%, 6px); transition: opacity .2s ease, transform .2s ease; }
.machine-hotspot:hover::before, .machine-hotspot:focus-visible::before, .show-targets .machine-hotspot::before { border-color: var(--cyan); box-shadow: 0 0 22px rgba(54,221,255,.7), inset 0 0 28px rgba(54,221,255,.08); }
.machine-hotspot:hover span, .machine-hotspot:focus-visible span, .show-targets .machine-hotspot span { opacity: 1; transform: translate(-50%, 0); }
.show-targets .scene-nav--ticket { filter: brightness(1.18) drop-shadow(0 0 12px rgba(255,189,63,.65)); }
.rotate-note { display: none; position: absolute; bottom: 18px; left: 50%; z-index: 15; width: max-content; max-width: calc(100% - 28px); padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(7,7,31,.88); font-size: .72rem; font-weight: 800; transform: translateX(-50%); }

.content-view { width: min(1180px, calc(100% - 34px)); margin: 0 auto; padding: clamp(40px, 6vw, 76px) 0 120px; }
.view-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 24px; }
.view-heading h1 { margin: 0; font-family: "Bungee", sans-serif; font-size: clamp(2rem, 5vw, 4.4rem); line-height: 1; letter-spacing: -.03em; text-shadow: 0 0 28px rgba(255,79,163,.22); }
.view-heading p:not(.eyebrow) { max-width: 720px; margin: 12px 0 0; color: var(--muted); }
.eyebrow, .profile-kicker { margin: 0 0 7px; color: var(--cyan); font-size: .7rem; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.secondary-button, .profile-actions button, .card-heading button { min-height: 42px; padding: 9px 15px; color: white; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.06); font-weight: 900; cursor: pointer; }
.glass-card { border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(145deg, var(--panel-bright), var(--panel)); box-shadow: var(--shadow); }

.profile-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 22px; padding: clamp(20px, 3vw, 32px); overflow: hidden; position: relative; }
.profile-hero::after { content: ""; position: absolute; width: 240px; height: 240px; right: -70px; bottom: -150px; border-radius: 50%; background: radial-gradient(circle, rgba(255,79,163,.32), transparent 68%); pointer-events: none; }
.avatar-placeholder { position: relative; width: clamp(84px, 11vw, 126px); aspect-ratio: 1; display: grid; place-items: center; border: 4px solid rgba(255,255,255,.76); border-radius: 28%; background: conic-gradient(from 20deg, var(--pink), var(--gold), var(--green), var(--cyan), var(--violet), var(--pink)); box-shadow: inset 0 0 0 5px rgba(9,9,39,.45), 0 0 30px rgba(103,104,255,.28); font-family: "Bungee", sans-serif; font-size: clamp(1.3rem, 3vw, 2.4rem); }
.avatar-placeholder i { position: absolute; right: -7px; bottom: -7px; padding: 5px 8px; border: 2px solid var(--night); border-radius: 999px; color: var(--night); background: var(--gold); font-family: "Nunito", sans-serif; font-size: .58rem; font-style: normal; font-weight: 900; text-transform: uppercase; }
.profile-identity h2, .public-preview h2 { margin: 0; font-family: "Bungee", sans-serif; font-size: clamp(1.45rem, 3vw, 2.7rem); }
.profile-identity p:last-child, .public-preview p:last-child { margin: 6px 0 0; color: var(--muted); }
.profile-actions { z-index: 1; display: grid; gap: 8px; }
.profile-actions button:first-child { border: 0; background: linear-gradient(110deg, var(--pink), var(--violet)); box-shadow: 0 8px 22px rgba(255,79,163,.2); }

.wallet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 16px 0; }
.stat-card { min-height: 118px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; color: white; background: rgba(255,255,255,.055); text-align: left; cursor: pointer; transition: transform .2s ease, border-color .2s ease; }
.stat-card:hover { border-color: rgba(255,255,255,.45); transform: translateY(-2px); }
.stat-card small, .stat-card strong, .stat-card span { display: block; }
.stat-card small { color: var(--muted); font-size: .67rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.stat-card strong { margin: 3px 0; font-family: "Bungee", sans-serif; font-size: 1.65rem; }
.stat-card span { color: var(--muted); font-size: .75rem; }
.stat-card--credit strong { color: var(--cyan); }
.stat-card--ticket strong, .stat-card--booth strong { color: var(--gold); }
.profile-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 16px; }
.records-card, .badge-card { padding: 23px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.card-heading .eyebrow { margin: 0; }
.card-heading button { min-height: 34px; padding: 6px 10px; color: var(--cyan); font-size: .72rem; }
.record-list { margin: 19px 0 0; }
.record-list div { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.record-list dt { color: var(--muted); }
.record-list dd { margin: 0; font-weight: 900; }
.badge-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0 13px; }
.badge-slots span { aspect-ratio: 1; display: grid; place-items: center; border: 2px dashed rgba(185,185,216,.28); border-radius: 24%; color: rgba(185,185,216,.35); font-family: "Bungee", sans-serif; }
.badge-card > p, .badge-card > small { color: var(--muted); }
.progress-track { height: 10px; overflow: hidden; margin: 22px 0 8px; border-radius: 999px; background: rgba(255,255,255,.09); }
.progress-track span { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--pink), var(--cyan)); }
.profile-tabs { display: flex; gap: 8px; margin-top: 16px; padding: 9px; overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: rgba(10,9,39,.78); }
.profile-tabs button { flex: 1 0 auto; min-height: 44px; padding: 9px 14px; color: var(--muted); border: 0; border-radius: 12px; background: transparent; font-weight: 900; cursor: pointer; }
.profile-tabs button.is-active { color: white; background: linear-gradient(110deg, rgba(255,79,163,.28), rgba(54,221,255,.2)); }

.public-preview { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 34px; overflow: hidden; }
.candidate-label { position: absolute; top: 0; right: 0; padding: 6px 12px; color: var(--night); background: var(--gold); border-radius: 0 24px 0 13px; font-size: .62rem; font-weight: 900; letter-spacing: .08em; }
.privacy-callout { display: flex; gap: 10px 18px; margin-top: 16px; padding: 17px 20px; border: 1px solid rgba(92,240,176,.24); border-radius: 17px; background: rgba(92,240,176,.07); }
.privacy-callout strong { color: var(--green); }
.privacy-callout span { color: var(--muted); }
.leaderboard-panel { padding: clamp(18px, 4vw, 34px); }
.board-tabs { display: flex; gap: 8px; }
.board-tabs button { min-height: 42px; flex: 1; color: var(--muted); border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.04); font-weight: 900; }
.board-tabs button.is-active { color: var(--night); background: var(--cyan); }
.sample-board { margin: 22px 0; padding: 0; list-style: none; }
.sample-board li { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 14px; padding: 15px 8px; border-bottom: 1px solid rgba(255,255,255,.09); }
.sample-board li strong { width: 38px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 12px; color: var(--night); background: var(--gold); }
.sample-board li span { font-weight: 900; }
.sample-board time { color: var(--cyan); font-variant-numeric: tabular-nums; font-weight: 900; }
.cache-note { color: var(--muted); font-size: .8rem; }
.placeholder-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.placeholder-card { min-height: 210px; display: grid; place-items: center; padding: 22px; color: var(--muted); border-style: dashed; font-weight: 900; }
.settings-preview { display: grid; gap: 10px; padding: 24px; }
.settings-preview button { min-height: 52px; padding: 12px 16px; color: white; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.05); text-align: left; font-weight: 900; }
.settings-preview .danger-candidate { color: #ff9fbd; border-color: rgba(255,79,163,.3); }
.ticket-placeholder { min-height: 380px; display: grid; place-items: center; align-content: center; gap: 12px; padding: 30px; text-align: center; }
.ticket-placeholder h2, .ticket-placeholder p { margin: 0; }
.ticket-placeholder p { color: var(--muted); }
.ticket-icon { width: 96px; aspect-ratio: 1; display: grid; place-items: center; border: 4px dotted var(--night); border-radius: 50%; color: var(--night); background: var(--gold); box-shadow: 0 0 32px rgba(255,189,63,.3); font-family: "Bungee", sans-serif; font-size: 2.3rem; }

.mobile-dock { display: none; }
.game-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; color: white; background: var(--night); }
.game-dialog::backdrop { background: var(--night); }
.game-dialog[open] { display: grid; grid-template-rows: 64px 1fr; }
.game-dialog-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 9px 16px; border-bottom: 1px solid var(--line); background: rgba(8,7,31,.96); }
.game-dialog-bar strong, .game-dialog-bar small { display: block; }
.game-dialog-bar strong { font-family: "Bungee", sans-serif; }
.game-dialog-bar small { color: var(--muted); }
.game-dialog-bar button { min-height: 44px; padding: 9px 15px; color: white; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.07); font-weight: 900; }
.game-dialog iframe { width: 100%; height: 100%; border: 0; background: white; }

/* Desktop games own their full staged canvas and provide their own controls. */
@media (min-width: 761px) {
  .game-dialog[open] { position: fixed; inset: 0; display: block; width: 100vw; height: 100dvh; overflow: hidden; }
  .game-dialog-bar { display: none; }
  .game-dialog iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
}
.toast { position: fixed; z-index: 500; left: 50%; bottom: 28px; max-width: min(520px, calc(100% - 30px)); padding: 12px 18px; border: 1px solid var(--line); border-radius: 999px; color: white; background: rgba(10,9,39,.96); box-shadow: var(--shadow); font-weight: 800; opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@keyframes view-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }

@media (max-width: 1080px) {
  .desktop-nav button { padding-inline: 8px; font-size: .8rem; }
  .wallet-chip { display: none; }
}

@media (max-width: 760px) {
  :root { --header-height: 66px; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .app-header { grid-template-columns: 1fr auto; padding: 8px 12px; }
  .brand-gem { width: 42px; height: 42px; border-radius: 13px; }
  .brand-button small { display: none; }
  .desktop-nav { display: none; }
  .header-actions { justify-content: end; }
  .profile-chip { width: 44px; min-height: 44px; }
  .arcade-view, .scene-stage { min-height: calc(100dvh - var(--header-height) - 72px); }
  .scene-frame { width: min(100vw, calc((100dvh - var(--header-height) - 72px) * 16 / 9)); }
  .scene-toolbar { top: 8px; width: calc(100% - 16px); }
  .scene-toolbar span { font-size: .58rem; }
  .scene-toolbar button { min-height: 32px; padding: 5px 9px; font-size: .58rem; }
  .rotate-note { display: block; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .mobile-dock { position: fixed; z-index: 150; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); left: 8px; height: 64px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 19px; background: rgba(8,7,31,.94); box-shadow: 0 14px 40px rgba(0,0,20,.5); backdrop-filter: blur(16px); }
  .mobile-dock button { min-width: 0; color: var(--muted); border: 0; border-radius: 13px; background: transparent; font-size: .58rem; font-weight: 900; }
  .mobile-dock button span { width: 26px; height: 26px; display: grid; place-items: center; margin: 0 auto 2px; border: 1px solid var(--line); border-radius: 9px; color: white; font-family: "Bungee", sans-serif; font-size: .62rem; }
  .mobile-dock button[aria-current="page"] { color: white; background: rgba(54,221,255,.1); }
  .content-view { width: min(100% - 20px, 1180px); padding: 34px 0 30px; }
  .view-heading { display: grid; align-items: start; }
  .view-heading .secondary-button { width: 100%; }
  .profile-hero { grid-template-columns: auto 1fr; gap: 16px; }
  .profile-actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .wallet-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 92px; }
  .profile-grid { grid-template-columns: 1fr; }
  .public-preview { grid-template-columns: auto 1fr; padding: 28px 20px; }
  .public-preview .secondary-button { grid-column: 1 / -1; }
  .privacy-callout { display: grid; }
  .placeholder-grid { grid-template-columns: 1fr; }
  .placeholder-card { min-height: 130px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); border-radius: 18px; text-align: center; }
}

@media (max-width: 420px) {
  .brand-button strong { font-size: .82rem; }
  .scene-toolbar { align-items: stretch; border-radius: 15px; }
  .scene-toolbar span { display: none; }
  .scene-toolbar button { width: 100%; }
  .profile-hero { grid-template-columns: 1fr; text-align: center; }
  .profile-hero .avatar-placeholder { margin: 0 auto; }
  .profile-actions { grid-column: auto; }
  .card-heading { align-items: flex-start; }
  .sample-board li { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; }
}

@media (orientation: landscape) and (max-height: 560px) {
  .rotate-note { display: none; }
  .app-header { position: fixed; top: 8px; left: 8px; min-height: 52px; width: auto; grid-template-columns: auto; padding: 5px; border: 1px solid var(--line); border-radius: 16px; }
  .brand-button span:last-child, .desktop-nav, .header-actions { display: none; }
  .brand-gem { width: 40px; height: 40px; }
  .arcade-view, .scene-stage { min-height: 100dvh; }
  .scene-frame { width: min(100vw, calc(100dvh * 16 / 9)); }
  .scene-toolbar { top: 8px; width: min(72%, 620px); }
}

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

/* One-shell navigation: the same compact dock is used in windowed and true fullscreen views. */
:root {
  --header-height: 0px;
}

.app-header {
  display: none !important;
}

body {
  min-height: 100dvh;
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
}

.app-content,
:root:fullscreen .app-content {
  min-height: 100dvh;
  padding-bottom: calc(82px + env(safe-area-inset-bottom));
}

.arcade-view,
.scene-stage {
  min-height: 100dvh;
}

.scene-frame {
  width: min(100vw, calc((100dvh - 76px) * 16 / 9));
}

.mobile-dock,
:root:fullscreen .mobile-dock {
  position: fixed;
  z-index: 150;
  right: auto;
  bottom: calc(8px + env(safe-area-inset-bottom));
  left: 50%;
  width: min(960px, calc(100% - 16px));
  height: 64px;
  display: grid !important;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(8, 7, 31, 0.94);
  box-shadow: 0 14px 40px rgba(0, 0, 20, 0.5), 0 0 24px rgba(54, 221, 255, 0.12);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
}

.mobile-dock button {
  min-width: 0;
  color: var(--muted);
  border: 0;
  border-radius: 13px;
  background: transparent;
  font-size: 0.62rem;
  font-weight: 900;
  cursor: pointer;
}

.mobile-dock button span {
  width: 28px;
  height: 26px;
  display: grid;
  place-items: center;
  margin: 0 auto 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: white;
  font-family: "Bungee", sans-serif;
  font-size: 0.58rem;
}

.mobile-dock button:hover,
.mobile-dock button:focus-visible,
.mobile-dock button[aria-current="page"] {
  color: white;
  background: linear-gradient(135deg, rgba(255, 79, 163, 0.2), rgba(54, 221, 255, 0.16));
}

.fc-fullscreen-nav,
:root:fullscreen .fc-fullscreen-nav {
  display: none !important;
}

@media (max-width: 620px) {
  .mobile-dock,
  :root:fullscreen .mobile-dock {
    grid-template-columns: repeat(8, minmax(64px, 1fr));
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: start;
  }
}

/* Arcade Home BGM control, paired with the fullscreen control. */
.fc-audio-button {
  position: absolute;
  z-index: 30;
  top: clamp(14px, 2vw, 28px);
  right: calc(clamp(14px, 2vw, 28px) + 158px);
  min-width: 102px;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(103, 226, 255, .78);
  border-radius: 999px;
  color: white;
  background: rgba(9, 10, 39, .86);
  box-shadow: 0 0 18px rgba(45, 210, 255, .18);
  font-family: "Nunito", sans-serif;
  font-size: .82rem;
  font-weight: 900;
  backdrop-filter: blur(10px);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.fc-audio-button::before { content: "♪"; margin-right: .42em; color: #63e8ff; }
.fc-audio-button.is-muted { border-color: rgba(255, 102, 190, .72); background: rgba(34, 12, 48, .86); }
.fc-audio-button.is-muted::before { content: "×"; color: #ff75c6; }
.fc-audio-button:hover, .fc-audio-button:focus-visible { background: rgba(224, 45, 122, .94); border-color: white; transform: translateY(-2px); }

@media (max-width: 720px) {
  .fc-audio-button { top: 12px; right: 116px; min-width: 88px; min-height: 38px; padding: 8px 10px; font-size: .72rem; }
}

/* Private Studio preview hotspot for the approved Rhythm Star Parade prototype. */
@media (min-width: 761px) {
  .arcade-view button.machine-hotspot--rhythm[data-action="rhythm-star"] {
    left: 54.5% !important;
    top: 16% !important;
    width: 32% !important;
    height: 56% !important;
    translate: -50% 0 !important;
  }
}

/* The active Arcade room is a fixed background scene, never scrollable content. */
html:has(.arcade-view.is-active),
body:has(.arcade-view.is-active) {
  width: 100%;
  height: 100dvh;
  overflow: hidden !important;
  overscroll-behavior: none;
}

.arcade-view.is-active {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.arcade-view.is-active .scene-stage,
.arcade-view.is-active .scene-frame {
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  aspect-ratio: auto;
  overflow: hidden;
}

.arcade-view.is-active .scene-frame {
  background-color: #06061d;
  background-image: url("assets/arcade-main-c04.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.arcade-view.is-active .scene-background {
  display: none !important;
}

@media (max-width: 760px) {
  .arcade-view.is-active .scene-frame {
    background-image: url("assets/arcade-main-mobile-c03.png?v=20260903g");
  }
}

/* Full-viewport arcade room */
.fc-room-viewport {
  position: relative !important;
  width: 100vw !important;
  max-width: none !important;
  height: calc(100dvh - 76px) !important;
  min-height: 520px;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  overflow: hidden !important;
  border-radius: 0 !important;
}

.fc-room-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100%, calc((100dvh - 76px) * 16 / 9));
  aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%);
}

.fc-room-canvas > img[src*="arcade-main-c04"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.fc-fullscreen-button {
  position: absolute;
  z-index: 30;
  right: clamp(14px, 2vw, 28px);
  top: clamp(14px, 2vw, 28px);
  min-width: 44px;
  min-height: 44px;
  padding: 10px 16px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background: rgba(8, 12, 31, 0.82);
  color: #fff;
  font: 800 0.9rem/1 "Nunito", sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  transition: transform 160ms ease, background 160ms ease;
}

.fc-fullscreen-button:hover,
.fc-fullscreen-button:focus-visible {
  background: rgba(224, 45, 122, 0.94);
  transform: translateY(-2px);
}

:root:fullscreen .fc-room-viewport {
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 0;
  margin: 0 !important;
  background: #050817;
}

:root:fullscreen .fc-room-canvas {
  width: max(100%, calc(100dvh * 16 / 9));
}

@media (max-width: 760px) {
  .fc-room-viewport {
    height: calc(100dvh - 124px) !important;
    min-height: 430px;
  }

  .fc-room-canvas {
    width: max(100%, calc((100dvh - 124px) * 16 / 9));
  }

  .fc-fullscreen-button {
    top: 12px;
    right: 12px;
    padding: 10px 13px;
    font-size: 0.78rem;
  }
}

/* Compact navigation shown inside the arcade room's fullscreen mode. */
.fc-fullscreen-nav {
  display: none;
  position: absolute;
  z-index: 32;
  left: 50%;
  bottom: clamp(18px, 3vh, 34px);
  width: min(540px, 36vw);
  min-width: 440px;
  padding: 8px;
  gap: 6px;
  transform: translateX(-50%);
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 18px;
  background: rgba(7, 12, 32, 0.82);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42), 0 0 24px rgba(45, 226, 230, 0.18);
  backdrop-filter: blur(12px);
}

:root:fullscreen .fc-fullscreen-nav {
  display: flex;
}

:root:fullscreen body {
  min-height: 100dvh;
  overflow: auto;
  background: #050817;
}

:root:fullscreen .app-header,
:root:fullscreen .mobile-dock {
  display: none !important;
}

:root:fullscreen .app-content {
  min-height: 100dvh;
  padding-bottom: 92px;
}

@media (min-width: 761px) {
  html:has(.arcade-view.is-active),
  body:has(.arcade-view.is-active) {
    width: 100%;
    height: 100dvh;
    overflow: hidden;
  }

  .arcade-view.is-active .scene-toolbar {
    top: calc(var(--header-height) + 14px);
  }

  :root:fullscreen body {
    overflow: hidden;
  }
}

:root:fullscreen .content-view {
  min-height: calc(100dvh - 92px);
}

:root:fullscreen .fc-fullscreen-nav {
  position: fixed;
}

/* Live beta desktop viewport correction: fill every pixel below the fixed header. */
@media (min-width: 761px) {
  .arcade-view.is-active {
    top: var(--header-height);
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: auto;
  }

  .arcade-view.is-active .scene-stage,
  .arcade-view.is-active .scene-frame {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    box-shadow: none;
  }

  .arcade-view.is-active .scene-toolbar {
    top: 14px;
  }

  :root:fullscreen .arcade-view.is-active {
    inset: 0;
    height: 100dvh;
  }

  /* Lift the standalone destination PNGs only in the normal desktop view. */
  :root:not(:fullscreen) .arcade-view.is-active .scene-nav--ticket,
  :root:not(:fullscreen) .arcade-view.is-active .scene-nav--karaoke {
    top: 68.5% !important;
  }
}


.fc-fullscreen-nav button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 46px;
  padding: 8px 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font: 800 0.72rem/1.1 "Nunito", sans-serif;
  letter-spacing: 0.035em;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.fc-fullscreen-nav button:hover,
.fc-fullscreen-nav button:focus-visible,
.fc-fullscreen-nav button[aria-current="page"] {
  color: #fff;
  background: linear-gradient(135deg, rgba(224, 45, 122, 0.94), rgba(46, 205, 211, 0.88));
  transform: translateY(-2px);
}

@media (max-width: 760px) {
  .fc-fullscreen-nav {
    width: calc(100% - 24px);
    min-width: 0;
    bottom: 12px;
    gap: 3px;
    padding: 6px;
  }

  .fc-fullscreen-nav button {
    min-height: 44px;
    padding: 6px 2px;
    font-size: 0.62rem;
    letter-spacing: 0;
  }
}

/* Final one-shell override: must remain after all legacy fullscreen rules. */
:root:fullscreen .app-header,
html.fc-editor-fullscreen-preview .app-header {
  display: none !important;
}

:root:fullscreen .mobile-dock,
html.fc-editor-fullscreen-preview .mobile-dock {
  display: grid !important;
}

:root:fullscreen .fcrektfullscreen-nav,
html.fc-editor-fullscreen-preview .fc-fullscreen-nav {
 display: none !important;
}
/* Keep the Arcade Room sound and fullscreen controls in one stable row. */
@media (min-width: 700px) {
  #view-arcade .fc-audio-button,
  #view-arcade .fc-fullscreen-button {
    position: fixed !important;
    top: 20px !important;
    bottom: auto !important;
    height: 42px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    transform: none !important;
    z-index: 40 !important;
  }

  #view-arcade .fc-fullscreen-button {
    left: auto !important;
    right: 24px !important;
    width: 104px !important;
  }

  #view-arcade .fc-audio-button {
    left: auto !important;
    right: 140px !important;
    width: 116px !important;
  }
}

/* Persistent account identity and wallet totals in the bottom navigation. */
.mobile-dock,
:root:fullscreen .mobile-dock {
  width: min(1080px, calc(100% - 16px));
  grid-template-columns: repeat(7, minmax(0, 1fr)) repeat(2, minmax(82px, .9fr));
}

.mobile-dock .dock-account-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  text-align: left;
}

.mobile-dock .dock-account-button .dock-player-icon {
  width: 34px;
  height: 34px;
  margin: 0;
  border: 2px solid rgba(255, 255, 255, .82);
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #ff5ea9, #7c5cff 52%, #3cdeef);
  box-shadow: 0 0 16px rgba(73, 222, 242, .2);
  font-size: .58rem;
}

.mobile-dock .dock-player-icon img,
.mobile-dock .dock-player-icon b {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: inherit;
}

.mobile-dock .dock-player-icon img {
  object-fit: cover;
}

.mobile-dock .dock-player-icon b {
  font: inherit;
}

.mobile-dock .dock-account-button small {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: .64rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-dock .dock-wallet-button {
  display: grid;
  grid-template-columns: 1fr;
  place-content: center;
  gap: 3px;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid rgba(83, 220, 255, .26);
  background: linear-gradient(145deg, rgba(38, 46, 99, .66), rgba(8, 10, 38, .8));
}

.mobile-dock .dock-wallet-button small {
  color: #aeb8dc;
  font-size: .55rem;
  font-weight: 1000;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.mobile-dock .dock-wallet-button strong {
  color: #61e8ff;
  font: 900 .9rem/1 "Bungee", sans-serif;
}

.mobile-dock .dock-wallet-button--tickets {
  border-color: rgba(255, 206, 91, .3);
}

.mobile-dock .dock-wallet-button--tickets strong {
  color: #ffd45e;
}

@media (max-width: 620px) {
  .mobile-dock,
  :root:fullscreen .mobile-dock {
    grid-template-columns: repeat(7, minmax(64px, 1fr)) repeat(2, minmax(78px, 1fr));
  }

  .mobile-dock .dock-account-button {
    grid-template-columns: 1fr;
    gap: 1px;
    text-align: center;
  }

  .mobile-dock .dock-account-button .dock-player-icon {
    width: 28px;
    height: 26px;
    margin-inline: auto;
  }

  .mobile-dock .dock-account-button small {
    font-size: .55rem;
  }
}
