/* Chrome 61 baseline + progressive enhancement layer */
:root {
  --cyan: #2cf2ff;
  --pink: #ff2e88;
  --flamingo: #ff75a0;
  --sunset-gold: #ffd470;
  --amber: #ff9838;
  --violet-deep: #0c0618;

  --font-title: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-script: "Snell Roundhand", "Savoye LET", "Brush Script MT", Georgia, serif;
  --font-arcade: "DIN Alternate", "Arial Black", "Helvetica Neue", monospace;
  --font-zh: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.cinema-vignette {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(
    ellipse 84% 76% at 50% 48%,
    rgba(0, 0, 0, 0) 58%,
    rgba(10, 4, 22, 0.44) 100%
  );
}

.modal-backdrop {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: 20px;
  padding-bottom: 20px;
  padding-top: calc(20px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
  padding-bottom: calc(20px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  background: rgba(10, 4, 22, 0.88);
  background: radial-gradient(circle at 50% 45%, rgba(24, 10, 44, 0.72), rgba(8, 3, 16, 0.92));
}

@supports ((-webkit-backdrop-filter: blur(12px)) or (backdrop-filter: blur(12px))) {
  .modal-backdrop {
    background: radial-gradient(circle at 50% 45%, rgba(24, 10, 44, 0.52), rgba(8, 3, 16, 0.84));
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}

/* ============================================================
   LOADING SCREEN
   ============================================================ */
.loading-sun {
  width: 88px;
  height: 88px;
  margin-bottom: 14px;
  -webkit-filter: drop-shadow(0 0 24px rgba(255, 110, 120, 0.55));
  filter: drop-shadow(0 0 24px rgba(255, 110, 120, 0.55));
  animation: floatSlow 3.2s ease-in-out infinite;
}

.loading-sun svg {
  width: 100%;
  height: 100%;
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.progress-fill {
  transition: width 0.22s ease;
  box-shadow: 0 0 14px rgba(255, 120, 160, 0.65);
}

/* ============================================================
   START SHOWROOM
   ============================================================ */
.start-showroom {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 24px 18px;
  padding-top: calc(18px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
  padding-bottom: calc(16px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  background: linear-gradient(
    180deg,
    rgba(10, 4, 22, 0.62) 0%,
    rgba(10, 4, 22, 0.18) 20%,
    rgba(10, 4, 22, 0) 36%,
    rgba(10, 4, 22, 0) 64%,
    rgba(10, 4, 22, 0.52) 82%,
    rgba(10, 4, 22, 0.86) 100%
  );
  animation: fadeInUI 0.45s ease-out;
}

@keyframes fadeInUI {
  from { opacity: 0; }
  to { opacity: 1; }
}

.menu-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  z-index: 2;
}

.title-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding-top: 2px;
}

.title-kicker {
  font-family: var(--font-arcade);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 3.5px;
  color: var(--cyan);
  text-shadow: 0 2px 8px rgba(8, 3, 22, 0.85), 0 0 14px rgba(44, 242, 255, 0.72);
  margin-bottom: 4px;
  padding-left: 2px;
}

.vice-logo {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-weight: 900;
  line-height: 1;
}

.logo-zh {
  font-family: var(--font-title);
  font-size: 52px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.04em;
  line-height: 1.06;
  padding-right: 10px;
  color: #ffe38e;
  background: linear-gradient(180deg, #fffef6 10%, #ffe38e 48%, #ff9352 84%, #ff5a7e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-filter: drop-shadow(3px 5px 0px rgba(24, 6, 42, 0.92));
  filter: drop-shadow(3px 5px 0px rgba(24, 6, 42, 0.92));
}

.logo-zh-rush {
  display: inline-block;
  margin-left: 4px;
  font-size: 1.06em;
  color: #2cf2ff;
  background: linear-gradient(180deg, #ffffff 12%, #9bf8ff 52%, #1ce8ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-script {
  font-family: var(--font-script);
  font-size: 32px;
  font-style: italic;
  line-height: 1;
  color: #fff2f8;
  margin-top: -8px;
  margin-left: 26px;
  transform: rotate(-5deg);
  transform-origin: left center;
  text-shadow:
    0 3px 6px rgba(14, 3, 28, 0.9),
    0 0 10px rgba(255, 125, 185, 0.95),
    0 0 22px rgba(255, 36, 132, 0.9);
}

.neon-flicker {
  display: inline-block;
  animation: hkNeonFlicker 6.5s infinite;
}

@keyframes hkNeonFlicker {
  0%, 19%, 21%, 63%, 65%, 100% { opacity: 1; }
  20% { opacity: 0.52; }
  64% { opacity: 0.72; }
}

.menu-top-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.menu-top-right > * + * {
  margin-left: 10px;
}

.supports-flex-gap .menu-top-right {
  column-gap: 10px;
}

.supports-flex-gap .menu-top-right > * + * {
  margin-left: 0;
}

.best-float {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.8);
}

.best-float-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--sunset-gold);
}

.best-float-val {
  font-family: var(--font-arcade);
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  text-shadow: 0 0 12px rgba(44, 242, 255, 0.45), 0 3px 10px rgba(0, 0, 0, 0.85);
}

.showroom-spacer {
  flex: 1;
  min-height: 0;
  pointer-events: none;
}

/* Bottom Dock */
.menu-dock {
  display: flex;
  flex-direction: column;
  z-index: 2;
}

.menu-dock > * + * {
  margin-top: 12px;
}

.supports-flex-gap .menu-dock {
  row-gap: 12px;
}

.supports-flex-gap .menu-dock > * + * {
  margin-top: 0;
}

.dock-main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.avatar-grid {
  display: flex;
  align-items: flex-end;
}

.avatar-grid > * + * {
  margin-left: 12px;
}

.supports-flex-gap .avatar-grid {
  column-gap: 12px;
}

.supports-flex-gap .avatar-grid > * + * {
  margin-left: 0;
}

.avatar-card {
  position: relative;
  width: 112px;
  height: 112px;
  border: none;
  border-radius: 20px;
  overflow: hidden;
  padding: 0;
  background: #140a24;
  cursor: pointer;
  opacity: 0.78;
  transform: scale(0.94);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
  transition: transform 0.24s ease, opacity 0.2s ease, box-shadow 0.24s ease;
}

.avatar-card:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.avatar-card.selected {
  opacity: 1;
  transform: scale(1.05) translateY(-6px);
}

.avatar-card[data-accent="sunset"].selected {
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.62),
    0 0 0 2.5px rgba(255, 212, 112, 0.92),
    0 0 24px rgba(255, 152, 56, 0.55);
}

.avatar-card[data-accent="coral"].selected {
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.62),
    0 0 0 2.5px rgba(255, 117, 160, 0.95),
    0 0 24px rgba(255, 46, 136, 0.58);
}

.avatar-card[data-accent="aqua"].selected {
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.62),
    0 0 0 2.5px rgba(44, 242, 255, 0.95),
    0 0 24px rgba(44, 242, 255, 0.52);
}

.avatar-art {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.avatar-tag {
  display: none;
}

.avatar-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 6px 7px;
  background: linear-gradient(180deg, rgba(12, 5, 24, 0) 0%, rgba(12, 5, 24, 0.9) 74%);
  text-align: center;
  pointer-events: none;
}

.avatar-name {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
}

.avatar-skill {
  font-size: 10px;
  font-weight: 700;
  color: var(--sunset-gold);
  margin-top: 2px;
}

.cta-section {
  flex-shrink: 0;
}

.launch-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 208px;
  height: 62px;
  padding: 0 30px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #160724;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(255, 46, 136, 0.45), 0 0 22px rgba(255, 180, 90, 0.3);
  transition: transform 0.16s ease;
}

