* {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      user-select: none;
      -webkit-user-select: none;
      -webkit-tap-highlight-color: transparent;
    }
    body, html {
      width: 100%;
      height: 100%;
      overflow: hidden;
      background-color: #0b0f19;
      font-family: 'Kanit', 'Outfit', sans-serif;
      color: #ffffff;
    }
    .rotate-device-overlay {
      display: none;
    }
    @media screen and (orientation: portrait) and (max-width: 900px) {
      .rotate-device-overlay {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(11, 15, 25, 0.96);
        z-index: 99999;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        padding: 24px;
      }
      .rotate-phone-card {
        background: rgba(25, 32, 50, 0.9);
        border: 1px solid rgba(255, 215, 0, 0.35);
        border-radius: 20px;
        padding: 28px 24px;
        max-width: 340px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.6);
      }
      .rotate-phone-icon {
        font-size: 48px;
        margin-bottom: 12px;
        animation: rotatePhone 2s infinite ease-in-out;
      }
      @keyframes rotatePhone {
        0%, 100% { transform: rotate(0deg); }
        50% { transform: rotate(-90deg); }
      }
      .rotate-hint {
        margin-top: 14px;
        font-size: 13px;
        color: #ffd700;
      }
    }
    #game-container {
      position: relative;
      width: 100vw;
      height: 100vh;
      overflow: hidden;
      background: #000;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    #gameCanvas {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 1;
      display: none;
    }
    #bgVideo {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center 15%;
      z-index: 2;
      display: block;
      opacity: 0.98;
      pointer-events: none; /* Disables browser hover video overlay tools (PiP and Video Super Resolution) */
    }
    .screen-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 10;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      pointer-events: auto;
      /* CRITICAL: No backdrop blur on fullscreen overlay so video stays 100% crisp */
    }
    .screen-overlay.hidden {
      display: none !important;
      pointer-events: none;
    }
    .glass-card {
      background: rgba(18, 22, 34, 0.82);
      border: 1px solid rgba(255, 255, 255, 0.18);
      border-radius: 24px;
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 215, 0, 0.15);
      padding: 24px 32px;
      max-width: 92vw;
      width: 480px;
      text-align: center;
      animation: modalFadeIn 0.28s ease-out forwards;
      max-height: 90vh;
      overflow-y: auto;
    }
    @keyframes modalFadeIn {
      from { opacity: 0; transform: scale(0.92) translateY(12px); }
      to { opacity: 1; transform: scale(1) translateY(0); }
    }
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 12px 24px;
      margin: 6px;
      font-size: 16px;
      font-weight: 700;
      border: none;
      border-radius: 14px;
      cursor: pointer;
      color: #fff;
      transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
      box-shadow: 0 6px 16px rgba(0,0,0,0.3);
      position: relative;
      overflow: hidden;
    }
    .btn:hover {
      transform: translateY(-2px) scale(1.03);
      box-shadow: 0 10px 22px rgba(0,0,0,0.4);
    }
    .btn:active {
      transform: translateY(1px) scale(0.98);
    }
    .btn-gold {
      background: linear-gradient(135deg, #ffd700, #ff9900);
      color: #111;
      text-shadow: 0 1px 1px rgba(255,255,255,0.4);
    }
    .btn-blue {
      background: linear-gradient(135deg, #00d2ff, #0066ff);
    }
    .btn-green {
      background: linear-gradient(135deg, #2ecc71, #27ae60);
    }
    .btn-red {
      background: linear-gradient(135deg, #ff4757, #e84118);
    }
    .btn-purple {
      background: linear-gradient(135deg, #9b59b6, #8e44ad);
    }
    .btn-outline {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.25);
    }
    #hud {
      position: absolute;
      top: 14px;
      left: 14px;
      right: 14px;
      z-index: 5;
      display: flex;
      justify-content: space-between;
      align-items: center;
      pointer-events: none;
    }
    .hud-left, .hud-right, .hud-center {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .hud-pill {
      background: rgba(16, 20, 32, 0.78);
      border: 1px solid rgba(255, 255, 255, 0.18);
      backdrop-filter: blur(8px);
      padding: 6px 14px;
      border-radius: 20px;
      font-weight: 700;
      font-size: 14px;
      display: flex;
      align-items: center;
      gap: 6px;
      box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
    .hud-pill.dimmed {
      opacity: 0.45;
      filter: grayscale(0.8);
    }
    .hud-pill.timer-urgent {
      background: rgba(255, 71, 87, 0.42) !important;
      border-color: #ff4757 !important;
      color: #fff !important;
      box-shadow: 0 0 16px rgba(255, 71, 87, 0.9) !important;
      animation: pulseUrgentTimer 0.6s infinite alternate !important;
    }
    @keyframes pulseUrgentTimer {
      0% { transform: scale(1); filter: brightness(1); }
      100% { transform: scale(1.08); filter: brightness(1.3); }
    }
    #bossBarContainer {
      position: absolute;
      top: 58px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 5;
      background: rgba(18, 20, 32, 0.85);
      border: 1px solid rgba(255, 71, 87, 0.4);
      border-radius: 16px;
      padding: 6px 16px;
      display: none;
      flex-direction: column;
      align-items: center;
      width: 280px;
      box-shadow: 0 0 20px rgba(255, 71, 87, 0.4);
    }
    #bossBarFill {
      width: 100%;
      height: 10px;
      background: #ff4757;
      border-radius: 5px;
      transition: width 0.2s ease;
      margin-top: 4px;
      box-shadow: 0 0 10px #ff4757;
    }
    #bonusBanner {
      position: absolute;
      top: 70px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 5;
      background: linear-gradient(135deg, rgba(255, 215, 0, 0.9), rgba(255, 107, 107, 0.9));
      color: #111;
      font-weight: 800;
      font-size: 18px;
      padding: 8px 22px;
      border-radius: 24px;
      display: none;
      box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
      animation: pulseBanner 1s infinite alternate;
    }
    @keyframes pulseBanner {
      from { transform: translateX(-50%) scale(0.96); }
      to { transform: translateX(-50%) scale(1.04); }
    }
    #mobileControls {
      position: absolute;
      bottom: max(18px, env(safe-area-inset-bottom, 18px));
      left: 0;
      right: 0;
      height: 110px;
      padding: 0 22px;
      display: none;
      justify-content: space-between;
      align-items: center;
      z-index: 25;
      pointer-events: none;
    }
    .touch-btn {
      pointer-events: auto;
      width: 68px;
      height: 68px;
      background: rgba(18, 24, 38, 0.55);
      border: 2.5px solid rgba(255, 255, 255, 0.5);
      border-radius: 50%;
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 26px;
      color: #fff;
      touch-action: none;
      user-select: none;
      -webkit-user-select: none;
      box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
      transition: transform 0.08s, background 0.1s;
    }
    .touch-btn:active, .touch-btn.active {
      transform: scale(0.9);
      background: rgba(255, 215, 0, 0.5);
      border-color: #ffd700;
      box-shadow: 0 0 18px rgba(255, 215, 0, 0.65);
    }
    .dpad {
      display: flex;
      gap: 16px;
    }
    @media (max-width: 920px), (pointer: coarse) {
      #hud {
        top: 8px;
        left: 8px;
        right: 8px;
        flex-wrap: wrap;
        gap: 4px;
      }
      .hud-pill {
        padding: 4px 10px;
        font-size: 12px;
      }
      .glass-card {
        padding: 18px 20px;
        width: 94vw;
        max-height: 86vh;
      }
    }
    .thai-ai-credit {
      position: absolute;
      bottom: 14px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 1000;
      pointer-events: auto;
      text-align: center;
    }
    .thai-ai-credit a {
      text-decoration: none;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background: rgba(18, 18, 24, 0.75);
      border: 1px solid rgba(255, 215, 0, 0.35);
      border-radius: 20px;
      backdrop-filter: blur(8px);
      padding: 4px 16px;
      transition: all 0.25s ease;
    }
    .thai-ai-credit a:hover {
      transform: scale(1.05);
      box-shadow: 0 0 16px rgba(255, 215, 0, 0.6), 0 4px 20px rgba(0, 0, 0, 0.5);
      border-color: rgba(255, 215, 0, 0.75);
    }
    .brand-domain {
      color: #ffd700;
      font-weight: 700;
      font-size: 13px;
      letter-spacing: 0.6px;
      text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    }
    .brand-sub {
      color: #e2e8f0;
      font-size: 10.5px;
      opacity: 0.9;
      margin-top: 1px;
    }
    .victory-stars {
      display: flex;
      justify-content: center;
      gap: 12px;
      font-size: 42px;
      margin: 12px 0;
    }
    .star-item {
      opacity: 0.2;
      transform: scale(0.6);
      transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    .star-item.active {
      opacity: 1;
      transform: scale(1.15);
      filter: drop-shadow(0 0 10px #ffd700);
    }
    .vic-modal {
      width: min(94vw, 560px) !important;
      padding: 16px 20px !important;
      max-height: 94vh;
      overflow-y: hidden !important;
    }
    .vic-header {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      margin-bottom: 2px;
    }
    .vic-icon {
      font-size: 26px;
      line-height: 1;
    }
    .vic-title {
      font-size: 21px;
      font-weight: 800;
      color: #ffd700;
      margin: 0;
      letter-spacing: 0.5px;
    }
    .vic-subtitle {
      font-size: 12px;
      color: #ced6e0;
      margin: 2px 0 6px 0;
    }
    .victory-stars {
      display: flex;
      justify-content: center;
      gap: 12px;
      font-size: 30px;
      margin: 2px 0 8px 0;
    }
    .vic-grid {
      display: grid !important;
      grid-template-columns: repeat(5, 1fr) !important;
      gap: 6px !important;
      margin: 8px 0 12px 0 !important;
    }
    .stats-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 7px;
      margin: 10px 0;
    }
    .stat-box {
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 12px;
      padding: 6px 4px;
      font-size: 11px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }
    .stat-val {
      font-size: 14.5px;
      font-weight: 800;
      color: #ffd700;
      margin-top: 2px;
      white-space: nowrap;
    }
    .vic-actions {
      display: flex;
      gap: 8px;
      justify-content: center;
      width: 100%;
    }
    .vic-actions .btn {
      margin: 0 !important;
      padding: 9px 12px !important;
      font-size: 13.5px !important;
      border-radius: 14px !important;
      white-space: nowrap !important;
    }
    #btnNextLevel {
      flex: 1.4 !important;
      font-weight: 800 !important;
      font-size: 14.5px !important;
    }
    #btnVicShop {
      flex: 1.1 !important;
    }
    #btnVicMenu {
      flex: 1 !important;
    }
    #screenLifeLost .glass-card {
      width: min(90vw, 320px) !important;
      padding: 16px 20px !important;
      overflow-y: hidden !important;
    }
    #screenLifeLost h2 {
      font-size: 18px !important;
      font-weight: 800;
      color: #ff6b81;
      margin: 2px 0 4px 0 !important;
    }
    #screenLifeLost p {
      font-size: 13px !important;
      color: #ced6e0;
      margin: 0 0 12px 0 !important;
    }
    #screenLifeLost .btn {
      margin: 0 !important;
      padding: 9px 12px !important;
      font-size: 13px !important;
      white-space: nowrap !important;
    }
    .shop-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin: 14px 0;
      max-height: 48vh;
      overflow-y: auto;
      padding-right: 4px;
    }
    .shop-item {
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 16px;
      padding: 10px 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .level-select-card {
      width: min(95vw, 560px);
      max-height: 94vh;
      padding: 14px 18px;
      border-radius: 20px;
      overflow: hidden;
      box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 215, 0, 0.15);
      border: 1px solid rgba(255, 215, 0, 0.25);
    }
    .level-header {
      text-align: center;
      margin-bottom: 6px;
    }
    .level-title {
      font-size: 18px;
      font-weight: 800;
      color: #ffd700;
      margin: 0;
      letter-spacing: 0.5px;
      text-shadow: 0 2px 8px rgba(255, 215, 0, 0.35);
    }
    .world-subtitle {
      font-size: 11.5px;
      color: #ced6e0;
      margin-top: 3px;
      font-weight: 500;
    }
    .world-tabs {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 6px;
      margin: 8px 0;
    }
    .world-tab-btn {
      background: rgba(255, 255, 255, 0.07);
      border: 1px solid rgba(255, 255, 255, 0.16);
      border-radius: 12px;
      padding: 6px 4px;
      color: #dcdde1;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
      user-select: none;
      -webkit-user-select: none;
    }
    .world-tab-btn .tab-name {
      font-size: 12px;
      font-weight: 800;
    }
    .world-tab-btn .tab-range {
      font-size: 9.5px;
      opacity: 0.75;
      margin-top: 1px;
    }
    .world-tab-btn:hover {
      background: rgba(255, 255, 255, 0.15);
      border-color: rgba(255, 215, 0, 0.5);
      transform: translateY(-1px);
    }
    .world-tab-btn.active {
      background: linear-gradient(135deg, rgba(255, 215, 0, 0.28), rgba(255, 168, 1, 0.16));
      border: 1.5px solid #ffd700;
      color: #ffd700;
      box-shadow: 0 0 14px rgba(255, 215, 0, 0.32);
      transform: translateY(-1px);
    }
    .world-tab-btn.active .tab-range {
      opacity: 1;
      color: #fff;
      font-weight: 600;
    }
    .level-grid {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 8px;
      margin: 8px 0 12px 0;
      max-height: none;
      overflow: visible;
    }
    .lvl-btn {
      background: rgba(255, 255, 255, 0.08);
      border: 1.5px solid rgba(255, 255, 255, 0.2);
      border-radius: 12px;
      padding: 11px 0;
      font-weight: 800;
      font-size: 15px;
      color: #fff;
      cursor: pointer;
      transition: all 0.18s cubic-bezier(0.25, 1, 0.5, 1);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 3px;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    }
    .lvl-btn:hover:not(.locked) {
      background: rgba(255, 215, 0, 0.22);
      border-color: #ffd700;
      color: #ffd700;
      transform: translateY(-2px) scale(1.03);
      box-shadow: 0 6px 14px rgba(255, 215, 0, 0.3);
    }
    .lvl-btn.boss {
      border-color: #ff4757;
      color: #ff6b81;
      background: rgba(255, 71, 87, 0.12);
      box-shadow: 0 0 10px rgba(255, 71, 87, 0.22);
    }
    .lvl-btn.boss:hover:not(.locked) {
      background: rgba(255, 71, 87, 0.28);
      border-color: #ff6b81;
      box-shadow: 0 0 16px rgba(255, 71, 87, 0.45);
    }
    .lvl-btn.current {
      border-color: #00d2ff;
      color: #00d2ff;
      box-shadow: 0 0 12px rgba(0, 210, 255, 0.45);
      animation: pulseCurrentLvl 1.8s infinite ease-in-out;
    }
    @keyframes pulseCurrentLvl {
      0%, 100% { transform: scale(1); box-shadow: 0 0 10px rgba(0, 210, 255, 0.3); }
      50% { transform: scale(1.03); box-shadow: 0 0 18px rgba(0, 210, 255, 0.65); }
    }
    .lvl-btn.locked {
      opacity: 0.32;
      cursor: not-allowed;
      background: rgba(0, 0, 0, 0.28);
      border-color: rgba(255, 255, 255, 0.08);
      color: #8892b0;
    }
    .level-footer {
      display: flex;
      justify-content: center;
      gap: 8px;
      margin-top: 4px;
      flex-wrap: wrap;
    }

