/* frontend/public/css/mobile-core.css */
/* Global 80s / Early 90s Synthwave Neon Arcade Core Stylesheet */

:root {
  --bg-dark: #070312;
  --bg-card: rgba(16, 8, 36, 0.94);
  --brand-blue: #00f0ff;
  --brand-pink: #ff007f;
  --brand-gold: #fde047;
  --brand-green: #00ff66;
  --brand-error: #f43f5e;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-subtle: rgba(0, 240, 255, 0.3);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  /* `clip` stops horizontal scroll WITHOUT creating a nested vertical scroll trap */
  overflow-x: clip;
  overflow-y: visible;
  touch-action: manipulation;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(circle at 50% 0%, rgba(255, 0, 127, 0.16) 0%, transparent 55%),
    linear-gradient(rgba(0, 240, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 28px 28px, 28px 28px;
  color: var(--text-main);
  user-select: none;
  -webkit-user-select: none;
}

/* Always allow text entry & selection inside form controls, search bars, and report modals on iOS/Android */
input,
textarea,
select {
  user-select: text;
  -webkit-user-select: text;
}

.app-container {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  overflow: visible;
}

/* Remove duplicate outer padding when a page uses its own inner arcade layout wrapper */
.app-container:has(.arcade-home),
.app-container:has(.games-hall-shell),
.app-container:has(.tasks-layout),
.app-container:has(.scratch-layout),
.app-container:has(.wallet-layout),
.app-container:has(.profile-scroll-body) {
  padding: 0;
}

/* =========================================================
   AUTHORITATIVE 6-TAB SINGLE-LINE BOTTOM NAVIGATION GUARD
   Prevents left:0 + translateX(-50%) collisions & 5-col wrapping
   ========================================================= */

.bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  width: 100% !important;
  max-width: 440px !important;
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  align-items: center !important;
  gap: 3px !important;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)) 4px !important;
  box-sizing: border-box !important;
  z-index: 9500 !important;
}

.bottom-nav .nav-item {
  width: 100% !important;
  min-width: 0 !important;
  height: 54px !important;
  padding: 4px 1px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  box-sizing: border-box !important;
}

.bottom-nav .nav-label {
  font-size: 0.56rem !important;
  letter-spacing: 0.2px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
}

/* =========================================================
   1. RETRO ARCADE BRAND HEADER & AUTH CARDS
   ========================================================= */

.brand-header {
  text-align: center;
  margin: 28px 0 24px 0;
}

.brand-header h1 {
  margin: 0;
  font-family: monospace, sans-serif;
  font-size: 2.15rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.7), 0 3px 0 #000000;
}

.brand-header h1 span {
  color: var(--brand-pink);
  text-shadow: 0 0 14px rgba(255, 0, 127, 0.9), 0 3px 0 #000000;
}

.card {
  width: 100%;
  background: linear-gradient(160deg, rgba(28, 12, 54, 0.94), rgba(11, 6, 26, 0.98));
  border: 2px solid var(--brand-blue);
  border-radius: 20px;
  padding: 22px 18px;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(0, 240, 255, 0.22),
    inset 0 0 14px rgba(255, 0, 127, 0.12);
}

/* =========================================================
   2. FORM INPUTS & 3D ARCADE CABINET BUTTONS
   ========================================================= */

.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-group label {
  display: block;
  font-family: monospace, sans-serif;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 7px;
  color: var(--brand-blue);
}

.form-control {
  width: 100%;
  padding: 13px 14px;
  background: #070312;
  border: 1.5px solid rgba(0, 240, 255, 0.38);
  border-radius: 12px;
  color: var(--text-main);
  font-family: monospace, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: text;
  -webkit-user-select: text;
}

.form-control:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.4);
}