.launch-btn:focus {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.launch-btn:active {
  transform: translateY(1px) scale(0.97);
}

.launch-btn-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  background: linear-gradient(125deg, #ffe58f 0%, #ff9d3b 42%, #ff2e88 95%);
}

.launch-btn-content {
  position: relative;
  z-index: 1;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #160724;
}

.launch-btn-content > * + * {
  margin-left: 8px;
}

.controls-strip {
  display: flex;
  justify-content: center;
}

.controls-desktop {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.56);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.controls-mobile {
  display: none;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.64);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 8, 34, 0.78);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
  transition: background 0.16s ease, transform 0.12s ease;
}

@supports ((-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px))) {
  .icon-btn {
    background: rgba(16, 8, 34, 0.5);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}

.icon-btn:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.icon-btn:active {
  transform: scale(0.93);
}

.rank-icon-btn {
  color: var(--sunset-gold);
}

.icon-svg {
  width: 19px;
  height: 19px;
}

.icon-btn.muted {
  color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 46, 136, 0.28);
}

.primary-btn {
  width: 100%;
  padding: 14px 22px;
  border: none;
  border-radius: 999px;
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #160724;
  background: linear-gradient(125deg, #ffe58f 0%, #ff9d3b 42%, #ff2e88 100%);
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(255, 46, 136, 0.38);
}

.primary-btn:active {
  transform: scale(0.97);
}

.secondary-btn {
  width: 100%;
  padding: 12px 18px;
  margin-top: 10px;
  border: none;
  border-radius: 999px;
  font-family: var(--font-zh);
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.secondary-btn:active {
  opacity: 0.78;
}

.rank-cta-btn {
  color: var(--sunset-gold);
  background: rgba(255, 212, 112, 0.16);
}

/* ============================================================
   IN-GAME HUD
   ============================================================ */
#hud {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  z-index: 10;
  padding: 18px 18px 18px;
  padding-top: calc(16px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
  padding-bottom: calc(16px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hud-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.hud-metrics {
  display: flex;
}

.hud-metrics > * + * {
  margin-left: 20px;
}

.hud-stat {
  display: flex;
  flex-direction: column;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.85);
}

.hud-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.72);
}

.hud-value {
  font-family: var(--font-arcade);
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  text-shadow: 0 0 12px rgba(44, 242, 255, 0.4), 0 3px 12px rgba(0, 0, 0, 0.85);
}

.coin-val {
  color: var(--sunset-gold);
}

.hud-actions {
  display: flex;
  pointer-events: auto;
}

.hud-actions > * + * {
  margin-left: 10px;
}

.hud-bars {
  position: absolute;
  top: 74px;
  top: calc(70px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
  left: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.nitro-wrap {
  width: 100%;
  max-width: 240px;
  display: flex;
  align-items: center;
  background: rgba(14, 7, 30, 0.72);
  border-radius: 999px;
  padding: 5px 12px;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
}

@supports ((-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px))) {
  .nitro-wrap {
    background: rgba(14, 7, 30, 0.5);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}

.nitro-wrap > * + * {
  margin-left: 10px;
}

.nitro-label {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-arcade);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--cyan);
}

.nitro-label > * + * {
  margin-left: 4px;
}

.nitro-track {
  flex: 1;
  min-width: 0;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.nitro-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--sunset-gold), var(--pink));
  transition: width 0.08s linear;
}

