/* =========================================================
   Moles Under The Pitch - Tactical Tabletop Football Theme
   Refined retro-tactical aesthetic: high legibility, clean 
   typography, pixel-art accents, and authentic dugout feel.
   ========================================================= */

:root {
  --bg-dark: #0d1118;
  --panel-bg: #151c27;
  --panel-header-bg: #1e2736;
  --panel-border: #2c394d;
  --panel-border-dark: #090d13;
  --pitch-green: #233720;
  --pitch-border: #385532;
  --accent-blue: #3b82f6;
  --accent-blue-hover: #60a5fa;
  --accent-gold: #f59e0b;
  --accent-orange: #f97316;
  --accent-red: #ef4444;
  --accent-green: #10b981;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-bright: #ffffff;
  
  --font-pixel: 'Press Start 2P', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-tactical: 'Chakra Petch', sans-serif;
}

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

body.pitch-theme {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 50% 30%, rgba(26, 38, 56, 0.6) 0%, rgba(9, 13, 19, 0.98) 100%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 28px 28px, 28px 28px;
}

/* Subtle CRT scanline overlay */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%);
  background-size: 100% 4px;
  z-index: 999;
  opacity: 0.45;
}

/* Master Game Container */
.game-wrapper {
  width: 95%;
  max-width: 1300px;
  margin: 24px auto;
  background: var(--panel-bg);
  border: 2px solid var(--panel-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  overflow: hidden;
}

/* Tactical Top Bar */
.tactical-top-bar {
  background: var(--panel-header-bg);
  border-bottom: 2px solid var(--panel-border-dark);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-helm {
  font-size: 18px;
}

.brand-title {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: #ffffff;
  letter-spacing: 0.8px;
}

.version-tag {
  background: #0f1622;
  border: 1px solid var(--panel-border);
  color: var(--accent-blue-hover);
  font-size: 10px;
  padding: 2px 7px;
  font-family: var(--font-tactical);
  font-weight: 700;
  border-radius: 2px;
  letter-spacing: 0.5px;
}

.bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-green);
  font-family: var(--font-tactical);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.status-indicator .dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

.system-time {
  background: #0b0f16;
  padding: 4px 10px;
  border: 1px solid var(--panel-border);
  color: var(--accent-gold);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  border-radius: 2px;
}

/* Main Console Grid */
.console-body {
  display: grid;
  grid-template-columns: 290px 1fr 320px;
  gap: 14px;
  padding: 16px;
  min-height: 620px;
}

@media (max-width: 1100px) {
  .console-body {
    grid-template-columns: 1fr;
  }
}

/* Tactical Panels */
.tactical-panel {
  background: #101620;
  border: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  border-radius: 3px;
  overflow: hidden;
}

.panel-header {
  background: #182230;
  border-bottom: 1px solid var(--panel-border);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-family: var(--font-tactical);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 1px;
}

.panel-badge {
  font-family: var(--font-tactical);
  font-size: 11px;
  font-weight: 700;
  background: #0b0f16;
  color: var(--text-muted);
  padding: 2px 7px;
  border: 1px solid #283548;
  border-radius: 2px;
}

.panel-badge.highlight {
  color: var(--accent-gold);
  border-color: rgba(245, 158, 11, 0.4);
}

/* Player / Slayer Dossier Panel */
.pixel-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.portrait-frame {
  background: #090d13;
  border: 2px solid #2a384c;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 10px;
  gap: 8px;
  border-radius: 4px;
}

.avatar-container {
  position: relative;
  width: 112px;
  height: 112px;
  flex-shrink: 0;
  border: 2px solid var(--accent-gold);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
  background: #000;
}

.profile-img {
  display: block;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
}

.player-name {
  font-family: var(--font-tactical);
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.portrait-label {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--accent-orange);
  letter-spacing: 1px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: #0a0e14;
  padding: 8px;
  border: 1px solid #253346;
  border-radius: 3px;
}

.stat-box {
  background: #16202d;
  border: 1px solid #2e3e54;
  text-align: center;
  padding: 6px 2px;
  border-radius: 2px;
}

.stat-label {
  font-family: var(--font-tactical);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

/* Skills Section: BLK, FZY, JUG, MB */
.skills-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skills-header {
  font-family: var(--font-tactical);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.skills-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.skill-chip {
  background: #172230;
  border: 1px solid #2d3e56;
  padding: 6px 8px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: help;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.skill-chip:hover {
  background: #202e42;
  border-color: #3b506e;
}

.skill-code {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-gold);
  background: #090e15;
  padding: 2px 5px;
  border-radius: 2px;
  border: 1px solid #334358;
}

.skill-chip.frenzy .skill-code {
  color: var(--accent-orange);
}

.skill-chip.mighty .skill-code {
  color: #f87171;
}

.skill-name {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
}

.identity-info {
  background: #090d13;
  border: 1px solid #202b3b;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 3px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.info-row .key {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.info-row .val {
  color: var(--accent-gold);
  font-weight: 700;
}

.info-row .val.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #38bdf8;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Center Pitch / Auth */
.pitch-tactical-view {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  background-color: var(--pitch-green);
  background-image: 
    radial-gradient(circle at center, rgba(42, 70, 38, 0.6) 0%, rgba(16, 26, 17, 0.95) 100%),
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  border: 2px solid var(--pitch-border);
  position: relative;
}

.banner-box {
  text-align: center;
  margin-bottom: 20px;
  background: rgba(16, 22, 32, 0.92);
  border: 1px solid #334358;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  border-radius: 4px;
}

.pitch-heading {
  font-family: var(--font-pixel);
  font-size: 15px;
  color: #ffffff;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.pitch-subtext {
  font-size: 14px;
  color: #cbd5e1;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Status Notice Box */
.status-box {
  padding: 12px 16px;
  margin-bottom: 20px;
  border-left: 4px solid var(--accent-blue);
  background: rgba(15, 23, 42, 0.94);
  font-family: var(--font-mono);
  font-size: 13px;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  border-radius: 0 4px 4px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.status-box.error {
  border-left-color: var(--accent-red);
  color: #fca5a5;
  background: rgba(50, 15, 15, 0.95);
}

.status-box.success {
  border-left-color: var(--accent-green);
  color: #86efac;
  background: rgba(15, 45, 25, 0.95);
}

/* Auth Controls */
.auth-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 480px;
  margin: 0 auto 20px auto;
  width: 100%;
}

.social-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.retro-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  cursor: pointer;
  border: 1px solid;
  border-radius: 4px;
  position: relative;
  text-decoration: none;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-google {
  background: #ffffff;
  color: #1e293b;
  border-color: #cbd5e1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-google:hover {
  background: #f8fafc;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-ms {
  background: #23272e;
  color: #ffffff;
  border-color: #3b4352;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-ms:hover {
  background: #2e343e;
  border-color: #4a5568;
}

.btn-action {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: #2563eb;
  font-weight: 600;
  white-space: nowrap;
}

.btn-action:hover {
  background: var(--accent-blue-hover);
}

.btn-danger {
  background: #b91c1c;
  color: #ffffff;
  border-color: #dc2626;
  width: 100%;
  margin-top: 10px;
}

.btn-danger:hover {
  background: #dc2626;
}

.provider-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Divider */
.retro-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 8px 0;
}

.retro-divider::before,
.retro-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #334155;
}

.retro-divider span {
  padding: 0 12px;
  font-family: var(--font-tactical);
  font-weight: 700;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Magic link input */
.magic-link-form {
  background: rgba(16, 23, 34, 0.94);
  border: 1px solid #334155;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border-radius: 4px;
}

.input-group label {
  display: block;
  font-family: var(--font-tactical);
  font-weight: 700;
  font-size: 11px;
  color: var(--accent-gold);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.input-wrapper {
  display: flex;
  gap: 8px;
}

@media (max-width: 600px) {
  .input-wrapper {
    flex-direction: column;
  }
}

.retro-input {
  flex: 1;
  background: #090e15;
  border: 1px solid #3b4a60;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 11px 14px;
  border-radius: 3px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.retro-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.field-help {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 8px;
  line-height: 1.4;
}

/* Dice / Action Preview Dock */
.action-dock {
  background: rgba(16, 23, 34, 0.95);
  border: 1px solid #2c3c52;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 10px;
  border-radius: 4px;
}

.dice-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-tactical);
  font-weight: 700;
  font-size: 13px;
  color: var(--accent-gold);
}

.dice-pip {
  font-size: 18px;
}

.action-buttons-preview {
  display: flex;
  gap: 8px;
}

.mock-btn {
  background: #1b2432;
  border: 1px solid #384963;
  color: #94a3b8;
  font-family: var(--font-tactical);
  font-weight: 700;
  font-size: 12px;
  padding: 8px 12px;
  cursor: default;
  border-radius: 3px;
}

.mock-btn.active {
  background: #2563eb;
  border-color: #60a5fa;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
}

/* Log Terminal Panel */
.log-panel {
  display: flex;
  flex-direction: column;
}

.log-console {
  background: #080c12;
  border: 1px solid #1f2b3c;
  margin: 14px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #86efac;
  flex: 1;
  min-height: 250px;
  max-height: 380px;
  overflow-y: auto;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-radius: 3px;
}

.log-entry.sys {
  color: #38bdf8;
}

.log-entry.err {
  color: #f87171;
}

.log-entry.succ {
  color: #4ade80;
}

.compliance-card {
  background: #111823;
  border: 1px solid #233144;
  margin: 0 14px 14px 14px;
  padding: 12px;
  border-radius: 3px;
}

.compliance-title {
  font-family: var(--font-tactical);
  font-weight: 700;
  font-size: 11px;
  color: var(--accent-gold);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.compliance-text {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.45;
}

/* Footer */
.tactical-footer {
  background: #101622;
  border-top: 1px solid var(--panel-border);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-tactical);
  font-weight: 700;
  font-size: 12px;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--accent-blue-hover);
}

.hidden {
  display: none !important;
}
