/* ════════════════════════════════════════════════════════════════════════════
   GAROBIT Sci-Fi Theme — futuristic city / space HUD
   ════════════════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Orbitron:wght@600;700;900&display=swap');
:root {
  --sf-bg: #060810;
  --sf-bg2: #0a1020;
  --sf-cyan: #00e5ff;
  --sf-blue: #4fc3f7;
  --sf-purple: #7c4dff;
  --sf-magenta: #e040fb;
  --sf-gold: #ffd978;
  --sf-glass: rgba(8, 14, 28, 0.62);
  --sf-glass-border: rgba(0, 229, 255, 0.28);
  --sf-glow-cyan: 0 0 18px rgba(0, 229, 255, 0.35);
  --sf-glow-purple: 0 0 22px rgba(124, 77, 255, 0.4);
}

/* ── Lobby background: sci-fi command corridor ── */
#lobbyPage {
  background: transparent !important;
  background-image: none !important;
  overflow: hidden !important;
}

#lobbyPage::before {
  z-index: 0 !important;
  background-color: #6ec8f8 !important;
  background-image: url('../assets/images/player-sky-backdrop.jpg?v=20260930sky1') !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  transform: translateZ(0);
  backface-visibility: hidden;
}

#loadingScreen {
  background-color: #000 !important;
  background-image: none !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: stretch !important;
  overflow: hidden !important;
}

.loading-screen-body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-hero-copy {
  text-align: center;
  width: 100%;
  max-width: 420px;
  padding: 0 8px;
}

#loadingScreen .lobby-hero-kicker {
  margin-bottom: 8px;
}

#loadingScreen .lobby-hero-title {
  margin-bottom: 0;
}

#loadingScreen .loader {
  z-index: 2;
  background: linear-gradient(180deg, transparent 0%, rgba(6, 8, 16, 0.72) 35%, rgba(6, 8, 16, 0.92) 100%);
}

#slotPage {
  background-color: #6ec8f8 !important;
  background-image: url('../assets/images/player-sky-backdrop.jpg?v=20260930sky1') !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

/* ── Brand bar — โลโก้ชิดซ้ายบน · กระเป๋าขวาบน ── */
.lobby-brand-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding:
    env(safe-area-inset-top, 0px)
    env(safe-area-inset-right, 0px)
    0
    env(safe-area-inset-left, 0px);
  pointer-events: none;
}

.lobby-brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  user-select: none;
  margin: 12px 0 0 10px;
  padding: 0;
}

.lobby-brand-hex {
  position: relative;
  /* ใหญ่ขึ้นครึ่งตัวจากขนาดเดิม (~1.5x) */
  width: clamp(72px, 10.8vw, 87px);
  height: clamp(72px, 10.8vw, 87px);
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 0;
  color: #e8fbff;
  isolation: isolate;
  overflow: visible;
  flex-shrink: 0;
}

/* ขอบหกเหลี่ยม — ปิดในล็อบบี้ ให้เหลือแค่ไอคอนแอป */
.lobby-brand-hex::before {
  display: none;
}

.lobby-brand-hex::after {
  display: none;
}

.lobby-brand-hex-svg,
.lobby-brand-hex .garobit-g-logo-img,
.lobby-brand-hex .lobby-app-icon {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center center;
  pointer-events: none;
  user-select: none;
  background: transparent !important;
  filter: none;
}

.lobby-brand-name {
  font-size: clamp(18px, 4vw, 22px);
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #fff;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.45);
}

/* ── Hero copy ── */
.lobby-hero-scifi {
  position: relative;
  z-index: 4;
  text-align: center;
  padding: 0 8px 12px;
}

.lobby-hero-scifi:not(.lobby-main-display) {
  margin-top: 0;
}

.lobby-hero-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--sf-cyan);
  text-transform: uppercase;
  margin-bottom: 6px;
  opacity: 0.9;
}

.lobby-hero-title {
  font-size: clamp(20px, 5.2vw, 28px);
  font-weight: 900;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.65), 0 0 20px rgba(0, 229, 255, 0.25);
  margin: 0 0 14px;
}

.lobby-hero-title em {
  font-style: normal;
  background: linear-gradient(90deg, var(--sf-cyan), var(--sf-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── Stats chips ── */
.lobby-stats-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.lobby-stat-chip {
  flex: 1 1 90px;
  max-width: 120px;
  padding: 8px 6px;
  border-radius: 12px;
  background: rgba(8, 14, 28, 0.82);
  border: 1px solid var(--sf-glass-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.lobby-stat-chip .val {
  display: block;
  font-size: clamp(13px, 3.2vw, 16px);
  font-weight: 800;
  color: var(--sf-cyan);
  line-height: 1.2;
}

.lobby-stat-chip .lbl {
  display: block;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-top: 2px;
}

/* ── Glass panels ── */
.sf-glass-panel {
  border-radius: 14px;
  background: rgba(8, 14, 28, 0.84);
  border: 1px solid var(--sf-glass-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 8px 28px rgba(0,0,0,0.35);
  overflow: hidden;
}

.lobby-rank-panel {
  text-align: left;
  margin-bottom: 12px;
  padding: 10px 12px 8px;
}

/* คู่แผงอันดับ — ซ้ายคะแนนจริง / ขวาฐานว่าง (เตรียมงานอนาคต) */
.lobby-rank-row-pair {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 12px;
}

.lobby-rank-row-pair > .lobby-rank-panel {
  flex: 1 1 0;
  min-width: 0;
  margin-bottom: 0;
  /* กรอบเฉพาะช่องข้อความอันดับ — ไม่ห่อชุดช่องแสดงผลหลักทั้งก้อน */
  border: 1px solid rgba(0, 229, 255, 0.42);
  border-radius: 12px;
  background: rgba(6, 12, 26, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px rgba(0, 229, 255, 0.1),
    0 0 14px rgba(0, 229, 255, 0.08);
}

.lobby-rank-row-pair .lobby-rank-panel h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 8px;
  padding: 5px 8px;
  border: 1px solid rgba(0, 229, 255, 0.38);
  border-radius: 8px;
  background: rgba(0, 36, 64, 0.4);
  box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.08);
  box-sizing: border-box;
}

.lobby-rank-row-pair .lobby-rank-panel h3 .lobby-rank-title-flag {
  flex-shrink: 0;
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.lobby-rank-row-pair .lobby-rank-panel h3 .lobby-rank-title-globe {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: #5ef0ff;
  filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.55));
}

.lobby-rank-row-pair .lobby-rank-panel h3 .lobby-rank-title-globe-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.lobby-rank-row-pair .lobby-rank-panel h3 .lobby-rank-title-flag:empty,
.lobby-rank-row-pair .lobby-rank-panel h3 .lobby-rank-title-flag[hidden] {
  display: none;
}

.lobby-rank-row-pair .lobby-rank-panel h3 .lobby-rank-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobby-rank-row-pair .lobby-rank-row {
  font-size: 15px;
  gap: 4px;
  padding: 0;
  min-height: 38px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.lobby-rank-row-pair .lobby-rank-row .pts {
  font-size: 14px;
}

.lobby-rank-row-pair .lobby-rank-row .medal {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 0;
}

.lobby-rank-row-pair .lobby-rank-row .medal .rank-medal-icon,
.lobby-rank-row .medal .rank-medal-icon,
.social-rank-item .medal .rank-medal-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
  background: transparent;
  pointer-events: none;
  user-select: none;
  animation: rankMedalShadow 3.6s ease-in-out infinite;
}

/* ไอคอนอันดับ — เด้งอยู่กับที่ตลอด และเงาวับพาดผ่านเป็นพักๆ */
@keyframes rankMedalBounce {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  30% { transform: translateY(-4px) scale(0.96, 1.06); }
  48% { transform: translateY(0) scale(1.04, 0.95); }
  64% { transform: translateY(-2px) scale(0.99, 1.02); }
  80% { transform: translateY(0) scale(1, 1); }
}

@keyframes rankMedalShadow {
  0%, 64%, 100% { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4)); }
  74% { filter: drop-shadow(0 0 7px rgba(255, 226, 140, 0.95)) drop-shadow(0 0 12px rgba(0, 229, 255, 0.55)); }
  86% { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4)); }
}

@keyframes rankMedalSheen {
  0%, 66% { transform: translateX(-160%) skewX(-18deg); opacity: 0; }
  72% { opacity: 0.9; }
  84% { transform: translateX(280%) skewX(-18deg); opacity: 0.9; }
  90%, 100% { transform: translateX(280%) skewX(-18deg); opacity: 0; }
}

.lobby-rank-row .medal:has(.rank-medal-icon),
.social-rank-item .medal:has(.rank-medal-icon) {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  animation: rankMedalBounce 1.15s ease-in-out infinite;
  transform-origin: center bottom;
}

.lobby-rank-row .medal:has(.rank-medal-icon)::after,
.social-rank-item .medal:has(.rank-medal-icon)::after {
  content: "";
  position: absolute;
  top: -10%;
  left: 0;
  width: 42%;
  height: 120%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 248, 214, 0.2) 32%, rgba(255, 255, 255, 0.78) 50%, rgba(140, 230, 255, 0.35) 68%, transparent 100%);
  pointer-events: none;
  animation: rankMedalSheen 3.6s ease-in-out infinite;
}

.lobby-rank-row:nth-child(2) .medal:has(.rank-medal-icon),
.lobby-rank-row:nth-child(2) .rank-medal-icon,
.lobby-rank-row:nth-child(2) .medal:has(.rank-medal-icon)::after { animation-delay: 0.35s; }
.lobby-rank-row:nth-child(3) .medal:has(.rank-medal-icon),
.lobby-rank-row:nth-child(3) .rank-medal-icon,
.lobby-rank-row:nth-child(3) .medal:has(.rank-medal-icon)::after { animation-delay: 0.7s; }
.lobby-rank-row:nth-child(4) .medal:has(.rank-medal-icon),
.lobby-rank-row:nth-child(4) .rank-medal-icon,
.lobby-rank-row:nth-child(4) .medal:has(.rank-medal-icon)::after { animation-delay: 1.05s; }
.lobby-rank-row:nth-child(5) .medal:has(.rank-medal-icon),
.lobby-rank-row:nth-child(5) .rank-medal-icon,
.lobby-rank-row:nth-child(5) .medal:has(.rank-medal-icon)::after { animation-delay: 1.4s; }

@media (prefers-reduced-motion: reduce) {
  .lobby-rank-row .medal:has(.rank-medal-icon),
  .social-rank-item .medal:has(.rank-medal-icon),
  .rank-medal-icon,
  .lobby-rank-row .medal:has(.rank-medal-icon)::after,
  .social-rank-item .medal:has(.rank-medal-icon)::after {
    animation: none;
  }
}

.lobby-rank-row-pair .lobby-rank-row .medal .rank-medal-num,
.lobby-rank-row .medal .rank-medal-num {
  font-size: 13px;
  line-height: 1;
  color: rgba(220, 240, 255, 0.85);
}

.lobby-rank-row-pair .lobby-rank-row .lobby-rank-row-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.lobby-rank-row-pair .lobby-rank-row .lobby-rank-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-rank-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.social-rank-item .social-rank-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.social-rank-item .medal {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ล็อกความสูงเหลือเห็น 3 อันดับ — เกินแล้วเลื่อนขึ้นลงแบบลื่น */
.lobby-rank-row-pair .lobby-rank-panel #lobbyRankList,
.lobby-rank-row-pair .lobby-rank-panel #lobbyPlayerRankList {
  --lobby-rank-row-slot: 44px;
  height: calc(var(--lobby-rank-row-slot) * 3);
  max-height: calc(var(--lobby-rank-row-slot) * 3);
  min-height: calc(var(--lobby-rank-row-slot) * 3);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  scroll-padding-block: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.45) rgba(8, 14, 28, 0.35);
}

.lobby-rank-row-pair .lobby-rank-panel #lobbyRankList::-webkit-scrollbar,
.lobby-rank-row-pair .lobby-rank-panel #lobbyPlayerRankList::-webkit-scrollbar {
  width: 5px;
}

.lobby-rank-row-pair .lobby-rank-panel #lobbyRankList::-webkit-scrollbar-track,
.lobby-rank-row-pair .lobby-rank-panel #lobbyPlayerRankList::-webkit-scrollbar-track {
  background: rgba(8, 14, 28, 0.35);
  border-radius: 999px;
}

.lobby-rank-row-pair .lobby-rank-panel #lobbyRankList::-webkit-scrollbar-thumb,
.lobby-rank-row-pair .lobby-rank-panel #lobbyPlayerRankList::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.55), rgba(124, 77, 255, 0.4));
  border-radius: 999px;
}

