/* ==========================================================
   GAME STYLES: game.html (Creative Cyberpunk / SOC Edition)
   Dual-Mode Architecture: Full Desktop SOC Terminal + Smartphone
   Smooth Instant Tabs, Responsive Audio FX, Visual Equalizers
   ========================================================== */

/* Main Viewport Container */
.game-viewport {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
}

/* ==========================================================
   TOP SYSTEM CONTROL BAR (Unified for PC & Mobile)
   ========================================================== */
.system-topbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.back-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}
.back-home-btn:hover {
  color: #fff;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.topbar-brand {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-brand span {
  color: var(--accent-cyan);
}

/* Viewport Tabs */
.system-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-tertiary);
  padding: 3px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.tab-btn {
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.tab-btn.active {
  background: var(--border-highlight);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Controls Wrap: Device Switcher + Audio Toggle + HUD */
.topbar-right-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Device Mode Switcher Pill */
.device-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-tertiary);
  padding: 3px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.device-btn {
  padding: 5px 10px;
  font-size: 0.74rem;
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.device-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-weight: 700;
}

/* Sound FX Toggle */
.sound-toggle-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.sound-toggle-btn:hover {
  border-color: var(--border-highlight);
  color: #fff;
}

.sound-toggle-btn.active {
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.3);
}

/* HUD Top Metrics */
.hud-metrics-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.metric-pill {
  display: flex;
  flex-direction: column;
  padding: 4px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  position: relative;
  overflow: hidden;
}

.metric-pill-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-pill-val {
  font-size: 0.92rem;
  font-weight: 800;
  transition: color 0.3s ease;
}

/* ==========================================================
   DESKTOP WORKSTATION MODE
   ========================================================== */
.view-mode-desktop {
  width: 100%;
  max-width: 1460px;
  margin: 0 auto;
  padding: 18px 24px 30px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.desktop-soc-grid {
  display: grid;
  grid-template-columns: 300px 1fr 360px;
  gap: 20px;
  flex: 1;
  min-height: 660px;
}

/* Left Column: Incidents Stream */
.soc-incidents-col {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.soc-col-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
}

.incidents-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
}

.incident-card {
  padding: 11px 13px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.incident-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-muted);
  transform: translateX(2px);
}

.incident-card.active {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.09);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.12);
}

