:root {
  --bg-dark: #090d16;
  --panel: rgba(15, 23, 42, 0.86);
  --border: rgba(148, 163, 184, 0.24);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --cyber: #d946ef;
  --gold: #facc15;
  --danger: #ef4444;
  --success: #22c55e;
  --touch-scale: 1;
  --touch-opacity: 0.78;
}

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

html, body {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg-dark);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

#app {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #0f172a;
  touch-action: none;
}

.hidden {
  display: none !important;
}

.card-glass {
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

/* ==================== BUTTONS ==================== */
.btn {
  border: none;
  border-radius: 11px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  transition: transform 0.14s ease, filter 0.14s ease, box-shadow 0.14s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

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

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.btn-cyber {
  background: linear-gradient(135deg, #c026d3, #2563eb);
  box-shadow: 0 6px 18px rgba(192, 38, 211, 0.4);
}

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

.btn-glass {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.btn-danger-outline {
  background: rgba(127, 29, 29, 0.35);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(30, 41, 59, 0.9);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
}

.icon-btn:hover {
  background: rgba(51, 65, 85, 0.95);
}

.coin-pill {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(250, 204, 21, 0.55);
  color: var(--gold);
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 4px 14px rgba(250, 204, 21, 0.18);
}

/* ==================== OVERLAYS & MENU ==================== */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(6, 10, 20, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow-y: auto;
  touch-action: pan-y;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#shopOverlay,
#guideOverlay,
#wardrobeOverlay,
#achieveOverlay {
  z-index: 35;
}

#adminOverlay {
  z-index: 48;
}

.admin-card {
  width: min(760px, 100%);
}

.admin-login-box {
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid rgba(192, 38, 211, 0.4);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
}

.admin-lock-msg {
  font-size: 14px;
  margin-bottom: 12px;
  color: #e2e8f0;
}

.admin-login-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-input {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.38);
  color: #ffffff;
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  user-select: text;
}

.admin-input:focus {
  border-color: #38bdf8;
}

.admin-input.sm {
  width: 96px;
  padding: 5px 8px;
  font-size: 13px;
}

.admin-err {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #f87171;
  min-height: 18px;
}

.admin-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-section {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.admin-section h3 {
  font-size: 14px;
  color: #38bdf8;
  margin-bottom: 10px;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}

.admin-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.admin-item-chip {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.admin-props-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.admin-props-grid label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.6);
  padding: 7px 10px;
  border-radius: 9px;
}

.admin-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.chk-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.28);
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 12.5px;
  cursor: pointer;
}

.icon-btn.active {
  background: rgba(56, 189, 248, 0.36);
  border-color: #38bdf8;
}

.menu-shell {
  width: min(1040px, 100%);
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72);
  max-height: 95vh;
  display: flex;
  flex-direction: column;
}

.menu-hero {
  position: relative;
  height: 300px;
  background: linear-gradient(135deg, #1e1b4b, #0f172a);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 24px;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  opacity: 0.72;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(9, 13, 22, 0.65) 0%,
    rgba(9, 13, 22, 0.28) 45%,
    rgba(15, 23, 42, 0.97) 100%
  );
}

.hero-top-bar,
.hero-title-block {
  position: relative;
  z-index: 2;
}

.hero-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-title-block h1 {
  font-size: clamp(28px, 4.2vw, 46px);
  font-weight: 900;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #ffffff, #38bdf8, #e879f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 4px 20px rgba(56, 189, 248, 0.25);
  margin: 4px 0 6px;
}

.hero-title-block p {
  color: #e2e8f0;
  max-width: 720px;
  font-size: 14px;
  line-height: 1.45;
}

.tag-cyber {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(217, 70, 239, 0.24);
  border: 1px solid rgba(232, 121, 249, 0.5);
  color: #f5d0fe;
}

.menu-body {
  padding: 18px 24px 24px;
  overflow-y: auto;
}

.section-heading {
  font-size: 16px;
  color: #cbd5e1;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.diff-card {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.diff-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.6);
}

.diff-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.diff-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  color: #090d16;
  background: #4ade80;
}

.diff-card h3 {
  font-size: 17px;
  color: #fff;
}

.diff-card p {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.4;
}

.diff-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: #94a3b8;
}

.diff-meta span {
  background: rgba(15, 23, 42, 0.7);
  padding: 4px 8px;
  border-radius: 7px;
}

/* ==================== MODALS (SHOP, GUIDE, PAUSE, RESULT) ==================== */
.modal-card {
  width: min(920px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
}

.small-card {
  width: min(410px, 100%);
  text-align: center;
}

.small-card h2 {
  margin-bottom: 6px;
}

.small-card p {
  color: var(--muted);
  margin-bottom: 18px;
  font-size: 14px;
}

.stack-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.modal-header p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}

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

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.shop-item {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.shop-item-top {
  display: flex;
  gap: 10px;
  align-items: center;
}

.shop-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 24px;
  flex-shrink: 0;
}