.lobby-rank-row-pair .lobby-rank-panel #lobbyRankList .lobby-rank-row,
.lobby-rank-row-pair .lobby-rank-panel #lobbyPlayerRankList .lobby-rank-row {
  min-height: var(--lobby-rank-row-slot, 38px);
  height: var(--lobby-rank-row-slot, 38px);
  align-items: center;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}

.lobby-rank-row-pair .lobby-rank-panel #lobbyPlayerRankList .lobby-rank-row .medal {
  width: 36px;
  height: 36px;
  font-size: 0;
  flex-shrink: 0;
}

.lobby-rank-row-pair .lobby-rank-panel #lobbyRankList .lobby-rank-empty,
.lobby-rank-row-pair .lobby-rank-panel #lobbyPlayerRankList .lobby-rank-empty {
  min-height: calc(var(--lobby-rank-row-slot, 38px) * 3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lobby-rank-panel-reserve {
  display: flex;
  flex-direction: column;
}

.lobby-rank-panel-reserve .lobby-rank-reserve-body {
  flex: 1 1 auto;
  min-height: 8px;
}

.lobby-player-rank-row .lobby-player-rank-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.lobby-player-rank-row .lobby-player-rank-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.lobby-player-rank-row .lobby-player-rank-text .name {
  color: #e8eef8;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.lobby-player-rank-row .lobby-player-rank-text .gid {
  color: rgba(180, 210, 235, 0.72);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobby-rank-panel h3 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sf-cyan);
  font-weight: 800;
}

.lobby-rank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 13px;
  color: #e8eef8;
}

.lobby-rank-row:last-child { border-bottom: none; }

.lobby-rank-row .medal {
  width: 36px;
  height: 36px;
  text-align: center;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lobby-rank-row .pts { color: var(--sf-gold); font-weight: 700; font-size: 12px; white-space: nowrap; }

.lobby-rank-empty {
  color: rgba(255,255,255,0.45);
  font-size: 12px;
  text-align: center;
  padding: 8px 0;
}

/* ── Feature cards ── */
.lobby-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.lobby-feature-card {
  border-radius: 12px;
  padding: 10px 4px 8px;
  text-align: center;
  background: rgba(8, 14, 28, 0.78);
  border: 1px solid rgba(255,255,255,0.08);
}

.lobby-feature-card .ico { font-size: 22px; line-height: 1; margin-bottom: 4px; }
.lobby-feature-card .txt {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  line-height: 1.2;
}

.lobby-feature-card:nth-child(1) { border-color: rgba(0,229,255,0.35); box-shadow: 0 0 12px rgba(0,229,255,0.12); }
.lobby-feature-card:nth-child(2) { border-color: rgba(124,77,255,0.35); box-shadow: 0 0 12px rgba(124,77,255,0.12); }
.lobby-feature-card:nth-child(3) { border-color: rgba(0,230,118,0.35); box-shadow: 0 0 12px rgba(0,230,118,0.1); }
.lobby-feature-card:nth-child(4) { border-color: rgba(255,215,0,0.35); box-shadow: 0 0 12px rgba(255,215,0,0.1); }

/* ── Tab bar sci-fi dock — ชิดขอบซ้ายขวาล่างกรอบเกม ── */
.lobby-bottom-dock .tab-bar {
  background: rgba(6, 10, 20, 0.94) !important;
  border-top: 1px solid rgba(0, 229, 255, 0.22) !important;
  box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(0, 229, 255, 0.08) !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  border-radius: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.lobby-bottom-dock .svg-button-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  background: transparent !important;
  border-top: none !important;
  box-shadow: none !important;
  position: relative !important;
  transform: translateY(-10px);
}

.lobby-bottom-dock .svg-button-container svg.lobby-gold-bar-hit {
  filter: none;
}

.lobby-bar-btn-side {
  transition: opacity 0.2s ease;
}

.lobby-bar-btn-side:active {
  opacity: 0.88;
}

.robit-countdown-slot #lobbyCountdown,
.lv-countdown-box #lobbyCountdown {
  color: rgba(255, 248, 220, 0.95) !important;
  letter-spacing: 0.04em;
  text-shadow:
    0 0 6px rgba(255, 215, 80, 0.35),
    0 0 10px rgba(0, 229, 255, 0.15),
    0 1px 3px rgba(0, 0, 0, 0.85) !important;
}

.lobby-bottom-dock .level-badge#levelBadge,
.lobby-bottom-dock .level-badge#attackLevelBadge {
  bottom: -8px !important;
  text-shadow:
    0 0 8px rgba(255, 215, 0, 0.45),
    0 1px 3px rgba(0, 0, 0, 0.65) !important;
}

.lobby-bottom-dock .level-badge#levelBadge {
  right: 8px !important;
  left: auto !important;
}

.lobby-bottom-dock .level-badge#attackLevelBadge {
  left: 8px !important;
  right: auto !important;
}

.tab-item { color: rgba(255, 255, 255, 0.48) !important; }
.tab-item:hover { color: #7eeaff !important; }
.tab-item.active {
  color: #00e5ff !important;
  background: rgba(0, 229, 255, 0.1) !important;
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.28), 0 0 14px rgba(0, 229, 255, 0.12) !important;
}

.lobby-bottom-dock .tab-item.active:has(.tab-icon-scifi) {
  background: transparent !important;
  box-shadow: none !important;
}

.tab-item.active .label { color: #00e5ff !important; }

.tab-item-lobby.active {
  background: transparent !important;
  box-shadow: none !important;
}

.tab-item-lobby .label {
  margin-top: 2px;
  font-size: 10px !important;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.tab-item-lobby .lv-countdown-box #lobbyCountdown {
  font-size: 11px !important;
  line-height: 1.15;
}

/* ── Sci-fi tab icons (Settings / Social / Store / Bank) ── */
.tab-item .icon.tab-icon-scifi {
  position: relative;
  width: 42px;
  height: 42px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0;
  line-height: 0;
  color: #7eeaff;
  background:
    radial-gradient(circle at 30% 26%, rgba(124, 77, 255, 0.24) 0%, transparent 50%),
    radial-gradient(circle at 72% 72%, rgba(0, 229, 255, 0.16) 0%, transparent 44%),
    rgba(4, 8, 18, 0.96);
  border: 1.5px solid rgba(0, 229, 255, 0.38);
  box-shadow:
    0 0 14px rgba(0, 229, 255, 0.22),
    0 0 24px rgba(124, 77, 255, 0.1),
    inset 0 0 12px rgba(0, 229, 255, 0.06);
  isolation: isolate;
  overflow: visible;
  filter: none !important;
  transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.tab-item .icon.tab-icon-scifi::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(0, 229, 255, 0.55) 60deg,
    rgba(124, 77, 255, 0.4) 130deg,
    transparent 200deg,
    rgba(0, 229, 255, 0.28) 300deg,
    transparent 360deg
  );
  animation: tabIconOrbitRing 5s linear infinite;
  pointer-events: none;
  z-index: 0;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 0.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 0.5px));
}

.tab-item .icon.tab-icon-social::before { animation-duration: 6.2s; animation-direction: reverse; }
.tab-item .icon.tab-icon-store::before { animation-duration: 4.6s; }
.tab-item .icon.tab-icon-bank::before { animation-duration: 5.8s; }

@keyframes tabIconOrbitRing {
  to { transform: rotate(360deg); }
}

.tab-item .icon.tab-icon-scifi .tab-icon-scifi-svg {
  position: relative;
  z-index: 1;
  width: 21px;
  height: 21px;
  display: block;
  filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.55));
}

.tab-item .icon.tab-icon-settings { color: #00e5ff; }
.tab-item .icon.tab-icon-social { color: #b388ff; }
.tab-item .icon.tab-icon-store { color: #ffd978; }
.tab-item .icon.tab-icon-bank { color: #ffe082; }

.tab-item:hover .icon.tab-icon-scifi {
  color: #fff;
  border-color: rgba(0, 229, 255, 0.62);
  box-shadow:
    0 0 18px rgba(0, 229, 255, 0.32),
    0 0 28px rgba(124, 77, 255, 0.16),
    inset 0 0 14px rgba(0, 229, 255, 0.1);
}

.tab-item.active .icon.tab-icon-scifi {
  border-color: rgba(0, 229, 255, 0.38) !important;
  box-shadow:
    0 0 14px rgba(0, 229, 255, 0.22),
    0 0 24px rgba(124, 77, 255, 0.1),
    inset 0 0 12px rgba(0, 229, 255, 0.06) !important;
  filter: none !important;
}

.tab-item.active .icon.tab-icon-scifi::before {
  background: none;
  -webkit-mask: none;
  mask: none;
  inset: 0;
  border: 2px solid rgba(0, 229, 255, 0.92);
  animation: tabMenuWave 1.35s ease-out infinite;
}

.tab-item.active .icon.tab-icon-social::before {
  border-color: rgba(179, 136, 255, 0.95);
  animation-duration: 1.35s;
  animation-direction: normal;
}

.tab-item.active .icon.tab-icon-store::before,
.tab-item.active .icon.tab-icon-bank::before {
  border-color: rgba(255, 217, 120, 0.95);
  animation-duration: 1.35s;
}

@keyframes tabMenuWave {
  0% {
    transform: scale(1);
    opacity: 0.95;
    border-width: 2px;
  }
  100% {
    transform: scale(1.68);
    opacity: 0;
    border-width: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tab-item.active .icon.tab-icon-scifi::before {
    animation: none;
    transform: none;
    opacity: 0.9;
    border-width: 3px;
  }
}

.tab-item.active .icon.tab-icon-scifi .tab-icon-scifi-svg {
  filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.55));
}

.tab-item .icon.tab-icon-settings .tab-icon-scifi-svg {
  width: 22px;
  height: 22px;
}

.tab-item .icon.tab-icon-store .tab-icon-scifi-svg,
.tab-item .icon.tab-icon-bank .tab-icon-scifi-svg {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 0 5px rgba(255, 217, 120, 0.55));
}

.tab-item.active .icon.tab-icon-store .tab-icon-scifi-svg,
.tab-item.active .icon.tab-icon-bank .tab-icon-scifi-svg {
  filter: drop-shadow(0 0 5px rgba(255, 217, 120, 0.55));
}

@media (max-width: 768px) {
  .tab-item .icon.tab-icon-scifi {
    width: 38px;
    height: 38px;
  }
  .tab-item .icon.tab-icon-scifi .tab-icon-scifi-svg {
    width: 19px;
    height: 19px;
  }
  .tab-item .icon.tab-icon-store .tab-icon-scifi-svg,
  .tab-item .icon.tab-icon-bank .tab-icon-scifi-svg {
    width: 20px;
    height: 20px;
  }
}

/* ── Lobby gold bar hit — ไม่ต้อง pulse บนรูปเต็ม ── */
.lobby-bottom-dock .lobby-bar-hit-robit {
  outline: none;
}

@keyframes svgPulseGlowSciFi {
  0%, 100% {
    filter: drop-shadow(0 0 4px rgba(255, 200, 60, 0.42)) drop-shadow(0 0 8px rgba(0, 229, 255, 0.1));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(255, 215, 80, 0.78)) drop-shadow(0 0 16px rgba(0, 229, 255, 0.2));
  }
}

/* ── Back buttons ── */
.back-btn {
  background: transparent !important;
  border: none !important;
  color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
  transform: none !important;
  transform-origin: center center !important;
  isolation: isolate;
  overflow: visible;
  filter: drop-shadow(0 14px 8px rgba(0, 0, 0, 0.88)) drop-shadow(0 22px 20px rgba(0, 0, 0, 0.5)) drop-shadow(0 6px 12px rgba(0, 200, 255, 0.42)) !important;
  transition: transform 0.18s cubic-bezier(0.22, 1.28, 0.36, 1), filter 0.18s ease-out !important;
}

.back-btn::after,
.world-back-btn::after,
.social-top-back::after,
.modal-back-btn::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -10px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, rgba(0, 0, 0, 0.7) 0%, rgba(0, 170, 255, 0.22) 48%, transparent 74%);
  pointer-events: none;
  z-index: -1;
  filter: blur(3px);
}

.back-btn:focus,
.back-btn:focus-visible,
.back-btn:active,
.back-btn:hover {
  outline: none !important;
}

.back-btn:hover {
  filter: brightness(1.08) drop-shadow(0 16px 10px rgba(0, 0, 0, 0.9)) drop-shadow(0 26px 24px rgba(0, 0, 0, 0.55)) drop-shadow(0 8px 14px rgba(0, 200, 255, 0.5)) !important;
}

