    :root {
      --bg-body: #05070b;
      --bg-phone: #0d101a;
      --card-bg: #151928;
      --card-border: #242b44;
      --primary-gold: #f5a623;
      --gold-gradient: linear-gradient(135deg, #ffc837 0%, #ff8008 100%);
      --text-main: #f0f3fa;
      --text-sub: #7e88a6;
      --accent-green: #00d26a;
      --accent-red: #f8312f;
      --accent-blue: #0088cc;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-tap-highlight-color: transparent;
      user-select: none;
    }

    body {
      background-color: var(--bg-body);
      color: var(--text-main);
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
      min-height: 100vh;
      display: flex;
      justify-content: center;
      align-items: flex-start;
      overflow-x: hidden;
    }

    /* 手機視圖容器 */
    .app-viewport {
      width: 100%;
      max-width: 440px;
      min-height: 100vh;
      background-color: var(--bg-phone);
      position: relative;
      display: flex;
      flex-direction: column;
      box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
      border-left: 1px solid rgba(255, 255, 255, 0.05);
      border-right: 1px solid rgba(255, 255, 255, 0.05);
      padding-bottom: 75px;
    }

    /* 頂部資產欄 */
    .top-bar {
      position: sticky;
      top: 0;
      z-index: 100;
      background: rgba(13, 16, 26, 0.96);
      backdrop-filter: blur(12px);
      padding: 12px 16px;
      border-bottom: 1px solid var(--card-border);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .user-profile {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .avatar {
      width: 38px;
      height: 38px;
      border-radius: 50%;
      background: var(--gold-gradient);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 900;
      color: #000;
      font-size: 16px;
      box-shadow: 0 2px 10px rgba(245, 166, 35, 0.35);
    }

    .user-info .username {
      font-size: 14px;
      font-weight: 700;
      color: var(--text-main);
    }

    .user-info .vip-badge {
      font-size: 10px;
      color: #ffc837;
      background: rgba(245, 166, 35, 0.15);
      border: 1px solid rgba(245, 166, 35, 0.3);
      padding: 1px 6px;
      border-radius: 8px;
      display: inline-block;
      margin-top: 2px;
    }

    .top-right-tools {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .tool-btn {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      color: var(--text-sub);
      width: 32px;
      height: 32px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 14px;
      transition: all 0.15s;
    }

    .tool-btn.active {
      color: #ffc837;
      border-color: #ffc837;
    }

    .wallet-pill {
      background: var(--card-bg);
      border: 1px solid rgba(245, 166, 35, 0.4);
      padding: 6px 12px;
      border-radius: 20px;
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 15px;
      font-weight: 800;
      color: #ffc837;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }

    /* 存錢罐橫幅 */
    .vault-banner {
      margin: 12px 16px 0;
      background: linear-gradient(135deg, #181d30 0%, #111422 100%);
      border: 1px solid #28314e;
      border-radius: 14px;
      padding: 12px 16px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    .vault-info {
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

    .vault-title {
      font-size: 12px;
      color: var(--text-sub);
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .vault-rate {
      font-size: 10px;
      color: #2ed573;
      background: rgba(46, 213, 115, 0.15);
      padding: 1px 6px;
      border-radius: 6px;
      font-weight: 700;
    }

    .vault-amount {
      font-size: 20px;
      font-weight: 800;
      color: var(--accent-green);
    }

    .btn-collect {
      background: var(--gold-gradient);
      color: #000;
      font-weight: 800;
      border: none;
      padding: 8px 16px;
      border-radius: 20px;
      font-size: 13px;
      cursor: pointer;
      box-shadow: 0 2px 10px rgba(255, 168, 0, 0.3);
      transition: transform 0.1s;
    }

    .btn-collect:active { transform: scale(0.95); }

    /* 跑馬燈 */
    .marquee-bar {
      margin: 10px 16px 0;
      background: rgba(245, 166, 35, 0.08);
      border: 1px solid rgba(245, 166, 35, 0.15);
      border-radius: 8px;
      padding: 6px 12px;
      font-size: 12px;
      color: #ffc837;
      display: flex;
      align-items: center;
      gap: 8px;
      overflow: hidden;
      white-space: nowrap;
    }

    .marquee-text {
      display: inline-block;
      animation: marquee 18s linear infinite;
    }

    @keyframes marquee {
      0% { transform: translateX(100%); }
      100% { transform: translateX(-100%); }
    }

    /* 各視圖容器 */
    .tab-content {
      display: none;
      padding: 16px;
      animation: fadeIn 0.2s ease-in-out;
    }

    .tab-content.active {
      display: block;
    }

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

    /* 頂部返回導覽 */
    .view-sub-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 14px;
    }

    .btn-back-lobby {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      color: var(--text-main);
      padding: 6px 12px;
      border-radius: 12px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .view-title {
      font-size: 16px;
      font-weight: 800;
      color: #fff;
    }

    /* 大廳賽道卡片 */
    .section-title {
      font-size: 15px;
      font-weight: 800;
      margin: 16px 0 12px;
      color: var(--text-main);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .game-card {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: 16px;
      padding: 16px;
      margin-bottom: 14px;
      position: relative;
      overflow: hidden;
      cursor: pointer;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
      transition: transform 0.15s, border-color 0.2s;
    }

    .game-card:active {
      transform: scale(0.98);
      border-color: var(--primary-gold);
    }

    .game-card-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 8px;
    }

    .game-badge {
      font-size: 11px;
      font-weight: 600;
      padding: 3px 8px;
      border-radius: 6px;
    }

    .badge-fast { background: rgba(248, 49, 47, 0.2); color: #ff6b6b; border: 1px solid rgba(248, 49, 47, 0.3); }
    .badge-idle { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, 0.3); }
    .badge-viral { background: rgba(0, 210, 106, 0.2); color: #00d26a; border: 1px solid rgba(0, 210, 106, 0.3); }

    .game-name {
      font-size: 16px;
      font-weight: 800;
      color: #fff;
    }

    .game-desc {
      font-size: 13px;
      color: var(--text-sub);
      line-height: 1.45;
      margin-bottom: 12px;
    }

    .game-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .game-meta {
      font-size: 12px;
      color: var(--primary-gold);
    }

    .btn-play-mini {
      background: var(--gold-gradient);
      border: none;
      color: #000;
      font-weight: 800;
      font-size: 13px;
      padding: 6px 14px;
      border-radius: 12px;
    }

    /* 賭桌舞台 */
    .casino-table {
      background: radial-gradient(circle at 50% 40%, #15221b 0%, #0c1410 100%);
      border: 2px solid #2d4f3b;
      border-radius: 20px;
      padding: 18px 14px;
      box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.7), 0 8px 25px rgba(0, 0, 0, 0.4);
      position: relative;
    }

    .bet-selector {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 8px;
      margin-bottom: 14px;
    }

    .bet-chip {
      background: #0d1612;
      border: 1px solid #254030;
      color: #7b9e8a;
      padding: 5px 12px;
      border-radius: 14px;
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
    }

    .bet-chip.active {
      background: rgba(245, 166, 35, 0.15);
      border-color: #ffc837;
      color: #ffc837;
      box-shadow: 0 0 10px rgba(245, 166, 35, 0.3);
    }

    .streak-meter {
      display: flex;
      justify-content: space-between;
      gap: 4px;
      margin-bottom: 16px;
      background: rgba(0, 0, 0, 0.3);
      padding: 6px;
      border-radius: 10px;
      border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .streak-step {
      flex: 1;
      font-size: 11px;
      padding: 5px 2px;
      border-radius: 6px;
      color: #60796c;
      text-align: center;
    }

    .streak-step.active {
      background: var(--gold-gradient);
      color: #000;
      font-weight: 900;
      box-shadow: 0 2px 8px rgba(245, 166, 35, 0.5);
    }

    .duel-stage {
      display: flex;
      justify-content: space-around;
      align-items: center;
      margin: 10px 0 18px;
      position: relative;
    }

    .card-slot-wrap {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
    }

    .slot-label {
      font-size: 12px;
      font-weight: 800;
      padding: 3px 10px;
      border-radius: 12px;
    }

    .label-dealer { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
    .label-player { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }

    .poker-card-3d {
      width: 115px;
      height: 160px;
      perspective: 1000px;
    }

    .poker-inner {
      width: 100%;
      height: 100%;
      position: relative;
      transform-style: preserve-3d;
      transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .poker-inner.flipped {
      transform: rotateY(180deg);
    }

    .poker-face {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      backface-visibility: hidden;
      border-radius: 12px;
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      padding: 10px;
    }

    .poker-front {
      background: #ffffff;
      color: #111;
      transform: rotateY(180deg);
      border: 2px solid #e2e8f0;
    }

    .poker-front.red { color: #dc2626; }

    .card-corner-val {
      font-size: 20px;
      font-weight: 900;
      line-height: 1;
    }

    .card-center-suit-symbol {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      font-size: 54px;
      opacity: 0.95;
    }

    .poker-back {
      background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
      border: 2px solid #3b82f6;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: #93c5fd;
      position: relative;
      overflow: hidden;
    }

    .poker-back::before {
      content: '';
      position: absolute;
      top: 6px; left: 6px; right: 6px; bottom: 6px;
      border: 1px dashed rgba(147, 197, 253, 0.4);
      border-radius: 8px;
    }

    .back-logo {
      font-size: 32px;
      margin-bottom: 4px;
    }

    .back-text {
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 1px;
      color: #bfdbfe;
    }

    .versus-badge {
      font-size: 16px;
      font-weight: 900;
      color: #ffc837;
      background: rgba(0, 0, 0, 0.6);
      border: 2px solid #ffc837;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 0 12px rgba(245, 166, 35, 0.4);
    }

    .duel-stamp {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) rotate(-12deg) scale(0);
      font-size: 26px;
      font-weight: 900;
      padding: 6px 18px;
      border-radius: 10px;
      border: 4px solid;
      pointer-events: none;
      z-index: 50;
      transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    }

    .duel-stamp.win {
      color: #00d26a;
      border-color: #00d26a;
      background: rgba(0, 210, 106, 0.2);
      transform: translate(-50%, -50%) rotate(-12deg) scale(1);
    }

    .duel-stamp.lose {
      color: #f8312f;
      border-color: #f8312f;
      background: rgba(248, 49, 47, 0.2);
      transform: translate(-50%, -50%) rotate(12deg) scale(1);
    }

    .pot-display-bar {
      background: rgba(0, 0, 0, 0.4);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 12px;
      padding: 8px 12px;
      margin-bottom: 12px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 13px;
    }

    .pot-display-bar b { color: #ffc837; font-size: 15px; }

    .table-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin-top: 14px;
      position: relative;
      z-index: 20;
    }

    .btn-action {
      padding: 14px 10px;
      font-size: 15px;
      font-weight: 800;
      border: none;
      border-radius: 14px;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 3px;
      transition: transform 0.1s;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    }

    .btn-action:active { transform: scale(0.96); }
    .btn-action-higher { background: linear-gradient(135deg, #00d26a, #009e4f); color: #fff; }
    .btn-action-lower { background: linear-gradient(135deg, #f8312f, #ba1816); color: #fff; }

    .btn-cashout-gold {
      grid-column: span 2;
      background: var(--gold-gradient);
      color: #000;
      font-weight: 900;
      padding: 13px;
      border-radius: 14px;
      border: none;
      font-size: 16px;
      cursor: pointer;
      margin-top: 4px;
      box-shadow: 0 4px 15px rgba(245, 166, 35, 0.4);
    }

    /* 賽道二：神魔集卡 */
    .pack-container {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: 18px;
      padding: 20px 16px;
      text-align: center;
    }

    .pack-visual {
      width: 140px;
      height: 195px;
      margin: 10px auto;
      background: linear-gradient(145deg, #7c3aed 0%, #3b82f6 100%);
      border-radius: 16px;
      border: 2px solid #a78bfa;
      box-shadow: 0 10px 30px rgba(139, 92, 246, 0.35);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: #fff;
      cursor: pointer;
      transition: transform 0.2s, box-shadow 0.2s;
    }

    .pack-visual:active {
      transform: scale(0.95);
      box-shadow: 0 4px 15px rgba(139, 92, 246, 0.6);
    }

    .reveal-area {
      display: none;
      margin-top: 16px;
      padding-top: 16px;
      border-top: 1px dashed var(--card-border);
    }

    .reveal-cards-row {
      display: flex;
      justify-content: center;
      gap: 10px;
    }

    .card-item {
      width: 90px;
      height: 130px;
      border-radius: 10px;
      background: #1c2136;
      border: 1px solid var(--card-border);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 6px;
      font-size: 11px;
      box-shadow: 0 4px 12px rgba(0,0,0,0.4);
      animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .card-item.ssr {
      border: 2px solid #ffc837;
      background: linear-gradient(180deg, #2b2310 0%, #151828 100%);
      color: #ffc837;
    }

    .card-item.sr {
      border: 1px solid #c084fc;
      color: #c084fc;
    }

    .gallery-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin-top: 12px;
    }

    .gallery-slot {
      background: #111422;
      border: 1px solid #23283e;
      border-radius: 10px;
      padding: 10px 6px;
      font-size: 11px;
      text-align: center;
      color: var(--text-sub);
    }

    .gallery-slot.unlocked {
      background: rgba(245, 166, 35, 0.1);
      border-color: rgba(245, 166, 35, 0.4);
      color: #ffc837;
      font-weight: 700;
    }

    /* 賽道三：群組暗牌 */
    .duel-box {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: 18px;
      padding: 20px 16px;
      text-align: center;
    }

    .card-deck-select {
      display: flex;
      justify-content: center;
      gap: 8px;
      margin: 12px 0;
    }

    .deck-option {
      width: 48px;
      height: 68px;
      border-radius: 8px;
      background: #20263d;
      border: 1px solid #364066;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      font-size: 18px;
      cursor: pointer;
    }

    .deck-option.selected {
      border: 2px solid #ffc837;
      background: #ffc837;
      color: #000;
      box-shadow: 0 4px 12px rgba(245, 166, 35, 0.4);
    }

    .secret-arena {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 16px;
      margin: 16px 0;
    }

    .duel-card-slot {
      width: 105px;
      height: 145px;
      border-radius: 12px;
      background: #131726;
      border: 2px dashed #3c466e;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      color: var(--text-sub);
    }

    .duel-card-slot.active {
      border-style: solid;
      border-color: #ffc837;
      background: #1c2238;
      color: #fff;
    }

    .btn-share-tg {
      background: linear-gradient(135deg, #0088cc 0%, #006699 100%);
      color: #fff;
      font-weight: 800;
      padding: 13px 20px;
      border-radius: 14px;
      border: none;
      font-size: 14px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin-top: 10px;
      width: 100%;
      justify-content: center;
      box-shadow: 0 4px 15px rgba(0, 136, 204, 0.35);
    }

    /* 底部導覽欄 */
    .bottom-nav {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 62px;
      background: rgba(18, 22, 35, 0.98);
      border-top: 1px solid var(--card-border);
      display: flex;
      justify-content: space-around;
      align-items: center;
      z-index: 100;
    }

    .nav-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 3px;
      color: var(--text-sub);
      font-size: 11px;
      cursor: pointer;
      transition: color 0.15s;
    }

    .nav-item.active {
      color: var(--primary-gold);
      font-weight: 800;
    }

    .nav-icon { font-size: 20px; }

    /* 通用彈窗與語言彈窗 */
    .modal-overlay {
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(0, 0, 0, 0.75);
      backdrop-filter: blur(5px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 999;
      padding: 20px;
    }

    .modal-card {
      background: var(--card-bg);
      border: 1px solid #3d466e;
      border-radius: 20px;
      padding: 24px 20px;
      text-align: center;
      max-width: 320px;
      width: 100%;
      animation: popIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    @keyframes popIn {
      from { transform: scale(0.85); opacity: 0; }
      to { transform: scale(1); opacity: 1; }
    }

    .modal-title {
      font-size: 18px;
      font-weight: 800;
      margin-bottom: 8px;
      color: #fff;
    }

    .modal-msg {
      font-size: 13px;
      color: var(--text-sub);
      line-height: 1.5;
      margin-bottom: 18px;
      white-space: pre-line;
    }

    .modal-btn {
      width: 100%;
      padding: 12px;
      border-radius: 12px;
      font-weight: 800;
      border: none;
      background: var(--gold-gradient);
      color: #000;
      font-size: 14px;
      cursor: pointer;
    }

    /* 語言選擇列表 */
    .lang-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin: 14px 0;
    }

    .lang-option-btn {
      background: #111524;
      border: 1px solid var(--card-border);
      color: var(--text-main);
      padding: 11px 16px;
      border-radius: 12px;
      font-size: 14px;
      font-weight: 700;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      transition: all 0.15s;
    }

    .lang-option-btn:active { transform: scale(0.98); }
    .lang-option-btn.active {
      border-color: #ffc837;
      background: rgba(245, 166, 35, 0.12);
      color: #ffc837;
    }

/* 字型跟著語言走：簡體頁面用簡體字型（標點靠左下），繁體、日文、韓文各用自己的，不然看起來會像混用 */
html[lang="zh-Hant"] body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif; }
html[lang="ja"] body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif; }
html[lang="ko"] body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; }