.shop-item h3 {
  font-size: 15px;
}

.shop-stock {
  font-size: 12px;
  color: #38bdf8;
  font-weight: 700;
}

.shop-desc {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.4;
}

.shop-buy-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.modal-footer {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.shop-toast {
  font-size: 13px;
  font-weight: 700;
  color: #4ade80;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.guide-box {
  background: rgba(30, 41, 59, 0.62);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.guide-box.full {
  grid-column: 1 / -1;
}

.guide-box h3 {
  font-size: 15px;
  margin-bottom: 8px;
  color: #38bdf8;
}

.guide-box ul {
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.55;
  color: #e2e8f0;
}

.guide-box p {
  font-size: 13px;
  line-height: 1.55;
  color: #e2e8f0;
}

/* ==================== HUD ==================== */
.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.hud-left,
.hud-center,
.hud-right {
  pointer-events: auto;
  padding: 10px 12px;
}

.hud-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hud-status-row {
  margin-top: 6px;
}

.hud-stat {
  font-size: 13px;
  font-weight: 700;
}

.coin-text {
  color: var(--gold);
}

.status-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 8px;
}

.status-safe {
  background: rgba(22, 163, 74, 0.28);
  color: #86efac;
}

.status-hear {
  background: rgba(217, 119, 6, 0.35);
  color: #fde047;
}

.status-chase {
  background: rgba(220, 38, 38, 0.45);
  color: #fecaca;
  animation: pulseBadge 0.6s infinite alternate;
}

@keyframes pulseBadge {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.mini-note {
  font-size: 11px;
  color: #cbd5e1;
}

.hud-center {
  min-width: 220px;
}

.stamina-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #cbd5e1;
  margin-bottom: 5px;
  font-weight: 700;
}

.stamina-bar-bg {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.stamina-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #22c55e, #38bdf8);
  transition: width 0.08s linear;
}

.buff-strip {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.buff-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.35);
  color: #e0e7ff;
}

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

