/* ==========================================================================
   GOLDEN ROCK CLUB - VIDEO ARCADE ARENA (MOBILE-FIRST PORTRAIT SHELL)
   Theme: Luxury Dark Metallic Gold & Cyberpunk Arcade Neon
   ========================================================================== */

:root {
  --bg-desktop: #03060a;
  --bg-core: #070b13;
  --bg-card: rgba(14, 22, 38, 0.92);
  --bg-card-hover: rgba(22, 34, 58, 0.98);
  --gold-primary: #f7d488;
  --gold-secondary: #e5a93b;
  --gold-dark: #b87b14;
  --gold-bright: #ffd700;
  --gold-gradient: linear-gradient(135deg, #f7d488 0%, #e5a93b 50%, #b87b14 100%);
  --gold-gradient-hover: linear-gradient(135deg, #fff2cc 0%, #f7d488 50%, #d49522 100%);
  --gold-glow: 0 0 20px rgba(247, 212, 136, 0.35);
  --gold-glow-strong: 0 0 30px rgba(255, 215, 0, 0.6);
  --border-gold: rgba(247, 212, 136, 0.25);
  --border-gold-hover: rgba(255, 215, 0, 0.7);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-gold: #f7de7b;
  --neon-red: #ff3366;
  --neon-cyan: #00f0ff;
  --neon-green: #10b981;
}

/* Base Reset & Mobile Native Optimizations */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-desktop);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(229, 169, 59, 0.15) 0%, transparent 70%),
    radial-gradient(circle at 10% 90%, rgba(0, 240, 255, 0.05) 0%, transparent 40%),
    linear-gradient(180deg, #070b13 0%, #03060a 100%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

/* ==========================================================================
   STRICT MOBILE PORTRAIT CONTAINER SHELL (Always Mobile-Proportioned)
   ========================================================================== */
.mobile-app-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  background: var(--bg-core);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.95), 0 0 25px rgba(229, 169, 59, 0.15);
  border-left: 1px solid rgba(247, 212, 136, 0.15);
  border-right: 1px solid rgba(247, 212, 136, 0.15);
  display: flex;
  flex-direction: column;
}

@media (max-width: 480px) {
  .mobile-app-shell {
    border-left: none;
    border-right: none;
    box-shadow: none;
  }
}

/* Typography Enhancements */
h1, h2, h3, .brand-font {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.5px;
}
.arcade-font {
  font-family: 'Armata', sans-serif;
}
.digital-font {
  font-family: 'DSDIGI', sans-serif;
}

/* Legacy .gold class override */
.gold {
  background: var(--gold-gradient) !important;
  color: #070b13 !important;
  font-weight: 700;
  border: none !important;
  box-shadow: 0 4px 15px rgba(229, 169, 59, 0.35);
}

/* ==========================================================================
   MOBILE-FIRST HEADER BAR (Strictly compact for mobile screens)
   ========================================================================== */
.mobile-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 11, 19, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-gold);
  padding: 8px 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-main);
  flex-shrink: 0;
}
.mobile-brand img {
  height: 32px;
  width: auto;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.5));
}
.mobile-brand .brand-text {
  display: flex;
  flex-direction: column;
}
.mobile-brand .brand-title {
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 0.92rem;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  white-space: nowrap;
}
.mobile-brand .brand-sub {
  font-size: 0.6rem;
  letter-spacing: 1px;
  color: var(--neon-cyan);
  text-transform: uppercase;
}

