/* ════════════════════════════════════════════════════════════════════════════
   PLAYER PAGE STYLES - SVG BUTTON VERSION (ปรับปรุงใหม่)
   ════════════════════════════════════════════════════════════════════════════ */
.player-page {
    background: #0a0a0a;
    min-height: 100vh;
    padding-bottom: 100px;
    overflow-x: hidden;
    box-sizing: border-box;
    position: relative;
}

.player-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border-bottom: 2px solid #d4af37;
    padding: 20px;
    margin-bottom: 20px;
}

.player-logo {
    color: #d4af37;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
}

.player-balance {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.balance-item {
    background: rgba(212, 175, 55, 0.1);
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    box-sizing: border-box;
}

.balance-item .value {
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.balance-item .label {
    color: #888;
    font-size: 12px;
}

.balance-item.diamond .value { color: #4fc3f7; }
.balance-item.star .value { color: #ffd700; }

.player-country-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid #d4af37;
    border-radius: 8px;
    padding: 10px 15px;
}

.player-content {
    padding: 20px;
}

.player-tab {
    display: none;
}

.player-tab.active {
    display: block;
    animation: fadeIn 0.3s;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #151515;
    border: 1px solid #333;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: 0.3s;
}

.setting-item:hover {
    border-color: #d4af37;
    background: #1a1a1a;
}

.setting-item .label {
    color: #d4af37;
    font-size: 16px;
}

/* ==========================================
   TAB BAR
   ========================================== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    /* โปร่งใส — ให้ภาพพื้นหลังล็อบบี้ไหลยาวถึงใต้แท็บบาร์ */
    background: transparent;
    border-top: none;
    box-shadow: none;
    display: flex;
    justify-content: space-around;
    height: 80px;
    align-items: center;
    z-index: 500;
    box-sizing: border-box;
    padding-bottom: env(safe-area-inset-bottom);
}

.tab-item {
    flex: 1;
    text-align: center;
    cursor: pointer;
    color: #888;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tab-item:hover { color: #d4af37; }
.tab-item.active { color: #d4af37; }

.tab-item .icon {
    font-size: 36px;
    margin-bottom: 4px;
}

/* โลกอยู่กลางแถบแท็บ (ระดับเดียวกับเพื่อน) — ชื่อ LOBBY ทับกลางลูกโลก */
.tab-item-lobby {
    justify-content: center;
}

.lobby-earth-stack {
    position: relative;
    width: 120px;
    height: 120px;
    margin-top: -10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-item .icon.tab-home-icon {
    position: absolute;
    inset: 0;
    margin: 0;
    font-size: 36px;
    line-height: 1;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.tab-item .icon.tab-home-icon .lobby-earth-canvas {
    width: 120px !important;
    height: 120px !important;
    display: block;
    pointer-events: none;
    filter:
      brightness(1.22)
      contrast(1.08)
      saturate(1.15)
      drop-shadow(0 2px 8px rgba(0, 160, 255, 0.55))
      drop-shadow(0 0 14px rgba(255, 255, 255, 0.35));
}

.tab-item .label.lobby-earth-label {
    position: relative;
    z-index: 2;
    margin: 0;
    padding: 0 2px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.4px;
    line-height: 1;
    color: #fff;
    text-shadow:
      0 0 4px rgba(0, 0, 0, 0.95),
      0 1px 0 #000,
      0 0 10px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    white-space: nowrap;
}

.tab-item.active .label.lobby-earth-label {
    color: #ffe566;
    text-shadow:
      0 0 4px rgba(0, 0, 0, 0.95),
      0 1px 0 #000,
      0 0 12px rgba(255, 215, 0, 0.55);
}

.tab-item .label {
    font-size: 16px;
    font-weight: bold;
    text-shadow:
      0 1px 2px rgba(0, 0, 0, 0.75),
      0 0 8px rgba(0, 0, 0, 0.35);
}

/* ==========================================
   LOBBY PAGE (HOME)
   ========================================== */
#lobbyPage {
    display: none;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: #f3e7c8;
    background-image:
        linear-gradient(180deg, rgba(255, 248, 230, 0.22) 0%, rgba(255, 244, 220, 0.08) 45%, rgba(255, 250, 240, 0.1) 100%),
        url('../assets/images/lobby-backdrop.webp?v=20260728af');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    padding: 20px;
    padding-bottom: 160px;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    box-sizing: border-box;
}

/* ชั้นภาพพื้นหลังเต็มจอ รวมโซนใต้แท็บบาร์ — อย่าบัง position:fixed ของลูก */
#lobbyPage::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-color: #f3e7c8;
    background-image:
        linear-gradient(180deg, rgba(255, 248, 230, 0.22) 0%, rgba(255, 244, 220, 0.08) 45%, rgba(255, 250, 240, 0.1) 100%),
        url('../assets/images/lobby-backdrop.webp?v=20260728af');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* เดสก์ท็อป player-stage: ภาพพื้นหลังแค่ในกรอบจอเกม ไม่ล้นนอกเฟรม */
html.player-stage #lobbyPage::before {
    inset: auto;
    left: var(--stage-left);
    top: var(--stage-top);
    width: var(--stage-w);
    height: var(--stage-h);
}

/* ใบไม้ในกรอบล็อบบี้เท่านั้น */
.lobby-ambience {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.45s ease;
}

.lobby-ambience.is-live {
    opacity: 1;
}

.lobby-ambience.is-reduced {
    display: none;
}

.lobby-ambience-fx {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

@media (prefers-reduced-motion: reduce) {
    .lobby-ambience {
        display: none;
    }
}

#lobbyPage.active { display: block; }

.lobby-header {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    margin-bottom: 30px;
}

/* กระเป๋า + Business เรียงใต้กัน มุมขวาบน */
.lobby-bag-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    flex-shrink: 0;
}

.lobby-biz-under-bag {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    margin: 0;
    padding: 2px 4px;
    border: none;
    background: transparent;
    color: #d4af37;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.25s ease;
}

.lobby-biz-under-bag:hover {
    transform: scale(1.06);
}

.lobby-biz-under-bag-icon {
    font-size: clamp(18px, 3.2vw, 24px);
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}

.lobby-biz-under-bag-label {
    font-size: clamp(9px, 1.8vw, 11px);
    font-weight: 800;
    letter-spacing: 0.2px;
    color: #ffe8a0;
    text-shadow:
      0 1px 2px rgba(0, 0, 0, 0.85),
      0 0 6px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
}

/* ==========================================
   SETTING BUTTON (ขนาดมาตรฐานตามจอ)
   ========================================== */
.setting-btn {
    width: clamp(42px, 6.5vw, 52px);
    height: clamp(42px, 6.5vw, 52px);
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #d4af37;
    font-size: clamp(24px, 3.8vw, 32px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    transition: 0.3s;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.setting-btn:hover { 
    background: rgba(212,175,55,0.1);
    transform: scale(1.05);
}

.lobby-header .bag-btn {
    width: clamp(47px, 6.5vw, 57px);
    height: clamp(47px, 6.5vw, 57px);
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #d4af37;
    font-size: clamp(29px, 3.8vw, 37px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    transition: transform 0.3s;
    padding: 0;
    margin: 0;
    line-height: 1;
    flex-shrink: 0;
}

.lobby-header .bag-btn:hover {
    background: transparent;
    transform: scale(1.05);
}

/* ดาวบินจากกระเป๋าล็อบบี้ → ไอคอนดาว */
.lobby-header .bag-btn.is-star-launch {
    animation: lobbyBagStarLaunch 0.35s cubic-bezier(0.22, 1.4, 0.36, 1) both;
}

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

/* ดาวถึงแม่ — ไม่เด้งไอคอน/เลข (แม่หันหน้าตรงนิ่งรับใน 3D) */
.lobby-stars-top .lobby-star-spin.is-star-catch-bounce {
    animation: none;
}

.lobby-stars-top .format-number.is-star-count-pop {
    animation: none;
}

.lobby-star-fly-ghost {
    /* ต่ำกว่า .lobby-stars-top (1000) ให้บินลอดเลขดาว */
    z-index: 990;
}

.inventory-bag-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px 36px;
    text-align: center;
    min-height: 180px;
}

.inventory-bag-empty-icon {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 16px;
    opacity: 0.55;
}

.inventory-bag-empty-text {
    color: #888;
    font-size: 16px;
}

.inventory-bag-empty[hidden],
.inventory-bag-list[hidden] {
    display: none !important;
}

.inventory-bag-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 18px;
    max-height: min(55vh, 420px);
    overflow-y: auto;
    padding: 12px 4px 8px;
    justify-items: center;
}

.inventory-bag-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: none;
    min-width: 0;
}

.inventory-bag-item-icon {
    font-size: 56px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-bag-item-icon .game-icon-coin,
.inventory-bag-item-icon .game-icon-grenade,
.inventory-bag-item-icon .game-icon-shield,
.inventory-bag-item-icon .game-icon-starship,
.inventory-bag-item-icon .game-icon-reaper,
.inventory-bag-item-icon .game-icon-bust,
.inventory-bag-item-icon .game-icon-crate,
.inventory-bag-item-icon .game-icon-diamond,
.inventory-bag-item-icon .game-icon-star {
    width: 56px;
    height: 56px;
}

.inventory-bag-item-amount {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

@media (max-width: 768px) {
    .inventory-bag-item-icon { font-size: 48px; }
    .inventory-bag-item-icon .game-icon-coin,
    .inventory-bag-item-icon .game-icon-grenade,
    .inventory-bag-item-icon .game-icon-shield,
    .inventory-bag-item-icon .game-icon-starship,
    .inventory-bag-item-icon .game-icon-reaper,
    .inventory-bag-item-icon .game-icon-bust,
    .inventory-bag-item-icon .game-icon-crate,
    .inventory-bag-item-icon .game-icon-diamond,
    .inventory-bag-item-icon .game-icon-star {
        width: 48px;
        height: 48px;
    }
    .inventory-bag-item-amount { font-size: 18px; }
}

/* ==========================================
   ✅ SVG BUTTON CONTROLS
   ========================================== */
.svg-button-container {
    position: fixed !important;
    bottom: 110px !important;
    left: 0 !important;
    right: 5px !important;
    height: 80px !important;
    z-index: 300 !important;
}

.svg-button-container svg {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

/* Animation สำหรับ ROBIT — เรืองทองแบบแท่ง */
@keyframes svgPulseGlow {
    0%, 100% { 
        filter: drop-shadow(0 0 4px rgba(255, 200, 60, 0.45));
    }
    50% { 
        filter: drop-shadow(0 0 14px rgba(255, 215, 80, 0.85));
    }
}

.lobby-bar-btn-robit {
    animation: svgPulseGlow 2.2s ease-in-out infinite !important;
}

#robitPolygon {
    animation: none !important;
}

/* ข้อความ ROBIT — หนาขึ้นเฉพาะมือถือ (เว็บคงแบบเดิม) */
@media (max-width: 768px) {
    #robitText {
        font-weight: 900 !important;
        font-family: Arial Black, Arial, sans-serif !important;
        stroke: rgba(90, 55, 8, 0.45);
        stroke-width: 1.45px;
        paint-order: stroke fill;
    }
}

/* ==========================================
   ✅ LEVEL BADGE - ชิดมุมขวาล่างของปุ่ม HOME
   ========================================== */
.level-badge {
    position: absolute !important;
    bottom: 0 !important;
    right: 0 !important;
    left: auto !important;
    top: auto !important;
    background: transparent !important;
    background-image: none !important;
    color: #ffd700 !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    padding: 0 4px 2px 0 !important;
    border-radius: 0 !important;
    border: none !important;
    z-index: 302 !important;
    font-family: Arial Black, Arial, sans-serif;
    white-space: nowrap;
    box-shadow: none !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
    pointer-events: none;
    line-height: 1.1;
}

/* เว็บ/เดสก์ท็อป: Lv ใหญ่ หนา สีเหลืองเหมือน HOME ไม่มีพื้นหลัง */
@media (min-width: 769px) {
  .svg-button-container > .level-badge#levelBadge {
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    color: #ffd700 !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    padding: 0 5px 2px 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
    font-family: Arial Black, Arial, sans-serif !important;
  }
}

/* ==========================================
   ✅ COUNTDOWN BOX - ชิดล่างสุดของปุ่ม ROBIT
   ========================================== */
.lv-countdown-box {
    position: absolute !important;
    bottom: 0 !important;
    top: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: transparent !important;
    border: none !important;
    padding: 0 0 2px !important;
    border-radius: 0 !important;
    text-align: center;
    z-index: 303 !important;
    pointer-events: none;
    white-space: nowrap;
}

.lv-countdown-box #lobbyCountdown {
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: bold !important;
    letter-spacing: 0.5px !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9) !important;
    line-height: 1.1;
}

/* ซ่อนส่วนที่ไม่ใช้แล้ว */
.lobby-country, .lobby-stars { 
    display: none !important; 
}

/* ==========================================
   WORLD PAGE — ฐานโลกเต็มจอ (Google Earth shell)
   ========================================== */
#worldPage.world-page {
  padding: 0;
  overflow: hidden;
  background: #0a0e16;
  z-index: 110;
}

#worldPage.world-page.active {
  display: block;
}

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

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

