* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0e1a;
  font-family: "Microsoft JhengHei", "Segoe UI", system-ui, sans-serif;
  color: #f0f6ff;
}

#glCanvas, #hudCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

#hudCanvas {
  pointer-events: none;
}

/* Static Zero-GPU Menu Background (replaces live 60 FPS WebGL flyover in menu/lobby!) */
.menu-static-bg {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background-color: #161436;
  background-size: cover;
  background-position: center;
  transition: background 0.35s ease;
}

.menu-static-bg[data-track-bg="0"] {
  background:
    radial-gradient(circle at 72% 62%, rgba(255, 206, 118, 0.55) 0%, rgba(255, 142, 92, 0.25) 26%, transparent 56%),
    linear-gradient(180deg, #142f68 0%, #4b5d94 42%, #e69766 72%, #114375 72.5%, #0a2548 100%);
}

.menu-static-bg[data-track-bg="1"] {
  background:
    radial-gradient(circle at 26% 24%, rgba(255, 245, 232, 0.55) 0%, transparent 40%),
    linear-gradient(180deg, #2468bf 0%, #7eb8f2 48%, #f8dce8 74%, #355e3b 74.5%, #1d3824 100%);
}

.menu-static-bg[data-track-bg="2"] {
  background:
    radial-gradient(circle at 76% 28%, rgba(255, 224, 128, 0.58) 0%, transparent 42%),
    linear-gradient(180deg, #245a9e 0%, #a58f82 46%, #f0a465 73%, #9e4c28 73.5%, #5c2714 100%);
}

.menu-static-bg[data-track-bg="3"] {
  background:
    radial-gradient(circle at 22% 22%, rgba(0, 240, 255, 0.22) 0%, transparent 42%),
    radial-gradient(circle at 78% 28%, rgba(255, 68, 204, 0.22) 0%, transparent 44%),
    linear-gradient(180deg, #06081a 0%, #141940 50%, #3a1c64 74%, #0b1024 74.5%, #050814 100%);
}

.menu-static-bg[data-track-bg="4"] {
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 150, 220, 0.36) 0%, transparent 48%),
    radial-gradient(circle at 78% 26%, rgba(120, 232, 255, 0.28) 0%, transparent 44%),
    linear-gradient(180deg, #261b66 0%, #7f57b8 48%, #f5b2d8 74%, #26194f 74.5%, #140e30 100%);
}

.menu-static-bg[data-track-bg="5"] {
  background:
    radial-gradient(circle at 24% 20%, rgba(255, 248, 198, 0.75) 0%, rgba(255, 224, 128, 0.28) 24%, transparent 50%),
    linear-gradient(180deg, #1e80e8 0%, #76c6fc 48%, #f4f8ff 73%, #52aa56 73.5%, #2f7a38 100%);
}

.menu-static-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.92;
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: cover;
  /* Crisp static SVG silhouette of Taipei 101 + Rollercoaster Loops + Ferris Wheel! */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 900' preserveAspectRatio='xMidYMax slice'%3E%3Cg fill='rgba(12,16,38,0.52)'%3E%3Cpath d='M0 720 Q220 560 440 690 T880 650 T1320 690 T1600 620 L1600 900 L0 900 Z'/%3E%3Cpath d='M1180 660 L1188 470 L1176 470 L1188 415 L1176 415 L1188 360 L1176 360 L1188 305 L1176 305 L1194 250 L1200 140 L1206 250 L1224 305 L1212 305 L1224 360 L1212 360 L1224 415 L1212 415 L1224 470 L1212 470 L1220 660 Z'/%3E%3Crect x='1090' y='520' width='48' height='150'/%3E%3Crect x='1250' y='490' width='56' height='180'/%3E%3Crect x='1325' y='550' width='42' height='120'/%3E%3C/g%3E%3Cg fill='none' stroke='rgba(255,195,240,0.28)' stroke-width='5'%3E%3Cpath d='M-20 680 Q180 510 340 650 Q480 760 640 540 Q760 390 880 570 Q1000 720 1200 590 T1620 640'/%3E%3Ccircle cx='390' cy='530' r='82'/%3E%3Ccircle cx='1410' cy='520' r='96' stroke-dasharray='12 10'/%3E%3C/g%3E%3C/svg%3E");
}

.hidden {
  display: none !important;
}

.overlay-center {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 18px;
}

.glass-card {
  position: relative;
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 160, 225, 0.22), transparent 44%),
    radial-gradient(circle at 86% 18%, rgba(135, 220, 255, 0.20), transparent 46%),
    radial-gradient(circle at 50% 95%, rgba(190, 145, 255, 0.22), transparent 52%),
    linear-gradient(155deg, rgba(30, 18, 58, 0.90), rgba(40, 22, 74, 0.92) 50%, rgba(22, 28, 66, 0.92));
  border: 1.5px solid rgba(255, 190, 240, 0.55);
  border-radius: 22px;
  box-shadow:
    0 22px 60px rgba(24, 10, 52, 0.62),
    0 0 32px rgba(210, 140, 255, 0.24),
    inset 0 1px 0 rgba(255, 240, 255, 0.28);
  padding: 24px 28px;
}

.menu-card {
  width: min(1020px, 96vw);
  max-height: 95vh;
  overflow-y: auto;
}

.title-block {
  text-align: center;
  margin-bottom: 16px;
}

.title-block h1 {
  font-size: 34px;
  letter-spacing: 3px;
  background: linear-gradient(90deg, #9cf4ff, #ffb3e6, #d8b4fe, #ffe49e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 16px rgba(244, 140, 255, 0.42));
}

.subtitle {
  font-size: 15px;
  color: #ffd4f0;
  letter-spacing: 4px;
  margin-top: 2px;
  text-shadow: 0 0 12px rgba(255, 165, 230, 0.45);
}

.career-bar {
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: #cfe4ff;
  display: inline-block;
}

.track-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.track-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(46, 28, 78, 0.56), rgba(32, 34, 74, 0.62));
  border: 1.5px solid rgba(220, 175, 255, 0.28);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.track-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 175, 235, 0.78);
  box-shadow: 0 0 18px rgba(244, 150, 255, 0.22);
}