.back-btn:active,
.back-btn.is-pressed {
  transform: scale(0.86) !important;
  box-shadow: none !important;
  transition: transform 0.08s ease-out, filter 0.08s ease-out !important;
  filter: brightness(0.98) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.55)) !important;
}

/* ร้าน + ธนาคาร: ปุ่มย้อนกลับกลางล่าง — ไม่ขยับความสูง */
#storePage .back-btn,
#bankPage .back-btn {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
}

#storePage .back-btn:active,
#storePage .back-btn.is-pressed,
#bankPage .back-btn:active,
#bankPage .back-btn.is-pressed {
  transform: translateX(-50%) scale(0.86) !important;
}

.modal-back-btn,
.world-back-btn,
.social-top-back {
  background: transparent !important;
  border: none !important;
  color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
  transform-origin: center center !important;
  transition: transform 0.18s cubic-bezier(0.22, 1.28, 0.36, 1), filter 0.18s ease-out !important;
}

.modal-back-btn img,
.world-back-btn img,
.social-top-back img {
  display: block;
  pointer-events: none;
  user-select: none;
}

.modal-back-btn {
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
}

.modal-back-btn:focus,
.modal-back-btn:focus-visible,
.modal-back-btn:active {
  outline: none !important;
  box-shadow: none !important;
}

.modal-back-btn:active,
.modal-back-btn.is-pressed,
.world-back-btn:active,
.world-back-btn.is-pressed,
.social-top-back:active,
.social-top-back.is-pressed {
  transform: scale(0.86) !important;
  transition: transform 0.08s ease-out, filter 0.08s ease-out !important;
}

/* ── Full pages (store/bank/social) ── */
#storePage,
#businessPage,
#socialPage {
  background-color: #6ec8f8 !important;
  background-image: url('../assets/images/player-sky-backdrop.jpg?v=20260930sky1') !important;
  background-size: cover !important;
  background-position: center !important;
}

/* ── Bank page — แผงยอดรวมกลางจอ ── */
#bankPage.bank-page-themed .bank-stage {
  overflow: visible !important;
}

#bankPage.bank-page-themed .bank-stage-bg-picture {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

#bankPage.bank-page-themed .bank-stage-bg-picture .bank-stage-bg,
#bankPage.bank-page-themed .bank-stage-bg {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: fill !important;
}

/* มือถือ: ธนาคารเต็มจอเครื่อง — ไม่ใช้สัดส่วนพื้นฐาน */
@media (max-width: 1024px) {
  html.player-stage #bankPage.bank-page-themed,
  #bankPage.bank-page-themed {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
  }

  @supports (height: 100dvh) {
    html.player-stage #bankPage.bank-page-themed,
    #bankPage.bank-page-themed {
      height: 100dvh !important;
      max-height: 100dvh !important;
    }
  }

  #bankPage.bank-page-themed .bank-stage {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto !important;
    max-width: none !important;
    max-height: none !important;
    transform: none !important;
    margin: 0 !important;
  }
}

#bankPage.bank-page-themed .bank-balance-panel-hit {
  position: absolute !important;
  left: calc(50% - 3px) !important;
  top: calc(50% - 125px) !important;
  transform: translate(-50%, -50%) !important;
  width: calc(92% - 80px) !important;
  max-width: calc(92% - 80px) !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  cursor: pointer !important;
  z-index: 5 !important;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease-out !important;
}

#bankPage.bank-page-themed .bank-balance-panel-hit:focus,
#bankPage.bank-page-themed .bank-balance-panel-hit:focus-visible,
#bankPage.bank-page-themed .bank-balance-panel-hit:active {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

#bankPage.bank-page-themed .bank-balance-panel-hit:active,
#bankPage.bank-page-themed .bank-balance-panel-hit.is-pressed {
  transform: translate(-50%, -50%) scale(0.96) !important;
}

#bankPage.bank-page-themed .bank-balance-panel-center {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  pointer-events: none !important;
  user-select: none !important;
}

#bankPage.bank-page-themed .bank-balance-total {
  position: absolute !important;
  left: 6% !important;
  right: 38% !important;
  top: calc(50% + 6px) !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  z-index: 2 !important;
  pointer-events: none !important;
  user-select: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: 'Cinzel', 'Times New Roman', serif !important;
  color: #7af6ff !important;
  font-size: clamp(16px, 3.2vw, 28px) !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  font-variant-numeric: tabular-nums !important;
  text-align: center !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-shadow: none !important;
}

/* ── Bank — ฐานทรัพย์สิน 2×2: แบงค์/เหรียน บน, เพชร/ทองแท่ง ล่าง ── */
#bankPage.bank-page-themed .bank-asset-grid {
  position: absolute;
  left: 50%;
  top: calc(46% + 105px);
  transform: translate(-50%, -50%);
  width: calc(92% - 80px);
  max-width: calc(92% - 80px);
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 6px;
  pointer-events: auto;
  background: transparent;
}

#bankPage.bank-page-themed .bank-asset-slot {
  position: relative;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  transform-origin: center center;
  transition: transform 0.08s ease-out;
}

#bankPage.bank-page-themed .bank-asset-slot:focus,
#bankPage.bank-page-themed .bank-asset-slot:focus-visible,
#bankPage.bank-page-themed .bank-asset-slot:active,
#bankPage.bank-page-themed .bank-asset-slot:hover {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

#bankPage.bank-page-themed .bank-asset-slot:active,
#bankPage.bank-page-themed .bank-asset-slot.is-pressed {
  transform: scale(0.96);
}

#bankPage.bank-page-themed .bank-asset-slot img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none !important;
  user-select: none;
  pointer-events: none;
  background: transparent;
}

#bankPage.bank-page-themed .bank-asset-slot .bank-asset-value {
  position: absolute;
  top: calc(48% + 2px);
  transform: translateY(-50%);
  z-index: 2;
  pointer-events: none;
  user-select: none;
  font-family: 'Cinzel', 'Times New Roman', serif;
  color: #7af6ff;
  font-size: clamp(14px, 2.6vw, 20px);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  text-align: center;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: none;
}

#bankPage.bank-page-themed .bank-asset-slot.is-coins .bank-asset-value,
#bankPage.bank-page-themed .bank-asset-slot.is-gold .bank-asset-value {
  left: 6%;
  right: 40%;
}

#bankPage.bank-page-themed .bank-asset-slot.is-cash .bank-asset-value,
#bankPage.bank-page-themed .bank-asset-slot.is-diamond .bank-asset-value {
  left: 40%;
  right: 6%;
}

/* ── Bank — การ์ดโอน / กู้ แยกชั้น: ดำทึบด้านหลัง + ภาพการ์ดด้านบน ── */
#bankPage.bank-page-themed .bank-service-row {
  position: absolute;
  left: 50%;
  bottom: 6%;
  transform: translate(-50%, -35px);
  width: calc(92% - 85px);
  max-width: calc(92% - 85px);
  z-index: 5;
  pointer-events: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  background: transparent;
}

#bankPage.bank-page-themed .bank-service-hotspot {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  cursor: pointer;
  overflow: visible;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  transform-origin: 50% 100%;
  transition: transform 0.08s ease-out;
}

#bankPage.bank-page-themed .bank-service-hotspot:focus,
#bankPage.bank-page-themed .bank-service-hotspot:focus-visible,
#bankPage.bank-page-themed .bank-service-hotspot:active,
#bankPage.bank-page-themed .bank-service-hotspot:hover {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

/* ชั้นดำทึบ — อยู่หลังการ์ดเท่านั้น ไม่รวมกับพิกเซลของภาพ */
#bankPage.bank-page-themed .bank-service-card-fill {
  position: absolute;
  left: 3.5%;
  right: 3.5%;
  top: 5%;
  bottom: 5%;
  z-index: 0;
  background: #000;
  clip-path: polygon(6% 0, 94% 0, 100% 14%, 100% 86%, 94% 100%, 6% 100%, 0 86%, 0 14%);
  pointer-events: none;
}

#bankPage.bank-page-themed .bank-service-card-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  max-width: none !important;
  user-select: none;
  pointer-events: none;
  background: transparent;
}

#bankPage.bank-page-themed .bank-service-hotspot.is-transfer {
  transform: translate(-12px, 3px) scale(1.1);
}

#bankPage.bank-page-themed .bank-service-hotspot.is-loan {
  transform: translate(9px, 3px) scale(1.1);
}

#bankPage.bank-page-themed .bank-service-hotspot.is-transfer:active,
#bankPage.bank-page-themed .bank-service-hotspot.is-transfer.is-pressed {
  transform: translate(-12px, 3px) scale(1.056);
}

#bankPage.bank-page-themed .bank-service-hotspot.is-loan:active,
#bankPage.bank-page-themed .bank-service-hotspot.is-loan.is-pressed {
  transform: translate(9px, 3px) scale(1.056);
}

/* ── แจ้งเตือนอยู่ระหว่างการพัฒนา (กดโลกในล็อบบี้) ── */
.dev-notice-overlay {
  background: transparent !important;
  padding: 16px !important;
  z-index: 1200 !important;
  opacity: 1;
  transition: opacity 0.28s ease;
}

.dev-notice-overlay.is-closing {
  opacity: 0 !important;
  pointer-events: none !important;
}

.dev-notice-panel {
  position: relative;
  width: min(92vw, 520px);
  max-width: 520px;
  background: transparent;
  border: none;
  box-shadow: none;
  line-height: 0;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.28s ease;
}

.dev-notice-overlay.is-closing .dev-notice-panel,
.dev-notice-panel.is-closing {
  opacity: 0;
}

.dev-notice-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none !important;
  pointer-events: none;
  user-select: none;
  background: transparent;
}

.dev-notice-close {
  position: absolute;
  top: 7%;
  right: 5.5%;
  width: 11%;
  aspect-ratio: 1;
  padding: 0;
  margin: 0;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-radius: 50%;
  transition: transform 0.08s ease-out;
  z-index: 3;
}

.dev-notice-close:focus,
.dev-notice-close:focus-visible,
.dev-notice-close:active {
  outline: none !important;
  box-shadow: none !important;
}

.dev-notice-close:active,
.dev-notice-close.is-pressed {
  transform: scale(0.92);
}

/* นับถอยหลัง — แนวเดียวกับกากบาท (ซ้ายมือ) สไตล์ sci-fi */
.dev-notice-countdown {
  position: absolute;
  top: 7%;
  right: calc(5.5% + 11% + 2%);
  z-index: 3;
  width: 11%;
  aspect-ratio: 1;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  color: #ff3b5c;
  font-family: 'Orbitron', 'Arial Black', system-ui, sans-serif;
  font-size: clamp(14px, 3.6vw, 22px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: 0.08em;
  text-shadow:
    0 0 4px rgba(255, 64, 96, 1),
    0 0 12px rgba(255, 20, 70, 0.85),
    0 0 22px rgba(255, 0, 80, 0.45),
    0 0 28px rgba(0, 229, 255, 0.22),
    0 1px 2px rgba(0, 0, 0, 0.9);
  background: transparent;
  border: none;
  box-shadow: none;
  pointer-events: none;
  user-select: none;
  opacity: 1;
  transition: opacity 0.1s ease;
  animation: devNoticeCountdownPulse 1s ease-in-out infinite;
}

.dev-notice-countdown.is-fading {
  opacity: 0 !important;
  animation: none !important;
}

.dev-notice-countdown[hidden] {
  display: none !important;
}

@keyframes devNoticeCountdownPulse {
  0%, 100% {
    color: #ff3b5c;
    filter: brightness(1);
  }
  50% {
    color: #ff6b8a;
    filter: brightness(1.15);
  }
}

/* ── HOME (ปุ่ม HOME ขวาของ ROBIT) — ทางเดินยาน + ปุ่มแจ้งเตือนพัฒนา ── */
#homePage {
  background-color: #6ec8f8 !important;
  background-image: url('../assets/images/player-sky-backdrop.jpg?v=20260930sky1') !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  display: none;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  padding:
    calc(env(safe-area-inset-top, 0px) + 16px)
    20px
    calc(env(safe-area-inset-bottom, 0px) + 28px);
  box-sizing: border-box;
}

#homePage.active {
  display: flex !important;
}

/* ปุ่มแจ้งเตือนพัฒนา — กลางจอสุด */
.home-dev-notice-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: block;
  width: min(92vw, 520px);
  max-width: 520px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  pointer-events: none;
  z-index: 2;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.28s ease, visibility 0s linear 0s;
}

.home-dev-notice-btn.is-closing {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%);
  transition: opacity 0.28s ease, visibility 0s linear 0.28s;
  pointer-events: none !important;
}

.home-dev-notice-btn[hidden] {
  display: none !important;
}

.home-dev-notice-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none !important;
  pointer-events: none;
  user-select: none;
  background: transparent;
}

