/* Grimoire Cyberpunk Mythic Theme: Obsidian, Electric Violet, and Cyber Gold */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800;900&family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=Fira+Code:wght@400;500;600&display=swap');

:root {
  --bg-dark: #050508;           /* Obsidian Black */
  --bg-card: #0c0d14;           /* Deep Mythic Purple-Black */
  --bg-surface: #171825;        /* Space Slate */
  --bg-surface-hover: #222437;  /* Hover Slate */
  
  --color-primary: #a855f7;     /* Electric Violet / Mythic Purple */
  --color-secondary: #f59e0b;   /* Cyber Gold / Amber Sparks */
  --color-accent: #2563eb;      /* Dark Cobalt Accent */
  
  --text-pure: #ffffff;
  --text-high: #f8fafc;         
  --text-medium: #c084fc;       /* Lavender Accent Text */
  --text-muted: #64748b;        
  
  --color-win: #10b981;         
  --color-win-bg: rgba(16, 185, 129, 0.1);
  --color-loss: #ef4444;
  --color-loss-bg: rgba(239, 68, 68, 0.1);
  
  --border-light: rgba(168, 85, 247, 0.1);
  --border-medium: rgba(168, 85, 247, 0.22);
  --border-accent: rgba(245, 158, 11, 0.28);
  
  --glow-cyan: 0 0 15px rgba(168, 85, 247, 0.28);
  --glow-gold: 0 0 15px rgba(245, 158, 11, 0.2);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: transparent !important;
  color: var(--text-high);
  height: 100vh;
  overflow: hidden;
  font-family: 'Inter', system-ui, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--text-pure);
}

/* Sidebar Layout System */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.sidebar {
  width: 260px;
  background-color: var(--bg-card);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 1.75rem 1.5rem;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.sidebar-header {
  margin-bottom: 2.5rem;
}

.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  text-align: center;
}

.logo-text {
  font-size: 1.5rem;
  letter-spacing: 0.5px;
  font-family: 'Cinzel', serif;
  font-weight: 800;
  color: var(--text-pure);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.sidebar-nav .nav-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
}

.sidebar-nav .nav-btn:hover {
  color: var(--text-pure);
  background-color: var(--bg-surface);
}

.sidebar-nav .nav-btn.active {
  color: var(--text-pure);
  border-color: var(--color-primary);
  background-color: rgba(168, 85, 247, 0.1);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.08);
}

.sidebar-nav .nav-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: var(--transition-fast);
}

.sidebar-nav .nav-btn:hover svg {
  transform: translateX(2px);
}

.sidebar-footer {
  border-top: 1px solid var(--border-light);
  padding-top: 1.25rem;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.main-content {
  margin-left: 260px;
  flex-grow: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-dark);
  transition: margin-left var(--transition-normal);
}

.sidebar-hidden .sidebar {
  display: none !important;
}

.sidebar-hidden .main-content {
  margin-left: 0 !important;
}

.content-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 2.5rem;
  border-bottom: 1px solid var(--border-light);
  background-color: rgba(5, 5, 8, 0.55);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 90;
}

.content-header h1 {
  font-size: 2.15rem;
  font-family: 'Cinzel', serif;
  font-weight: 900;
  letter-spacing: 1.5px;
  margin: 0;
  color: var(--text-pure);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9), 0 0 10px rgba(168, 85, 247, 0.35);
  text-transform: uppercase;
}

main {
  flex-grow: 1;
  padding: 1.5rem 2.5rem 0 2.5rem !important;
  max-width: 100%;
  width: 100%;
  height: calc(100vh - 74px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view-section {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  height: 100%;
  overflow: hidden;
}

.view-section > .panel,
.view-section > div {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  height: 100%;
  overflow: hidden;
}

.view-section > .panel,
.view-section > div > .panel {
  margin-bottom: 0 !important;
  border-bottom: none !important;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  height: 100%;
  overflow-y: auto;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid var(--border-medium);
  font-size: 0.85rem;
  background-color: var(--bg-surface);
  color: var(--text-high);
}

.btn:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-pure);
  border-color: var(--color-primary);
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--text-pure);
  border: none;
  font-weight: 600;
  box-shadow: var(--glow-cyan);
}
.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.4);
}