.incident-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.incident-tag {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.incident-channel {
  font-size: 0.68rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.incident-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
}

.incident-preview {
  font-size: 0.74rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Central Workspace: Communications Feed */
.soc-center-workspace {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.feed-header {
  padding: 14px 20px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.feed-sender-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feed-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.feed-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.feed-status {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Chat Messages */
.feed-messages-area {
  flex: 1;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  background: #090c12;
}

.desktop-msg {
  max-width: 82%;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  line-height: 1.55;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-muted);
  color: var(--text-main);
  align-self: flex-start;
  position: relative;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.desktop-msg-time {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Link Preview Embed */
.embed-intel-card {
  margin-top: 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: var(--transition);
}

.embed-intel-card:hover {
  border-color: var(--accent-cyan);
}

.embed-intel-host {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.embed-intel-url {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: underline;
  word-break: break-all;
}

/* Call Monitor UI with Equalizer */
.desktop-call-monitor {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  text-align: center;
  background: radial-gradient(circle at 50% 25%, rgba(220, 38, 38, 0.16) 0%, #090c12 75%);
}

.call-pulse-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  margin-bottom: 16px;
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
  animation: pulse-ring 1.8s infinite;
}

/* Audio Wave Equalizer */
.audio-equalizer {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 24px;
  margin: 12px 0;
}

.eq-bar {
  width: 3px;
  background: var(--danger);
  border-radius: 2px;
  animation: eq-bounce 1.2s ease-in-out infinite alternate;
}

.eq-bar:nth-child(1) { height: 8px; animation-delay: 0.1s; }
.eq-bar:nth-child(2) { height: 18px; animation-delay: 0.3s; }
.eq-bar:nth-child(3) { height: 24px; animation-delay: 0.2s; }
.eq-bar:nth-child(4) { height: 14px; animation-delay: 0.4s; }
.eq-bar:nth-child(5) { height: 20px; animation-delay: 0.15s; }
.eq-bar:nth-child(6) { height: 10px; animation-delay: 0.35s; }

.call-wiretap-transcript {
  max-width: 620px;
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 14px;
}

/* Right Column: Threat Intel & Actions */
.soc-right-actions {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.intel-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.intel-box-title {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.threat-cat-badge {
  font-size: 0.85rem;
  font-weight: 800;
  color: #f87171;
}

.desktop-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

/* Action Buttons */
.btn-soc-action {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-xs);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  border: 1px solid transparent;
}

.btn-soc-action .action-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-soc-action .action-shortcut {
  font-size: 0.72rem;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xs);
}

.btn-soc-accept {
  background: rgba(239, 68, 68, 0.12);
  border-color: var(--danger-border);
  color: #fca5a5;
}
.btn-soc-accept:hover {
  background: rgba(239, 68, 68, 0.24);
  color: #fee2e2;
  border-color: var(--danger);
  transform: translateY(-2px);
  box-shadow: 0 4px 18px var(--danger-glow);
}

.btn-soc-reject {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--success-border);
  color: #6ee7b7;
}
.btn-soc-reject:hover {
  background: rgba(16, 185, 129, 0.24);
  color: #a7f3d0;
  border-color: var(--success);
  transform: translateY(-2px);
  box-shadow: 0 4px 18px var(--success-glow);
}

.btn-soc-inspect {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}
.btn-soc-inspect:hover {
  background: rgba(56, 189, 248, 0.22);
  color: #bae6fd;
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.25);
}

/* ==========================================================
   MOBILE SMARTPHONE MODE
   ========================================================== */
.view-mode-mobile {
  width: 100%;
  max-width: 480px;
  margin: 10px auto 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 12px;
}

.phone-mockup-frame {
  background: var(--bg-secondary);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-phone);
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 700px;
  max-height: 860px;
  height: 84vh;
}

.mobile-notch-bar {
  background: var(--bg-secondary);
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  font-size: 0.74rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.mobile-notch-cutout {
  width: 90px;
  height: 14px;
  background: #000;
  border-radius: 0 0 10px 10px;
}

.mobile-hud-strip {
  background: var(--bg-tertiary);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.mobile-chat-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: #090c12;
}

.mobile-actions-panel {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================================
   MODAL WINDOWS (Technical Inspection & Outcome Feedback)
   ========================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 14, 0.88);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.18s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 600px;
  max-height: 88vh;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85);
  animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-close-btn {
  color: var(--text-muted);
  font-size: 1.3rem;
  padding: 4px 8px;
  cursor: pointer;
  transition: var(--transition);
}
.modal-close-btn:hover {
  color: #fff;
}

.inspect-indicators {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.indicator-row {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.indicator-row.flagged {
  border-left: 3px solid var(--danger);
  background: rgba(239, 68, 68, 0.05);
}

.indicator-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.indicator-value {
  font-size: 0.85rem;
  color: var(--text-main);
}
.indicator-row.flagged .indicator-value {
  color: #fca5a5;
  font-weight: 600;
}

.inspect-takeaway-box {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: var(--radius-xs);
  padding: 14px;
  font-size: 0.88rem;
  color: #e0f2fe;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* Feedback Modal Content */
.feedback-badge {
  align-self: flex-start;
  margin-bottom: 12px;
}

.feedback-headline {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.feedback-summary {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 18px;
}

.feedback-consequences-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
}

.feedback-consequences-list li {
  font-size: 0.88rem;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  line-height: 1.45;
}
.feedback-consequences-list.danger li {
  border-left-color: var(--danger);
  color: #fecaca;
}

.feedback-delta-banner {
  display: flex;
  gap: 20px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  margin-bottom: 18px;
}

/* ==========================================================
   TAB: THREAT VECTORS GUIDE (База угроз)
   ========================================================== */
.threats-library-view {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 50px;
  display: none;
  flex-direction: column;
  gap: 24px;
}

.threats-library-view.active {
  display: flex;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.library-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.library-card:hover {
  border-color: var(--border-muted);
  transform: translateY(-2px);
}

/* ==========================================================
   FINAL SCREEN SUMMARY
   ========================================================== */
.final-report-view {
  width: 100%;
  max-width: 740px;
  margin: 24px auto 40px;
  padding: 30px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  display: none;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.final-report-view.active {
  display: flex;
}

.final-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 20px 0;
}

.final-stat-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-xs);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

/* Keyframes */
@keyframes eq-bounce {
  0% { height: 4px; }
  100% { height: 24px; }
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
  70% { box-shadow: 0 0 0 16px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 991px) {
  .system-topbar {
    padding: 10px 14px;
    flex-wrap: wrap;
  }
  .system-tabs {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .desktop-soc-grid {
    grid-template-columns: 1fr;
  }
  .soc-incidents-col {
    display: none;
  }
}