/* กากบาทขวาบน — กดแล้วกลับหน้าหลัก */
.home-dev-notice-close {
  position: absolute;
  top: 7%;
  right: 5.5%;
  width: 11%;
  aspect-ratio: 1;
  padding: 0;
  margin: 0;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  border-radius: 50%;
  z-index: 3;
  transition: transform 0.08s ease-out;
}

.home-dev-notice-close:focus,
.home-dev-notice-close:focus-visible,
.home-dev-notice-close:active {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

.home-dev-notice-close:active,
.home-dev-notice-close.is-pressed {
  transform: scale(0.92);
}

/* ข้อความ — ตำแหน่งเดิมด้านล่าง */
.home-page-copy {
  text-align: center;
  max-width: 420px;
  margin: 0 auto 18px;
  z-index: 3;
}

.home-page-kicker {
  margin: 0 0 8px;
  color: var(--sf-cyan);
  font-size: clamp(11px, 2.8vw, 13px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
}

.home-page-title {
  margin: 0 0 10px;
  color: #f4fbff;
  font-size: clamp(28px, 8vw, 40px);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.05;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.home-page-title em {
  font-style: normal;
  color: var(--sf-gold);
}

.home-page-sub {
  margin: 0;
  color: rgba(220, 240, 255, 0.78);
  font-size: clamp(13px, 3.4vw, 15px);
  line-height: 1.45;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

#homePage .back-btn {
  align-self: flex-start;
  z-index: 3;
}

#storePage h2,
#bankPage h2,
#businessPage h2,
#socialPage h2,
#socialPageTitle {
  color: var(--sf-cyan) !important;
  text-shadow: 0 0 12px rgba(0,229,255,0.35);
}

#socialPage .friend-add-box {
  max-width: 420px;
  margin: 8px auto 0;
}

#socialPage .friend-notice-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 217, 120, 0.55);
  background: rgba(8, 16, 28, 0.9);
  color: #ffe08a;
  font: 700 16px/1.2 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
  cursor: pointer;
}

#socialPage .friend-notice-menu.is-open {
  border-color: rgba(0, 229, 255, 0.7);
  color: #f4fbff;
}

#socialPage .social-friend-badge[hidden] { display: none; }
#socialPage .social-friend-badge {
  display: inline-block;
  min-width: 16px;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 999px;
  background: #d01212;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  vertical-align: 1px;
}

#socialPage .friend-notice-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #d01212;
  color: #fff;
  font-size: 12px;
  line-height: 22px;
  text-align: center;
}

#socialPage .friend-notice-list {
  margin: -4px 0 14px;
  padding: 8px 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: rgba(8, 16, 28, 0.72);
}

#socialPage .friend-search {
  position: relative;
  margin-bottom: 14px;
}

#socialPage .friend-search label {
  display: block;
  margin-bottom: 8px;
  color: #f4fbff;
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
}

#socialPage .friend-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 229, 255, 0.45);
  background: rgba(8, 16, 28, 0.9);
  color: #fff;
  font-size: 16px;
}

#socialPage .friend-suggest {
  margin-top: 6px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(8, 16, 28, 0.96);
  border: 1px solid rgba(0, 229, 255, 0.35);
}

#socialPage .friend-suggest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

#socialPage .friend-suggest-item:last-child {
  border-bottom: 0;
}

#socialPage .friend-suggest-item:hover,
#socialPage .friend-suggest-item:focus {
  background: rgba(0, 180, 255, 0.18);
}

#socialPage .friend-suggest-id {
  color: #9ec9e8;
  font-size: 12px;
  flex-shrink: 0;
}

#socialPage .friend-suggest-empty {
  margin: 0;
  padding: 12px;
  color: #c5d4e0;
  text-align: center;
}

#socialPage .friend-list-frame {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(0, 229, 255, 0.5);
  background: rgba(8, 16, 28, 0.72);
}

#socialPage .friend-slot {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 217, 120, 0.55);
  background: rgba(8, 16, 28, 0.92);
  color: #f4fbff;
  font: 700 16px/1.2 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
  text-align: left;
  cursor: pointer;
}

#socialPage .friend-slot-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#socialPage:has(.friend-chat:not([hidden])) {
  z-index: 600 !important;
}

#socialPage .friend-chat[hidden] { display: none; }

#socialPage .friend-chat {
  position: fixed;
  left: var(--stage-left, 0px);
  top: var(--stage-top, 0px);
  width: var(--stage-w, 100%);
  height: var(--stage-h, 100%);
  right: auto;
  bottom: auto;
  z-index: 520;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  border: 0;
  background: #060c16;
  box-shadow: none;
  overflow: hidden;
  box-sizing: border-box;
}

#socialPage .friend-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.28);
}

#socialPage .friend-chat-head p {
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f4fbff;
  font: 700 16px/1.2 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
}

#socialPage .friend-chat-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  margin-left: auto;
  position: relative;
  z-index: 5;
}

#socialPage .friend-chat-tool {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #f4fbff;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  z-index: 6;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#socialPage .friend-chat-tool svg {
  width: 26px;
  height: 26px;
  display: block;
  pointer-events: none;
}

#socialPage .friend-chat-tool.is-live {
  color: #7dffb2;
}

.friend-call {
  position: fixed;
  left: var(--stage-left, 0px);
  top: var(--stage-top, 0px);
  width: var(--stage-w, 100%);
  height: var(--stage-h, 100%);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  box-sizing: border-box;
  padding: 24px;
  background: rgba(6, 12, 22, 0.94);
  color: #f4fbff;
}

.friend-call[hidden] { display: none !important; }

.friend-call:not([hidden]) {
  display: flex !important;
  z-index: 100000 !important;
  pointer-events: auto !important;
}

.friend-call-stage {
  position: absolute;
  inset: 0;
  background: #000;
}

.friend-call-stage[hidden] { display: none !important; }

#friendCallRemote,
#friendCallLocal {
  display: block;
  object-fit: cover;
  background: #000;
}

#friendCallRemote {
  width: 100%;
  height: 100%;
}

#friendCallLocal {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  width: 104px;
  height: 148px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  transform: scaleX(-1);
}

.friend-call.is-video {
  justify-content: flex-end;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

.friend-call.is-video .friend-call-name,
.friend-call.is-video .friend-call-status,
.friend-call.is-video .friend-call-actions {
  position: relative;
  z-index: 2;
}

.friend-call-name {
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 22px/1.3 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
}

.friend-call-status {
  margin: 0;
  color: #9ec9e8;
  font: 600 16px/1.3 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
}

.friend-call-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.friend-call-actions button {
  min-width: 120px;
  min-height: 56px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font: 700 18px/1 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.friend-call-actions button[hidden] { display: none; }

.friend-call-accept { background: #178a34; }

.friend-call-decline,
.friend-call-hangup { background: #c81e1e; }

#socialPage .friend-chat-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #f4fbff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

#socialPage .friend-chat-close svg {
  width: 22px;
  height: 22px;
  display: block;
}

#socialPage .friend-chat-send {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(#ffe08a, #d7a12d);
  color: #3a2508;
  font: 700 14px/1 "Thonburi", sans-serif;
  cursor: pointer;
}

#socialPage .friend-chat-log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

#socialPage .friend-chat-calllog {
  align-items: flex-end;
}

#socialPage .friend-chat-calllog:not(.is-mine):not(.is-theirs) {
  align-self: center;
}

#socialPage .friend-chat-callbubble {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 168px;
  max-width: min(240px, calc(var(--stage-w, 100vw) * 0.62));
  margin: 0;
  padding: 10px 14px;
  border-radius: 18px;
  background: #3a3b3c;
  color: #fff;
  box-sizing: border-box;
}

#socialPage .friend-chat-callicon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #e4e6eb;
}

#socialPage .friend-chat-callicon svg {
  width: 22px;
  height: 22px;
  display: block;
}

#socialPage .friend-chat-callcopy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

#socialPage .friend-chat-callcopy b {
  font: 700 15px/1.25 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
}

#socialPage .friend-chat-callcopy span {
  color: #b0b3b8;
  font: 600 13px/1.25 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
}

#socialPage .friend-chat-item {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 6px;
  width: fit-content;
  max-width: 92%;
}

#socialPage .friend-chat-item.is-mine {
  align-self: flex-end;
}

#socialPage .friend-chat-item.is-theirs {
  align-self: flex-start;
}

#socialPage .friend-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex: 0 0 auto;
  overflow: hidden;
  align-self: flex-end;
  border: 1px solid rgba(158, 201, 232, 0.85);
  background: rgba(255, 255, 255, 0.08);
  color: #9ec9e8;
}

#socialPage .friend-chat-avatar img,
#socialPage .friend-chat-avatar svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#socialPage .friend-chat-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex: 0 0 auto;
}

#socialPage .friend-chat-bubble {
  max-width: min(240px, calc(var(--stage-w, 100vw) * 0.62));
  margin: 0;
  padding: 8px 12px;
  border-radius: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 600 16px/1.35 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
}

#socialPage .friend-chat-item.is-mine .friend-chat-bubble {
  background: #1d4ed8;
  color: #fff;
}

#socialPage .friend-chat-item.is-theirs .friend-chat-bubble {
  background: rgba(255, 255, 255, 0.12);
  color: #f4fbff;
}

#socialPage .friend-chat-time,
#socialPage .friend-chat-read {
  color: #9ec9e8;
  font: 600 11px/1.2 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
}

#socialPage .friend-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(0, 229, 255, 0.28);
}

#socialPage .friend-chat-form input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 229, 255, 0.45);
  background: rgba(8, 16, 28, 0.9);
  color: #fff;
  font: 600 16px/1.3 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
}

#socialPage .friend-chat-send { padding: 0 16px; }

#socialPage .friend-chat-mic,
#socialPage .friend-chat-cam {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f4fbff;
  display: grid;
  place-items: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#socialPage .friend-chat-mic svg,
#socialPage .friend-chat-cam svg {
  width: 22px;
  height: 22px;
  display: block;
  pointer-events: none;
}

#socialPage .friend-chat-mic.is-recording {
  background: #c81e1e;
  color: #fff;
}

#socialPage .friend-chat-cam {
  position: relative;
  touch-action: manipulation;
  cursor: pointer;
}

.friend-media-pick {
  position: fixed;
  left: var(--stage-left, 0px);
  top: var(--stage-top, 0px);
  width: var(--stage-w, 100%);
  height: var(--stage-h, 100%);
  z-index: 100001;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: #071018;
  color: #f4fbff;
}

.friend-media-pick[hidden] { display: none !important; }

.friend-media-back {
  flex: 0 0 auto;
  width: 44px;
  height: 40px;
  margin: 8px 0 0 8px;
  border: 0;
  background: transparent;
  color: #f4fbff;
  font: 700 28px/1 "Thonburi", sans-serif;
}

.friend-media-tabs {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px 12px 10px;
}

.friend-media-tab {
  height: 64px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #d5e8f8;
  display: grid;
  place-items: center;
}

.friend-media-tab svg {
  width: 30px;
  height: 30px;
  pointer-events: none;
}

.friend-media-tab.is-on {
  background: #1d4ed8;
  color: #fff;
}

.friend-shoot {
  display: none;
  flex: 1;
  min-height: 0;
  position: relative;
  background: #000;
}

.friend-media-pick.is-camera .friend-shoot { display: block; }

.friend-media-pick.is-camera .friend-media-grid { display: none; }

.friend-shoot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.friend-shoot-go {
  position: absolute;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  width: 74px;
  height: 74px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 5px solid #fff;
  background: #fff;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.28);
}

.friend-media-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  align-content: start;
  padding: 4px 8px calc(12px + env(safe-area-inset-bottom, 0px));
}

.friend-media-cell,
.friend-media-add {
  position: relative;
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  color: #f4fbff;
}

.friend-media-cell img,
.friend-media-cell video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.friend-media-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent #fff;
}

.friend-media-add {
  display: grid;
  place-items: center;
  font: 700 13px/1.2 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
}

.friend-media-grid:has(.friend-media-cell) .friend-media-add {
  font-size: 28px;
}

.friend-media-grid:not(:has(.friend-media-cell)) .friend-media-add {
  grid-column: 1 / -1;
  aspect-ratio: auto;
  min-height: 140px;
}

#socialPage .friend-chat-file {
  display: block;
  width: min(220px, calc(var(--stage-w, 100vw) * 0.62));
  border-radius: 14px;
  overflow: hidden;
  background: #101820;
  color: #9ec9e8;
  text-decoration: none;
}

#socialPage .friend-chat-file img,
#socialPage .friend-chat-file video {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  background: #0b1218;
}