.btn-gold {
  background-color: var(--color-secondary);
  color: var(--bg-dark);
  border: none;
  font-weight: 600;
  box-shadow: var(--glow-gold);
}
.btn-gold:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.35);
}

.btn-danger {
  background-color: var(--color-loss-bg);
  color: var(--color-loss);
  border-color: rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
  background-color: var(--color-loss);
  color: white;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.btn-xs {
  padding: 1px 5px;
  font-size: 0.65rem;
  border-radius: 4px;
}

/* Layout Main */
main {
  flex: 1;
  padding: 2rem;
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
}

.view-section {
  display: none;
  animation: fadeIn var(--transition-normal);
}

.view-section.active {
  display: block;
}

/* Fullscreen Playtest Section active state */
#playtest-view.view-section.active {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  margin: 0;
  padding: 1.5rem;
  background-color: #030305;
  box-sizing: border-box;
}
 
/* Fullscreen Deckbuilder Section active state */
#deckbuilder-view.view-section.active {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  margin: 0;
  padding: 1.5rem;
  background-color: #030305;
  box-sizing: border-box;
}

/* Sidebar hiding rules */
#app-layout.sidebar-hidden .sidebar {
  transform: translateX(-260px);
  pointer-events: none;
}
#app-layout.sidebar-hidden .main-content {
  margin-left: 0;
}
#app-layout.sidebar-hidden .content-header {
  display: none !important;
}
#app-layout.sidebar-hidden main {
  padding: 0;
}

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

/* Panels (Cards) */
.panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.5rem;
}

/* Forms & Auth View */
.sidebar-hidden .content-header {
  display: none !important;
}

.sidebar-hidden .form-card-split {
  transform: translateY(-2.5rem);
}

#auth-view.view-section.active {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: transparent;
}

.form-card-split {
  display: flex;
  width: 100%;
  max-width: 800px;
  min-height: 480px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), var(--glow-cyan);
  margin: 0 auto;
}

.auth-showcase {
  flex: 1;
  background: #0f0b1a;
  border-right: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  position: relative;
}

.auth-showcase::after {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  background: rgba(168, 85, 247, 0.08);
  filter: blur(50px);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.auth-showcase-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-form-side {
  flex: 1;
  padding: 3.5rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 768px) {
  .form-card-split {
    flex-direction: column;
    max-width: 450px;
  }
  .auth-showcase {
    padding: 2rem;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }
  .auth-form-side {
    padding: 2.5rem 2rem;
  }
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-medium);
  margin-bottom: 0.25rem;
  font-weight: 500;
  text-transform: uppercase;
}

.input-field {
  width: 100%;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-high);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.input-field:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(0, 242, 254, 0.1);
}

/* Checkboxes */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Multi-column layout */
.columns-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

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

/* Tables */
.table-container {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.table th, .table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border-light);
}

.table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-win { background-color: var(--color-win-bg); color: var(--color-win); }
.badge-loss { background-color: var(--color-loss-bg); color: var(--color-loss); }
.badge-neutral { background-color: var(--bg-surface); color: var(--text-medium); }

/* Decks grid */
.decks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.deck-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-fast);
}

.deck-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--glow-cyan);
  transform: translateY(-1px);
}

.deck-price {
  font-family: 'Outfit', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-secondary);
}

/* Pairings Pod Cards */
.pods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.pod-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
  transition: var(--transition-normal);
}

.pod-card:hover {
  border-color: var(--border-accent);
  box-shadow: 0 4px 20px rgba(0,242,254,0.05);
}