@keyframes spin {
        from { transform: rotate(0deg); }
        to { transform: rotate(360deg); }
      }

/* ========================================================
   Mobile Landscape Enforcement & Non-Intrusive Menu Styles
   ======================================================== */

/* Rotate Device Prompt */
.rotate-device-overlay {
  display: none;
}

@media screen and (orientation: portrait) and (max-width: 1024px) {
  .rotate-device-overlay {
    display: flex !important;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(11, 15, 25, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 24px;
    color: #fff;
    pointer-events: auto;
  }
  .rotate-phone-card {
    background: rgba(22, 28, 44, 0.88);
    border: 1.5px solid rgba(255, 215, 0, 0.45);
    border-radius: 24px;
    padding: 32px 24px;
    max-width: 320px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 30px rgba(255, 215, 0, 0.25);
  }
  .rotate-phone-icon {
    font-size: 56px;
    margin-bottom: 14px;
    display: inline-block;
    animation: rotatePhoneAnim 2s infinite ease-in-out;
  }
  .rotate-phone-card h2 {
    font-size: 20px;
    font-weight: 800;
    color: #ffd700;
    margin-bottom: 10px;
  }
  .rotate-phone-card p {
    font-size: 13px;
    color: #ced6e0;
    margin-bottom: 16px;
    line-height: 1.5;
  }
  .rotate-hint {
    font-size: 12px;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: #ffd700;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 700;
  }
}

@keyframes rotatePhoneAnim {
  0%, 20% { transform: rotate(0deg); }
  50%, 75% { transform: rotate(-90deg); }
  95%, 100% { transform: rotate(0deg); }
}



/* Mobile Landscape Parity with Desktop */
@media screen and (orientation: landscape) and (max-height: 600px) {
  #hud {
    top: 6px !important;
    left: max(10px, env(safe-area-inset-left)) !important;
    right: max(10px, env(safe-area-inset-right)) !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
  }
  .hud-left, .hud-right, .hud-center {
    display: flex;
    align-items: center;
    gap: 4px !important;
  }
  .hud-pill {
    padding: 3px 8px !important;
    font-size: 11.5px !important;
    border-radius: 14px !important;
    gap: 3px !important;
  }
  #bossBarContainer {
    top: 38px !important;
    width: 220px !important;
    padding: 3px 10px !important;
  }
  #bonusBanner {
    top: 40px !important;
    font-size: 13px !important;
    padding: 4px 14px !important;
  }
  #mobileControls {
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    left: max(12px, env(safe-area-inset-left)) !important;
    right: max(12px, env(safe-area-inset-right)) !important;
    height: 75px !important;
    padding: 0 !important;
  }
  .touch-btn {
    width: 58px !important;
    height: 58px !important;
    font-size: 22px !important;
    background: rgba(18, 24, 38, 0.4) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
  }
  #btnJump {
    width: 66px !important;
    height: 66px !important;
  }
  .glass-card {
    padding: 12px 18px !important;
    max-height: 96vh !important;
    overflow-y: hidden !important;
  }
  .vic-modal {
    width: min(94vw, 530px) !important;
    padding: 8px 14px !important;
    max-height: 98vh !important;
    overflow-y: hidden !important;
  }
  .vic-header {
    gap: 6px !important;
  }
  .vic-icon {
    font-size: 20px !important;
  }
  .vic-title {
    font-size: 16px !important;
  }
  .vic-subtitle {
    font-size: 10px !important;
    margin: 1px 0 3px 0 !important;
  }
  .victory-stars {
    font-size: 22px !important;
    margin: 1px 0 5px 0 !important;
    gap: 8px !important;
  }
  .vic-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 4px !important;
    margin: 5px 0 8px 0 !important;
  }
  .vic-grid .stat-box {
    padding: 4px 2px !important;
    font-size: 9.5px !important;
    border-radius: 8px !important;
  }
  .vic-grid .stat-val {
    font-size: 12.5px !important;
    margin-top: 1px !important;
  }
  .vic-actions {
    gap: 6px !important;
  }
  .vic-actions .btn {
    padding: 6px 8px !important;
    font-size: 11.5px !important;
    border-radius: 10px !important;
  }
  #screenLifeLost .glass-card {
    padding: 10px 16px !important;
    width: min(90vw, 290px) !important;
  }
  #screenLifeLost h2 {
    font-size: 16px !important;
    margin: 2px 0 3px 0 !important;
  }
  #screenLifeLost p {
    font-size: 11.5px !important;
    margin-bottom: 8px !important;
  }
  #screenLifeLost .btn {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }
  #screenPause .glass-card {
    padding: 12px 18px !important;
    width: min(90vw, 300px) !important;
  }
  #screenPause h2 {
    font-size: 18px !important;
    margin-bottom: 8px !important;
  }
  #screenGameOver .glass-card {
    padding: 10px 18px !important;
    width: min(92vw, 420px) !important;
  }
  .level-select-card {
    padding: 7px 14px !important;
    width: min(96vw, 530px) !important;
  }
  .level-title {
    font-size: 15px !important;
  }
  .world-subtitle {
    font-size: 10px !important;
    margin-top: 1px !important;
  }
  .world-tabs {
    margin: 4px 0 !important;
    gap: 4px !important;
  }
  .world-tab-btn {
    padding: 3px 2px !important;
    border-radius: 9px !important;
  }
  .world-tab-btn .tab-name {
    font-size: 10px !important;
  }
  .world-tab-btn .tab-range {
    font-size: 8px !important;
  }
  .level-grid {
    margin: 4px 0 6px 0 !important;
    gap: 5px !important;
  }
  .lvl-btn {
    padding: 5px 0 !important;
    font-size: 12.5px !important;
    border-radius: 9px !important;
  }
  .level-footer {
    gap: 6px !important;
    margin-top: 2px !important;
  }
  .level-footer .btn {
    padding: 4px 10px !important;
    font-size: 11px !important;
  }
}