#socialPage .friend-chat-file a {
  display: block;
  padding: 6px 10px 8px;
  color: #d7ecff;
  font: 700 13px/1.2 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
  text-decoration: none;
}

#socialPage .friend-chat-compose {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
}

#socialPage .friend-chat-compose input { width: 100%; }

#socialPage .friend-chat-livewave {
  display: none;
  align-items: center;
  gap: 2px;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(125, 255, 178, 0.7);
  background: rgba(8, 16, 28, 0.94);
  box-sizing: border-box;
}

#socialPage .friend-chat-form.is-recording input { display: none; }

#socialPage .friend-chat-form.is-recording .friend-chat-livewave { display: flex; }

#socialPage .friend-chat-livewave i,
#socialPage .friend-chat-wave i {
  display: block;
  flex: 1 1 2px;
  width: auto;
  max-width: 3px;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
}

#socialPage .friend-chat-livewave i {
  flex: 1 1 0;
  max-width: none;
  background: #7dffb2;
}

#socialPage .friend-chat-voice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 196px;
  max-width: min(240px, calc(var(--stage-w, 100vw) * 0.62));
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 14px;
  font: 700 13px/1 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
  cursor: pointer;
}

#socialPage .friend-chat-item.is-mine .friend-chat-voice {
  background: #1d4ed8;
  color: #fff;
}

#socialPage .friend-chat-item.is-theirs .friend-chat-voice {
  background: rgba(255, 255, 255, 0.12);
  color: #f4fbff;
}

#socialPage .friend-chat-voice-play {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 1.6px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

#socialPage .friend-chat-voice-play::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 2px;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent currentColor;
}

#socialPage .friend-chat-voice.is-playing .friend-chat-voice-play::before {
  width: 8px;
  height: 10px;
  margin: 0;
  border: 0;
  background:
    linear-gradient(currentColor, currentColor) left center / 2.5px 100% no-repeat,
    linear-gradient(currentColor, currentColor) right center / 2.5px 100% no-repeat;
}

#socialPage .friend-chat-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 22px;
  flex: 1;
  min-width: 0;
  color: inherit;
}

#socialPage .friend-chat-voice.is-playing .friend-chat-wave i { opacity: 0.35; }

#socialPage .friend-chat-voice.is-playing .friend-chat-wave i.is-heard { opacity: 1; }

#socialPage .friend-chat-voice-len { flex: 0 0 auto; }

#socialPage .friend-panel-title,
#socialPage .friend-panel-empty,
#socialPage .friend-panel-name {
  margin: 10px 0 0;
  color: #f4fbff;
  font: 700 15px/1.3 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
  text-align: left;
}

#socialPage .friend-panel-empty {
  color: #c5d4e0;
  font-weight: 600;
}

#socialPage .friend-panel-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: #fff;
  font: 700 15px/1.2 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
}

#socialPage .friend-panel-row span:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#socialPage .friend-accept {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(#ffe08a, #d7a12d);
  color: #3a2508;
  font: 700 14px/1 "Thonburi", sans-serif;
  cursor: pointer;
}

#socialPage .friend-panel-wait {
  flex: 0 0 42px;
  color: #ffd978;
  text-align: right;
}

#lobbyPage .lobby-brand-logo {
  display: none !important;
}

.lobby-brand-bar .lobby-bag-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  pointer-events: auto;
  margin: 0 8px 0 auto;
  /* กรอบใหญ่ขึ้น — ไอคอนคงขนาดเดิม */
  --sf-hex-frame-size: clamp(72px, 11vw, 86px);
  --sf-hex-icon-size: clamp(48px, 7.2vw, 58px);
  --sf-biz-icon-size: clamp(22px, 4.2vw, 28px);
  /* กรอบหกเหลี่ยม — ice / plasma cyan (สไตล์ใหม่) */
  --sf-hex-rim: linear-gradient(
    155deg,
    #c8ffff 0%,
    #5ef8ff 18%,
    #00d4ff 42%,
    #2a7bff 68%,
    #6dffe8 88%,
    #e8ffff 100%
  );
  --sf-hex-core:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(0, 232, 255, 0.28) 0%, transparent 58%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(20, 80, 255, 0.22) 0%, transparent 55%),
    linear-gradient(165deg, #0c1828 0%, #050c16 48%, #081420 100%);
  --sf-hex-glow:
    0 0 8px rgba(0, 232, 255, 0.55),
    0 0 22px rgba(0, 160, 255, 0.32),
    0 0 36px rgba(45, 120, 255, 0.16),
    inset 0 0 14px rgba(0, 232, 255, 0.14);
}

.lobby-brand-bar .bag-btn.bag-btn-scifi {
  position: relative;
  width: var(--sf-hex-frame-size);
  height: var(--sf-hex-frame-size);
  padding: 0;
  border: none;
  border-radius: 0;
  font-size: 0;
  line-height: 0;
  color: #e8fbff;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  overflow: visible;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.lobby-brand-bar .bag-btn.bag-btn-scifi::before {
  display: none;
}

/* กรอบหกเหลี่ยมร่วม — ล็อบบี้หิบ / Robit / Business */
.lobby-brand-bar .bag-btn.bag-btn-scifi .bag-btn-hex-frame,
.scifi-chest-btn .bag-btn-hex-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  background: var(--sf-hex-core);
  border: none;
  box-shadow: var(--sf-hex-glow);
  overflow: hidden;
}

.lobby-brand-bar .bag-btn.bag-btn-scifi .bag-btn-hex-frame::before,
.scifi-chest-btn .bag-btn-hex-frame::before {
  content: '';
  position: absolute;
  inset: -3px;
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  background: var(--sf-hex-rim);
  z-index: 0;
  pointer-events: none;
  opacity: 0.95;
}

.lobby-brand-bar .bag-btn.bag-btn-scifi .bag-btn-hex-frame::after,
.scifi-chest-btn .bag-btn-hex-frame::after {
  content: '';
  position: absolute;
  inset: 2px;
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  background: var(--sf-hex-core);
  box-shadow: inset 0 0 0 1px rgba(180, 255, 255, 0.22);
  z-index: 0;
  pointer-events: none;
}

.lobby-brand-bar .bag-btn.bag-btn-scifi .bag-btn-hex-frame.scifi-chest-icon-stack {
  overflow: visible;
}

/* หิบล็อบบี้ / หิบตู้ — เอาฐานหกเหลี่ยมออก เหลือแค่ไอคอน */
.lobby-brand-bar .bag-btn.bag-btn-scifi .bag-btn-hex-frame,
#lobbyChestBtn .bag-btn-hex-frame,
#slotSessionBagBtn .bag-btn-hex-frame,
.scifi-chest-btn .bag-btn-hex-frame {
  clip-path: none !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.lobby-brand-bar .bag-btn.bag-btn-scifi .bag-btn-hex-frame::before,
.lobby-brand-bar .bag-btn.bag-btn-scifi .bag-btn-hex-frame::after,
#lobbyChestBtn .bag-btn-hex-frame::before,
#lobbyChestBtn .bag-btn-hex-frame::after,
#slotSessionBagBtn .bag-btn-hex-frame::before,
#slotSessionBagBtn .bag-btn-hex-frame::after,
.scifi-chest-btn .bag-btn-hex-frame::before,
.scifi-chest-btn .bag-btn-hex-frame::after {
  display: none !important;
  content: none !important;
}

.scifi-chest-btn.is-chest-open .bag-btn-hex-frame.scifi-chest-icon-stack,
.lobby-brand-bar .bag-btn.bag-btn-scifi.is-chest-open .bag-btn-hex-frame.scifi-chest-icon-stack {
  overflow: visible;
}

.scifi-chest-icon-stack {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lobbyChestBtn,
#slotSessionBagBtn,
#slotPage .slot-session-bag-btn.slot-chest-btn {
  --sf-hex-frame-size: clamp(86.4px, 13.2vw, 103.2px);
  --sf-hex-icon-size: clamp(57.6px, 8.64vw, 69.6px);
  width: var(--sf-hex-frame-size);
  height: var(--sf-hex-frame-size);
  pointer-events: auto !important;
  z-index: 30;
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
}

#lobbyChestBtn:focus,
#lobbyChestBtn:focus-visible,
#lobbyChestBtn:active,
#slotSessionBagBtn:focus,
#slotSessionBagBtn:focus-visible,
#slotSessionBagBtn:active,
.scifi-chest-btn:focus,
.scifi-chest-btn:focus-visible,
.scifi-chest-btn:active {
  outline: none !important;
  outline-offset: 0 !important;
}

.scifi-chest-3d {
  position: absolute !important;
  inset: 0 !important;
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
  transform: none;
  z-index: 3;
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.22));
  transition: filter 0.18s ease;
}

.scifi-chest-3d-canvas,
.scifi-chest-3d-video {
  width: 100% !important;
  height: 100% !important;
  display: block;
  pointer-events: none;
  object-fit: contain;
  background: transparent;
}

.scifi-chest-3d-src {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.scifi-chest-btn.is-chest-open .scifi-chest-3d,
.scifi-chest-btn.is-ready.is-chest-open .scifi-chest-3d {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.28)) drop-shadow(0 0 10px rgba(0, 232, 255, 0.42));
}

.scifi-chest-btn:hover .scifi-chest-3d {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.28)) drop-shadow(0 0 7px rgba(0, 232, 255, 0.36));
}

/* Place the slot chest look on the lobby: same city backdrop, viewport-locked crop */
#lobbyChestBtn {
  background: transparent !important;
  background-image: none !important;
}

#lobbyPage #lobbyChestBtn,
#slotPage .slot-session-bag-btn.slot-chest-btn {
  position: relative;
  top: -12px;
  right: auto;
  left: auto;
  bottom: auto;
}

#slotPage .slot-chest-chrome {
  pointer-events: none;
  z-index: 200;
}

#slotPage .slot-chest-chrome .lobby-bag-stack,
#slotPage .slot-chest-chrome #slotSessionBagBtn {
  pointer-events: auto;
}

.lobby-chest-home {
  position: relative;
  width: clamp(86.4px, 13.2vw, 103.2px);
  height: clamp(86.4px, 13.2vw, 103.2px);
  flex-shrink: 0;
}

/* ซ้อนหิบล็อบบี้ + หิบตู้ที่มุมขวาบน — ซ่อนจากผู้เล่นชั่วคราว */
.player-chest-pile {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 4px);
  right: 10px;
  width: clamp(102px, 16.2vw, 122px);
  height: clamp(102px, 16.2vw, 122px);
  z-index: 30;
}

#lobbyPage.active ~ .player-chest-pile,
#slotPage.active ~ .player-chest-pile {
  display: none !important;
}

.player-chest-pile .lobby-chest-home {
  position: absolute;
  pointer-events: none;
}

.player-chest-pile .lobby-chest-home .bag-btn {
  pointer-events: auto;
}

.player-chest-pile .lobby-chest-home--rear {
  top: 14px;
  right: 14px;
  z-index: 1;
}

.player-chest-pile .lobby-chest-home--front {
  top: 0;
  right: 0;
  z-index: 2;
}

html.player-stage .player-chest-pile {
  top: calc(var(--stage-top) + 4px);
  right: auto;
  left: calc(var(--stage-left) + var(--stage-w) - 10px);
  transform: translateX(-100%);
}

.lobby-chest-fly-layer {
  position: fixed;
  inset: 0;
  z-index: 980;
  pointer-events: none;
  visibility: hidden;
}

.lobby-chest-fly-layer,
.lobby-chest-fly-layer.is-on {
  visibility: hidden !important;
  pointer-events: none !important;
}

.lobby-chest-fly-dim {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 16, 0);
  transition: background 0.45s ease;
}

.lobby-chest-fly-layer.is-on .lobby-chest-fly-dim {
  background: rgba(4, 8, 16, 0.58);
}

html.player-stage .lobby-chest-fly-layer {
  left: var(--stage-left) !important;
  top: var(--stage-top) !important;
  width: var(--stage-w) !important;
  height: var(--stage-h) !important;
  right: auto !important;
  bottom: auto !important;
}

#lobbyChestBtn.is-lobby-flying,
#slotSessionBagBtn.is-lobby-flying {
  pointer-events: none !important;
  overflow: visible !important;
}

.lobby-brand-bar .bag-btn.bag-btn-scifi.is-lobby-flying:hover,
#lobbyChestBtn.is-lobby-flying:hover,
#slotSessionBagBtn.is-lobby-flying:hover {
  transform: none !important;
}

#lobbyChestBtn.is-lobby-flying .scifi-chest-3d,
#slotSessionBagBtn.is-lobby-flying .scifi-chest-3d {
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 16px rgba(0, 232, 255, 0.4));
}