.world-resource-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.world-page-chrome {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 14px 0 14px;
  pointer-events: none;
}

.world-back-btn {
  pointer-events: auto;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 10px;
  background: rgba(8, 12, 22, 0.72);
  color: #ffe8a0;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.world-back-btn:hover {
  background: rgba(20, 28, 48, 0.88);
  border-color: #d4af37;
}

.world-page-hint {
  margin-top: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* ==========================================
   BUSINESS PAGE - Map
   ========================================== */
#businessPage {
    background: #0a0a0a;
    overflow: hidden;
}

.biz-stats-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(212, 175, 55, 0.1);
    border: 2px solid #d4af37;
    border-radius: 12px;
}

.biz-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.biz-stat-icon { font-size: 24px; }
.biz-stat-value { color: #d4af37; font-size: 24px; font-weight: bold; }
.biz-stat-label { color: #888; font-size: 14px; }

.map-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 250px);
    overflow: hidden;
    background: #0a0a0a;
    border-radius: 12px;
    border: none;
    touch-action: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.map-content {
    position: relative;
    width: 1290px;
    height: 800px;
    background: radial-gradient(circle at center, #1a1a1a 0%, #0a0a0a 100%);
    transform-origin: center center;
}

.level-node {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid #d4af37;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    box-sizing: border-box;
}

.level-node:hover { transform: scale(1.1); }

.level-node.unlocked {
    border-color: #00cc66;
    box-shadow: 0 0 20px rgba(0, 204, 102, 0.6);
}

.level-node.current {
    border-color: #ffd700;
    animation: pulseYellow 2s infinite;
}

@keyframes pulseYellow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6); border-color: #ffd700; }
    50% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.9); border-color: #ffed4e; }
}