/* Header Actions in 1 tidy row */
.mobile-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.user-chip {
  background: rgba(247, 212, 136, 0.1);
  border: 1px solid var(--border-gold);
  padding: 4px 8px;
  border-radius: 14px;
  font-size: 0.74rem;
  color: var(--text-gold);
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 95px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.balance-chip {
  background: linear-gradient(135deg, rgba(247, 212, 136, 0.22) 0%, rgba(184, 123, 20, 0.18) 100%);
  border: 1px solid var(--gold-primary);
  box-shadow: var(--gold-glow);
  padding: 4px 10px;
  border-radius: 14px;
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.balance-chip:active {
  transform: scale(0.96);
}
.balance-chip i.fa-coins {
  color: #ffd700;
  font-size: 0.8rem;
}
.balance-chip i.fa-sync-alt {
  font-size: 0.68rem;
  color: var(--text-gold);
  opacity: 0.8;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  border-radius: 14px;
  padding: 5px 9px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-logout:hover, .btn-logout:active {
  background: rgba(239, 68, 68, 0.35);
  color: #fff;
}

/* ==========================================================================
   MOBILE PWA INSTALL BANNER (Embedded in flow, never overlapping)
   ========================================================================== */
#pnl-pwa-install {
  background: linear-gradient(90deg, rgba(247, 212, 136, 0.18) 0%, rgba(14, 22, 38, 0.95) 100%);
  border-bottom: 1px solid var(--border-gold);
  padding: 8px 12px;
  display: none;
}
.pwa-banner-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pwa-banner-text {
  font-size: 0.74rem;
  color: var(--text-gold);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}
.pwa-banner-text i {
  color: var(--gold-bright);
  font-size: 1rem;
}
.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-pwa-banner-install {
  background: var(--gold-gradient);
  color: #070b13;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-pwa-banner-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.85rem;
  padding: 4px;
  cursor: pointer;
}

/* ==========================================================================
   VIEW 1: MOBILE VIP LOGIN
   ========================================================================== */
#login {
  min-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px 16px 60px;
  position: relative;
}

.login-card {
  width: 100%;
  padding: 26px 20px;
  text-align: center;
  border: 1px solid var(--border-gold);
  background: linear-gradient(180deg, rgba(17, 27, 46, 0.95) 0%, rgba(10, 15, 26, 0.98) 100%);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), var(--gold-glow);
}

.login-logo-wrap {
  width: 90px;
  height: 90px;
  margin: 0 auto 12px;
  padding: 8px;
  background: radial-gradient(circle, rgba(247, 212, 136, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  border: 2px solid var(--gold-primary);
  box-shadow: var(--gold-glow);
  animation: floatLogo 4s ease-in-out infinite;
}
.login-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes floatLogo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.login-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 2px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.login-subtitle {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 18px;
}

.vip-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(247, 212, 136, 0.12);
  border: 1px solid var(--border-gold);
  color: var(--text-gold);
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.input-group-custom {
  position: relative;
  margin-bottom: 14px;
  text-align: left;
}
.input-group-custom label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-gold);
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.input-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-field-wrap i.input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-gold);
  font-size: 0.9rem;
  pointer-events: none;
}
.input-field-wrap input {
  width: 100%;
  background: rgba(5, 8, 15, 0.9);
  border: 1px solid rgba(247, 212, 136, 0.35);
  border-radius: 10px;
  padding: 10px 12px 10px 38px;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
}
.input-field-wrap input:focus {
  outline: none;
  border-color: var(--gold-bright);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
}
.input-field-wrap input::placeholder {
  color: #64748b;
  font-size: 0.82rem;
}
.toggle-pwd-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.btn-arcade-gold {
  width: 100%;
  background: var(--gold-gradient);
  color: #070b13;
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.8px;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(229, 169, 59, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-transform: uppercase;
}
.btn-arcade-gold:active {
  transform: scale(0.98);
}

.login-disclaimer {
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 16px;
  line-height: 1.3;
}

/* ==========================================================================
   VIEW 2: MOBILE-FIRST DASHBOARD & GAME SELECTOR
   ========================================================================== */
#app {
  padding-bottom: 74px; /* Space for bottom nav */
  width: 100%;
}