/* ========================================================
   Non-Obtrusive Minimalist Menu (100% Background Visibility)
   ======================================================== */
.menu-screen-layout {
  justify-content: flex-end !important;
  align-items: center !important;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px)) !important;
  background: transparent !important;
  pointer-events: none;
}

.menu-bottom-dock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 580px;
  padding: 0 16px;
  pointer-events: auto;
  z-index: 20;
  animation: dockFadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dockFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.play-main-btn {
  font-size: 19px !important;
  font-weight: 800 !important;
  padding: 13px 44px !important;
  border-radius: 30px !important;
  background: linear-gradient(135deg, #ffd700, #ff8c00) !important;
  color: #111 !important;
  border: 2px solid rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 8px 24px rgba(255, 165, 0, 0.45), 0 4px 14px rgba(0, 0, 0, 0.5) !important;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4);
  letter-spacing: 0.5px;
  cursor: pointer;
  margin: 0 !important;
  animation: pulsePlayBtn 2.2s infinite ease-in-out;
}

.play-main-btn:hover {
  transform: translateY(-2px) scale(1.04) !important;
  box-shadow: 0 12px 30px rgba(255, 165, 0, 0.65), 0 6px 18px rgba(0, 0, 0, 0.6) !important;
}

@keyframes pulsePlayBtn {
  0%, 100% { box-shadow: 0 8px 24px rgba(255, 165, 0, 0.45), 0 4px 14px rgba(0, 0, 0, 0.5); }
  50% { box-shadow: 0 10px 32px rgba(255, 215, 0, 0.75), 0 6px 18px rgba(0, 0, 0, 0.6); }
}

