    :root {
      --bg-dark: #0a0614;
      --bg-surface: #160e29;
      --bg-card: #20143b;
      --accent-orange: #ff7700;
      --accent-pink: #ff2b66;
      --accent-cyan: #00f2ff;
      --accent-gold: #ffcc00;
      --text-main: #f5f0ff;
      --text-muted: #a69bbd;
      --font-title: 'Creepster', cursive;
      --font-main: 'Outfit', sans-serif;
    }

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

    html, body {
      width: 100%;
      height: 100%;
      overflow: hidden;
      background-color: var(--bg-dark);
      color: var(--text-main);
      font-family: var(--font-main);
      touch-action: manipulation;
    }

    #app {
      width: 100vw;
      height: 100vh;
      display: flex;
      flex-direction: column;
      position: relative;
      background: radial-gradient(circle at 50% 15%, #1a1033 0%, #080410 85%);
    }

    /* --- TOP NAVBAR --- */
    .game-header {
      height: 56px;
      background: rgba(18, 11, 34, 0.92);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-bottom: 1px solid rgba(255, 119, 0, 0.3);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 16px;
      z-index: 50;
    }

    .header-left {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .brand-logo-circle {
      width: 42px;
      height: 42px;
      border-radius: 50%;
      border: 2px solid var(--accent-orange);
      background: radial-gradient(circle, #2e164f 0%, #150827 100%);
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 0 12px rgba(255, 119, 0, 0.6), inset 0 0 6px rgba(255, 119, 0, 0.3);
      overflow: hidden;
      flex-shrink: 0;
      position: relative;
      text-decoration: none;
      transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
      cursor: pointer;
    }

    .brand-logo-circle:hover {
      transform: scale(1.08) rotate(4deg);
      box-shadow: 0 0 18px rgba(255, 119, 0, 0.9), inset 0 0 10px rgba(255, 119, 0, 0.5);
    }

    .brand-logo-img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      border-radius: 50%;
      pointer-events: none;
    }

    .brand-title {
      font-family: var(--font-title);
      font-size: 1.3rem;
      letter-spacing: 1px;
      color: #ffffff;
      line-height: 1;
    }

    .brand-title .highlight {
      color: var(--accent-orange);
      text-shadow: 0 0 8px rgba(255, 119, 0, 0.6);
    }

    .brand-subtitle {
      font-size: 0.65rem;
      font-weight: 800;
      color: var(--accent-pink);
      letter-spacing: 0.5px;
    }

    .header-center {
      display: flex;
      align-items: center;
    }

    .tournament-ribbon {
      display: flex;
      align-items: center;
      gap: 6px;
      background: linear-gradient(90deg, rgba(255, 43, 102, 0.25), rgba(255, 119, 0, 0.25));
      border: 1px solid rgba(255, 119, 0, 0.45);
      padding: 5px 14px;
      border-radius: 20px;
      font-size: 0.8rem;
      font-weight: 700;
      color: var(--accent-gold);
    }

    .header-right {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .creator-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: linear-gradient(135deg, rgba(255, 119, 0, 0.22), rgba(138, 43, 226, 0.28));
      border: 1px solid rgba(255, 119, 0, 0.45);
      color: #ffffff;
      text-decoration: none;
      padding: 5px 12px;
      border-radius: 20px;
      font-family: var(--font-main);
      font-size: 0.8rem;
      font-weight: 600;
      letter-spacing: 0.2px;
      transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
      box-shadow: 0 0 10px rgba(255, 119, 0, 0.25);
    }

    .creator-badge:hover {
      background: linear-gradient(135deg, rgba(255, 119, 0, 0.38), rgba(160, 60, 255, 0.45));
      border-color: var(--accent-orange);
      transform: translateY(-2px) scale(1.03);
      box-shadow: 0 4px 16px rgba(255, 119, 0, 0.5);
      color: #ffffff;
    }

    .creator-badge-icon {
      font-size: 0.85rem;
      color: #ffcc00;
      filter: drop-shadow(0 0 4px rgba(255, 204, 0, 0.8));
    }

    .creator-badge-name {
      color: #ffaa33;
      font-weight: 800;
      letter-spacing: 0.3px;
    }

    .creator-badge-arrow {
      font-size: 0.75rem;
      opacity: 0.75;
      color: var(--accent-cyan);
      transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .creator-badge:hover .creator-badge-arrow {
      transform: translate(2px, -2px);
      opacity: 1;
    }

    .nav-btn {
      background: rgba(38, 24, 64, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.15);
      color: var(--text-main);
      padding: 6px 12px;
      border-radius: 8px;
      font-family: var(--font-main);
      font-size: 0.82rem;
      font-weight: 700;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 5px;
      transition: all 0.2s ease;
    }

    .nav-btn:hover {
      background: rgba(55, 35, 92, 1);
      border-color: var(--accent-orange);
      transform: translateY(-1px);
    }

    .icon-btn {
      background: rgba(38, 24, 64, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.15);
      color: var(--text-main);
      width: 36px;
      height: 36px;
      border-radius: 8px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1rem;
    }

    /* --- GAME CANVAS CONTAINER --- */
    .game-viewport {
      flex: 1;
      position: relative;
      width: 100%;
      height: calc(100vh - 56px);
      overflow: hidden;
      display: flex;
      justify-content: center;
      align-items: center;
      background: #06030c;
    }

    #gameCanvas {
      display: block;
      max-width: 100%;
      max-height: 100%;
      object-fit: contain;
      box-shadow: 0 0 45px rgba(0, 0, 0, 0.95);
      /* Removed pixelated rendering so vector curves stay crisp and smooth */
    }

    /* --- TOUCH CONTROLS (COOKIE RUN 2-BUTTON SYSTEM) --- */
    .touch-controls {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 125px;
      pointer-events: none;
      display: none;
      justify-content: space-between;
      align-items: flex-end;
      padding: 0 24px 18px 24px;
      z-index: 40;
    }

    .touch-controls.active {
      display: flex;
    }

    .touch-btn {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      border: none;
      outline: none;
      border-radius: 50%;
      cursor: pointer;
      font-family: var(--font-main);
      font-weight: 800;
      color: #ffffff;
      box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 255, 255, 0.15);
      touch-action: manipulation;
      transition: transform 0.08s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.08s ease;
      pointer-events: auto;
      user-select: none;
      -webkit-user-select: none;
      position: relative;
    }

    .touch-btn:active {
      transform: scale(0.91);
    }

    .btn-jump {
      width: 86px;
      height: 86px;
      background: linear-gradient(135deg, #00f0ff 0%, #0062ff 100%);
      border: 3.5px solid rgba(255, 255, 255, 0.95);
      box-shadow: 0 0 25px rgba(0, 180, 255, 0.65), 0 8px 20px rgba(0, 0, 0, 0.7), inset 0 2px 6px rgba(255, 255, 255, 0.6);
    }

    .btn-jump:active {
      box-shadow: 0 0 35px rgba(0, 220, 255, 0.9), inset 0 3px 8px rgba(0, 0, 0, 0.3);
    }

    .btn-slide {
      width: 86px;
      height: 86px;
      background: linear-gradient(135deg, #f038ff 0%, #7b1fa2 100%);
      border: 3.5px solid rgba(255, 255, 255, 0.95);
      box-shadow: 0 0 25px rgba(240, 56, 255, 0.65), 0 8px 20px rgba(0, 0, 0, 0.7), inset 0 2px 6px rgba(255, 255, 255, 0.6);
    }

    .btn-slide:active {
      box-shadow: 0 0 35px rgba(255, 80, 255, 0.9), inset 0 3px 8px rgba(0, 0, 0, 0.3);
    }

    .touch-icon {
      font-size: 1.5rem;
      line-height: 1;
      filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
    }

    .touch-label {
      font-size: 0.8rem;
      letter-spacing: 1px;
      margin-top: 3px;
      font-weight: 900;
      text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    }

    .touch-sub {
      font-size: 0.52rem;
      font-weight: 600;
      color: rgba(255, 255, 255, 0.88);
      letter-spacing: 0.2px;
      margin-top: 2px;
      text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
      white-space: nowrap;
    }

    /* --- MODALS --- */
    .modal-backdrop {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(5, 3, 12, 0.85);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      display: none;
      justify-content: center;
      align-items: center;
      padding: 16px;
      z-index: 100;
    }

    .modal-backdrop.active {
      display: flex;
    }

    .modal-card {
      background: var(--bg-surface);
      border: 1px solid rgba(255, 119, 0, 0.45);
      border-radius: 18px;
      width: 100%;
      max-width: 660px;
      max-height: 88vh;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 119, 0, 0.2);
    }

    .modal-header {
      padding: 16px 20px;
      background: rgba(28, 18, 48, 0.95);
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .modal-title-group {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .modal-icon {
      font-size: 1.6rem;
    }

    .modal-title {
      font-family: var(--font-title);
      font-size: 1.35rem;
      letter-spacing: 1px;
      color: var(--accent-orange);
      line-height: 1.1;
    }

    .modal-subtitle {
      font-size: 0.75rem;
      color: var(--text-muted);
    }

    .modal-close {
      background: rgba(255, 255, 255, 0.1);
      border: none;
      color: #fff;
      width: 32px;
      height: 32px;
      border-radius: 50%;
      cursor: pointer;
      font-size: 1rem;
    }

    .modal-close:hover {
      background: var(--accent-pink);
    }

    .modal-body {
      padding: 18px 20px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .prize-summary-strip {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
    }

    .prize-pill {
      padding: 8px 10px;
      border-radius: 10px;
      font-size: 0.75rem;
      font-weight: 700;
      text-align: center;
    }

    .prize-pill.rank-1 { background: rgba(255, 204, 0, 0.15); border: 1px solid var(--accent-gold); color: var(--accent-gold); }
    .prize-pill.rank-2 { background: rgba(200, 200, 200, 0.15); border: 1px solid #ccc; color: #fff; }
    .prize-pill.rank-3 { background: rgba(205, 127, 50, 0.15); border: 1px solid #cd7f32; color: #ffaa66; }

    .leaderboard-table-wrap {
      overflow-x: auto;
      border-radius: 10px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      background: rgba(15, 10, 28, 0.6);
    }

    .leaderboard-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.85rem;
      text-align: left;
    }

    .leaderboard-table th {
      background: rgba(32, 22, 56, 0.9);
      padding: 10px 14px;
      color: var(--accent-orange);
      font-weight: 700;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .leaderboard-table td {
      padding: 10px 14px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .anti-cheat-notice {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.75rem;
      color: var(--accent-cyan);
      background: rgba(0, 242, 255, 0.08);
      padding: 8px 12px;
      border-radius: 8px;
    }

    .prize-rule-notice {
      font-size: 0.78rem;
      color: #ffcf66;
      background: rgba(255, 170, 0, 0.12);
      border: 1px solid rgba(255, 170, 0, 0.3);
      padding: 8px 12px;
      border-radius: 8px;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .my-latest-run-card {
      margin-top: 12px;
      margin-bottom: 8px;
      padding: 10px 14px;
      background: rgba(0, 242, 255, 0.08);
      border: 1px solid rgba(0, 242, 255, 0.25);
      border-radius: 10px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
    }

    #inputPlayerName:read-only,
    #inputPlayerName[readonly] {
      background: rgba(0, 242, 255, 0.06) !important;
      color: #00ffcc !important;
      cursor: not-allowed !important;
      border-color: rgba(0, 242, 255, 0.45) !important;
      font-weight: 700 !important;
    }

    .candy-bank-banner {
      background: rgba(255, 43, 102, 0.15);
      border: 1px solid var(--accent-pink);
      padding: 10px 16px;
      border-radius: 10px;
      font-weight: 700;
      color: #ffffff;
      display: flex;
      justify-content: space-between;
    }

    .costumes-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
    }

    .costume-card {
      background: var(--bg-card);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 12px;
      padding: 14px;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      gap: 6px;
    }

    .costume-card.selected {
      border-color: var(--accent-cyan);
      box-shadow: 0 0 15px rgba(0, 242, 255, 0.35);
    }

    .costume-avatar {
      font-size: 2.2rem;
      line-height: 1;
      margin: 4px 0;
    }

    .costume-card h4 {
      font-size: 0.95rem;
      color: #fff;
    }

    .costume-card p {
      font-size: 0.72rem;
      color: var(--text-muted);
    }

    .costume-bonus {
      font-size: 0.72rem;
      color: var(--accent-gold);
      font-weight: 600;
    }

    .btn-skin-action {
      width: 100%;
      padding: 8px 12px;
      border-radius: 8px;
      border: none;
      font-family: var(--font-main);
      font-weight: 700;
      font-size: 0.8rem;
      cursor: pointer;
      margin-top: 4px;
    }

    .btn-skin-action.btn-select { background: #00cc66; color: #fff; }
    .btn-skin-action.btn-selected { background: #354460; color: #8cb0d0; cursor: default; }
    .btn-skin-action.btn-unlock { background: var(--accent-pink); color: #fff; }

    .submit-score-summary {
      background: rgba(32, 22, 56, 0.8);
      border: 1px solid rgba(255, 119, 0, 0.3);
      border-radius: 12px;
      padding: 14px;
      text-align: center;
    }

    .score-display .lbl {
      display: block;
      font-size: 0.75rem;
      color: var(--accent-gold);
      letter-spacing: 1px;
    }

    .score-display .val {
      font-size: 2rem;
      font-weight: 900;
      color: #fff;
    }

    .sub-stats {
      margin-top: 6px;
      font-size: 0.85rem;
      color: var(--text-muted);
    }

    .submit-form {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .form-group {
      display: flex;
      flex-direction: column;
      gap: 5px;
    }

    .form-group label {
      font-size: 0.8rem;
      font-weight: 600;
    }

    .form-group input {
      background: rgba(12, 8, 24, 0.8);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 8px;
      padding: 10px 14px;
      color: #fff;
      font-family: var(--font-main);
      font-size: 0.9rem;
    }

    .form-group input:focus {
      outline: none;
      border-color: var(--accent-orange);
    }

    .btn-primary {
      background: linear-gradient(135deg, var(--accent-pink), #cc0044);
      border: none;
      color: #fff;
      padding: 12px 18px;
      border-radius: 10px;
      font-family: var(--font-main);
      font-weight: 700;
      font-size: 0.95rem;
      cursor: pointer;
      width: 100%;
      margin-top: 6px;
    }

    .btn-primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 15px rgba(255, 43, 102, 0.4);
    }

    .submit-success-box {
      text-align: center;
      padding: 20px;
      background: rgba(0, 204, 102, 0.1);
      border: 1px solid #00cc66;
      border-radius: 12px;
    }

    .btn-secondary {
      background: #354460;
      border: none;
      color: #fff;
      padding: 8px 16px;
      border-radius: 8px;
      font-family: var(--font-main);
      font-weight: 700;
      cursor: pointer;
      margin-top: 10px;
    }

    .rules-section {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .rules-section h3 {
      font-size: 0.95rem;
      color: var(--accent-orange);
      border-left: 3px solid var(--accent-orange);
      padding-left: 8px;
    }

    .rules-section ul {
      padding-left: 20px;
      font-size: 0.82rem;
      color: var(--text-muted);
      line-height: 1.6;
    }

    .rules-section strong {
      color: #fff;
    }

    .creator-modal-card {
      margin-top: 10px;
      background: linear-gradient(135deg, rgba(255, 119, 0, 0.1), rgba(138, 43, 226, 0.15));
      border: 1px solid rgba(255, 119, 0, 0.35);
      border-radius: 12px;
      padding: 14px;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    }

    .creator-modal-card p {
      font-size: 0.84rem;
      color: var(--text-muted);
      line-height: 1.6;
      margin: 4px 0;
    }

    .creator-site-link {
      display: inline-block;
      color: var(--accent-orange);
      font-weight: 700;
      text-decoration: none;
      padding: 3px 8px;
      background: rgba(255, 119, 0, 0.15);
      border-radius: 6px;
      border: 1px solid rgba(255, 119, 0, 0.3);
      transition: all 0.2s ease;
      margin-top: 4px;
    }

    .creator-site-link:hover {
      background: rgba(255, 119, 0, 0.3);
      border-color: var(--accent-orange);
      color: #ffffff;
      transform: translateY(-1px);
      box-shadow: 0 2px 8px rgba(255, 119, 0, 0.4);
    }

    @media (max-width: 900px) {
      .creator-badge .creator-badge-text { font-size: 0.75rem; }
    }

    @media (max-width: 768px) {
      .header-center { display: none; }
      .nav-btn .btn-text { display: none; }
      .creator-badge { padding: 4px 10px; }
      .creator-badge .creator-badge-text { font-size: 0.72rem; }
      .costumes-grid { grid-template-columns: 1fr; }
      .prize-summary-strip { grid-template-columns: 1fr; }
    }

    @media (max-width: 520px) {
      .creator-badge-text { display: none; }
      .creator-badge { padding: 6px 8px; }
      .brand-title { font-size: 1.1rem; }
      .brand-subtitle { font-size: 0.55rem; }
    }

    /* --- Backdrop Shake Animation for invalid click --- */
    @keyframes cardShake {
      0%, 100% { transform: translateX(0); }
      20%, 60% { transform: translateX(-7px); }
      40%, 80% { transform: translateX(7px); }
    }
    .modal-card-shake {
      animation: cardShake 0.35s ease-in-out !important;
      border-color: #ff3366 !important;
      box-shadow: 0 0 30px rgba(255, 51, 102, 0.45) !important;
    }

    /* Custom Sleek Scrollbar for Modal Body */
    .modal-body::-webkit-scrollbar {
      width: 6px;
    }
    .modal-body::-webkit-scrollbar-track {
      background: rgba(0, 0, 0, 0.25);
      border-radius: 4px;
    }
    .modal-body::-webkit-scrollbar-thumb {
      background: rgba(255, 119, 0, 0.45);
      border-radius: 4px;
    }
    .modal-body::-webkit-scrollbar-thumb:hover {
      background: var(--accent-orange);
    }

    /* =========================================================
       1. LANDSCAPE MODE: SUBMIT SCORE MODAL (หมุนแนวนอนแล้วเห็นครบ)
       ========================================================= */
    @media (orientation: landscape) and (max-height: 560px), (max-height: 520px) {
      .modal-backdrop {
        padding: 6px;
      }
      .modal-card {
        max-height: 98vh;
        max-width: 820px;
        border-radius: 12px;
      }
      .modal-header {
        padding: 6px 14px;
      }
      .modal-title {
        font-size: 1.05rem;
      }
      .modal-subtitle {
        font-size: 0.65rem;
      }
      .modal-icon {
        font-size: 1.2rem;
      }
      .modal-close {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
      }

      /* 2-Column Split inside Submit Score Modal in Landscape */
      #modalSubmitScore .modal-body {
        display: grid;
        grid-template-columns: 200px 1fr;
        gap: 10px;
        padding: 8px 14px;
        max-height: calc(98vh - 42px);
        overflow-y: auto;
      }

      #modalSubmitScore .submit-score-summary {
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 8px;
      }
      #modalSubmitScore .score-display .lbl {
        font-size: 0.68rem;
      }
      #modalSubmitScore .score-display .val {
        font-size: 1.6rem;
      }
      #modalSubmitScore .sub-stats {
        font-size: 0.72rem;
        margin-top: 4px;
      }

      #modalSubmitScore .submit-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 5px 8px;
      }

      #modalSubmitScore .form-group:nth-child(1) { grid-column: 1; }
      #modalSubmitScore .form-group:nth-child(2) { grid-column: 2; }
      #modalSubmitScore .form-group:nth-child(3) { grid-column: span 2; }

      #modalSubmitScore .form-group {
        gap: 2px;
      }
      #modalSubmitScore .form-group label {
        font-size: 0.72rem;
      }
      #modalSubmitScore .form-group input {
        padding: 6px 10px;
        font-size: 0.8rem;
      }
      #modalSubmitScore #phoneBindingHelp,
      #modalSubmitScore #nameLockHelp,
      #modalSubmitScore #nameTakenError {
        font-size: 0.62rem;
      }

      #modalSubmitScore .submit-anti-cheat-note {
        grid-column: span 2;
        font-size: 0.64rem !important;
        margin-bottom: 2px !important;
      }

      #modalSubmitScore #btnSubmitScore {
        grid-column: span 1;
        margin-top: 0;
        padding: 7px 10px;
        font-size: 0.82rem;
      }
      #modalSubmitScore #btnRestartFromModal {
        grid-column: span 1;
        margin-top: 0;
        padding: 7px 10px;
        font-size: 0.78rem;
      }

      #modalSubmitScore .submit-success-box {
        grid-column: span 2;
        padding: 10px;
      }
    }

    /* =========================================================
       2. PORTRAIT MODE OPTIMIZATION (เล่นเกมแนวตั้งบนมือถือ)
       ========================================================= */
    @media (orientation: portrait) {
      .game-header {
        height: 50px;
        padding: 0 10px;
        flex-shrink: 0;
      }
      .header-center {
        display: none;
      }
      .brand-logo-circle {
        width: 36px;
        height: 36px;
      }
      .brand-title {
        font-size: 1.05rem;
      }
      .brand-subtitle {
        font-size: 0.58rem;
      }
      .creator-badge {
        padding: 4px 8px;
        gap: 3px;
      }
      .creator-badge-text {
        font-size: 0.7rem;
      }
      .nav-btn {
        padding: 5px 8px;
        font-size: 0.78rem;
      }

      /* Viewport in Portrait: Canvas takes top half, Controller takes bottom half */
      .game-viewport {
        height: calc(100vh - 50px) !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: center !important;
        padding: 0 !important;
        background: radial-gradient(circle at 50% 25%, #160a2c 0%, #06030c 100%) !important;
        overflow: hidden !important;
      }

      #gameCanvas {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 50vh !important;
        aspect-ratio: 16 / 9;
        margin-top: 4px;
        box-shadow: 0 6px 30px rgba(0, 0, 0, 0.95);
        border-bottom: 2px solid rgba(255, 119, 0, 0.45);
        flex-shrink: 0;
      }

      /* Arcade Controller Pad in Portrait Mode */
      .touch-controls {
        position: relative !important;
        flex: 1 1 auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 150px !important;
        display: flex !important;
        pointer-events: auto !important;
        justify-content: space-around !important;
        align-items: center !important;
        padding: 16px 20px 24px 20px !important;
        background: linear-gradient(180deg, rgba(22, 12, 42, 0.95) 0%, rgba(8, 4, 18, 0.99) 100%) !important;
        border-top: 1px solid rgba(255, 119, 0, 0.25) !important;
        box-shadow: inset 0 10px 30px rgba(0, 0, 0, 0.85) !important;
        z-index: 40 !important;
      }

      .touch-controls::before {
        content: "🎮 2-THUMB ARCADE DECK • ซ้าย: Jump / ขวา: Slide";
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.68rem;
        font-weight: 700;
        color: rgba(255, 204, 0, 0.75);
        letter-spacing: 0.5px;
        white-space: nowrap;
        pointer-events: none;
      }

      .touch-btn {
        width: 110px !important;
        height: 110px !important;
        border-radius: 50%;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 4px !important;
        pointer-events: auto !important;
      }

      .touch-btn .touch-icon {
        font-size: 1.6rem;
        line-height: 1;
        margin-bottom: 2px;
      }

      .touch-btn .touch-label {
        font-size: 1.05rem;
        font-weight: 900;
        line-height: 1;
        margin: 2px 0;
      }

      .touch-btn .touch-sub {
        font-size: 0.56rem;
        line-height: 1.1;
        max-width: 90px;
        text-align: center;
        opacity: 0.85;
      }
    }