.nitro-fill.is-fever {
  background: linear-gradient(90deg, var(--pink), var(--amber));
  box-shadow: 0 0 12px rgba(255, 46, 136, 0.85);
}

.nitro-fab-wrap {
  position: absolute;
  right: 25%;
  bottom: 25%;
  transform: translate(50%, 50%);
  z-index: 6;
  pointer-events: none;
}

.nitro-fab {
  position: relative;
  width: 68px;
  height: 68px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(14, 7, 30, 0.68);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42);
  transition: opacity 0.18s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.nitro-fab:disabled {
  pointer-events: none;
  opacity: 0.58;
  cursor: default;
}

.nitro-fab:not(:disabled) {
  opacity: 1;
  background: radial-gradient(circle at 32% 28%, rgba(255, 46, 136, 0.92), rgba(255, 130, 42, 0.88));
  box-shadow: 0 0 24px rgba(255, 46, 136, 0.82), 0 8px 20px rgba(0, 0, 0, 0.45);
  animation: pulse 0.85s infinite alternate;
}

.nitro-fab.is-fever {
  opacity: 0.92;
  background: rgba(255, 46, 136, 0.34);
  box-shadow: 0 0 20px rgba(255, 46, 136, 0.6);
}

.nitro-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}

.nitro-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 4;
}

.nitro-ring-fill {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-dasharray: 188.5;
  stroke-dashoffset: 188.5;
  transition: stroke-dashoffset 0.08s linear, stroke 0.18s ease;
}

.nitro-fab:not(:disabled) .nitro-ring-fill {
  stroke: #fff3b0;
}

.nitro-fab.is-fever .nitro-ring-fill {
  stroke: var(--pink);
}

.nitro-fab-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
  pointer-events: none;
}

.nitro-fab-icon {
  color: var(--cyan);
  margin-bottom: 1px;
}

.nitro-fab:not(:disabled) .nitro-fab-icon,
.nitro-fab.is-fever .nitro-fab-icon {
  color: #ffffff;
}