/* 3D Neon Magenta Arcade Action Button */
.btn-primary {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid var(--brand-gold);
  background: linear-gradient(180deg, #ff007f 0%, #be185d 100%);
  color: #ffffff;
  font-family: monospace, sans-serif;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 5px 0 #701a75, 0 0 18px rgba(255, 0, 127, 0.5);
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.2s ease;
}

.btn-primary:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #701a75, 0 0 10px rgba(255, 0, 127, 0.4);
}

.btn-primary:disabled,
.btn-disabled {
  background: rgba(55, 65, 81, 0.6) !important;
  border-color: rgba(148, 163, 184, 0.3) !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}

/* 3D Cyber Cyan Social / Secondary Button */
.btn-social {
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--brand-blue);
  background: rgba(16, 8, 36, 0.92);
  color: #ffffff;
  font-family: monospace, sans-serif;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(2, 132, 199, 0.75), 0 0 14px rgba(0, 240, 255, 0.22);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn-social:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(2, 132, 199, 0.75);
}

.error-text {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid var(--brand-error);
  padding: 8px 10px;
  border-radius: 8px;
  font-family: monospace, sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  margin-top: 8px;
  display: none;
}

/* Invisible Bot Honeypot */
.oh-honey {
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  height: 0;
  width: 0;
  z-index: -1;
  pointer-events: none;
}

/* =========================================================
   3. EULA & LEGAL MODAL OVERLAYS
   ========================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 2, 14, 0.86);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-card {
  background: linear-gradient(160deg, #1b0a38 0%, #090514 100%);
  border: 2px solid var(--brand-blue);
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.85), 0 0 24px rgba(0, 240, 255, 0.35);
}

.modal-header {
  padding: 16px 18px;
  border-bottom: 1.5px solid rgba(0, 240, 255, 0.3);
  font-family: monospace, sans-serif;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-align: center;
  color: var(--brand-blue);
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #cbd5e1;
  text-align: left;
}

.modal-body h3 {
  color: var(--brand-gold);
  font-family: monospace, sans-serif;
  font-size: 0.9rem;
  margin-top: 18px;
  margin-bottom: 6px;
}

.modal-footer {
  padding: 16px 18px;
  border-top: 1px solid rgba(0, 240, 255, 0.25);
  background: #070312;
}

.custom-checkbox {
  width: 24px;
  height: 24px;
  pointer-events: none;
  accent-color: var(--brand-green);
}

/* =========================================================
   4. LOGIN, PASSWORD TOGGLE & PUSH GATE OVERLAY
   ========================================================= */

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-wrapper .form-control {
  padding-right: 45px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:active {
  color: var(--brand-blue);
}

.auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  font-size: 0.8rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-blue);
}

.forgot-link {
  color: var(--brand-blue);
  font-family: monospace, sans-serif;
  text-decoration: none;
  font-weight: 800;
}

/* Full-Screen Push Notification Gate */
.push-gate-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #1b0a38 0%, #070312 100%);
  z-index: 99999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.push-gate-icon {
  font-size: 3.8rem;
  color: var(--brand-blue);
  margin-bottom: 18px;
  filter: drop-shadow(0 0 14px rgba(0, 240, 255, 0.6));
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.push-gate-title {
  font-family: monospace, sans-serif;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 10px;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
}

.push-gate-text {
  font-size: 0.86rem;
  color: #cbd5e1;
  line-height: 1.5;
  max-width: 360px;
  margin-bottom: 26px;
}

/* =========================================================
   5. FULLSCREEN MODAL MASTER STYLES
   ========================================================= */

.modal-fullscreen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-dark);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 14px 18px;
  background: #120726;
  border-bottom: 2px solid var(--brand-blue);
  position: relative;
  z-index: 100;
}

.modal-nav-back {
  background: transparent;
  border: none;
  color: var(--brand-blue);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 10px 0 0;
}

.modal-nav-title {
  margin: 0;
  font-family: monospace, sans-serif;
  font-size: 1rem;
  font-weight: 900;
  color: #ffffff;
  flex: 1;
  text-align: center;
  padding-right: 24px;
}

.support-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}