.level-node.locked {
    border-color: #444;
    background: #222;
    opacity: 0.4;
    cursor: not-allowed;
}

.level-node .lv-icon { font-size: 24px; margin-bottom: 2px; }
.level-node .lv-text { color: #fff; font-size: 14px; font-weight: bold; }
.level-node .lv-req { color: #888; font-size: 10px; }

.modal-back-btn {
    width: 90%;
    max-width: 400px;
    margin: 20px auto;
    display: block;
    padding: 14px;
    background: linear-gradient(135deg, #d4af37, #f5d76e);
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.modal-back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .player-balance { grid-template-columns: repeat(2, 1fr); }
    .balance-item .value { font-size: 20px; }
    
    .tab-bar { height: 70px; }
    .tab-item .icon { font-size: 30px; }
    .tab-item .icon.tab-home-icon {
      font-size: 30px;
      width: 120px;
      height: 120px;
      margin-top: 0;
    }
    .lobby-earth-stack {
      width: 120px;
      height: 120px;
      margin-top: -8px;
    }
    .tab-item .icon.tab-home-icon .lobby-earth-canvas {
      width: 120px !important;
      height: 120px !important;
    }
    .tab-item .label.lobby-earth-label {
      font-size: 11px;
    }
    .tab-item .label { font-size: 14px; }
    
    .setting-btn { 
        width: clamp(56px, 15vw, 68px);
        height: clamp(56px, 15vw, 68px);
        font-size: clamp(34px, 8.5vw, 46px);
        margin: -6px 0 0 -8px;
        position: relative;
        top: -4px;
        left: -4px;
    }

    .lobby-bag-stack {
        margin: -6px -8px 0 auto;
        position: relative;
        top: -4px;
        right: -4px;
    }

    .lobby-header .bag-btn {
        width: clamp(61px, 15vw, 73px);
        height: clamp(61px, 15vw, 73px);
        font-size: clamp(39px, 8.5vw, 51px);
        margin: 0;
        background: transparent;
    }

    .lobby-biz-under-bag-icon {
        font-size: clamp(20px, 5vw, 26px);
    }

    .lobby-biz-under-bag-label {
        font-size: clamp(10px, 2.6vw, 12px);
    }

    #lobbyPage {
        padding-top: 8px;
        padding-left: 8px;
    }

    .lobby-header {
        margin-bottom: 18px;
    }
    
    .lobby-stars-top {
        font-size: 24px;
        top: 8px;
        pointer-events: none;
    }

    .lobby-stars-top .lobby-star-spin {
        width: calc(1.2em + 26px);
        height: calc(1.2em + 26px);
    }
    
    .svg-button-container {
        bottom: 90px !important;
        left: 0 !important;
        right: 3px !important;
        height: 72px !important;
    }
    
    .svg-button-container .level-badge {
        bottom: 0 !important;
        right: 0 !important;
        left: auto !important;
        top: auto !important;
        background: transparent !important;
        color: #ffd700 !important;
        font-size: 17px !important;
        font-weight: 900 !important;
        padding: 0 3px 1px 0 !important;
        border: none !important;
        box-shadow: none !important;
        line-height: 1 !important;
        font-family: Arial Black, Arial, sans-serif !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7) !important;
        -webkit-text-stroke: 0.35px #ffd700;
    }
    
    .lv-countdown-box {
        bottom: 0 !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    
    .level-node { width: 70px; height: 70px; }
    .level-node .lv-icon { font-size: 20px; }
    .level-node .lv-text { font-size: 12px; }
}

@media (max-width: 375px) {
    .svg-button-container {
        bottom: 85px !important;
        left: 0 !important;
        right: 2px !important;
        height: 68px !important;
    }
    
    .svg-button-container .level-badge {
        bottom: 0 !important;
        right: 0 !important;
        left: auto !important;
        background: transparent !important;
        color: #ffd700 !important;
        font-size: 15px !important;
        font-weight: 900 !important;
        padding: 0 2px 1px 0 !important;
        border: none !important;
        box-shadow: none !important;
        line-height: 1 !important;
        font-family: Arial Black, Arial, sans-serif !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7) !important;
        -webkit-text-stroke: 0.35px #ffd700;
    }
    
    .lv-countdown-box {
        bottom: 0 !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

@media (min-width: 414px) and (max-width: 768px) {
    .svg-button-container {
        bottom: 95px !important;
        left: 0 !important;
        right: 6px !important;
        height: 78px !important;
    }
    
    .svg-button-container .level-badge {
        bottom: 0 !important;
        right: 0 !important;
        left: auto !important;
        top: auto !important;
        background: transparent !important;
        color: #ffd700 !important;
        font-size: 17px !important;
        font-weight: 900 !important;
        padding: 0 3px 1px 0 !important;
        border: none !important;
        box-shadow: none !important;
        line-height: 1 !important;
        font-family: Arial Black, Arial, sans-serif !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7) !important;
        -webkit-text-stroke: 0.35px #ffd700;
    }

    .lv-countdown-box {
        bottom: 0 !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .svg-button-container {
        max-width: none !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        bottom: 110px !important;
        height: 84px !important;
        width: auto !important;
    }
    
    .level-badge {
        bottom: 0 !important;
        right: 0 !important;
    }
    
    .lv-countdown-box {
        bottom: 0 !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

/* จอเว็บใหญ่ (ผู้เล่นเท่านั้น): แถบปุ่มชิดขอบกรอบแนวตั้ง iPad Pro */
@media (min-width: 1025px) {
    html.player-stage .svg-button-container {
        max-width: none !important;
        left: var(--stage-left) !important;
        right: calc(100vw - var(--stage-left) - var(--stage-w)) !important;
        width: auto !important;
        transform: none !important;
        bottom: calc(100vh - var(--stage-top) - var(--stage-h) + 110px) !important;
        height: 84px !important;
    }

    html.player-stage .level-badge {
        bottom: 0 !important;
        right: 0 !important;
        left: auto !important;
    }

    html.player-stage .lv-countdown-box {
        bottom: 0 !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

@supports (padding: max(0px)) {
    .tab-bar { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
    #lobbyPage { padding-bottom: max(160px, calc(80px + env(safe-area-inset-bottom))); }
}

/* มือถือเท่านั้น: Lv ชิดขวาล่าง HOME, ไม่มีพื้นหลัง, สีเหลือง ใหญ่ หนา */
@media (max-width: 768px) {
  .svg-button-container > .level-badge#levelBadge {
    position: absolute !important;
    bottom: 0 !important;
    right: 0 !important;
    left: auto !important;
    top: auto !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    color: #ffd700 !important;
    font-weight: 900 !important;
    font-size: 17px !important;
    padding: 0 2px 0 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7) !important;
    -webkit-text-stroke: 0.35px #ffd700;
    font-family: Arial Black, Arial, sans-serif !important;
    line-height: 1 !important;
    z-index: 305 !important;
  }
}


.world-live-status {
  font-weight: 800;
  letter-spacing: 0.4px;
}