.nitro-fab-text {
  font-family: var(--font-zh);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

.status-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

.pill {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  margin: 0 4px 4px;
  border-radius: 999px;
}

.shield-pill {
  background: rgba(44, 242, 255, 0.28);
  color: var(--cyan);
}

.magnet-pill {
  background: rgba(255, 209, 102, 0.28);
  color: #ffe082;
}

.boost-pill {
  background: rgba(255, 42, 133, 0.32);
  color: #ff9ec7;
}

.danger-pill {
  background: rgba(255, 42, 85, 0.5);
  color: #ffdce3;
  animation: pulse 0.45s infinite alternate;
}

.fever-pill {
  background: linear-gradient(90deg, rgba(255, 46, 136, 0.92), rgba(255, 152, 56, 0.92));
  color: #ffffff;
}

.quality-pill {
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.85);
}

.callout {
  position: absolute;
  top: 29%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: 90vw;
  font-family: var(--font-title);
  font-size: clamp(20px, 5.6vw, 28px);
  font-weight: 900;
  line-height: 1.32;
  letter-spacing: 1.5px;
  text-align: center;
  text-shadow: 0 4px 18px rgba(12, 3, 24, 0.92), 0 0 24px var(--pink);
  pointer-events: none;
  animation: popIn 0.24s ease-out;
  white-space: pre-line;
  word-break: keep-all;
}

@keyframes popIn {
  from { opacity: 0; transform: translate(-50%, -26%) scale(0.74); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

#game-canvas {
  touch-action: none;
}

.over-masthead {
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--pink);
  text-shadow: 0 0 12px rgba(255, 46, 136, 0.55);
  margin-bottom: 12px;
}

/* ============================================================
   MODALS: PAUSE, GAME OVER, LEADERBOARD
   ============================================================ */
.velvet-card {
  width: 100%;
  max-width: 400px;
  background: #170b2c;
  background: linear-gradient(165deg, rgba(28, 14, 52, 0.96), rgba(13, 7, 26, 0.98));
  border-radius: 26px;
  padding: 26px 22px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.68), 0 0 42px rgba(255, 46, 136, 0.18);
  text-align: center;
}

.small-card {
  max-width: 330px;
}

.card-kicker {
  font-family: var(--font-arcade);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 3.5px;
  color: var(--cyan);
  margin-bottom: 6px;
}

.card-heading {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 20px;
}

/* ============================================================
   GAME OVER BORDERLESS CINEMA RESULT SCREEN (Zero Wireframes)
   ============================================================ */
.over-cinema {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: 28px 24px 26px;
  padding-top: calc(28px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
  padding-bottom: calc(26px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 46, 136, 0.24), transparent 58%),
    linear-gradient(180deg, rgba(10, 4, 22, 0.88) 0%, rgba(16, 7, 32, 0.72) 48%, rgba(8, 3, 18, 0.94) 100%);
  animation: fadeInUI 0.32s ease-out;
}

@supports ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
  .over-cinema {
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
}

.over-top-band {
  width: 100%;
  max-width: 380px;
}

.over-masthead {
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--pink);
  text-shadow: 0 0 14px rgba(255, 46, 136, 0.75);
  margin-bottom: 6px;
}

.over-headline {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.5px;
  line-height: 1.2;
  color: #ffffff;
  margin-bottom: 8px;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.over-reason {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 220, 232, 0.86);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  line-height: 1.4;
}

.over-center-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 380px;
}

.over-hero-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.over-avatar-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #ffe58f, #ff2e88, #2cf2ff);
  box-shadow: 0 12px 34px rgba(255, 46, 136, 0.5);
}

.over-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #140a24;
}