.pod-card.completed {
  border-color: rgba(34, 197, 94, 0.2);
}

.pod-header-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-medium);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--color-secondary);
}

.pod-players-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pod-player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

/* Score Reporting Sheet */
.reporting-sheet {
  background-color: var(--bg-dark);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-top: 0.75rem;
}

.report-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.report-row span {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.85);
  backdrop-filter: blur(2px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
}

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

.modal {
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 90%;
  padding: 1.5rem;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* TV View Modal */
.tv-view-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-dark);
  z-index: 1000;
  padding: 2.5rem;
  flex-direction: column;
}

.tv-view-container.active {
  display: flex;
}

.tv-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border-medium);
  padding-bottom: 1rem;
}

.tv-title {
  font-size: 2.2rem;
  color: var(--color-primary);
  font-weight: 700;
}

.tv-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  overflow: hidden;
}

.tv-column {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tv-scroll-content {
  flex: 1;
  overflow-y: hidden;
}

.tv-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 1.1rem;
}

.tv-row:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.01);
}

.tv-pod-title {
  font-weight: 700;
  color: var(--color-secondary);
}

/* Print Layout */
@media print {
  body {
    background: white;
    color: black;
  }
  .navbar, .btn, .form-card, .movers-ticker {
    display: none !important;
  }
  main {
    max-width: 100%;
    padding: 0;
  }
  .panel {
    border: none;
    box-shadow: none;
    background: transparent;
  }
  .table th, .table td {
    border: 1px solid #ccc;
    color: black !important;
  }
}

/* Phase 4 Live & Active Styling */
.pulse-indicator {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--color-primary);
  box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7);
  animation: pulse-ring 1.6s infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(168, 85, 247, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0);
  }
}

/* Playtest Sandbox workspace */
/* Playtest Sandbox workspace */
.playtest-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.25rem;
  flex: 1;
  min-height: 0;
  background-color: #030305;
}

.playtest-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.playtest-mat {
  background-color: #050409;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  position: relative;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 1.5rem;
  overflow-y: auto;
}

.playtest-zone {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-content: flex-start;
  min-height: 150px;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(168, 85, 247, 0.02);
  border: 1px dashed rgba(168, 85, 247, 0.1);
  overflow: visible;
}

/* Graphic Cards Styling */
.playtest-card-wrapper {
  position: relative;
  width: 95px;
  height: 132px;
  margin: 5px 12px;
  display: inline-block;
  vertical-align: top;
  perspective: 1000px;
}

.playtest-card {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: visible;
  box-shadow: 0 5px 12px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.2s;
  position: relative;
  border: 1px solid var(--border-medium);
  background-color: #0c0d14;
}

.playtest-card.tapped {
  transform: rotate(90deg);
  box-shadow: -5px 5px 12px rgba(0,0,0,0.5);
  border-color: var(--color-secondary);
}

.playtest-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
  pointer-events: none;
}

.playtest-card-counter {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--color-secondary);
  color: var(--bg-dark);
  font-weight: 900;
  font-size: 0.75rem;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--text-pure);
  box-shadow: 0 3px 6px rgba(0,0,0,0.5);
  z-index: 10;
}

.playtest-card-actions {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10,10,12,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  border-radius: 7px;
  z-index: 15;
  padding: 0.25rem;
}

.playtest-card-wrapper:hover .playtest-card-actions {
  opacity: 1;
  pointer-events: auto;
}

.action-row-split {
  display: flex;
  gap: 4px;
  width: 100%;
  justify-content: center;
}

.action-icon-btn {
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-medium);
  color: var(--text-pure);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.action-icon-btn:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.action-icon-btn-danger:hover {
  background: var(--color-loss);
  border-color: var(--color-loss);
}

/* Horizontal Hand Tray */
.playtest-hand-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 1rem;
  background: rgba(12,13,20,0.9);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-top: 1rem;
  min-height: 150px;
  align-items: center;
  scrollbar-width: thin;
}