.scifi-chest-btn.is-lobby-flying .slot-session-bag-count {
  display: none !important;
}

.inventory-bag-scifi-overlay.is-lobby-chest-reveal {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  align-items: flex-start;
  padding-top: max(6vh, 12px);
  padding-bottom: min(42vh, 300px);
  animation: none !important;
}

.inventory-bag-scifi-overlay.is-lobby-chest-reveal .inventory-bag-scifi-title-chest {
  display: none;
}

.inventory-bag-scifi-title-chest {
  position: relative;
  width: 108px;
  height: 108px;
  flex-shrink: 0;
}
.inventory-chest-3d {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: none !important;
}
.inventory-chest-3d canvas,
.inventory-chest-3d .scifi-chest-3d-canvas,
.inventory-chest-3d .scifi-chest-3d-video {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  object-fit: contain;
  background: transparent;
}

.lobby-brand-bar .bag-btn.bag-btn-scifi:hover {
  transform: scale(1.04);
}

.lobby-brand-bar .bag-btn.bag-btn-scifi .bag-btn-crate-3d,
.lobby-brand-bar .bag-btn.bag-btn-scifi .bag-btn-crate-fallback {
  position: relative;
  z-index: 2;
  width: 78%;
  height: 78%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.35)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.lobby-brand-bar .bag-btn.bag-btn-scifi .bag-btn-crate-3d {
  width: 88%;
  height: 88%;
}

.lobby-brand-bar .bag-btn.bag-btn-scifi .bag-btn-crate-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.lobby-brand-bar .bag-btn.bag-btn-scifi.is-ready .bag-btn-crate-fallback {
  display: none;
}

.lobby-brand-bar .bag-btn.bag-btn-scifi.is-star-launch {
  animation: lobbyBagStarLaunch 0.35s cubic-bezier(0.22, 1.4, 0.36, 1) both;
}

/* Business — ไอคอนต้นฉบับ ไม่ใช้ฐานหกเหลี่ยม */
.lobby-brand-bar .lobby-biz-under-bag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--sf-hex-frame-size);
  height: var(--sf-hex-frame-size);
  margin: 0;
  position: relative;
  top: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  overflow: visible;
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.lobby-brand-bar .lobby-biz-under-bag:focus,
.lobby-brand-bar .lobby-biz-under-bag:focus-visible,
.lobby-brand-bar .lobby-biz-under-bag:active {
  outline: none !important;
}

.lobby-brand-bar .lobby-biz-under-bag .lobby-biz-icon-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.lobby-brand-bar .lobby-biz-under-bag:hover {
  transform: scale(1.04);
}

.lobby-brand-bar .lobby-biz-under-bag:hover .lobby-biz-icon-img {
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 8px rgba(0, 232, 255, 0.4));
}

.lobby-brand-bar .lobby-monopoly-under-bag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--sf-hex-frame-size);
  height: var(--sf-hex-frame-size);
  margin: 8px 0 0;
  position: relative;
  top: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  overflow: visible;
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.lobby-brand-bar .lobby-monopoly-under-bag:focus,
.lobby-brand-bar .lobby-monopoly-under-bag:focus-visible,
.lobby-brand-bar .lobby-monopoly-under-bag:active {
  outline: none !important;
}

.lobby-brand-bar .lobby-monopoly-under-bag .lobby-biz-icon-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.lobby-brand-bar .lobby-monopoly-under-bag:hover {
  transform: scale(1.04);
}

.lobby-brand-bar .lobby-monopoly-under-bag:hover .lobby-biz-icon-img {
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 8px rgba(0, 232, 255, 0.4));
}

@keyframes lobbyBagStarLaunch {
  0% { transform: scale(1); }
  40% { transform: scale(0.88); }
  100% { transform: scale(1); }
}

#lobbyPage {
  overflow: hidden !important;

  /* ── ดาว (อิสระ — ไม่ผูกกับช่องอื่น) ── */
  --lobby-star-top: calc(env(safe-area-inset-top, 0px) + 48px);
  --lobby-star-row: calc(1.45em + 28px);

  /* ── ช่องแสดงผลหลัก (stats + rankings + feature มัดรวมกัน) ── */
  /* ฐานเดิม แล้ว -37px = เลื่อนขึ้น (จาก -32px อีก 5px) */
  --lobby-main-display-top: calc(env(safe-area-inset-top, 0px) + 58px + 1.55rem + 34px + 18px - 37px);
  --lobby-main-display-bottom-pad: calc(150px + env(safe-area-inset-bottom, 0px));
}

.lobby-stars-top {
  top: var(--lobby-star-top) !important;
  --lobby-star-cell: 48.64px;
  --lobby-star-icon: var(--lobby-star-cell);
  --lobby-star-outer-extra-x: 48.64px;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible !important;
  color: var(--sf-gold, #ffd978);
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-size: var(--lobby-star-cell);
  line-height: 1;
  background: rgba(6, 12, 26, 0.55);
  border: 1px solid rgba(0, 229, 255, 0.42);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px rgba(0, 229, 255, 0.1),
    0 0 14px rgba(0, 229, 255, 0.08);
  padding: 4px calc(4px + var(--lobby-star-outer-extra-x));
  box-sizing: border-box;
}

.lobby-stars-top .lobby-star-spin {
  box-sizing: border-box;
  width: var(--lobby-star-cell);
  height: var(--lobby-star-cell);
  min-width: var(--lobby-star-cell);
  max-width: var(--lobby-star-cell);
  min-height: var(--lobby-star-cell);
  max-height: var(--lobby-star-cell);
  flex: 0 0 var(--lobby-star-cell);
  aspect-ratio: 1 / 1;
  margin: 0;
  padding: 0;
  border-width: 1px;
  border-style: solid;
  border-radius: 8px;
  overflow: visible;
  position: relative;
  top: 0;
  bottom: auto;
  left: 0;
  right: auto;
  transform: none;
  transform-origin: center center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: rgba(0, 229, 255, 0.8);
  background: rgba(6, 12, 26, 0.55);
  box-shadow:
    inset 0 0 0 1px rgba(0, 229, 255, 0.15),
    0 0 12px rgba(0, 229, 255, 0.2);
}

.lobby-stars-top .format-number {
  position: relative;
  opacity: 0.95;
  line-height: 1;
  font-size: calc(var(--lobby-star-cell) * 0.42);
  box-sizing: border-box;
  width: auto;
  min-width: var(--lobby-star-cell);
  max-width: none;
  height: var(--lobby-star-cell);
  min-height: var(--lobby-star-cell);
  max-height: var(--lobby-star-cell);
  flex: 0 0 auto;
  aspect-ratio: auto;
  margin: 0;
  padding: 0 12px;
  border-width: 1px;
  border-style: solid;
  border-radius: 8px;
  overflow: visible;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-color: rgba(255, 215, 0, 0.8);
  box-shadow:
    inset 0 0 0 1px rgba(255, 215, 0, 0.12),
    0 0 10px rgba(255, 215, 0, 0.14);
  background: rgba(6, 12, 26, 0.72);
  color: #ffd978;
  -webkit-text-fill-color: #ffd978;
  filter: none;
  text-shadow:
    0 0 6px rgba(0, 210, 255, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.45);
}

.lobby-stars-top .format-number::before {
  display: none;
  content: none;
}

.lobby-stars-top .lobby-star-spin .lobby-star-canvas {
  filter: none;
  opacity: 1;
}

/* ช่องแสดงผลหลัก — มัด stats / rankings / feature (ไม่ผูกตำแหน่งดาว) */
/* ไม่ใส่กรอบห่อทั้งชุด — กรอบอยู่เฉพาะช่องข้อความอันดับด้านใน */
#lobbyPage .lobby-main-display.lobby-hero-scifi,
#lobbyPage #lobbyMainDisplay {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  top: var(--lobby-main-display-top) !important;
  margin: 0 !important;
  padding-bottom: var(--lobby-main-display-bottom-pad) !important;
  transform: none !important;
  z-index: 4 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

@media (max-height: 740px) {
  .lobby-feature-grid { display: none; }
  .lobby-rank-panel,
  .lobby-rank-row-pair { margin-bottom: 8px; }
}

@media (max-height: 640px) {
  /* จอเตี้ย — ย่อแผงอันดับ ไม่ซ่อน (เคย display:none ทำให้อันดับหาย) */
  .lobby-rank-row-pair { margin-bottom: 6px; gap: 6px; }
  .lobby-rank-row-pair > .lobby-rank-panel { padding: 8px 10px 6px; }
  .lobby-rank-row-pair .lobby-rank-panel #lobbyRankList,
  .lobby-rank-row-pair .lobby-rank-panel #lobbyPlayerRankList {
    --lobby-rank-row-slot: 38px;
  }
  .lobby-stats-row { margin-bottom: 8px; }
}

/* ── Inventory / Storage Crate Modal (Sci-Fi) ── */
.inventory-bag-scifi-overlay {
  background: rgba(4, 8, 16, 0.52);
  backdrop-filter: blur(3px) saturate(0.92);
  -webkit-backdrop-filter: blur(3px) saturate(0.92);
}

.inventory-bag-scifi-overlay.active {
  animation: inventoryBagOverlayIn 0.28s ease both;
}

@keyframes inventoryBagOverlayIn {
  from { background: rgba(4, 8, 16, 0.08); backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); }
  to { background: rgba(4, 8, 16, 0.52); backdrop-filter: blur(3px) saturate(0.92); -webkit-backdrop-filter: blur(3px) saturate(0.92); }
}

.inventory-bag-scifi-overlay .inventory-bag-scifi-panel.modal-content {
  position: relative;
  max-width: min(94vw, 460px);
  max-height: min(86vh, 640px);
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.inventory-bag-scifi-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: polygon(0 14px, 14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px));
  background:
    radial-gradient(circle at 18% 12%, rgba(124, 77, 255, 0.22) 0%, transparent 48%),
    radial-gradient(circle at 82% 88%, rgba(0, 229, 255, 0.16) 0%, transparent 44%),
    rgba(4, 8, 18, 0.97);
  border: 1.5px solid rgba(0, 229, 255, 0.38);
  box-shadow:
    0 0 28px rgba(0, 229, 255, 0.18),
    0 0 48px rgba(124, 77, 255, 0.1),
    inset 0 0 24px rgba(0, 229, 255, 0.06);
  z-index: 0;
}

.inventory-bag-scifi-corners {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.inventory-bag-scifi-corners::before,
.inventory-bag-scifi-corners::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--sf-cyan);
  border-style: solid;
  opacity: 0.85;
}

.inventory-bag-scifi-corners::before {
  top: 6px;
  left: 6px;
  border-width: 2px 0 0 2px;
}

.inventory-bag-scifi-corners::after {
  bottom: 6px;
  right: 6px;
  border-width: 0 2px 2px 0;
}

.inventory-bag-scifi-header {
  position: relative;
  z-index: 3;
  margin: 0;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.22);
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.08) 0%, transparent 100%);
  flex: 0 0 auto;
}

.inventory-bag-scifi-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.inventory-bag-scifi-title-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.45));
}

.inventory-bag-scifi-title-text h2 {
  margin: 0;
  font-size: clamp(17px, 4.2vw, 20px);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #e8fbff;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
}

.inventory-bag-scifi-sub {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(0, 229, 255, 0.72);
}

.inventory-bag-scifi-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(0, 229, 255, 0.28);
  background: rgba(0, 229, 255, 0.06);
  color: var(--sf-cyan);
  font-size: 22px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.inventory-bag-scifi-close:hover {
  color: #fff;
  border-color: rgba(0, 229, 255, 0.55);
  background: rgba(0, 229, 255, 0.14);
  transform: rotate(90deg);
}

.inventory-bag-scifi-body {
  position: relative;
  z-index: 3;
  padding: 14px 16px 18px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.inventory-bag-scifi-empty {
  position: relative;
  min-height: 200px;
  padding: 36px 20px 32px;
  border-radius: 10px;
  border: 1px dashed rgba(0, 229, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(0, 229, 255, 0.04) 0%, transparent 100%),
    rgba(2, 8, 18, 0.55);
  overflow: hidden;
}

.inventory-bag-scifi-empty-glow {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 140px;
  height: 140px;
  transform: translate(-50%, -58%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.16) 0%, transparent 68%);
  pointer-events: none;
}

.inventory-bag-scifi-empty-icon {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  opacity: 0.72;
  filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.35));
}

