:root {
  --bg-dark: #08090f;
  --bg-card: rgba(22, 24, 35, 0.7);
  --bg-card-solid: #161823;
  --wigame-red: #e11d48;
  --wigame-amber: #f59e0b;
  --wigame-cyan: #06b6d4;
  --gold: #fac710;
  --text-main: #f1f1f2;
  --text-muted: #8a8b91;
  --success: #10b981;
  --glass-border: rgba(255, 255, 255, 0.08);
  --shadow-glow: 0 0 15px rgba(225, 29, 72, 0.35);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(circle at 10% 20%, rgba(225, 29, 72, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(245, 158, 11, 0.1) 0%, transparent 40%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px;
  overflow-x: hidden;
}

/* Header style */
.app-header {
  text-align: center;
  margin-bottom: 30px;
  position: relative;
  width: 100%;
  max-width: 1200px;
}

.header-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-card-solid);
  border: 1px solid var(--glass-border);
}

.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.lang-switch button[aria-pressed="true"] {
  background: linear-gradient(90deg, var(--wigame-red), #be123c);
  color: #fff;
}

.app-header a {
  color: inherit;
  text-decoration: underline;
}

html[lang="en"] [data-lang="vi"],
html:not([lang="vi"]) [data-lang="vi"] {
  display: none !important;
}

html[lang="vi"] [data-lang="en"] {
  display: none !important;
}

.app-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.35;
  padding: 0.06em 0 0.16em;
  overflow: visible;
  background: linear-gradient(135deg, var(--wigame-red) 20%, #ffffff 50%, var(--wigame-amber) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.app-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 400;
}

/* Main Sandbox Layout */
.sandbox-container {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 40px;
  width: 100%;
  max-width: 1200px;
  align-items: start;
}

@media (max-width: 960px) {
  .sandbox-container {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 30px;
  }
}

/* ==========================================================================
   PHONE EMULATOR FRAME STYLES
   ========================================================================== */
.emulator-section {
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-frame {
  width: 375px;
  height: 720px;
  background-color: #000000;
  border: 12px solid #1a1a1a;
  border-radius: 40px;
  box-shadow: 
    0 25px 60px -15px rgba(0, 0, 0, 0.8),
    0 0 0 2px rgba(255, 255, 255, 0.05),
    0 0 30px rgba(225, 29, 72, 0.2);
  position: relative;
  overflow: hidden;
}

/* Screen Notch */
.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 22px;
  background-color: #1a1a1a;
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 15px;
  z-index: 1000;
}

.phone-screen {
  width: 100%;
  height: 100%;
  position: relative;
  background-color: #111216;
  display: flex;
  flex-direction: column;
}

/* Mobile Status Bar */
.phone-status-bar {
  height: 28px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  z-index: 999;
  user-select: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
}

.phone-status-bar .signals {
  display: flex;
  gap: 5px;
}

/* Simulated H5 Browser Address Bar */
.phone-browser-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  margin: 6px 14px 10px;
  padding: 6px 10px;
  z-index: 99;
  backdrop-filter: blur(10px);
}

.browser-lock {
  font-size: 0.75rem;
}

.browser-url {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: all;
}

.browser-reload-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0 4px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.browser-reload-btn:hover {
  color: #fff;
  transform: rotate(90deg);
}

/* Floating Game HUD */
.floating-game-hud {
  position: absolute;
  top: 76px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  z-index: 50;
  pointer-events: none;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 11, 16, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   GAME IFRAME & CANVAS STYLES
   ========================================================================== */
.game-iframe {
  position: absolute;
  top: 74px;
  left: 0;
  width: 100%;
  height: calc(100% - 74px - 60px);
  border: none;
  z-index: 10;
  background: #000000;
}

#game-canvas {
  display: none;
}

/* ==========================================================================
   GAME HUD & OVERLAYS STYLES
   ========================================================================== */
.game-hud-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(22, 24, 35, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  z-index: 100;
  padding-bottom: 5px;
}

.hud-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.hud-tab:hover {
  color: var(--text-main);
}

.hud-tab.active {
  color: var(--wigame-amber);
  font-weight: 600;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

/* Generic Overlay Styling */
.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 11, 16, 0.92);
  backdrop-filter: blur(25px);
  z-index: 80;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.game-overlay.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.overlay-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.close-overlay {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
}

.close-overlay:hover {
  color: white;
}

/* Welcome Overlay */
.welcome-box {
  width: 90%;
  text-align: center;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-logo {
  width: 70px;
  height: 70px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--wigame-red), var(--wigame-amber));
  font-size: 2.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 15px;
  box-shadow: 0 10px 25px rgba(225, 29, 72, 0.4);
  animation: logoGlow 2s infinite alternate;
}

@keyframes logoGlow {
  0% { box-shadow: 0 5px 15px rgba(225, 29, 72, 0.3); }
  100% { box-shadow: 0 15px 30px rgba(245, 158, 11, 0.6); }
}

.welcome-box h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 4px;
  background: linear-gradient(90deg, var(--wigame-red), var(--wigame-amber));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-box .subtitle {
  font-size: 0.65rem;
  letter-spacing: 3px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 24px;
}

.welcome-box .desc {
  font-size: 0.8rem;
  color: #b0b0b8;
  line-height: 1.5;
  margin-bottom: 30px;
}