/* Matchup Matrix grid style */
.matrix-container {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-top: 1rem;
}

.matrix-grid {
  display: grid;
  background-color: var(--border-light);
  gap: 1px;
}

.matrix-cell {
  background-color: var(--bg-card);
  padding: 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 500;
}

.matrix-header-cell {
  background-color: var(--bg-surface);
  color: var(--text-high);
  font-weight: 700;
}

/* Comments thread style */
.comment-bubble {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
}

/* Fullscreen Companion Life Tracker View */
#lifetracker-view.view-section.active {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  margin: 0;
  padding: 1.5rem;
  background-color: #030305;
  box-sizing: border-box;
}

.life-tracker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 1.5rem;
  flex-grow: 1;
  overflow: hidden;
}

.life-player-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(3, 3, 5, 0.7) 100%);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.life-player-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.15);
}

.life-display-value {
  font-size: 4.5rem;
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
  color: var(--text-pure);
  line-height: 1;
  margin: 0.5rem 0;
  user-select: none;
  text-shadow: 0 0 10px rgba(255,255,255,0.05);
}

.life-control-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  color: var(--text-high);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.life-control-btn:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* Notifications bell & dropdown */
.notifications-bell-container {
  position: relative;
  cursor: pointer;
}

.notifications-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--color-high);
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.notifications-dropdown {
  position: absolute;
  top: 50px;
  right: 0;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.notifications-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.01);
}

.notifications-list {
  max-height: 280px;
  overflow-y: auto;
}

.notification-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.78rem;
  transition: var(--transition-fast);
}

.notification-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.notification-item.unread {
  border-left: 3px solid var(--color-primary);
  background: rgba(168, 85, 247, 0.02);
}

/* Responsive Mobile Layout Overrides */
@media (max-width: 768px) {
  /* 1. Sidebar Toggling & Main Content width */
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    width: 260px;
    z-index: 1000;
    box-shadow: 10px 0 35px rgba(0,0,0,0.8);
  }
  
  .sidebar.mobile-active {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0 !important;
    width: 100vw;
  }
  
  main {
    padding: 1rem !important;
  }
  
  .content-header {
    padding: 1rem 1.25rem !important;
  }
  
  .content-header h1 {
    font-size: 1.45rem !important;
  }

  .mobile-menu-toggle {
    display: inline-flex !important;
  }
  
  /* 2. Grid & Panel structures */
  .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  .active-roster-layout {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
  
  /* 3. My Decks & Discover visual spoilers grids */
  .decks-grid {
    grid-template-columns: 1fr !important;
  }
  
  .visual-spoilers-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
    gap: 0.5rem !important;
  }
  
  /* 4. Playtest Layout */
  .playtest-layout {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  /* 5. Life Tracker Grid spacing */
  .life-tracker-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
  
  .life-player-card {
    min-height: 220px !important;
    padding: 0.75rem !important;
  }
  
  .life-display-value {
    font-size: 4.5rem !important;
  }
  
  /* 6. Modals responsiveness */
  .modal {
    width: 96% !important;
    max-height: 85vh !important;
    padding: 1.25rem !important;
  }
  
  /* profile grid layout stack */
  .profile-layout {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
  
  /* hide profile header elements that overlap or position absolute on mobile */
  #header-profile-container {
    right: 1rem !important;
  }

  /* 7. Deck Builder Column-tab Drawer overrides */
  .builder-mobile-tabs {
    display: flex !important;
    gap: 0.25rem !important;
    border-radius: var(--radius-sm);
    padding: 0.25rem !important;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-light);
  }
  
  .builder-mobile-tabs .btn-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    transition: var(--transition-fast);
  }
  
  .builder-mobile-tabs .btn-tab.active {
    background: var(--color-primary);
    color: var(--text-pure);
    box-shadow: var(--glow-cyan);
  }

  .deckbuilder-workspace {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
  }

  /* Hide all columns by default on mobile, display only the active selection */
  .deckbuilder-workspace .deckbuilder-col-search,
  .deckbuilder-workspace .deckbuilder-col-decklist,
  .deckbuilder-workspace .deckbuilder-col-stats {
    display: none !important;
    height: auto !important;
    overflow: visible !important;
  }

  .deckbuilder-workspace.active-tab-search .deckbuilder-col-search {
    display: flex !important;
  }

  .deckbuilder-workspace.active-tab-decklist .deckbuilder-col-decklist {
    display: flex !important;
  }

  .deckbuilder-workspace.active-tab-stats .deckbuilder-col-stats {
    display: flex !important;
  }
}