.menu-sub-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-menu-pill {
  padding: 8px 16px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  border-radius: 20px !important;
  margin: 0 !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-menu-pill.btn-outline {
  background: rgba(14, 20, 32, 0.65) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.28) !important;
  color: #fff !important;
}

.btn-menu-pill.btn-outline:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
}

.thai-ai-credit-dock {
  margin-top: 2px;
}

.thai-ai-credit-dock a {
  text-decoration: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(12, 16, 26, 0.65);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 18px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 3px 14px;
  transition: all 0.25s ease;
}

.thai-ai-credit-dock a:hover {
  transform: scale(1.05);
  border-color: rgba(255, 215, 0, 0.7);
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.4);
}

/* Compact scaling for landscape phones */
@media screen and (orientation: landscape) and (max-height: 520px) {
  .menu-bottom-dock {
    gap: 6px;
    padding-bottom: max(6px, env(safe-area-inset-bottom, 6px));
  }
  .play-main-btn {
    font-size: 15px !important;
    padding: 9px 32px !important;
    border-radius: 22px !important;
  }
  .btn-menu-pill {
    padding: 6px 12px !important;
    font-size: 12px !important;
  }
  .thai-ai-credit-dock a {
    padding: 2px 10px;
  }
  .brand-domain {
    font-size: 11px;
  }
  .brand-sub {
    font-size: 8.5px;
  }
}