.inventory-bag-scifi-empty-text {
  position: relative;
  z-index: 1;
  color: rgba(232, 251, 255, 0.88);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.inventory-bag-scifi-empty-hint {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  color: rgba(0, 229, 255, 0.55);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.inventory-bag-scifi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 8px;
  padding: 2px 4px 4px 0;
  width: 100%;
  max-height: min(46vh, 340px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  justify-items: stretch;
  align-items: stretch;
  scrollbar-gutter: stable;
}

.inventory-bag-scifi-grid.inventory-bag-list,
.inventory-bag-scifi-grid.slot-session-bag-list {
  gap: 8px;
  padding: 2px 4px 4px 0;
  max-height: min(46vh, 340px);
  overflow-x: hidden;
  overflow-y: auto;
  justify-items: stretch;
}

.inventory-bag-scifi-grid::-webkit-scrollbar {
  width: 6px;
}

.inventory-bag-scifi-grid::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.28);
  border-radius: 999px;
}

.inventory-bag-scifi-slot {
  width: 100%;
  min-width: 0;
  display: flex;
}

.inventory-bag-scifi-slot-inner {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: clamp(118px, 28vw, 148px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
  clip-path: none;
  background:
    radial-gradient(circle at 30% 22%, rgba(124, 77, 255, 0.18) 0%, transparent 52%),
    radial-gradient(circle at 72% 78%, rgba(0, 229, 255, 0.12) 0%, transparent 46%),
    rgba(6, 10, 22, 0.92);
  border: 1px solid rgba(0, 229, 255, 0.24);
  box-shadow:
    inset 0 0 12px rgba(0, 229, 255, 0.05),
    0 0 10px rgba(0, 229, 255, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.inventory-bag-scifi-icon-layer {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(78px, 20vw, 104px);
  padding: 10px 8px 6px;
}

.inventory-bag-scifi-amount-layer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 8px;
  border-top: 1px solid rgba(0, 229, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(0, 229, 255, 0.1) 0%, rgba(0, 229, 255, 0.04) 100%),
    rgba(2, 8, 18, 0.72);
}

.inventory-bag-scifi-slot:hover .inventory-bag-scifi-slot-inner {
  border-color: rgba(0, 229, 255, 0.42);
  box-shadow:
    inset 0 0 14px rgba(0, 229, 255, 0.08),
    0 0 16px rgba(0, 229, 255, 0.18);
}

.inventory-bag-scifi-slot:hover .inventory-bag-scifi-amount-layer {
  border-top-color: rgba(0, 229, 255, 0.38);
  background:
    linear-gradient(180deg, rgba(0, 229, 255, 0.14) 0%, rgba(0, 229, 255, 0.06) 100%),
    rgba(2, 8, 18, 0.82);
}

.inventory-bag-scifi-slot .inventory-bag-item-icon,
.inventory-bag-scifi-slot .slot-session-bag-item-icon {
  font-size: clamp(58px, 16vw, 78px);
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.inventory-bag-scifi-slot .inventory-bag-item-icon .game-icon-coin,
.inventory-bag-scifi-slot .inventory-bag-item-icon .game-icon-grenade,
.inventory-bag-scifi-slot .inventory-bag-item-icon .game-icon-shield,
.inventory-bag-scifi-slot .inventory-bag-item-icon .game-icon-starship,
.inventory-bag-scifi-slot .inventory-bag-item-icon .game-icon-reaper,
.inventory-bag-scifi-slot .inventory-bag-item-icon .game-icon-bust,
.inventory-bag-scifi-slot .inventory-bag-item-icon .game-icon-crate,
.inventory-bag-scifi-slot .inventory-bag-item-icon .game-icon-diamond,
.inventory-bag-scifi-slot .inventory-bag-item-icon .game-icon-star,
.inventory-bag-scifi-slot .inventory-bag-item-icon .game-icon-key,
.inventory-bag-scifi-slot .slot-session-bag-item-icon .game-icon-coin,
.inventory-bag-scifi-slot .slot-session-bag-item-icon .game-icon-grenade,
.inventory-bag-scifi-slot .slot-session-bag-item-icon .game-icon-shield,
.inventory-bag-scifi-slot .slot-session-bag-item-icon .game-icon-starship,
.inventory-bag-scifi-slot .slot-session-bag-item-icon .game-icon-reaper,
.inventory-bag-scifi-slot .slot-session-bag-item-icon .game-icon-bust,
.inventory-bag-scifi-slot .slot-session-bag-item-icon .game-icon-crate,
.inventory-bag-scifi-slot .slot-session-bag-item-icon .game-icon-diamond,
.inventory-bag-scifi-slot .slot-session-bag-item-icon .game-icon-star,
.inventory-bag-scifi-slot .slot-session-bag-item-icon .game-icon-key {
  width: clamp(58px, 16vw, 78px);
  height: clamp(58px, 16vw, 78px);
}

.inventory-bag-scifi-slot .inventory-bag-item-amount,
.inventory-bag-scifi-slot .slot-session-bag-item-amount {
  color: var(--sf-gold);
  font-size: clamp(16px, 3.8vw, 19px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  text-shadow: 0 0 8px rgba(255, 217, 120, 0.35);
}

@media (max-width: 768px) {
  .inventory-bag-scifi-header { padding: 14px 14px 12px; }
  .inventory-bag-scifi-body { padding: 12px 12px 16px; }
  .inventory-bag-scifi-empty { min-height: 180px; padding: 28px 16px 24px; }
  .inventory-bag-scifi-empty-icon { width: 60px; height: 60px; }
}

/* ── Slot page — sci-fi chest (มุมบนขวา ตำแหน่งเดียวกับล็อบบี้) ── */
#slotPage .slot-session-bag-btn.slot-chest-btn {
  --sf-hex-frame-size: clamp(86.4px, 13.2vw, 103.2px);
  --sf-hex-icon-size: clamp(57.6px, 8.64vw, 69.6px);
  --sf-hex-rim: linear-gradient(
    155deg,
    #c8ffff 0%,
    #5ef8ff 18%,
    #00d4ff 42%,
    #2a7bff 68%,
    #6dffe8 88%,
    #e8ffff 100%
  );
  --sf-hex-core:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(0, 232, 255, 0.28) 0%, transparent 58%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(20, 80, 255, 0.22) 0%, transparent 55%),
    linear-gradient(165deg, #0c1828 0%, #050c16 48%, #081420 100%);
  --sf-hex-glow:
    0 0 8px rgba(0, 232, 255, 0.55),
    0 0 22px rgba(0, 160, 255, 0.32),
    0 0 36px rgba(45, 120, 255, 0.16),
    inset 0 0 14px rgba(0, 232, 255, 0.14);
  position: relative;
  top: -12px;
  right: auto;
  left: auto;
  bottom: auto;
  z-index: 200;
  width: var(--sf-hex-frame-size);
  height: var(--sf-hex-frame-size);
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #e8fbff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  overflow: visible;
  line-height: 0;
  transition: transform 0.2s ease;
}

#slotPage .slot-session-bag-btn.slot-chest-btn:hover {
  transform: scale(1.04);
  background: transparent;
}

#slotPage .slot-session-bag-btn.slot-chest-btn.is-catch {
  animation: slotBagCatch 0.45s ease;
}

#slotPage .slot-session-bag-btn.slot-chest-btn .slot-session-bag-count {
  z-index: 4;
  top: 16px;
  right: 2px;
}

#monopolyPage.monopoly-page {
  padding: 0;
  overflow: hidden;
  background-color: #6ec8f8;
  background-image: url('../assets/images/player-sky-backdrop.jpg?v=20260930sky1');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 110;
}

#monopolyPage.monopoly-page.active {
  display: block;
}

/* ห้องนี้ใช้กรอบแนวนอน — สลับสัดส่วน 19.5:9 เฉพาะตอนเปิด Mono Poly */
html.player-stage body:has(#monopolyPage.active) {
  --stage-w: min(2340px, 100vw, calc(100vh * 19.5 / 9));
  --stage-h: min(1080px, 100vh, calc(100vw * 9 / 19.5));
  --stage-left: calc((100vw - var(--stage-w)) / 2);
  --stage-top: calc((100vh - var(--stage-h)) / 2);
  top: var(--stage-top) !important;
  left: var(--stage-left) !important;
  width: var(--stage-w) !important;
  height: var(--stage-h) !important;
  min-height: 0 !important;
  max-width: var(--stage-w) !important;
  max-height: var(--stage-h) !important;
  aspect-ratio: 19.5 / 9;
}

@supports (height: 100dvh) {
  html.player-stage body:has(#monopolyPage.active) {
    --stage-w: min(2340px, 100vw, calc(100dvh * 19.5 / 9));
    --stage-h: min(1080px, 100dvh, calc(100vw * 9 / 19.5));
    --stage-left: calc((100vw - var(--stage-w)) / 2);
    --stage-top: calc((100dvh - var(--stage-h)) / 2);
    top: var(--stage-top) !important;
    left: var(--stage-left) !important;
    width: var(--stage-w) !important;
    height: var(--stage-h) !important;
    min-height: 0 !important;
    max-width: var(--stage-w) !important;
    max-height: var(--stage-h) !important;
  }
}

.monopoly-room-host {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  touch-action: none;
}

.monopoly-room-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  outline: none;
  cursor: grab;
  touch-action: none;
}

.monopoly-clock {
  position: absolute;
  top: 6px;
  left: 50%;
  z-index: 8;
  transform: translateX(-50%);
  margin: 0;
  padding: 4px 14px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 10px;
  background: rgba(8, 12, 20, 0.72);
  color: #fff;
  font: 700 18px/1.2 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  text-align: center;
  pointer-events: none;
  visibility: hidden;
}

.monopoly-clock.is-on {
  visibility: visible;
}

#monopolyPage.is-gate .monopoly-clock {
  visibility: hidden;
}

.monopoly-page-chrome {
  --mono-base-w: 180px;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 5;
  pointer-events: none;
}

.monopoly-page-hint {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 220px;
  height: 54px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.55);
  pointer-events: none;
}

.monopoly-hint-stack {
  position: absolute;
  top: 70px;
  left: calc(8px - 6px - 1px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: calc(var(--mono-base-w) + 42px);
  margin: 0;
  padding: 6px 34px 6px 6px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  background: rgba(8, 12, 20, 0.22);
  pointer-events: none;
}

.monopoly-hint-base {
  position: relative;
  width: var(--mono-base-w);
  height: 40px;
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.55);
}

.monopoly-base-ring {
  position: absolute;
  left: 4px;
  top: 4px;
  z-index: 1;
  height: calc(100% - 8px);
  aspect-ratio: 1;
  box-sizing: border-box;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  pointer-events: none;
}

.monopoly-slot-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.monopoly-page-hint .monopoly-slot-name {
  position: absolute;
  z-index: 1;
  left: 58px;
  right: 96px;
  top: 6px;
  color: #fff;
  font: 700 15px/1.15 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.monopoly-hint-base .monopoly-slot-name {
  position: absolute;
  z-index: 1;
  left: 40px;
  right: 84px;
  top: 4px;
  color: #fff;
  font: 700 12px/1.15 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.monopoly-slot-next {
  position: absolute;
  z-index: 1;
  right: 8px;
  top: 6px;
  color: #ffe08a;
  font: 700 12px/1 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
  white-space: nowrap;
  pointer-events: none;
  display: none;
}

.monopoly-hint-base .monopoly-slot-next {
  top: 4px;
  right: 8px;
  font-size: 10px;
}

.monopoly-slot-next.is-on {
  display: block;
}

.monopoly-base-cap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 40'%3E%3Cpath d='M41 20H179A19 19 0 0 0 160 1H28.94A21 21 0 0 1 41 20' fill='none' stroke='%23fff' stroke-opacity='0.88' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}

.monopoly-page-hint .monopoly-base-cap {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 54'%3E%3Cpath d='M55 27H219A26 26 0 0 0 193 1H37.39A28 28 0 0 1 55 27' fill='none' stroke='%23fff' stroke-opacity='0.88' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.monopoly-base-frame {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  aspect-ratio: 1 / 2;
  box-sizing: border-box;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 6px;
  background: rgba(8, 12, 20, 0.72);
  overflow: hidden;
  pointer-events: none;
  transform: translateX(calc(100% + 8px));
}

.monopoly-voice-btn {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  display: grid;
  place-items: center;
  pointer-events: auto;
  cursor: pointer;
}

.monopoly-voice-btn + .monopoly-voice-btn {
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.88);
}

.monopoly-voice-btn svg {
  width: 68%;
  height: 68%;
  overflow: visible;
}

.monopoly-voice-slash {
  display: none;
}

.monopoly-voice-btn.is-off {
  color: rgba(255, 255, 255, 0.55);
}

.monopoly-voice-btn.is-off .monopoly-voice-slash {
  display: block;
}

.monopoly-voice-btn.is-live {
  color: #b6ffb2;
}

.monopoly-voice-btn.is-locked {
  pointer-events: none;
  cursor: default;
}

#monopolyPage .monopoly-back-sign {
  position: absolute;
  top: 10px;
  right: 30px;
  left: auto;
  width: 16%;
  max-width: 84px;
  aspect-ratio: 1774 / 887;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  pointer-events: auto;
  z-index: 6;
  --slot-back-base-grow: 0.2;
  --slot-back-base-tilt: -4deg;
}