.welcome-box .guest-action {
  font-size: 0.75rem;
  color: var(--wigame-cyan);
  text-decoration: underline;
  cursor: pointer;
  margin-top: 15px;
}

/* Shop Overlay */
.shop-box {
  width: 90%;
  height: 80%;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow: hidden;
}

.shop-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.shop-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
  flex: 1;
}

.shop-items::-webkit-scrollbar {
  width: 4px;
}

.shop-items::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.shop-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}

.shop-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.item-visual {
  font-size: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 40px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}

.item-info h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.item-info .pkg-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.btn-buy {
  padding: 8px 12px !important;
  font-size: 0.78rem !important;
  background: linear-gradient(90deg, var(--wigame-red), #be123c) !important;
  box-shadow: 0 4px 10px rgba(225, 29, 72, 0.25) !important;
}

/* Profile Overlay */
.profile-box {
  width: 90%;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
}

.prof-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--wigame-cyan);
  object-fit: cover;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.prof-meta h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.prof-meta p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.profile-details {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.detail-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-row .label {
  color: var(--text-muted);
}

.detail-row .value {
  color: var(--text-main);
  font-weight: 500;
}

.detail-row .value.highlighted {
  color: var(--wigame-amber);
  font-weight: 700;
}

/* ==========================================================================
   DEVELOPER DASHBOARD STYLES (RIGHT PANEL)
   ========================================================================== */
.dashboard-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
}

@media (max-width: 960px) {
  .dashboard-section {
    height: auto;
    width: 375px;
  }
}

.dash-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.dash-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  border-left: 3px solid var(--wigame-red);
  padding-left: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input,
select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  transition: var(--transition);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--wigame-red);
  box-shadow: var(--shadow-glow);
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #c5c6ca;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.checkbox-group input {
  cursor: pointer;
}

.checkbox-group code {
  color: var(--wigame-red);
  font-family: 'JetBrains Mono', monospace;
}

/* Console logs */
.console-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 250px;
}

.console-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-clear {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-clear:hover {
  background-color: rgba(255,255,255,0.05);
  color: white;
  border-color: rgba(255,255,255,0.3);
}

.console-logs {
  background: #040508;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
}

.log-row {
  display: flex;
  gap: 8px;
  word-break: break-all;
}

.log-time {
  color: #4a4d5e;
  flex-shrink: 0;
}

.log-row.info .log-message { color: #58a6ff; }
.log-row.success .log-message { color: var(--success); }
.log-row.error .log-message { color: var(--wigame-red); }
.log-row.warn .log-message { color: var(--gold); }

/* Cheats grid */
.actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ==========================================================================
   BUTTONS AND UTILITIES
   ========================================================================== */
.btn {
  background: linear-gradient(90deg, var(--wigame-red), #be123c);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(225, 29, 72, 0.25);
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.4);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  width: 100%;
}

.btn-success {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.25);
}

.btn-success:hover {
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  border-color: rgba(255,255,255,0.15);
}

.btn-danger {
  background: #2b0c10;
  border: 1px solid rgba(225, 29, 72, 0.2);
  color: var(--wigame-red);
  box-shadow: none;
  width: 100%;
}

.btn-danger:hover {
  background: #3d0f14;
  border-color: var(--wigame-red);
  box-shadow: none;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.78rem;
}

/* Actions Grid */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.actions-grid .btn {
  width: 100%;
}

/* Checkbox group */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.checkbox-group input {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: var(--wigame-red);
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   WIGAME NATIVE CHECKOUT BOTTOM SHEET MODAL (MATCHES APP 100%)
   ========================================================================== */
.wigame-bottomsheet-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  overflow: hidden;
}

.wigame-bottomsheet-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.wigame-bottomsheet {
  background: #ffffff;
  border-radius: 28px 28px 0 0;
  padding: 12px 20px 24px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -12px 35px rgba(0, 0, 0, 0.35);
  color: #0f172a;
}

.wigame-bottomsheet-backdrop.active .wigame-bottomsheet {
  transform: translateY(0);
}

.bs-drag-handle {
  width: 44px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 2px;
  margin: 0 auto 14px;
}

.bs-title {
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  color: #1e293b;
  margin: 0 0 16px;
  letter-spacing: -0.3px;
}

.bs-partner {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0 0 4px;
  font-weight: 500;
}

.bs-pkg-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 12px;
  letter-spacing: -0.4px;
}

.bs-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 0 0 16px;
}

.bs-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.bs-total-label {
  font-size: 0.95rem;
  color: #64748b;
  font-weight: 500;
}

.bs-total-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
}

.bs-gold-box {
  background: #fef3c7;
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #b45309;
  font-weight: 600;
  margin-bottom: 14px;
}

.bs-disclaimer {
  font-size: 0.74rem;
  color: #94a3b8;
  text-align: center;
  line-height: 1.4;
  margin: 0 0 16px;
}

.bs-btn {
  width: 100%;
  height: 48px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
  margin-bottom: 10px;
}

.bs-btn:active {
  transform: scale(0.98);
}

.bs-btn-gold {
  background: linear-gradient(135deg, #f59e0b, #eab308);
  color: #1c1917;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.bs-btn-tammi {
  background: #ffffff;
  border: 1.5px solid #f43f5e;
  color: #f43f5e;
}

.bs-btn-close {
  background: transparent;
  color: #f43f5e;
  font-weight: 600;
  height: 38px;
  margin-bottom: 0;
}