#minimapCanvas {
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.hud-controls-mini {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Chatter Feed */
.chatter-feed {
  position: absolute;
  left: 14px;
  bottom: 84px;
  width: min(350px, 85vw);
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
}

.chatter-line {
  background: rgba(15, 23, 42, 0.82);
  border-left: 3px solid #38bdf8;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  animation: fadeSlideIn 0.2s ease;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Bottom Hotbar */
.hud-bottom {
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.hotbar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.item-slot {
  position: relative;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  padding: 6px 10px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.item-slot:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #38bdf8;
}

.item-slot:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.slot-key {
  font-size: 10px;
  background: #0f172a;
  color: #94a3b8;
  padding: 2px 5px;
  border-radius: 5px;
}

.slot-qty {
  background: #2563eb;
  color: #fff;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 11px;
}

.passive-pill {
  font-size: 12px;
  padding: 6px 9px;
  border-radius: 9px;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: #fde047;
}

.action-toggle-btn {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.action-toggle-btn.active {
  background: rgba(22, 163, 74, 0.42);
  border-color: #4ade80;
  color: #bbf7d0;
}

/* ==================== DIALOGUE CUTSCENE ==================== */
.dialogue-overlay {
  align-items: flex-end;
  background: rgba(6, 10, 20, 0.56);
  padding-bottom: 26px;
}

.dialogue-stage {
  width: min(860px, 100%);
}

.dialogue-box {
  display: flex;
  gap: 16px;
  padding: 16px;
  align-items: center;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.portrait-frame {
  width: 120px;
  height: 120px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
  background: #0f172a;
}

#portraitCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.dialogue-content {
  flex: 1;
  min-width: 0;
}

.dialogue-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.speaker-tag {
  background: linear-gradient(90deg, #2563eb, #9333ea);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.dlg-progress {
  font-size: 12px;
  color: var(--muted);
}

.dlg-text {
  font-size: 15.5px;
  line-height: 1.55;
  min-height: 50px;
  color: #f8fafc;
}

.dialogue-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

/* ==================== RESULT CARD ==================== */
.result-card {
  width: min(640px, 100%);
  padding: 0;
  overflow: hidden;
}

.result-art-wrap {
  position: relative;
  height: 220px;
  background: #0f172a;
}

.result-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 13px;
  background: #22c55e;
  color: #090d16;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.result-badge.caught {
  background: #ef4444;
  color: #fff;
}

.result-body {
  padding: 20px;
}

.result-body h2 {
  font-size: 24px;
  margin-bottom: 6px;
}

.result-body p {
  color: #cbd5e1;
  font-size: 14px;
  margin-bottom: 14px;
}

.reward-breakdown {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
}

.reward-row {
  display: flex;
  justify-content: space-between;
}

.reward-row.total {
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  padding-top: 6px;
  margin-top: 2px;
  font-weight: 800;
  color: var(--gold);
  font-size: 15px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==================== RESPONSIVE DIALOGUE & DESK ==================== */
@media (hover: none) and (pointer: coarse), (max-width: 768px) {
  .dialogue-box {
    flex-direction: column;
    align-items: stretch;
  }
  .portrait-frame {
    width: 84px;
    height: 84px;
    align-self: center;
  }
  .cyber-desk-main {
    flex-direction: column;
  }
}

/* ==================== V2.0 WEATHER, QUESTS, TABS, ACHIEVEMENTS, RGB DESK ==================== */
.weather-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.22);
  color: #bae6fd;
}

.quest-box {
  margin-top: 7px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 280px;
}

.quest-item {
  font-size: 11px;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.72);
  padding: 3px 7px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.quest-item.done {
  color: #86efac;
  text-decoration: line-through;
  opacity: 0.85;
}

.achieve-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border: 2px solid #facc15;
  color: #fef08a;
  padding: 10px 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
  animation: fadeSlideIn 0.25s ease;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.tab-btn {
  flex: 1;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
  padding: 9px 12px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.tab-btn.active {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #ffffff;
  border-color: #38bdf8;
}

.admin-tab-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rank-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 15px;
  background: linear-gradient(135deg, #facc15, #f97316);
  color: #090d16;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.cyber-desk {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.92), rgba(49, 46, 129, 0.55));
  border: 2px solid rgba(217, 70, 239, 0.6);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 0 22px rgba(217, 70, 239, 0.25);
}

.cyber-desk-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 800;
  color: #f0abfc;
  margin-bottom: 10px;
}

.speedrun-tag {
  background: rgba(15, 23, 42, 0.85);
  color: #22d3ee;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.45);
}

.cyber-desk-main {
  display: flex;
  gap: 12px;
  align-items: center;
}

#pcMonitorCanvas {
  border-radius: 10px;
  border: 2px solid #22d3ee;
  background: #090d16;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.35);
}

.cyber-desk-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-pick-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pc-game-btn.active {
  background: linear-gradient(135deg, #22d3ee, #2563eb);
  color: #090d16;
}

.combo-status {
  font-size: 12px;
  color: #fde047;
  font-weight: 700;
}

.achieve-card-locked {
  opacity: 0.55;
  filter: grayscale(0.7);
}

/* ==================== V3.0 CO-OP BAR, HARDCORE, WANTED, EXCUSE ==================== */
.coop-bar {
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.coop-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.coop-label {
  font-size: 13px;
  font-weight: 800;
  color: #38bdf8;
  min-width: 112px;
}

.hardcore-heading {
  color: #fb7185 !important;
  text-shadow: 0 0 12px rgba(244, 63, 94, 0.45);
}

.diff-card.hardcore {
  border-color: rgba(244, 63, 94, 0.45);
  background: linear-gradient(155deg, rgba(69, 10, 10, 0.65), rgba(30, 27, 75, 0.72));
}

.wanted-pill {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(250, 204, 21, 0.45);
  color: #facc15;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 13px;
  letter-spacing: 1px;
}

.robot-cmd-bar {
  display: flex;
  gap: 5px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.cmd-btn {
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(15, 23, 42, 0.82);
  color: #cbd5e1;
  padding: 3px 7px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.cmd-btn.active {
  background: #0284c7;
  color: #fff;
}

.excuse-card {
  width: min(460px, 100%);
  border: 2px solid #facc15;
}

.excuse-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.excuse-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  overflow: hidden;
}

.excuse-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ef4444, #facc15, #22c55e);
  transition: width 0.05s linear;
}

/* ==================== V4.0 & V5.0 MOBILE WEB PRO, CODEX & FINAL UX ==================== */
.rotate-banner {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 65;
  width: min(94vw, 520px);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(30, 58, 138, 0.92));
  border: 1px solid #38bdf8;
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #e0f2fe;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
}

.mode-pill {
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(217, 70, 239, 0.25);
  border: 1px solid rgba(232, 121, 249, 0.45);
  color: #f5d0fe;
}

.hud, .hud * {
  touch-action: none;
}

.touch-pro-layer {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  touch-action: none;
}

.touch-mode-group {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.touch-joy-zone {
  position: absolute;
  bottom: 0;
  top: 24%;
  pointer-events: auto;
  touch-action: none;
}

.touch-joy-zone.left-half {
  left: 0;
  width: 50%;
}

.touch-joy-zone.half-p1 {
  left: 0;
  width: 50%;
  border-right: 1px dashed rgba(56, 189, 248, 0.28);
}

.touch-joy-zone.half-p2 {
  right: 0;
  width: 50%;
}

.joy-hint-lbl {
  position: absolute;
  left: 16px;
  bottom: 18px;
  font-size: 11px;
  color: rgba(226, 232, 240, 0.52);
  font-weight: 700;
  pointer-events: none;
}

.joy-base {
  position: absolute;
  width: calc(114px * var(--touch-scale));
  height: calc(114px * var(--touch-scale));
  margin-left: calc(-57px * var(--touch-scale));
  margin-top: calc(-57px * var(--touch-scale));
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.42);
  border: 2px solid rgba(56, 189, 248, 0.65);
  opacity: var(--touch-opacity);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.25);
}

.joy-knob {
  width: calc(46px * var(--touch-scale));
  height: calc(46px * var(--touch-scale));
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #7dd3fc, #0284c7);
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.touch-right-cluster {
  position: absolute;
  right: 14px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: auto;
  transform: scale(var(--touch-scale));
  transform-origin: bottom right;
  opacity: var(--touch-opacity);
}

.touch-robot-arc,
.touch-aux-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.touch-pill-btn,
.touch-mini-btn {
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.touch-mini-btn.active {
  background: #0284c7;
  border-color: #38bdf8;
}

.touch-main-pad {
  display: grid;
  grid-template-columns: repeat(2, 62px);
  gap: 8px;
  align-items: center;
}

.touch-action-btn {
  width: 62px;
  height: 58px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.45);
}

.touch-action-btn small {
  font-size: 9.5px;
  margin-top: 2px;
}

.touch-action-btn.big {
  background: linear-gradient(135deg, #ea580c, #dc2626);
}

.touch-action-btn.cyan {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
}

.touch-action-btn.amber {
  background: linear-gradient(135deg, #d97706, #eab308);
  color: #090d16;
}

.touch-action-btn.sky {
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
}

.p-touch-tag {
  position: absolute;
  top: 8px;
  left: 12px;
  font-size: 12px;
  font-weight: 900;
  color: #7dd3fc;
  background: rgba(15, 23, 42, 0.72);
  padding: 2px 8px;
  border-radius: 8px;
}

.touch-2p-btns {
  position: absolute;
  bottom: 14px;
  display: flex;
  gap: 6px;
  pointer-events: auto;
  opacity: var(--touch-opacity);
}

.touch-2p-btns.p1 { right: 10px; }
.touch-2p-btns.p2 { right: 10px; }

.codex-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.codex-portrait {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: #0f172a;
  flex-shrink: 0;
}

.codex-meta {
  flex: 1;
  font-size: 12px;
  line-height: 1.45;
  color: #cbd5e1;
}

.codex-meta h4 {
  font-size: 14px;
  color: #f8fafc;
  margin-bottom: 2px;
}

.codex-threat {
  color: #facc15;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 4px;
}

.codex-tip {
  margin-top: 5px;
  color: #86efac;
  font-size: 11.5px;
}

/* Mobile Responsive Adjustments (Portrait & Short Landscape) */
@media (max-width: 780px), (max-height: 540px) {
  .overlay {
    padding: 8px;
    align-items: flex-start;
  }
  .menu-hero {
    height: 185px;
  }
  .hero-title-block h1 {
    font-size: 24px;
  }
  .hero-top-actions .btn {
    padding: 6px 9px;
    font-size: 11.5px;
  }
  .hud-top {
    gap: 6px;
    padding: 6px;
  }
  .hud-left {
    max-width: 58vw;
    padding: 6px 8px;
  }
  .hud-center {
    display: none;
  }
  #minimapCanvas {
    width: 112px;
    height: 66px;
  }
  .hud-bottom {
    bottom: 6px;
    padding: 0 6px;
    max-width: 44vw;
    left: 50%;
    transform: translateX(-50%);
  }
  .hotbar {
    gap: 4px;
    padding: 5px;
    flex-wrap: nowrap;
    overflow-x: auto;
    touch-action: pan-x;
  }
  .item-slot {
    min-width: 44px;
    padding: 4px 5px;
  }
  .item-slot .slot-name,
  .item-slot .slot-key {
    display: none;
  }
  .action-toggle-btn {
    display: none;
  }
  .chatter-feed {
    display: none;
  }
  .admin-tabs {
    flex-wrap: wrap;
  }
  .tab-btn {
    padding: 7px 8px;
    font-size: 11.5px;
  }
}