#monopolyPage .monopoly-back-sign .slot-back-base,
#monopolyPage .monopoly-back-sign .slot-back-arrow {
  position: absolute;
  display: block;
  pointer-events: none;
  transform-origin: center center;
}

#monopolyPage .monopoly-back-sign .slot-back-base {
  inset: calc(var(--slot-back-base-grow) * -100%);
  z-index: 0;
  transform-origin: 98.8% 52.3%;
  transform: rotate(var(--slot-back-base-tilt));
}

#monopolyPage .monopoly-back-sign .slot-back-arrow {
  left: -11.1%;
  top: 2%;
  bottom: auto;
  width: 122%;
  height: 122%;
  right: auto;
  z-index: 1;
  transform-origin: 50% 50%;
  transform: scale(1);
  animation: slot-back-arrow-bob 1.9s ease-in-out infinite;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.35));
}

#monopolyPage .monopoly-back-sign:active .slot-back-arrow {
  animation: none;
  transform: scale(0.9);
}

#monopolyPage .monopoly-back-sign .slot-back-base img,
#monopolyPage .monopoly-back-sign .slot-back-arrow img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (prefers-reduced-motion: reduce) {
  #monopolyPage .monopoly-back-sign .slot-back-arrow {
    animation: none;
  }
}

#monopolyPage .monopoly-roll-btn {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 7;
  visibility: hidden;
  pointer-events: none;
  margin: 0;
  padding: 8px 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(#ffe08a, #d7a12d);
  color: #3a2508;
  font: 700 16px/1 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
  letter-spacing: 0.02em;
  box-shadow: 0 3px 0 #8a6418, 0 6px 12px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

#monopolyPage .monopoly-roll-btn:active {
  transform: translateX(-50%) translateY(2px);
  box-shadow: 0 1px 0 #8a6418;
}

#monopolyPage .monopoly-roll-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

#monopolyPage.is-my-turn .monopoly-roll-btn {
  visibility: visible;
  pointer-events: auto;
}

#monopolyPage .monopoly-turn-call {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 58px;
  transform: translateX(-50%);
  z-index: 7;
  margin: 0;
  padding: 4px 12px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.82);
  color: #fff;
  font: 700 15px/1.2 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
  white-space: nowrap;
  pointer-events: none;
}

#monopolyPage .monopoly-turn-call.is-on {
  display: block;
}

#monopolyPage .monopoly-turn-order {
  display: none;
  position: absolute;
  left: 16px;
  right: 170px;
  top: 10px;
  z-index: 7;
  margin: 0;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font: 700 14px/1.35 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
  text-align: center;
  pointer-events: none;
}

#monopolyPage.is-order .monopoly-turn-order {
  display: block;
}

#monopolyPage .monopoly-cam-tab {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 7;
  display: flex;
  pointer-events: auto;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 3px 0 #8a6418, 0 6px 12px rgba(0, 0, 0, 0.35);
}

#monopolyPage .monopoly-cam-tab button {
  margin: 0;
  padding: 8px 14px;
  border: 0;
  background: #c9a15a;
  color: #3a2508;
  font: 700 14px/1 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
  cursor: pointer;
}

#monopolyPage .monopoly-cam-tab button + button {
  border-left: 1px solid rgba(58, 37, 8, 0.28);
}

#monopolyPage .monopoly-cam-tab button.is-on {
  background: linear-gradient(#ffe08a, #d7a12d);
}

#monopolyPage .monopoly-cam-tab button:active {
  transform: translateY(1px);
}

#monopolyPage.is-gate .monopoly-roll-btn,
#monopolyPage.is-gate .monopoly-turn-call,
#monopolyPage.is-gate .monopoly-cam-tab,
#monopolyPage.is-gate .monopoly-turn-order {
  visibility: hidden;
  pointer-events: none;
}

#monopolyPage .monopoly-entry {
  display: none;
}

#monopolyPage.is-gate .monopoly-entry {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  pointer-events: auto;
}

#monopolyPage.is-gate .monopoly-page-chrome {
  z-index: 9;
}

#monopolyPage.is-gate .monopoly-page-hint,
#monopolyPage.is-gate .monopoly-hint-stack {
  visibility: hidden;
}

#monopolyPage .monopoly-entry-card {
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: auto;
  padding: 6px 156px 6px 20px;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.88);
  box-shadow: none;
  text-align: center;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

#monopolyPage .monopoly-entry-title,
#monopolyPage .monopoly-prep-self,
#monopolyPage .monopoly-prep-friends,
#monopolyPage .monopoly-prep-row,
#monopolyPage .monopoly-prep-block,
#monopolyPage .monopoly-prep-pick,
#monopolyPage .monopoly-prep-gold,
#monopolyPage .monopoly-entry-go {
  width: min(560px, 100%);
}

#monopolyPage .monopoly-entry-title {
  margin: 0 0 4px;
  color: #f6e7b0;
  font: 700 20px/1 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
}

#monopolyPage .monopoly-prep-self {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin: 0 0 8px;
  padding: 6px 14px 6px 6px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.55);
  color: #fff;
  font: 700 16px/1.2 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
  text-align: left;
}

#monopolyPage .monopoly-prep-photo-ring {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

#monopolyPage .monopoly-prep-photo-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#monopolyPage .monopoly-prep-friends {
  margin: 0 0 8px;
  flex: 1 1 auto;
  min-height: 168px;
  display: flex;
  flex-direction: column;
}

#monopolyPage .monopoly-prep-friends .monopoly-prep-label {
  display: block;
  margin: 0 0 6px;
  text-align: left;
  font-size: 18px;
}

#monopolyPage .monopoly-friend-list {
  flex: 1 1 auto;
  min-height: 140px;
  max-height: none;
  overflow: auto;
}

#monopolyPage .monopoly-friend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  margin: 0 0 6px;
}

#monopolyPage .monopoly-friend-name {
  flex: 1 1 auto;
  min-width: 0;
  color: #fff8e4;
  font: 700 16px/1.2 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#monopolyPage .monopoly-friend-add {
  flex: 0 0 auto;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(#ffe08a, #d7a12d);
  color: #3a2508;
  font: 700 15px/1 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
  cursor: pointer;
}

#monopolyPage .monopoly-friend-add:disabled {
  opacity: 0.55;
  cursor: default;
}

#monopolyPage .monopoly-friend-wait {
  flex: 0 0 40px;
  color: #ffd978;
  font: 700 13px/1 "Thonburi", sans-serif;
  text-align: right;
}

#monopolyPage .monopoly-friend-empty {
  margin: 0;
  color: #c5d4e0;
  font: 600 14px/1.2 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
  text-align: left;
}

#monopolyPage .monopoly-prep-row,
#monopolyPage .monopoly-prep-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 4px;
}

#monopolyPage .monopoly-prep-label {
  color: #f6e7b0;
  font: 700 16px/1.2 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
}

#monopolyPage .monopoly-prep-step {
  display: flex;
  align-items: center;
  gap: 6px;
}

#monopolyPage .monopoly-prep-step button {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(#ffe08a, #d7a12d);
  color: #3a2508;
  font: 700 18px/1 "Thonburi", sans-serif;
  cursor: pointer;
}

#monopolyPage .monopoly-prep-step span {
  min-width: 22px;
  color: #fff8e4;
  font: 700 16px/1 "Thonburi", sans-serif;
}

#monopolyPage .monopoly-color-row {
  display: flex;
  gap: 6px;
}

#monopolyPage .monopoly-color-row button {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  cursor: pointer;
}

#monopolyPage .monopoly-color-row button.is-on {
  box-shadow: 0 0 0 2px #e6c56a;
}

#monopolyPage .monopoly-prep-pick,
#monopolyPage .monopoly-prep-gold {
  margin: 0 0 4px;
  color: #f6e7b0;
  font: 700 15px/1.2 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
}

#storePage .store-gold-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

#monopolyPage .monopoly-entry-go {
  margin: 0;
  padding: 4px 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(#ffe08a, #d7a12d);
  color: #3a2508;
  font: 700 20px/1 "Thonburi", "Sukhumvit Set", "Noto Sans Thai", sans-serif;
  box-shadow: 0 3px 0 #8a6418, 0 6px 12px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

#monopolyPage .monopoly-entry-go:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #8a6418;
}

#monopolyPage .monopoly-entry-go:disabled {
  opacity: 0.55;
  cursor: default;
}

/* ช่วงรอโหลดแรก — จอดำเต็มเว็บ ไม่ย่อเป็นกรอบมือถือแนวตั้ง */
html.player-stage #loadingScreen {
  left: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  background-color: #000 !important;
  background-image: none !important;
}

/* ห้องสล็อต — ป้ายไม้กลับ มุมบนขวา ชิดขอบบนจอ ขนาดเล็กลงนิด */
#slotPage .back-btn,
html.player-stage #slotPage .back-btn {
  left: auto !important;
  right: 0 !important;
  top: 0 !important;
  bottom: auto !important;
  width: calc(100% - (var(--slot-under-pair-width) * var(--slot-yellow-pack-scale) / 2 * 1.52) - 1.2%) !important;
  max-width: none !important;
  transform: translateY(0) scale(1) !important;
  transform-origin: top right !important;
}

html.player-stage #slotPage .back-btn {
  position: absolute !important;
}

#slotPage .slot-back-sign,
html.player-stage #slotPage .slot-back-sign {
  position: absolute !important;
  aspect-ratio: 1774 / 887;
  --slot-back-base-grow: 0.2;
  --slot-back-base-tilt: -4deg;
  padding: 0;
  filter: none !important;
}

#slotPage .slot-back-sign::after,
html.player-stage #slotPage .slot-back-sign::after {
  content: none;
  display: none;
}

#slotPage .slot-back-sign:hover,
#slotPage .slot-back-sign:active,
#slotPage .slot-back-sign.is-pressed {
  filter: none !important;
}

#slotPage .slot-back-sign .slot-back-base,
#slotPage .slot-back-sign .slot-back-arrow {
  position: absolute;
  display: block;
  pointer-events: none;
  transform: scale(1);
  transform-origin: center center;
  transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#slotPage .slot-back-sign .slot-back-base {
  inset: calc(var(--slot-back-base-grow) * -100%);
  z-index: 0;
  transform-origin: 98.8% 52.3%;
  transform: rotate(var(--slot-back-base-tilt));
}

/* ช่วงพัก: เด้งนุ่มอยู่กับที่ ไม่ย้วย */
#slotPage .slot-back-sign .slot-back-arrow {
  left: -11.1%;
  top: 2%;
  bottom: auto;
  width: 122%;
  height: 122%;
  right: auto;
  z-index: 1;
  transform-origin: 50% 50%;
  transform: scale(1);
  animation: slot-back-arrow-bob 1.9s ease-in-out infinite;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.35));
}

@keyframes slot-back-arrow-bob {
  0%, 100% { transform: scale(0.97); }
  50% { transform: scale(1.045); }
}

/* กด: ยุบเข้าเฉพาะลูกศร ฐานไม่ขยับ */
#slotPage .slot-back-sign.is-touched .slot-back-arrow {
  animation: none;
  transform-origin: 50% 50%;
  transition: transform 0.12s ease-out;
  transform: scale(0.9);
}

#slotPage .slot-back-sign.is-restoring .slot-back-arrow {
  animation: none;
  transform-origin: 50% 50%;
  transition: transform 0.2s ease-out;
  transform: scale(1);
}

#slotPage .slot-back-sign.is-touched .slot-back-base,
#slotPage .slot-back-sign.is-leaving .slot-back-base,
#slotPage .slot-back-sign.is-restoring .slot-back-base {
  transform: rotate(var(--slot-back-base-tilt));
}

#slotPage .slot-back-sign .slot-back-base img,
#slotPage .slot-back-sign .slot-back-arrow img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  #slotPage .slot-back-sign .slot-back-arrow {
    animation: none;
  }
}

#slotPage .slot-back-sign:active,
#slotPage .slot-back-sign.is-pressed,
html.player-stage #slotPage .slot-back-sign:active,
html.player-stage #slotPage .slot-back-sign.is-pressed {
  transform: translateY(0) scale(1) !important;
}

@media (max-width: 1024px) {
  html.player-stage #slotPage .slot-back-sign {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
    transform: translateY(0) scale(1) !important;
  }
}