.track-card.selected {
  background: linear-gradient(135deg, rgba(118, 52, 156, 0.62), rgba(56, 98, 168, 0.68));
  border-color: #f9a8d4;
  box-shadow: 0 0 22px rgba(249, 168, 212, 0.34), inset 0 1px 0 rgba(255, 240, 255, 0.22);
}

.track-bar {
  width: 6px;
  height: 44px;
  border-radius: 4px;
  flex-shrink: 0;
}

.track-info {
  flex: 1;
}

.track-name {
  font-size: 17px;
  font-weight: 700;
}

.track-desc {
  font-size: 13px;
  color: #b4d2ee;
  margin-top: 2px;
}

.track-meta {
  text-align: right;
  flex-shrink: 0;
}

.track-diff {
  font-size: 13px;
  color: #ffd859;
  font-weight: 600;
}

.track-best {
  font-size: 12px;
  color: #8ee4ff;
  margin-top: 3px;
}

.menu-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, #ff7ac6, #a78bfa, #5eead4);
  box-shadow: 0 6px 22px rgba(232, 121, 249, 0.36);
}

.btn-resume {
  background: linear-gradient(135deg, #5eead4, #7dd3fc);
  color: #1c1535;
  box-shadow: 0 6px 20px rgba(94, 234, 212, 0.34);
}

.btn-accent {
  background: linear-gradient(135deg, #f472b6, #fb923c, #fcd34d);
  box-shadow: 0 6px 20px rgba(244, 114, 182, 0.32);
}

.btn-mp {
  background: linear-gradient(135deg, #a78bfa, #60a5fa, #67e8f9);
  box-shadow: 0 6px 20px rgba(167, 139, 250, 0.34);
}

.btn-ghost {
  background: rgba(255, 225, 250, 0.12);
  border: 1px solid rgba(255, 200, 245, 0.32);
}

.controls-footer {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: #a8c4e0;
}

/* 3D GARAGE DOCK */
.garage-dock {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 24px;
}

.garage-drag-hint {
  position: fixed;
  bottom: 24px;
  left: 28px;
  background: rgba(10, 16, 32, 0.72);
  border: 1px solid rgba(90, 220, 255, 0.35);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  color: #cde8ff;
}

.garage-panel {
  pointer-events: auto;
  width: min(360px, 92vw);
}

.garage-panel h2 {
  font-size: 21px;
  color: #42f0ff;
}

.garage-sub {
  font-size: 12px;
  color: #9ec0df;
  margin: 4px 0 14px;
}

.form-group {
  margin-bottom: 13px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: #cde2f7;
  margin-bottom: 6px;
}

input[type="text"] {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(120, 185, 240, 0.35);
  background: rgba(8, 12, 26, 0.75);
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

input[type="text"]:focus {
  border-color: #38e8ff;
}

input[type="range"] {
  width: 100%;
  accent-color: #38e8ff;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.color-item {
  background: rgba(8, 14, 30, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  padding: 8px;
  text-align: center;
}

.color-item label {
  display: block;
  font-size: 11px;
  color: #b8d2ea;
  margin-bottom: 6px;
}

.color-item input[type="color"] {
  width: 100%;
  height: 36px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
}

.preset-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: transform 0.12s ease;
}

.preset-swatch:hover {
  transform: scale(1.16);
}

/* MULTIPLAYER LOBBY */
.mp-card {
  width: min(600px, 95vw);
}

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

.status-badge {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 160, 40, 0.22);
  border: 1px solid rgba(255, 180, 60, 0.55);
  color: #ffd37a;
}

.status-badge.online {
  background: rgba(20, 210, 130, 0.22);
  border-color: rgba(40, 240, 160, 0.6);
  color: #6effc8;
}

.mp-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mp-box {
  background: rgba(8, 14, 30, 0.62);
  border: 1px solid rgba(120, 180, 235, 0.22);
  border-radius: 14px;
  padding: 14px;
}

.mp-box h3 {
  font-size: 15px;
  margin-bottom: 6px;
  color: #5cf2ff;
}

.mp-box p {
  font-size: 12px;
  color: #a6c4e0;
  margin-bottom: 12px;
  line-height: 1.45;
}

.room-code-banner {
  text-align: center;
  font-size: 16px;
  background: rgba(0, 200, 255, 0.15);
  border: 1px solid rgba(56, 232, 255, 0.5);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 12px;
}

.room-code-banner span {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 6px;
  color: #ffd859;
  margin-left: 8px;
}

.mp-player-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.mp-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(12, 20, 42, 0.72);
}

.car-swatch {
  width: 24px;
  height: 16px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.mp-pname {
  flex: 1;
  font-weight: 600;
}

.mp-role {
  font-size: 12px;
  color: #8ee8ff;
}

.wait-hint {
  text-align: center;
  margin-top: 10px;
  color: #ffd56b;
  font-size: 13px;
}

/* IN-GAME HUD */
.glass-mini {
  background: rgba(8, 14, 30, 0.84);
  border: 1.5px solid rgba(64, 215, 255, 0.45);
  border-radius: 14px;
  padding: 12px 16px;
}

.hud-topleft {
  position: fixed;
  top: 18px;
  left: 18px;
  min-width: 245px;
  z-index: 10;
}

.hud-rank-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.hud-rank {
  font-size: 24px;
  font-weight: 800;
  color: #ffd84c;
}

.hud-sub {
  font-size: 13px;
  color: #b0c8e2;
}

.hud-fps {
  margin-left: auto;
  font-size: 12px;
  color: #6effb8;
  font-family: Consolas, monospace;
}

.hud-stat-line {
  font-size: 15px;
  margin-top: 3px;
  color: #d8ebff;
}

.hud-rings {
  float: right;
  color: #ffd859;
  font-weight: 700;
}

.hud-bottomright {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 255px;
  z-index: 10;
}

.hud-speed-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.hud-speed {
  font-family: Consolas, monospace;
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.hud-unit {
  font-size: 13px;
  color: #9ec8ea;
}

.hud-gear-col {
  margin-left: auto;
  text-align: right;
}

.hud-gear {
  font-size: 22px;
  font-weight: 800;
  color: #38f0ff;
  line-height: 1;
}

.hud-gforce {
  font-size: 14px;
  font-weight: 700;
  color: #ff7ac8;
  margin-top: 2px;
}

.hud-nitro-label {
  font-size: 11px;
  color: #b8d8f5;
  margin-top: 8px;
  margin-bottom: 4px;
}

.hud-nitro-track {
  height: 14px;
  border-radius: 7px;
  background: rgba(15, 24, 46, 0.9);
  border: 1px solid rgba(140, 220, 255, 0.5);
  overflow: hidden;
}

.hud-nitro-fill {
  height: 100%;
  background: linear-gradient(90deg, #0095ff, #38f8d8);
  transition: width 0.06s linear;
}

.hud-nitro-fill.boosting {
  background: linear-gradient(90deg, #ff4cc8, #ffe04c);
}

.hud-bottomleft {
  position: fixed;
  left: 18px;
  bottom: 18px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(8, 14, 28, 0.62);
  font-size: 12px;
  color: #c2daf2;
  z-index: 10;
}

.center-banner {
  position: fixed;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 30px;
  border-radius: 999px;
  background: rgba(8, 12, 28, 0.78);
  border: 2px solid #38f0ff;
  font-size: 26px;
  font-weight: 800;
  z-index: 15;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.modal-card {
  width: min(440px, 92vw);
  text-align: center;
}

.modal-card h2 {
  font-size: 28px;
  color: #ffd859;
  margin-bottom: 8px;
}

.fin-track {
  color: #a6d0f5;
  margin-bottom: 14px;
}

.fin-stats {
  background: rgba(8, 12, 28, 0.65);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fin-stats div {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
}

.fin-stats b {
  color: #38f0ff;
}

.toast {
  position: fixed;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12, 20, 42, 0.92);
  border: 1px solid #38e8ff;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  z-index: 40;
}

/* ROOM CHAT & IN-RACE CHAT */
.chat-box {
  margin-top: 12px;
  background: rgba(6, 11, 24, 0.72);
  border: 1px solid rgba(100, 185, 245, 0.28);
  border-radius: 12px;
  padding: 10px;
}

.chat-log {
  height: 135px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 4px;
  margin-bottom: 8px;
  font-size: 13px;
}

.chat-msg {
  line-height: 1.4;
  word-break: break-word;
}

.chat-msg.sys {
  color: #ffd859;
  font-size: 12px;
}

.chat-ts {
  color: #7c98b6;
  font-size: 11px;
  margin-right: 5px;
}

.chat-author {
  font-weight: 700;
  margin-right: 6px;
}

.quick-chat-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.quick-chat-btn {
  background: rgba(56, 180, 255, 0.16);
  border: 1px solid rgba(80, 210, 255, 0.35);
  color: #d6efff;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.quick-chat-btn:hover {
  background: rgba(56, 210, 255, 0.32);
}

.chat-input-row {
  display: flex;
  gap: 8px;
}

.race-chat-feed {
  position: fixed;
  left: 18px;
  bottom: 94px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 12;
  pointer-events: none;
}

.race-chat-item {
  background: rgba(8, 14, 30, 0.72);
  border-left: 3px solid #38e8ff;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13px;
  color: #eef6ff;
}

.race-chat-input {
  position: fixed;
  left: 18px;
  bottom: 52px;
  width: 320px;
  z-index: 18;
}

/* CUSTOM PROFILE AVATAR */
.career-bar-wrap {
  margin-top: 10px;
  padding: 5px 14px 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  font-size: 13px;
  color: #cfe4ff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #25365c, #162038);
  border: 2px solid rgba(80, 225, 255, 0.72);
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

.avatar-lg {
  width: 58px;
  height: 58px;
  font-size: 28px;
  cursor: pointer;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 15px;
}

.avatar-xs {
  width: 20px;
  height: 20px;
  font-size: 12px;
  border-width: 1.5px;
  vertical-align: middle;
  margin-right: 4px;
}

.avatar-editor-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-editor-right {
  flex: 1;
  min-width: 0;
}

.avatar-emoji-row {
  display: flex;
  gap: 3px;
  align-items: center;
}

.avatar-emoji-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(150, 210, 255, 0.35);
  background: rgba(12, 20, 42, 0.78);
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.avatar-emoji-btn:hover {
  transform: scale(1.15);
  border-color: #38e8ff;
}

/* TOUR & SHOP BUTTONS + SHOP MODAL */
.btn-tour {
  background: linear-gradient(135deg, #5eead4, #60a5fa, #c084fc);
  box-shadow: 0 6px 20px rgba(94, 234, 212, 0.32);
}

.btn-shop {
  background: linear-gradient(135deg, #fcd34d, #f9a8d4, #c084fc);
  color: #26143a;
  box-shadow: 0 6px 20px rgba(249, 168, 212, 0.36);
}

.shop-dock {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 18px 24px;
  z-index: 20;
  pointer-events: none;
}

.shop-panel {
  pointer-events: auto;
  width: min(490px, 94vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

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

.shop-preview-hint {
  font-size: 12px;
  color: #8ee8ff;
  margin-bottom: 10px;
}

.coin-pill {
  background: rgba(255, 208, 60, 0.18);
  border: 1.5px solid rgba(255, 215, 70, 0.65);
  color: #ffe066;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.shop-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.shop-tab {
  flex: 1;
  padding: 9px 6px;
  border-radius: 10px;
  border: 1px solid rgba(140, 200, 255, 0.25);
  background: rgba(10, 16, 34, 0.65);
  color: #b8d2ea;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.shop-tab.active {
  background: rgba(0, 185, 255, 0.24);
  border-color: #38e8ff;
  color: #fff;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 4px;
}

.shop-item {
  background: rgba(10, 16, 36, 0.72);
  border: 1.5px solid rgba(130, 180, 230, 0.24);
  border-radius: 14px;
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.shop-item.equipped {
  border-color: #38f8c4;
  box-shadow: 0 0 14px rgba(56, 248, 196, 0.28);
}

.shop-item-icon {
  font-size: 26px;
  line-height: 1.1;
}

.shop-item-name {
  font-size: 14px;
  font-weight: 700;
}

.shop-item-desc {
  font-size: 11px;
  color: #a6c4e0;
  flex: 1;
  line-height: 1.35;
}

.shop-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: #ffd875;
}

/* ======================================================
   BUYABLE PAGE UI THEMES WITH PATTERNED SVG BORDERS!
   ====================================================== */
body[data-theme]:not([data-theme="default"]) .glass-card::before,
body[data-theme]:not([data-theme="default"]) .glass-mini::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 26px;
  padding: 8px;
  pointer-events: none;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  z-index: 2;
}

body[data-theme]:not([data-theme="default"]) .glass-mini {
  position: relative;
}

body[data-theme]:not([data-theme="default"]) .glass-mini::before {
  inset: -4px;
  border-radius: 18px;
  padding: 5px;
}

body[data-theme]:not([data-theme="default"]) .glass-card::after {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 16px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 5px;
  font-weight: 700;
  pointer-events: none;
  z-index: 3;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

/* 1. 🌸 櫻花粉嫩邊框 (Sakura Blossom Border Pattern) */
body[data-theme="sakura"] .glass-card,
body[data-theme="sakura"] .glass-mini {
  background:
    radial-gradient(circle at 12px 12px, rgba(255, 195, 220, 0.12) 2px, transparent 2.5px) 0 0 / 28px 28px,
    linear-gradient(160deg, rgba(64, 18, 44, 0.88), rgba(96, 28, 66, 0.92));
  border: 2px solid rgba(255, 175, 212, 0.85);
  box-shadow: 0 22px 60px rgba(40, 6, 26, 0.65), 0 0 22px rgba(255, 140, 195, 0.25);
}
body[data-theme="sakura"] .glass-card::before,
body[data-theme="sakura"] .glass-mini::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Crect width='24' height='24' fill='%23ff8fb8'/%3E%3Ccircle cx='12' cy='7' r='3.5' fill='%23fff0f6'/%3E%3Ccircle cx='17' cy='11' r='3.5' fill='%23fff0f6'/%3E%3Ccircle cx='15' cy='17' r='3.5' fill='%23fff0f6'/%3E%3Ccircle cx='9' cy='17' r='3.5' fill='%23fff0f6'/%3E%3Ccircle cx='7' cy='11' r='3.5' fill='%23fff0f6'/%3E%3Ccircle cx='12' cy='12' r='2.5' fill='%23ffd166'/%3E%3C/svg%3E") repeat;
}
body[data-theme="sakura"] .glass-card::after {
  content: "🌸 ✿ 🌸";
  background: linear-gradient(90deg, #ff7eb3, #ffb8d9, #ff7eb3);
  color: #5a1236;
  border: 1.5px solid #fff0f6;
}
body[data-theme="sakura"] .title-block h1 {
  background: linear-gradient(90deg, #ff9ec4, #fff0f6, #ffd6e8);
  -webkit-background-clip: text;
}
body[data-theme="sakura"] .track-card.selected,
body[data-theme="sakura"] .shop-tab.active {
  background: rgba(235, 90, 155, 0.35);
  border-color: #ff9ec4;
}

/* 2. 🍬 糖果愛心波點邊框 (Candy Hearts & Stripes Border) */
body[data-theme="candy"] .glass-card,
body[data-theme="candy"] .glass-mini {
  background:
    radial-gradient(circle at 10px 10px, rgba(255, 255, 255, 0.09) 2px, transparent 2.5px) 0 0 / 22px 22px,
    linear-gradient(155deg, rgba(66, 22, 62, 0.88), rgba(28, 48, 86, 0.92));
  border: 2px solid rgba(255, 165, 230, 0.85);
}
body[data-theme="candy"] .glass-card::before,
body[data-theme="candy"] .glass-mini::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Crect width='24' height='24' fill='%23ff70a6'/%3E%3Cpath d='M0 24 L24 0' stroke='%2370d6ff' stroke-width='6'/%3E%3Cpath d='M12 17 C8 14 6 11 8.5 9 C10 7.8 11.5 9 12 10.2 C12.5 9 14 7.8 15.5 9 C18 11 16 14 12 17 Z' fill='%23fff6cc'/%3E%3C/svg%3E") repeat;
}
body[data-theme="candy"] .glass-card::after {
  content: "🍬 💖 🍭";
  background: linear-gradient(90deg, #ff70a6, #ffd670, #70d6ff);
  color: #3d1234;
  border: 1.5px solid #ffffff;
}
body[data-theme="candy"] .title-block h1 {
  background: linear-gradient(90deg, #ff70a6, #ffd670, #70d6ff);
  -webkit-background-clip: text;
}
body[data-theme="candy"] .track-card.selected,
body[data-theme="candy"] .shop-tab.active {
  background: rgba(255, 112, 166, 0.32);
  border-color: #ffd670;
}

/* 3. 🌅 熱帶夕陽海浪邊框 (Sunset Wave & Sunburst Border) */
body[data-theme="sunset"] .glass-card,
body[data-theme="sunset"] .glass-mini {
  background:
    repeating-linear-gradient(135deg, rgba(255, 190, 90, 0.05) 0 10px, transparent 10px 20px),
    linear-gradient(160deg, rgba(56, 20, 14, 0.88), rgba(88, 32, 18, 0.92));
  border: 2px solid rgba(255, 185, 90, 0.85);
}
body[data-theme="sunset"] .glass-card::before,
body[data-theme="sunset"] .glass-mini::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='24' viewBox='0 0 28 24'%3E%3Crect width='28' height='24' fill='%23f97316'/%3E%3Cpath d='M0 14 Q7 6 14 14 T28 14' fill='none' stroke='%23fef08a' stroke-width='3.2'/%3E%3Ccircle cx='14' cy='7' r='2.5' fill='%23fff7ed'/%3E%3C/svg%3E") repeat;
}
body[data-theme="sunset"] .glass-card::after {
  content: "🌴 ☀️ 🌊";
  background: linear-gradient(90deg, #f97316, #facc15, #fb7185);
  color: #421306;
  border: 1.5px solid #fef08a;
}
body[data-theme="sunset"] .title-block h1 {
  background: linear-gradient(90deg, #ffb347, #fff4d6, #ff6b6b);
  -webkit-background-clip: text;
}
body[data-theme="sunset"] .track-card.selected,
body[data-theme="sunset"] .shop-tab.active {
  background: rgba(245, 120, 40, 0.35);
  border-color: #ffae42;
}

/* 4. 🍃 薄荷森林藤蔓邊框 (Mint Leaf & Vine Border) */
body[data-theme="mint"] .glass-card,
body[data-theme="mint"] .glass-mini {
  background:
    radial-gradient(circle at 14px 14px, rgba(100, 255, 210, 0.08) 2px, transparent 3px) 0 0 / 26px 26px,
    linear-gradient(160deg, rgba(10, 44, 38, 0.88), rgba(14, 62, 54, 0.92));
  border: 2px solid rgba(90, 245, 195, 0.80);
}
body[data-theme="mint"] .glass-card::before,
body[data-theme="mint"] .glass-mini::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Crect width='24' height='24' fill='%2310b981'/%3E%3Cpath d='M4 18 Q12 4 20 6 Q18 18 4 18 Z' fill='%23a7f3d0'/%3E%3Ccircle cx='6' cy='6' r='2' fill='%23ecfdf5'/%3E%3C/svg%3E") repeat;
}
body[data-theme="mint"] .glass-card::after {
  content: "🌿 🍃 🌿";
  background: linear-gradient(90deg, #10b981, #6ee7b7, #14b8a6);
  color: #052e23;
  border: 1.5px solid #d1fae5;
}
body[data-theme="mint"] .title-block h1 {
  background: linear-gradient(90deg, #52f2c2, #ecfff8, #70e1f5);
  -webkit-background-clip: text;
}
body[data-theme="mint"] .track-card.selected,
body[data-theme="mint"] .shop-tab.active {
  background: rgba(16, 185, 129, 0.35);
  border-color: #52f2c2;
}

/* 5. 🌌 夢幻星雲星月邊框 (Galaxy Stars & Crescent Border) */
body[data-theme="galaxy"] .glass-card,
body[data-theme="galaxy"] .glass-mini {
  background:
    radial-gradient(circle at 8px 10px, rgba(255, 255, 255, 0.14) 1.2px, transparent 1.8px) 0 0 / 32px 32px,
    linear-gradient(160deg, rgba(24, 12, 56, 0.90), rgba(46, 18, 86, 0.94));
  border: 2px solid rgba(195, 135, 255, 0.85);
}
body[data-theme="galaxy"] .glass-card::before,
body[data-theme="galaxy"] .glass-mini::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'%3E%3Crect width='26' height='26' fill='%236d28d9'/%3E%3Cpolygon points='13,3 15,10 22,12 15,14 13,21 11,14 4,12 11,10' fill='%23fde047'/%3E%3Ccircle cx='4' cy='4' r='1.8' fill='%2338bdf8'/%3E%3Ccircle cx='22' cy='22' r='1.8' fill='%23f472b6'/%3E%3C/svg%3E") repeat;
}
body[data-theme="galaxy"] .glass-card::after {
  content: "✨ 🌙 ⭐";
  background: linear-gradient(90deg, #7c3aed, #c084fc, #38bdf8);
  color: #ffffff;
  border: 1.5px solid #fde047;
}
body[data-theme="galaxy"] .title-block h1 {
  background: linear-gradient(90deg, #c084fc, #f5e8ff, #38f8ff);
  -webkit-background-clip: text;
}
body[data-theme="galaxy"] .track-card.selected,
body[data-theme="galaxy"] .shop-tab.active {
  background: rgba(147, 51, 234, 0.35);
  border-color: #c084fc;
}

/* 6. 👑 皇家黑金菱格邊框 (Royal Gold Art-Deco Diamond Border) */
body[data-theme="gold"] .glass-card,
body[data-theme="gold"] .glass-mini {
  background:
    repeating-linear-gradient(45deg, rgba(255, 215, 70, 0.05) 0 8px, transparent 8px 16px),
    linear-gradient(160deg, rgba(14, 12, 10, 0.92), rgba(30, 24, 14, 0.95));
  border: 2px solid rgba(255, 215, 80, 0.90);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.72), 0 0 26px rgba(255, 205, 65, 0.24);
}
body[data-theme="gold"] .glass-card::before,
body[data-theme="gold"] .glass-mini::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Crect width='22' height='22' fill='%23b45309'/%3E%3Cpolygon points='11,2 20,11 11,20 2,11' fill='%23facc15' stroke='%23fef9c3' stroke-width='1.2'/%3E%3Ccircle cx='11' cy='11' r='2.5' fill='%2378350f'/%3E%3C/svg%3E") repeat;
}
body[data-theme="gold"] .glass-card::after {
  content: "👑 ♦ 👑";
  background: linear-gradient(90deg, #b45309, #facc15, #b45309);
  color: #1c1406;
  border: 1.5px solid #fef9c3;
}
body[data-theme="gold"] .title-block h1 {
  background: linear-gradient(90deg, #ffd859, #fff7d1, #e5a928);
  -webkit-background-clip: text;
}
body[data-theme="gold"] .track-card.selected,
body[data-theme="gold"] .shop-tab.active {
  background: rgba(235, 180, 35, 0.28);
  border-color: #ffd859;
}

/* 7. ⚡ 賽博霓虹電路邊框 (Cyber Neon Circuit Border) */
body[data-theme="cyber"] .glass-card,
body[data-theme="cyber"] .glass-mini {
  background:
    linear-gradient(90deg, rgba(0, 245, 255, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(rgba(255, 0, 180, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(160deg, rgba(8, 12, 30, 0.92), rgba(22, 10, 44, 0.95));
  border: 2px solid rgba(0, 245, 255, 0.90);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.72), 0 0 24px rgba(0, 240, 255, 0.26);
}
body[data-theme="cyber"] .glass-card::before,
body[data-theme="cyber"] .glass-mini::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Crect width='24' height='24' fill='%230ea5e9'/%3E%3Cpath d='M0 12 H8 L12 6 H24' fill='none' stroke='%23f43f5e' stroke-width='2.6'/%3E%3Ccircle cx='12' cy='18' r='2.8' fill='%2338f8ff'/%3E%3C/svg%3E") repeat;
}
body[data-theme="cyber"] .glass-card::after {
  content: "⚡ ◈ ⚡";
  background: linear-gradient(90deg, #06b6d4, #ec4899, #06b6d4);
  color: #ffffff;
  border: 1.5px solid #67e8f9;
}
body[data-theme="cyber"] .title-block h1 {
  background: linear-gradient(90deg, #00f5ff, #ffffff, #ff3cac);
  -webkit-background-clip: text;
}
body[data-theme="cyber"] .track-card.selected,
body[data-theme="cyber"] .shop-tab.active {
  background: rgba(6, 182, 212, 0.32);
  border-color: #f43f5e;
}

/* 8. 🦄 獨角獸極光框 (Unicorn Pastel Aurora) */
body[data-theme="unicorn"] .glass-card,
body[data-theme="unicorn"] .glass-mini {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 182, 240, 0.28), transparent 46%),
    radial-gradient(circle at 80% 80%, rgba(130, 232, 255, 0.28), transparent 46%),
    linear-gradient(150deg, rgba(46, 24, 78, 0.88), rgba(62, 34, 96, 0.90));
  border: 2px solid #f9a8d4;
  box-shadow: 0 22px 60px rgba(34, 12, 68, 0.65), 0 0 30px rgba(244, 150, 255, 0.36);
}
body[data-theme="unicorn"] .glass-card::after {
  content: "🦄 ✦ 🦄";
  background: linear-gradient(90deg, #f472b6, #a78bfa, #67e8f9);
  color: #ffffff;
  border: 1.5px solid #ffffff;
}

/* 9. 🍑 水蜜桃奶油框 (Warm Peach Cream) */
body[data-theme="peach"] .glass-card,
body[data-theme="peach"] .glass-mini {
  background:
    radial-gradient(circle at 18% 15%, rgba(255, 204, 168, 0.28), transparent 48%),
    linear-gradient(160deg, rgba(64, 28, 38, 0.88), rgba(82, 38, 46, 0.92));
  border: 2px solid #fdb494;
  box-shadow: 0 22px 60px rgba(48, 16, 24, 0.62), 0 0 26px rgba(255, 172, 132, 0.34);
}
body[data-theme="peach"] .glass-card::after {
  content: "🍑 ♡ 🍑";
  background: linear-gradient(90deg, #fb923c, #fda4af, #fde68a);
  color: #3b151e;
  border: 1.5px solid #fff7ed;
}

/* 10. 🐬 夢幻人魚海藍框 (Mermaid Aqua Pearl) */
body[data-theme="ocean"] .glass-card,
body[data-theme="ocean"] .glass-mini {
  background:
    radial-gradient(circle at 82% 18%, rgba(94, 234, 212, 0.26), transparent 46%),
    linear-gradient(160deg, rgba(10, 42, 68, 0.90), rgba(18, 56, 86, 0.92));
  border: 2px solid #5eead4;
  box-shadow: 0 22px 60px rgba(6, 28, 48, 0.68), 0 0 28px rgba(94, 234, 212, 0.32);
}
body[data-theme="ocean"] .glass-card::after {
  content: "🐬 🫧 🐬";
  background: linear-gradient(90deg, #06b6d4, #5eead4, #93c5fd);
  color: #082f49;
  border: 1.5px solid #e0f2fe;
}

/* 11. 🌠 許願流星夜空框 (Wishing Starlight Night) */
body[data-theme="starry"] .glass-card,
body[data-theme="starry"] .glass-mini {
  background:
    radial-gradient(circle at 50% 10%, rgba(253, 224, 71, 0.18), transparent 42%),
    linear-gradient(165deg, rgba(14, 18, 56, 0.92), rgba(26, 20, 74, 0.95));
  border: 2px solid #fde047;
  box-shadow: 0 22px 60px rgba(8, 8, 36, 0.72), 0 0 28px rgba(253, 224, 71, 0.28);
}
body[data-theme="starry"] .glass-card::after {
  content: "🌠 ★ 🌠";
  background: linear-gradient(90deg, #312e81, #7c3aed, #facc15);
  color: #ffffff;
  border: 1.5px solid #fef08a;
}

/* 12. 🌹 玫瑰水晶宮廷框 (Rose Crystal Palace) */
body[data-theme="rose"] .glass-card,
body[data-theme="rose"] .glass-mini {
  background:
    radial-gradient(circle at 50% 15%, rgba(251, 113, 133, 0.26), transparent 48%),
    linear-gradient(160deg, rgba(54, 12, 34, 0.92), rgba(74, 16, 46, 0.95));
  border: 2px solid #fb7185;
  box-shadow: 0 22px 60px rgba(38, 6, 22, 0.72), 0 0 30px rgba(251, 113, 133, 0.36);
}
body[data-theme="rose"] .glass-card::after {
  content: "🌹 💎 🌹";
  background: linear-gradient(90deg, #be123c, #fb7185, #be123c);
  color: #fff1f2;
  border: 1.5px solid #fecdd3;
}

/* 13. 💎 鑽石幻彩王者框 (Holographic Diamond Prism) */
body[data-theme="prism"] .glass-card,
body[data-theme="prism"] .glass-mini {
  background:
    linear-gradient(135deg, rgba(103, 232, 249, 0.16), rgba(244, 114, 182, 0.16), rgba(253, 224, 71, 0.16)),
    linear-gradient(160deg, rgba(22, 16, 48, 0.90), rgba(34, 22, 68, 0.94));
  border: 2.5px solid #e0f2fe;
  box-shadow: 0 22px 65px rgba(18, 10, 44, 0.72), 0 0 36px rgba(165, 243, 252, 0.42), 0 0 20px rgba(249, 168, 212, 0.36);
}
body[data-theme="prism"] .glass-card::after {
  content: "💎 ✧ 💎";
  background: linear-gradient(90deg, #67e8f9, #f9a8d4, #fde047, #a78bfa, #67e8f9);
  color: #1e1b4b;
  border: 1.5px solid #ffffff;
}

/* MAIN MENU TWO-COLUMN LAYOUT & PLAYER CHARACTER SHOWCASE */
.menu-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: stretch;
}

.menu-main-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.char-showcase {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 175, 235, 0.22), transparent 58%),
    linear-gradient(170deg, rgba(56, 30, 96, 0.72), rgba(38, 28, 78, 0.78) 55%, rgba(44, 34, 88, 0.80));
  border: 1.5px solid rgba(249, 180, 240, 0.44);
  border-radius: 18px;
  padding: 13px 14px;
  box-shadow: 0 0 24px rgba(216, 140, 255, 0.18), inset 0 1px 0 rgba(255, 235, 255, 0.22);
}

.char-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.char-identity {
  flex: 1;
  min-width: 0;
}

.char-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.char-rank-badge {
  display: inline-block;
  margin-top: 2px;
  font-size: 11px;
  color: #ffd859;
  background: rgba(255, 216, 89, 0.14);
  border: 1px solid rgba(255, 216, 89, 0.35);
  border-radius: 999px;
  padding: 1px 8px;
}

.char-coin-badge {
  font-size: 12px;
  font-weight: 700;
  color: #ffe27a;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(255, 208, 70, 0.45);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}

.char-speech {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 200, 240, 0.20), rgba(185, 225, 255, 0.18));
  border: 1px solid rgba(255, 195, 240, 0.46);
  border-radius: 14px;
  padding: 6px 10px;
  font-size: 12px;
  color: #fff0fa;
  text-align: center;
  line-height: 1.35;
  margin-bottom: 6px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.char-speech::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: rgba(74, 42, 114, 0.94);
  border-right: 1px solid rgba(255, 195, 240, 0.46);
  border-bottom: 1px solid rgba(255, 195, 240, 0.46);
}

.char-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 186px;
  cursor: pointer;
  margin: 2px 0 8px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 35% 32%, rgba(255, 168, 226, 0.28), transparent 55%),
    radial-gradient(circle at 68% 40%, rgba(135, 232, 255, 0.24), transparent 58%),
    radial-gradient(circle at 50% 60%, rgba(196, 148, 255, 0.22), transparent 70%);
  overflow: hidden;
}

.char-svg-wrap {
  width: 154px;
  height: 162px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: charFloat 2.8s ease-in-out infinite;
  transform-origin: center bottom;
  transition: transform 0.16s ease;
}

.char-stage:hover .char-svg-wrap {
  filter: drop-shadow(0 0 12px rgba(62, 240, 255, 0.45));
}

.char-svg-wrap.cheer {
  animation: charCheer 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes charFloat {
  0%, 100% { transform: translateY(0px) scaleY(1); }
  50% { transform: translateY(-5px) scaleY(1.015); }
}

@keyframes charCheer {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-16px) scale(1.08) rotate(-3deg); }
  65% { transform: translateY(-4px) scale(0.97) rotate(3deg); }
  100% { transform: translateY(0) scale(1); }
}

.char-eyes {
  transform-box: fill-box;
  transform-origin: center;
  animation: charBlink 4.4s ease-in-out infinite;
}

@keyframes charBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.1); }
}

.char-tail {
  transform-box: fill-box;
  transform-origin: right bottom;
  animation: charTailWag 2.1s ease-in-out infinite;
}

@keyframes charTailWag {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(9deg); }
}

.char-sparkle {
  animation: charTwinkle 2.4s ease-in-out infinite;
}

/* Pause continuous SVG repaints in Eco Mode so Main Menu uses literally 0% GPU / 0% CPU! */
body.eco-mode .char-svg-wrap,
body.eco-mode .char-eyes,
body.eco-mode .char-tail,
body.eco-mode .char-sparkle {
  animation: none !important;
}

@keyframes charTwinkle {
  0%, 100% { opacity: 0.95; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.92); }
}

.char-podium {
  position: absolute;
  bottom: 8px;
  width: 148px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 175, 235, 0.68) 0%, rgba(180, 140, 255, 0.38) 50%, rgba(125, 232, 255, 0.18) 76%, transparent 90%);
  border: 1.5px solid rgba(255, 205, 248, 0.72);
  box-shadow: 0 0 22px rgba(244, 150, 255, 0.48), 0 0 10px rgba(125, 232, 255, 0.35);
  z-index: 1;
}

.char-custom-section {
  background: rgba(34, 18, 64, 0.45);
  border: 1px solid rgba(235, 180, 255, 0.28);
  border-radius: 13px;
  padding: 8px 10px;
  margin-bottom: 9px;
}

.char-custom-label {
  font-size: 11px;
  color: #f3c6f9;
  margin-bottom: 5px;
  text-align: center;
}

.char-picker-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}

.char-pick-btn {
  height: 32px;
  border-radius: 10px;
  border: 1.5px solid rgba(235, 185, 255, 0.32);
  background: rgba(48, 28, 86, 0.72);
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.char-pick-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 180, 240, 0.85);
}

.char-pick-btn.active {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.58), rgba(167, 139, 250, 0.62));
  border-color: #fbcfe8;
  box-shadow: 0 0 14px rgba(249, 168, 212, 0.52);
}

.char-pick-btn.locked {
  position: relative;
  opacity: 0.52;
  filter: grayscale(0.55);
  border-style: dashed;
  border-color: rgba(255, 216, 89, 0.45);
}

.char-pick-btn.locked::after {
  content: "🔒";
  position: absolute;
  right: -3px;
  bottom: -4px;
  font-size: 10px;
  line-height: 1;
  filter: none;
}

.char-lv-box {
  background: rgba(24, 14, 52, 0.58);
  border: 1px solid rgba(255, 216, 89, 0.36);
  border-radius: 12px;
  padding: 7px 10px;
  margin-bottom: 8px;
}

.char-lv-label {
  font-size: 11px;
  font-weight: 700;
  color: #ffe27a;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.char-lv-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-bottom: 5px;
}

.char-lv-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff7ac6, #ffd859, #5eead4);
  transition: width 0.35s ease;
}

.char-lv-next {
  font-size: 10.5px;
  color: #d8e8ff;
  line-height: 1.35;
}

.shop-item.locked {
  opacity: 0.78;
  border-color: rgba(255, 216, 89, 0.42);
}

.shop-lv-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  margin-bottom: 4px;
  display: inline-block;
}

.shop-lv-badge.locked {
  background: rgba(255, 190, 60, 0.18);
  border: 1px solid rgba(255, 210, 90, 0.55);
  color: #ffd859;
}

.shop-lv-badge.unlocked {
  background: rgba(94, 234, 212, 0.20);
  border: 1px solid rgba(94, 234, 212, 0.62);
  color: #7efce8;
}

.fin-level-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 216, 89, 0.35);
  color: #e6f2ff;
}

.fin-level-box.leveled-up {
  background: linear-gradient(135deg, rgba(255, 122, 198, 0.28), rgba(255, 216, 89, 0.28));
  border: 1.5px solid #ffd859;
  color: #fff6c2;
  font-weight: 700;
  box-shadow: 0 0 20px rgba(255, 216, 89, 0.35);
}

.char-color-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.char-color-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.char-color-btn:hover {
  transform: scale(1.16);
}

.char-color-btn.active {
  border-color: #ffffff;
  transform: scale(1.18);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

.char-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.char-stat-box {
  background: rgba(8, 14, 30, 0.55);
  border: 1px solid rgba(130, 190, 240, 0.18);
  border-radius: 10px;
  padding: 6px 4px;
  text-align: center;
}

.char-stat-box span {
  display: block;
  font-size: 10px;
  color: #96badc;
}

.char-stat-box b {
  display: block;
  font-size: 12px;
  color: #eef7ff;
  margin-top: 2px;
}

@media (max-width: 860px) {
  .menu-layout {
    grid-template-columns: 1fr;
  }
  .char-stage {
    height: 154px;
  }
  .char-svg-wrap {
    width: 132px;
    height: 140px;
  }
}