/* 📖 PARCHMENT GRIMOIRE THEME (LIGHT MODE) OVERRIDES */
body.light-theme {
  --bg-dark: #fbf7ef;           /* Soft light parchment pages background */
  --bg-card: #ebdcb9;           /* Warm, dark tan parchment card windows */
  --bg-surface: #decfa8;        /* Fold/crease tan overlay */
  --bg-surface-hover: #d2c39d;  
  
  --color-primary: #5c1bb5;     /* Darker rich purple magic accent */
  --color-secondary: #a75c00;   /* Muted gold/amber ink */
  --color-accent: #1d4ed8;      
  
  --text-pure: #1c140a;         /* Deep sepia ink */
  --text-high: #2b2114;         
  --text-medium: #4c1199;       /* Deep violet highlights */
  --text-muted: #736450;        
  
  --border-light: rgba(92, 27, 181, 0.16);
  --border-medium: rgba(92, 27, 181, 0.32);
  --border-accent: rgba(167, 92, 0, 0.35);
  
  --glow-cyan: 0 0 10px rgba(92, 27, 181, 0.18);
  --glow-gold: 0 0 10px rgba(167, 92, 0, 0.12);
  
  background-image: 
    radial-gradient(circle at 50% 30%, rgba(255,255,255,0.7) 0%, rgba(0,0,0,0) 100%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.035'/%3E%3C/svg%3E"),
    linear-gradient(to right, #fbf7ef 0%, #eadebe 46%, #d8caa7 50%, #eadebe 54%, #fbf7ef 100%) !important;
  background-color: #f4e8cc !important;
}

/* Sidebar as Dark Gray Book Spine */
body.light-theme .sidebar {
  background-color: #1e1f24 !important;
  background-image: 
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.045'/%3E%3C/svg%3E"),
    linear-gradient(to right, #15161a 0%, #292a30 100%) !important;
  border-right: 2px solid var(--color-primary) !important;
}

body.light-theme .sidebar-nav .nav-btn {
  color: #a39688 !important;
}
body.light-theme .sidebar-nav .nav-btn:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.05) !important;
}
body.light-theme .sidebar-nav .nav-btn.active {
  color: #ffffff !important;
  background-color: rgba(92, 27, 181, 0.22) !important;
  border-color: var(--color-primary) !important;
}
body.light-theme .logo-text {
  color: #ffffff !important;
}
body.light-theme .sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.light-theme .panel,
body.light-theme .modal {
  background-color: #ebdcb9 !important; /* Rich Dark Tan Parchment */
  background-image: 
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.035'/%3E%3C/svg%3E"),
    linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 100%) !important;
  border: 1px solid var(--color-primary) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12) !important;
}

body.light-theme .content-header {
  background-color: rgba(24bf, 23d7, 215, 0.3) !important;
  border-bottom: 1px solid var(--color-primary) !important;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E") !important;
}

/* Slider Switch Styles */
.theme-slider::before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: .3s;
  border-radius: 50%;
}

input:checked + .theme-slider {
  background-color: var(--color-primary) !important;
}

input:checked + .theme-slider::before {
  transform: translateX(22px);
  background-color: #ffffff !important;
}