.over-stamp {
  position: absolute;
  right: -26px;
  bottom: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-family: var(--font-arcade);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #ffffff;
  background: linear-gradient(125deg, #ff2e88, #ff7a3d);
  box-shadow: 0 4px 12px rgba(255, 46, 136, 0.55);
  transform: rotate(-8deg);
}

.over-stamp.is-best {
  color: #160724;
  background: linear-gradient(125deg, #ffe58f, #2cf2ff);
  box-shadow: 0 4px 14px rgba(44, 242, 255, 0.55);
}

.over-score-big {
  font-family: var(--font-arcade);
  font-size: 62px;
  font-weight: 900;
  line-height: 1.02;
  font-variant-numeric: tabular-nums;
  color: #ffe58f;
  background: linear-gradient(180deg, #ffffff 8%, #ffe58f 54%, #ff8648 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-filter: drop-shadow(0 6px 20px rgba(255, 130, 60, 0.45));
  filter: drop-shadow(0 6px 20px rgba(255, 130, 60, 0.45));
  margin-bottom: 8px;
}

.over-new-best {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(44, 242, 255, 0.7);
}

.over-inline-stats {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
}

.over-inline-item strong {
  font-family: var(--font-arcade);
  font-size: 17px;
  font-weight: 800;
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

.over-inline-sep {
  margin: 0 12px;
  color: rgba(255, 255, 255, 0.32);
}

.best-v {
  color: var(--cyan);
}

.over-rank-line {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 800;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(44, 242, 255, 0.5), 0 2px 8px rgba(0, 0, 0, 0.85);
}

.over-bottom-dock {
  width: 100%;
  max-width: 340px;
}

.over-replay-btn {
  width: 100%;
  min-width: 0;
  height: 58px;
}

.over-replay-content {
  font-size: 20px;
}

.over-secondary-row {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.over-secondary-row > * + * {
  margin-left: 12px;
}

.supports-flex-gap .over-secondary-row {
  column-gap: 12px;
}

.supports-flex-gap .over-secondary-row > * + * {
  margin-left: 0;
}

.over-ghost-btn {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--font-zh);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.over-ghost-btn:active {
  opacity: 0.72;
}

.over-rank-btn {
  color: var(--sunset-gold);
  background: rgba(255, 212, 112, 0.16);
}

/* ============================================================
   LEADERBOARD MODAL (3.16 排行榜)
   ============================================================ */
.lb-card {
  max-width: 420px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  padding: 20px 18px 18px;
  text-align: left;
}

.lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.lb-title-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lb-heading {
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.15;
}

.lb-close-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.lb-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 12px;
}

.lb-tab {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 7px 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.lb-tab.active {
  background: linear-gradient(125deg, #ffe58f 0%, #ff9d3b 50%, #ff2e88 100%);
  color: #160724;
}

.lb-my-rank {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(44, 242, 255, 0.12);
  border: 1px solid rgba(44, 242, 255, 0.28);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.lb-my-label {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.78);
}

.lb-my-val {
  font-size: 13px;
  font-weight: 800;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}

.scroll-container {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.lb-scroll {
  flex: 1;
  min-height: 180px;
  max-height: 46vh;
  padding-right: 2px;
}

.lb-status {
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  padding: 28px 12px;
  line-height: 1.6;
}

.lb-list {
  list-style: none;
}

.lb-row {
  display: flex;
  align-items: center;
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: 8px;
}

.lb-row.top-1 {
  background: linear-gradient(90deg, rgba(255, 212, 112, 0.22), rgba(255, 152, 56, 0.08));
}

.lb-row.top-2 {
  background: linear-gradient(90deg, rgba(196, 224, 255, 0.18), rgba(44, 242, 255, 0.06));
}

.lb-row.top-3 {
  background: linear-gradient(90deg, rgba(255, 138, 101, 0.2), rgba(255, 46, 136, 0.06));
}

.lb-rank-num {
  width: 30px;
  flex-shrink: 0;
  text-align: center;
  font-family: var(--font-arcade);
  font-size: 15px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.65);
}

.lb-row.top-1 .lb-rank-num { color: #ffd470; font-size: 17px; }
.lb-row.top-2 .lb-rank-num { color: #d6e9ff; font-size: 16px; }
.lb-row.top-3 .lb-rank-num { color: #ffab76; font-size: 16px; }

/* Neon Monogram Avatar Badge (3.16 API returns nickname only) */
.lb-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: 6px;
  margin-right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.lb-avatar.crown-1 { box-shadow: 0 0 0 2px #ffd470, 0 0 12px rgba(255, 212, 112, 0.6); }
.lb-avatar.crown-2 { box-shadow: 0 0 0 2px #d6e9ff, 0 0 10px rgba(214, 233, 255, 0.5); }
.lb-avatar.crown-3 { box-shadow: 0 0 0 2px #ff9e64, 0 0 10px rgba(255, 158, 100, 0.5); }

.lb-avatar-g0 { background: linear-gradient(135deg, #ff2e88, #ff9838); }
.lb-avatar-g1 { background: linear-gradient(135deg, #2cf2ff, #4f5bff); }
.lb-avatar-g2 { background: linear-gradient(135deg, #a855f7, #ec4899); }
.lb-avatar-g3 { background: linear-gradient(135deg, #10b981, #06b6d4); }
.lb-avatar-g4 { background: linear-gradient(135deg, #f59e0b, #ef4444); }

.lb-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-score {
  flex-shrink: 0;
  margin-left: 8px;
  font-family: var(--font-arcade);
  font-size: 15px;
  font-weight: 800;
  color: var(--sunset-gold);
  font-variant-numeric: tabular-nums;
}

.lb-more-btn,
.lb-retry-btn {
  margin-top: 6px;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */
@media (max-width: 760px) {
  .start-showroom {
    padding: 16px 16px 14px;
    padding-top: calc(14px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
    padding-bottom: calc(14px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  }

  .logo-zh {
    font-size: 46px;
    line-height: 1.05;
    padding-right: 6px;
  }

  .logo-zh-rush {
    font-size: 1.1em;
    margin-left: 2px;
  }

  .logo-script {
    font-size: 28px;
    margin-top: -6px;
    margin-left: 10px;
  }

  .title-kicker {
    font-size: 11px;
    letter-spacing: 3px;
  }

  .menu-top-right > * + * {
    margin-left: 6px;
  }

  .supports-flex-gap .menu-top-right {
    column-gap: 6px;
  }

  .menu-top-right .icon-btn {
    width: 36px;
    height: 36px;
  }

  .dock-main {
    flex-direction: column;
    align-items: center;
  }

  .dock-main > * + * {
    margin-top: 12px;
  }

  .avatar-grid {
    width: 100%;
    justify-content: center;
  }

  .avatar-grid > * + * {
    margin-left: 8px;
  }

  .supports-flex-gap .avatar-grid {
    column-gap: 8px;
  }

  .avatar-card {
    width: 96px;
    height: 96px;
    border-radius: 16px;
  }

  .cta-section {
    width: 100%;
    max-width: 340px;
  }

  .launch-btn {
    width: 100%;
    height: 54px;
  }

  .launch-btn-content {
    font-size: 19px;
  }

  .controls-desktop {
    display: none;
  }

  .controls-mobile {
    display: block;
  }

  .best-float-val {
    font-size: 17px;
  }
}

@media (hover: hover) {
  .avatar-card:hover {
    opacity: 0.96;
    transform: scale(0.99) translateY(-4px);
  }
  .launch-btn:hover {
    transform: translateY(-2px) scale(1.02);
  }
  .icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
  }
}


/* ============================================================
   MAP SWITCHER & SECRET CODE UNLOCK MODAL (MIAMI COAST)
   ============================================================ */
.map-switcher {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-bottom: 10px;
}

.map-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(18, 9, 36, 0.62);
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.map-pill:active {
  transform: scale(0.97);
}

.map-pill-title {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.map-pill-sub {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.78;
  margin-top: 2px;
}

.map-pill.active {
  color: #ffffff;
  border-color: rgba(44, 242, 255, 0.85);
  background: linear-gradient(135deg, rgba(44, 242, 255, 0.26), rgba(255, 46, 136, 0.22));
  box-shadow: 0 0 18px rgba(44, 242, 255, 0.28);
}

.map-pill.active[data-map="miami"] {
  border-color: rgba(255, 94, 168, 0.92);
  background: linear-gradient(135deg, rgba(255, 46, 136, 0.34), rgba(44, 242, 255, 0.28));
  box-shadow: 0 0 20px rgba(255, 46, 136, 0.36);
}

.map-pill.locked {
  border-style: dashed;
  border-color: rgba(255, 212, 112, 0.48);
  color: rgba(255, 232, 185, 0.88);
}

.map-pill.locked .map-pill-sub {
  color: #ffd470;
  opacity: 0.95;
}

.code-desc {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 236, 246, 0.86);
  margin-bottom: 14px;
}

.code-desc strong {
  color: #2cf2ff;
}

.code-input-wrap {
  margin-bottom: 10px;
}

.code-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(44, 242, 255, 0.45);
  background: rgba(10, 5, 22, 0.78);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 1.5px;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}

.code-input:focus {
  border-color: #ff4fa3;
  box-shadow: 0 0 16px rgba(255, 79, 163, 0.35);
}

.code-msg {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #ff85a2;
}

.code-msg.ok {
  color: #52ffa8;
}
