/* ============================================================
   AIMSYNC - GLOBAL STYLES & TECH/RED GAMING THEME
   ============================================================ */

:root {
  --bg-deep: #090a0f;
  --bg-card: rgba(18, 21, 31, 0.75);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-input: rgba(10, 12, 18, 0.85);
  --accent-red: #e63946;
  --accent-red-hover: #ff4d5a;
  --accent-red-glow: rgba(230, 57, 70, 0.35);
  --text-main: #f1faee;
  --text-muted: #8b9bb4;
  --text-dim: #4a5568;
  --radius: 14px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Luce ambientale di sfondo */
.ambient-glow {
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(circle, rgba(230, 57, 70, 0.15) 0%, rgba(9, 10, 15, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.app-layout {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 30px 16px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ============================================================
   TOP NAVBAR, BRAND & LANGUAGE SELECTOR
   ============================================================ */

.top-nav {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 4px;
}

.logo-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.logo-brand-link:hover {
  transform: scale(1.02);
}

/* Vincolo rigido dimensioni logo + trasparenza su scuro */
.logo-brand-link img {
  width: 40px !important;
  height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  object-fit: contain;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 12px rgba(230, 57, 70, 0.6));
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
}

.logo-dot {
  width: 9px;
  height: 9px;
  background: var(--accent-red);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-red);
}

.logo-text span {
  color: var(--accent-red);
}

/* Selettore Lingua a Capsula Tech */
.lang-selector-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(18, 21, 31, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 12px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.lang-icon {
  font-size: 0.9rem;
  opacity: 0.8;
}

.lang-select {
  background: transparent !important;
  border: none !important;
  color: #f1faee !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  cursor: pointer;
  outline: none;
  padding-right: 4px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.lang-select option {
  background: #0d0f17;
  color: #fff;
  padding: 8px;
}

/* ============================================================
   AD SPACES
   ============================================================ */

.ad-slot {
  width: 100%;
  margin: 16px 0;
  display: flex;
  justify-content: center;
}

.ad-placeholder {
  width: 100%;
  max-width: 728px;
  height: 90px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

/* ============================================================
   MAIN CONTAINER & CARD
   ============================================================ */

.main-card {
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.card-header {
  text-align: center;
  margin-bottom: 24px;
}

.card-header h1 {
  font-size: 1.85rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.card-header p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Selettore Modalità di Mira (Hipfire / ADS / Sniper) */
.aim-mode-selector {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 4px;
  gap: 6px;
  margin-bottom: 22px;
}

.mode-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.mode-btn.active {
  background: var(--accent-red);
  color: #fff;
  box-shadow: 0 0 16px var(--accent-red-glow);
}

.mode-btn:hover:not(.active) {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

/* ============================================================
   GAME TRIGGER CARDS & SWAP
   ============================================================ */

.game-selection-cards {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.game-trigger-card {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.game-trigger-card:hover {
  border-color: rgba(230, 57, 70, 0.5);
  transform: translateY(-2px);
}

.card-tag {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-red);
  margin-bottom: 8px;
}

.card-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-avatar-box {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  text-transform: uppercase;
}

.game-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.change-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.action-btn.swap {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.action-btn.swap:hover {
  background: var(--accent-red);
  transform: rotate(180deg);
}

/* ============================================================
   CONTROLS (SENSITIVITY & DPI)
   ============================================================ */

.controls-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.control-box {
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.box-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.box-top label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.box-top input {
  width: 100px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  text-align: right;
}

.custom-slider {
  width: 100%;
  accent-color: var(--accent-red);
  cursor: pointer;
}

.preset-chips {
  display: flex;
  gap: 6px;
}

.preset-chips .chip {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'JetBrains Mono', monospace;
}

.preset-chips .chip.active {
  background: var(--accent-red);
  color: #fff;
  border-color: var(--accent-red);
}

/* ============================================================
   ADVANCED ENGINE SETTINGS ACCORDION
   ============================================================ */

.advanced-accordion {
  background: rgba(12, 14, 22, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 22px;
}

.accordion-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.accordion-toggle:hover {
  color: #fff;
}

.accordion-toggle svg {
  transition: transform 0.25s ease;
}

.accordion-toggle.open svg {
  transform: rotate(180deg);
}

.accordion-content {
  display: none;
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.accordion-content.show {
  display: grid;
}

.adv-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.adv-field label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.adv-field select, .adv-field input {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.82rem;
}

/* ============================================================
   OUTPUT CONSOLE & HUD
   ============================================================ */

.hud-display {
  background: linear-gradient(180deg, rgba(230, 57, 70, 0.08) 0%, rgba(15, 17, 26, 0.8) 100%);
  border: 1px solid rgba(230, 57, 70, 0.3);
  border-radius: 12px;
  padding: 24px 20px;
  margin-bottom: 24px;
}

.hud-main {
  text-align: center;
  margin-bottom: 20px;
}

.hud-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-red);
}

.hud-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 3rem;
  font-weight: 700;
  color: #fff;
  margin: 6px 0 14px;
  text-shadow: 0 0 20px var(--accent-red-glow);
}

.hud-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.pill-btn {
  background: var(--accent-red);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.pill-btn:hover {
  background: var(--accent-red-hover);
  transform: translateY(-1px);
}

.pill-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.pill-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 16px;
}

.metric-card {
  text-align: center;
}

.m-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.m-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

/* ============================================================
   GAME CONFIG GUIDE BOX
   ============================================================ */

.game-guide-box {
  background: rgba(14, 16, 25, 0.75);
  border: 1px solid rgba(230, 57, 70, 0.25);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 24px;
}

.guide-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.guide-header h4 {
  margin: 0;
  font-size: 0.95rem;
  color: #fff;
}

.guide-tag {
  background: rgba(230, 57, 70, 0.15);
  color: #ff6b7a;
  border: 1px solid rgba(230, 57, 70, 0.3);
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.guide-item {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px 12px;
}

.guide-item .g-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.guide-item code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #e2e8f0;
  word-break: break-all;
}

/* ============================================================
   DPI MATRIX TABLE
   ============================================================ */

.matrix-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #fff;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-family: 'JetBrains Mono', monospace;
}

.feel-tag {
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: inherit;
  color: var(--text-muted);
}

/* ============================================================
   FAQ & FOOTER
   ============================================================ */

.faq-container {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

.faq-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.faq-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.faq-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.app-footer {
  margin-top: 32px;
  color: var(--text-dim);
  font-size: 0.75rem;
  text-align: center;
}

/* ============================================================
   GAME PICKER MODAL
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-window {
  background: #11141e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 100%;
  max-width: 580px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.modal-title-wrap h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.modal-title-wrap p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.search-bar-wrap {
  position: relative;
  margin-bottom: 14px;
}

.search-bar-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-bar-wrap input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 12px 10px 38px;
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
}

.games-grid {
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding-right: 4px;
}

.grid-game-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
}

.grid-game-item:hover {
  background: rgba(230, 57, 70, 0.15);
  border-color: var(--accent-red);
}

.grid-game-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

/* ============================================================
   RESPONSIVENESS (MOBILE)
   ============================================================ */

@media (max-width: 640px) {
  .controls-panel, .faq-container {
    grid-template-columns: 1fr;
  }
  .game-selection-cards {
    flex-direction: column;
  }
  .action-btn.swap {
    transform: rotate(90deg);
  }
  .action-btn.swap:hover {
    transform: rotate(270deg);
  }
  .hud-value {
    font-size: 2.4rem;
  }
  .games-grid {
    grid-template-columns: 1fr;
  }
}