/* Compact Mobile Hero & Filter Bar */
.mobile-hero-bar {
  padding: 12px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-hero-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mobile-hero-title {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.mobile-count-pill {
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(247, 212, 136, 0.12);
  border: 1px solid var(--border-gold);
  color: var(--text-gold);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Mobile Search Bar */
.mobile-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.mobile-search-wrap i {
  position: absolute;
  left: 12px;
  color: var(--text-gold);
  font-size: 0.85rem;
  pointer-events: none;
}
.mobile-search-input {
  width: 100%;
  background: rgba(14, 22, 38, 0.9);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  padding: 7px 12px 7px 34px;
  color: #fff;
  font-size: 0.82rem;
  font-family: inherit;
  transition: all 0.2s ease;
}
.mobile-search-input:focus {
  outline: none;
  border-color: var(--gold-bright);
  background: rgba(18, 28, 48, 0.95);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.25);
}
.mobile-search-input::placeholder {
  color: #64748b;
  font-size: 0.78rem;
}

/* Category Filter Chips */
.mobile-category-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: none;
}
.mobile-category-scroll::-webkit-scrollbar {
  display: none;
}
.filter-chip {
  background: rgba(14, 22, 38, 0.85);
  border: 1px solid var(--border-gold);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-chip.active {
  background: var(--gold-gradient);
  color: #070b13;
  font-weight: 800;
  border-color: var(--gold-primary);
  box-shadow: 0 2px 8px rgba(229, 169, 59, 0.4);
}

/* Mobile-First 2-Column Game Grid */
#lst-games {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 6px 12px 16px;
}

.game-card {
  background: linear-gradient(180deg, rgba(16, 25, 44, 0.95) 0%, rgba(9, 14, 24, 0.98) 100%);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.game-card:active {
  transform: scale(0.97);
  border-color: var(--gold-bright);
}

.game-card-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #020408;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.game-card-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-code-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  background: rgba(7, 11, 19, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid var(--gold-primary);
  color: var(--text-gold);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
}

.game-tag-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(220, 38, 38, 0.88);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 6px;
}

.game-card-title {
  font-family: 'Cinzel', serif;
  font-size: 0.84rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

.btn-play-game {
  width: 100%;
  background: var(--gold-gradient);
  color: #070b13;
  font-weight: 800;
  font-size: 0.74rem;
  padding: 6px 8px;
  border-radius: 8px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-transform: uppercase;
}

/* ==========================================================================
   VIEW 3: MOBILE CANVAS GAME ARENA
   ========================================================================== */
#pnl-game {
  width: 100%;
  padding: 8px 8px 65px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-top-bar {
  width: 100%;
  background: rgba(14, 22, 38, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.btn-back-lobby {
  background: rgba(247, 212, 136, 0.15);
  border: 1px solid var(--border-gold);
  color: var(--text-gold);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-back-lobby:active {
  background: var(--gold-gradient);
  color: #070b13;
}

.arena-title {
  font-family: 'Cinzel', serif;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-gold);
  margin: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.canvas-chassis-container {
  width: 100%;
  position: relative;
  background: #000000;
  border: 2px solid #1e293b;
  border-radius: 16px;
  padding: 2px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.9), 0 0 15px rgba(229, 169, 59, 0.2);
  overflow: hidden;
}

#gameCanvas {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 10 / 16;
  display: block;
  border-radius: 14px;
  background: #000;
  touch-action: none;
}

/* ==========================================================================
   MOBILE NATIVE BOTTOM NAVIGATION BAR (Sticky to bottom of mobile frame)
   ========================================================================== */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 52px;
  background: rgba(7, 11, 19, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #64748b;
  font-size: 0.65rem;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 12px;
  transition: color 0.15s ease;
}
.bottom-nav-item i {
  font-size: 1.05rem;
}
.bottom-nav-item.active, .bottom-nav-item:active {
  color: var(--gold-bright);
}
.bottom-nav-item.active i {
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.6));
}

/* ==========================================================================
   ORIENTATION GUIDANCE OVERLAY (Rotate to portrait)
   ========================================================================== */
#landscape-rotate-prompt {
  display: none;
}
@media screen and (orientation: landscape) and (max-height: 560px) {
  #landscape-rotate-prompt {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(7, 11, 19, 0.98);
    backdrop-filter: blur(16px);
    z-index: 2147483647;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 24px;
  }
}

.rotate-icon-pulse {
  font-size: 40px;
  color: var(--gold-primary);
  margin-bottom: 12px;
  animation: pulseRotate 2.5s infinite linear;
}
@keyframes pulseRotate {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(90deg); }
  100% { transform: rotate(0deg); }
}
