/* About Page Styles */
.about-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
  line-height: 1.6;
}

.page-nav {
  margin-bottom: 40px;
}

.hero {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, var(--theme-bg-secondary), var(--theme-bg-primary));
  border-radius: 12px;
  margin-bottom: 50px;
  border: 2px solid var(--theme-border-primary);
}

.hero h1 {
  font-size: 3rem;
  color: var(--rs-gold);
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
  font-size: 1.3rem;
  color: var(--theme-text-secondary);
  margin: 0;
}

.story {
  display: grid;
  gap: 30px;
  margin-bottom: 50px;
}

.story-card {
  background: var(--theme-bg-secondary);
  border: 2px solid var(--theme-border-primary);
  border-radius: 12px;
  padding: 40px;
}

.story-card.featured {
  border-color: var(--rs-gold);
  background: linear-gradient(135deg, var(--theme-bg-secondary), var(--theme-bg-primary));
}

.story-card h2 {
  color: var(--rs-gold);
  font-size: 2rem;
  margin-bottom: 20px;
}

.story-card p {
  color: var(--theme-text-primary);
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.story-card p:last-child {
  margin-bottom: 0;
}

.features {
  background: var(--theme-bg-secondary);
  border: 2px solid var(--theme-border-primary);
  border-radius: 12px;
  padding: 40px;
  margin-bottom: 50px;
}

.features h2 {
  color: var(--rs-gold);
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 40px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.feature {
  background: var(--theme-bg-primary);
  border: 1px solid var(--theme-border-primary);
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  transition: transform 0.3s ease;
}

.feature:hover {
  transform: translateY(-5px);
  border-color: var(--rs-gold);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.feature h3 {
  color: var(--rs-gold);
  font-size: 1.3rem;
  margin-bottom: 15px;
}

.feature p {
  color: var(--theme-text-secondary);
}

.support {
  background: linear-gradient(135deg, var(--rs-gold), #d4af37);
  border-radius: 12px;
  padding: 50px;
  text-align: center;
  color: var(--theme-bg-primary);
  margin-bottom: 50px;
}

.support h2 {
  font-size: 2.2rem;
  margin-bottom: 20px;
}

.support p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  opacity: 0.9;
}

.support-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.tech {
  background: var(--theme-bg-secondary);
  border: 2px solid var(--theme-border-primary);
  border-radius: 12px;
  padding: 40px;
}

.tech h2 {
  color: var(--rs-gold);
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 40px;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
}

.tech-item {
  background: var(--theme-bg-primary);
  border: 1px solid var(--theme-border-primary);
  border-radius: 8px;
  padding: 25px;
}

.tech-item h4 {
  color: var(--rs-gold);
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.tech-item p {
  color: var(--theme-text-secondary);
}

@media (max-width: 768px) {
  .about-page {
    padding: 20px 15px;
  }
  
  .hero h1 {
    font-size: 2.2rem;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
  
  .features-grid,
  .tech-grid {
    grid-template-columns: 1fr;
  }
  
  .support-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .support-buttons .rs-button {
    min-width: 200px;
  }
}
/* RuneScape Classic 2000s Theme */

/* Default to Dark Theme */
:root {
  --rs-brown-dark: #2D1810;
  --rs-brown-medium: #4A2C17;
  --rs-brown-light: #6B4226;
  --rs-gold: #FFD700;
  --rs-blue: #4A90E2;
  --rs-green: #228B22;
  --rs-red: #DC143C;
  --rs-yellow: #DAA520;
  --rs-white: #F0F0F0;
  --rs-black: #E0E0E0;
  --rs-gray: #707070;
  --rs-panel-bg: #3A2818;
  --rs-panel-border: #6B4226;
  --rs-panel-border-dark: #2D1810;
  
  /* Theme-specific variables - DARK THEME DEFAULT */
  --theme-bg-primary: #1A1A1A;
  --theme-bg-secondary: #2D2D2D;
  --theme-text-primary: #E0E0E0;
  --theme-text-secondary: #B8860B;
  --theme-border-primary: #6B4226;
  --theme-border-secondary: #4A2C17;
  --theme-panel-bg: rgba(45, 24, 16, 0.95);
  --theme-panel-border: #6B4226;
  --theme-input-bg: #2D1810;
  --theme-gradient-start: rgba(45, 24, 16, 0.5);
  --theme-gradient-end: rgba(107, 66, 38, 0.3);
}

/* Light Theme - Only when explicitly set */
[data-theme="light"] {
  --rs-brown-dark: #654321;
  --rs-brown-medium: #8B4513;
  --rs-brown-light: #D2B48C;
  --rs-gold: #FFD700;
  --rs-blue: #0066CC;
  --rs-green: #00AA00;
  --rs-red: #CC0000;
  --rs-yellow: #FFFF00;
  --rs-white: #FFFFFF;
  --rs-black: #000000;
  --rs-gray: #999999;
  --rs-panel-bg: #C8B99C;
  --rs-panel-border: #8B7D6B;
  --rs-panel-border-dark: #5D4E37;
  
  /* Theme-specific variables */
  --theme-bg-primary: #D2B48C;
  --theme-bg-secondary: #C8B99C;
  --theme-text-primary: #000000;
  --theme-text-secondary: #654321;
  --theme-border-primary: #8B7D6B;
  --theme-border-secondary: #5D4E37;
  --theme-panel-bg: rgba(255, 255, 255, 0.9);
  --theme-panel-border: #8B7D6B;
  --theme-input-bg: #FFFFFF;
  --theme-gradient-start: rgba(139, 69, 19, 0.3);
  --theme-gradient-end: rgba(210, 180, 140, 0.3);
}

/* Dark Theme - Explicitly set for clarity */
[data-theme="dark"] {
  --rs-brown-dark: #2D1810;
  --rs-brown-medium: #4A2C17;
  --rs-brown-light: #6B4226;
  --rs-gold: #FFD700;
  --rs-blue: #4A90E2;
  --rs-green: #228B22;
  --rs-red: #DC143C;
  --rs-yellow: #DAA520;
  --rs-white: #F0F0F0;
  --rs-black: #E0E0E0;
  --rs-gray: #707070;
  --rs-panel-bg: #3A2818;
  --rs-panel-border: #6B4226;
  --rs-panel-border-dark: #2D1810;
  
  /* Theme-specific variables */
  --theme-bg-primary: #1A1A1A;
  --theme-bg-secondary: #2D2D2D;
  --theme-text-primary: #E0E0E0;
  --theme-text-secondary: #B8860B;
  --theme-border-primary: #6B4226;
  --theme-border-secondary: #4A2C17;
  --theme-panel-bg: rgba(45, 24, 16, 0.95);
  --theme-panel-border: #6B4226;
  --theme-input-bg: #2D1810;
  --theme-gradient-start: rgba(45, 24, 16, 0.5);
  --theme-gradient-end: rgba(107, 66, 38, 0.3);
}

/* Reset and Base Styles */
body {
  font-family: 'Courier New', monospace;
  background-color: var(--theme-bg-primary);
  background-image: 
    radial-gradient(circle at 20% 80%, var(--theme-gradient-start) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, var(--theme-gradient-end) 0%, transparent 50%);
  margin: 0;
  min-height: 100vh;
  position: relative;
}

/* General text color for all elements */
* {
  color: var(--theme-text-primary);
}

/* White text for headers, buttons, forms, and info cards */
h1, h2, h3, h4, h5, h6,
.about-page .feature-card h3,
.about-page .feature-card p,
.about-page .arch-feature p,
.about-page .comparison-item p,
.rs-button,
.rs-button-primary,
.form-label,
.form-input,
.rs-input,
.highscores-table td,
.auth-link.oauth-button,
.error-item {
  color: var(--rs-white) !important;
}

/* Specific overrides for better contrast */
p, span, div {
  color: var(--theme-text-primary);
}

/* Header Styles */
.app-header {
  background: linear-gradient(to bottom, var(--theme-bg-secondary), var(--theme-bg-primary));
  border-bottom: 3px solid var(--theme-border-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(8px); /* Modern glassmorphism effect */
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 20px;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Logo Styles - Optimized for common logo sizes */
.main-logo {
  height: 72px; /* Increased from 48px for better visibility */
  width: auto;
  max-width: 200px; /* Prevents overly wide logos */
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.main-logo:hover {
  opacity: 0.8;
}

/* Logo fallback text when image fails to load */
.logo-fallback {
  display: none; /* Hidden by default, shown via JS when image fails */
  font-size: 24px;
  font-weight: bold;
  color: var(--rs-gold);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  letter-spacing: 1px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Navigation Link Styles */
.nav-link {
  color: var(--theme-text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--rs-gold);
  background: var(--theme-bg-secondary);
  text-decoration: none;
  transform: translateY(-1px);
}

.nav-link-primary {
  background: linear-gradient(135deg, var(--rs-gold), #d4af37);
  color: var(--theme-bg-primary) !important;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
}

.nav-link-primary:hover {
  background: linear-gradient(135deg, #d4af37, var(--rs-gold));
  color: var(--theme-bg-primary) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(212, 175, 55, 0.4);
}

.nav-link-secondary {
  border: 2px solid var(--theme-border-primary);
  background: transparent;
}

.nav-link-secondary:hover {
  background: var(--theme-border-primary);
  border-color: var(--rs-gold);
}

.nav-link-donate {
  background: linear-gradient(135deg, #7289da, #5b6eac);
  color: white !important;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(114, 137, 218, 0.3);
  border: 2px solid #7289da;
}

.nav-link-donate:hover {
  background: linear-gradient(135deg, #5b6eac, #4a5a8a);
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(114, 137, 218, 0.4);
  border-color: #5b6eac;
}

.header-auth-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  padding-left: 15px;
  border-left: 1px solid var(--theme-border-primary);
}

/* Mobile Header Styles */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }
  
  .logo-section {
    order: 1;
  }
  
  .header-nav {
    order: 2;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  
  .nav-link {
    font-size: 0.9rem;
    padding: 6px 12px;
  }
  
  .header-auth-links {
    border-left: none;
    border-top: 1px solid var(--theme-border-primary);
    padding-left: 0;
    padding-top: 10px;
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
  
  .main-logo {
    height: 60px; /* Slightly smaller on mobile */
  }
}

.user-greeting {
  color: var(--theme-text-secondary);
  font-size: 13px;
  font-weight: bold;
}

.theme-toggle {
  min-width: 40px;
  padding: 8px;
  font-size: 16px;
  background: var(--theme-panel-bg);
  border: 2px outset var(--theme-border-primary);
}

.theme-toggle:hover {
  background: var(--theme-bg-secondary);
}

/* Main content area */
.main-content {
  padding: 20px;
  position: relative;
  padding-top: 80px; /* Add space for floating controls */
  padding-bottom: 280px; /* Increased space for fixed footer */
  min-height: calc(100vh - 200px); /* Ensure content takes full height minus footer */
}

/* Auth pages get different styling */
.auth-main {
  padding: 0;
  padding-bottom: 280px !important; /* Increased space for fixed footer */
  min-height: calc(100vh - 200px) !important; /* Ensure auth pages also account for footer */
  width: 100%;
}

/* Floating controls for main app (non-auth pages) */
.app-controls {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 1000;
}

.floating-toggle,
.floating-signout {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  background: var(--theme-panel-bg);
  border: 2px outset var(--theme-border-primary);
}

.floating-toggle {
  min-width: 40px;
  padding: 8px;
  font-size: 16px;
}

.floating-signout {
  font-size: 11px;
  padding: 8px 12px;
}

.floating-toggle:hover,
.floating-signout:hover {
  background: var(--theme-bg-secondary);
  transform: translateY(-1px);
}

/* Logo variants for different contexts */
.logo-small {
  height: 32px;
  width: auto;
}

.logo-medium {
  height: 48px;
  width: auto;
}

.logo-large {
  height: 64px;
  width: auto;
}

/* Icon logo for favicon/small spaces (16x16, 32x32) */
.logo-icon {
  height: 24px;
  width: 24px;
  object-fit: contain;
}

/* Flash Messages */
.flash {
  padding: 12px 16px;
  margin-bottom: 15px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  font-weight: bold;
  border: 2px solid;
  position: relative;
}

.flash.alert {
  background-color: rgba(220, 20, 60, 0.1);
  border-color: var(--rs-red);
  color: var(--rs-red);
}

.flash.notice {
  background-color: rgba(34, 139, 34, 0.1);
  border-color: var(--rs-green);
  color: var(--rs-green);
}

.flash.error {
  background-color: rgba(220, 20, 60, 0.1);
  border-color: var(--rs-red);
  color: var(--rs-red);
}

.flash.alert:before {
  content: "⚠ ";
  font-weight: bold;
}

.flash.notice:before {
  content: "✓ ";
  font-weight: bold;
}

.flash.error:before {
  content: "✕ ";
  font-weight: bold;
}

/* Authentication page logo (larger, centered) */
.auth-logo {
  height: 80px;
  width: auto;
  max-width: 300px;
  margin: 0 auto 20px;
  display: block;
}

/* Main Layout Container */
.dashboard-container {
  display: grid;
  /* fixed right column keeps controls/progress compact on large screens */
  /* Slightly wider right column and allow larger max-width for wide screens */
  grid-template-columns: 1fr 520px;
  gap: 28px;
  max-width: 1400px; /* allow more horizontal space on large monitors */
  margin: 0 auto;
  min-height: 75vh;
  align-items: start;
  padding-bottom: 2rem; /* Add padding to prevent footer overlap */
}

/* Panel Styling (Classic RS Interface) */
.rs-panel {
  background-color: var(--theme-bg-secondary);
  border: 3px outset var(--theme-border-primary);
  border-radius: 8px;
  padding: 0;
  box-shadow: 
    inset 1px 1px 0 rgba(255, 255, 255, 0.2),
    inset -1px -1px 0 rgba(0, 0, 0, 0.4),
    2px 2px 8px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.rs-panel-title {
  background: linear-gradient(to bottom, var(--rs-brown-medium), var(--rs-brown-dark));
  color: var(--rs-gold);
  font-weight: bold;
  font-size: 14px;
  text-align: center;
  padding: 8px;
  border-bottom: 2px inset var(--rs-panel-border);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Chat Interface */
.chat-section {
  display: flex;
  flex-direction: column;
  /* allow chat to size naturally while keeping a comfortable minimum */
  min-height: 60vh;
  overflow: visible;
  flex: 1;
}

.chat-section .rs-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  z-index: 2;
  overflow: visible;
  margin-bottom: 1rem;
  flex: 1;
}

#conversation-log {
  display: flex;
  flex-direction: column;
  flex: 2;
  background-color: var(--theme-panel-bg);
  border: 2px inset var(--theme-panel-border);
  margin-bottom: 0;
  border-radius: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--rs-brown-medium) var(--theme-bg-secondary);
  overflow: hidden;
  /* more flexible sizing to avoid huge vertical footprints */
  max-height: calc(100vh - 240px);
  min-height: 40vh;
  flex: 1;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 15px;
  padding-bottom: 0;
}

.messages-container::-webkit-scrollbar {
  width: 16px;
}

.messages-container::-webkit-scrollbar-track {
  background: var(--rs-panel-bg);
  border: 1px inset var(--rs-panel-border);
}

.messages-container::-webkit-scrollbar-thumb {
  background: var(--rs-brown-medium);
  border: 1px outset var(--rs-panel-border);
  border-radius: 2px;
}

/* Message Styling - Dark theme is now default */
.user-message,
.assistant-message {
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  box-sizing: border-box;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Enhanced Chat Interface - Balanced Classic Colors */

/* User Messages - Classic Blue with Readable Text */
/* User Messages - Classic Blue Background with RS Gold Text */
.user-message {
  background: linear-gradient(to bottom, #0F4C75, #3282B8); /* Classic RuneScape blue gradient */
  border: 2px outset #1B6CA8;
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
  font-weight: bold;
  color: var(--rs-gold) !important; /* Classic RuneScape gold text */
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
  font-family: 'Courier New', monospace;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.1), inset -1px -1px 0 rgba(0, 0, 0, 0.3);
}

/* Assistant Messages - Dark Green with Balanced Text */
.assistant-message {
  background: linear-gradient(to bottom, #1B4332, #2D5A3D); /* Classic dark green gradient */
  border: 2px outset #3A6B4A;
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
  color: var(--rs-green) !important; /* Classic RuneScape green #228B22 */
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
  font-family: 'Courier New', monospace;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.1), inset -1px -1px 0 rgba(0, 0, 0, 0.3);
}

/* Light mode message colors - matching classic theme */
[data-theme="light"] .user-message {
  background: linear-gradient(to bottom, #87CEEB, #4682B4); /* Light blue gradient */
  border: 2px outset #1E90FF;
  color: var(--rs-gold) !important; /* Keep gold text for consistency */
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .assistant-message {
  background: linear-gradient(to bottom, #98FB98, #32CD32); /* Light green gradient */
  border: 2px outset #228B22;
  color: var(--rs-green) !important; /* Keep green text for consistency */
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.assistant-message.loading {
  background: linear-gradient(to bottom, #2D5A3D, #3A6B4A); /* Match assistant message colors */
  border: 2px outset #4A7B5A;
  color: var(--rs-green) !important; /* Match assistant message green */
  font-style: italic;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
  animation: pulse 1.5s ease-in-out infinite alternate;
}

/* Light mode loading message */
[data-theme="light"] .assistant-message.loading {
  background: linear-gradient(to bottom, #FFF8DC, #F5DEB3);
  border: 2px outset var(--rs-gold);
  color: var(--rs-brown-medium);
}

@keyframes pulse {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

/* Message Form */
#message_form {
  flex-shrink: 0;
  padding: 15px;
  background: linear-gradient(to bottom, rgba(200, 185, 156, 0.3), rgba(200, 185, 156, 0.6));
  border-top: 1px solid var(--rs-panel-border);
  margin: 0;
}

.message-input-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rs-input {
  width: 100%;
  padding: 8px;
  border: 2px inset var(--theme-border-primary);
  border-radius: 4px;
  background-color: var(--theme-input-bg);
  color: var(--rs-white);
  font-family: 'Courier New', monospace;
  font-size: 13px;
  margin-bottom: 10px;
  box-sizing: border-box;
  resize: vertical;
  min-height: 60px;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.rs-button {
  background: linear-gradient(to bottom, var(--rs-brown-light), var(--rs-brown-medium));
  border: 2px outset var(--rs-panel-border);
  border-radius: 4px;
  padding: 8px 16px;
  color: var(--rs-white) !important; /* White text for buttons */
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 12px;
  cursor: pointer;
  text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.3);
  transition: all 0.1s ease;
}

.rs-button:hover {
  background: linear-gradient(to bottom, #DCC9AC, var(--rs-brown-medium));
  border: 2px outset #A0936B;
}

.rs-button:active {
  border: 2px inset var(--rs-panel-border);
  background: linear-gradient(to bottom, var(--rs-brown-medium), var(--rs-brown-light));
}

/* Small button variant */
.rs-button-sm {
  padding: 4px 8px;
  font-size: 10px;
  min-width: auto;
}

/* Stats Panel */
.stats-section {
  min-height: 1080px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: calc(100vh - 200px); /* Allow more height for stats */
  overflow-y: auto;
}

.stats-panel {
  min-height: 320px; /* reduced from 710px to avoid oversized right column */
  max-height: none; /* Remove restrictive max-height */
  overflow-y: auto;
  flex: 1;
}

.skills-table {
  min-height: 983px!important; /* Ensure stats table has enough height */
}

.stats-content {
  padding: 20px 24px; /* more breathing room for buttons */
  background-color: var(--theme-panel-bg);
  border: 2px inset var(--theme-panel-border);
  margin: 10px;
  border-radius: 4px;
  font-size: 14px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Make controls area flexible so buttons don't get squished */
.stats-bottom .rs-panel .stats-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stats-controls-panel, .stats-bottom .rs-panel .stats-content .controls-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap; /* allow buttons to wrap instead of squishing */
}

/* Scrollable area for the skills table */
.stats-scroll {
  max-height: calc(60vh); /* allow skills to take majority of available height */
  overflow-y: auto;
}

/* Bottom area below the skills table for controls and progress (normal flow) */
.stats-bottom {
  display: flex;
  flex-direction: column; /* force vertical stacking */
  gap: 12px;
  align-items: stretch;
  padding-top: 6px;
  margin-top: 12px;
}

.stats-bottom .rs-panel {
  width: 100%;
  margin: 0; /* full-width panels under the skills table */
  border-top: 1px solid rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.stats-bottom .rs-panel + .rs-panel {
  margin-top: 6px; /* small separation between stacked panels */
}

/* Stats Table */
.highscores-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.highscores-table th {
  background: linear-gradient(to bottom, var(--rs-brown-medium), var(--rs-brown-dark));
  color: var(--rs-gold);
  /* Increase header padding to match taller rows for consistency */
  padding: 24px 8px;
  border: 1px outset var(--rs-panel-border);
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.7);
  font-weight: bold;
}

.highscores-table td {
  /* Increase cell padding significantly to make rows taller */
  padding: 18px 8px;
  border: 1px inset var(--rs-gray);
  background-color: var(--theme-panel-bg);
  color: var(--rs-white);
  text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.highscores-table tr:nth-child(even) td {
  background-color: var(--theme-bg-secondary);
}

/* Header */
h1 {
  color: var(--rs-gold);
  font-size: 24px;
  text-align: center;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  margin-bottom: 20px;
  font-family: 'Courier New', monospace;
  font-weight: bold;
}

/* Legacy Controls - keeping for backwards compatibility */
.legacy-controls-panel {
  text-align: center;
  padding: 10px;
}

/* Sign out link */
a {
  color: var(--rs-blue);
  text-decoration: underline;
  font-weight: bold;
}

a:hover {
  color: var(--rs-red);
}

/* Authentication Pages */
.auth-container {
  padding: 20px;
  padding-bottom: 280px !important; /* Increased space for fixed footer */
  box-sizing: border-box;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  min-height: calc(100vh - 200px); /* Ensure auth pages account for footer */
}

.page-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 40px;
  align-items: start;
  margin-bottom: 20px;
  width: 100%;
  max-width: 100%;
  overflow: visible; /* Ensure content doesn't get cut off */
}

.left-section {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
  overflow: visible; /* Ensure content doesn't get cut off */
}

.right-section {
  position: sticky;
  top: 20px;
  height: fit-content;
}

/* About page specific styles */
.about-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
  box-sizing: border-box;
}

.about-page .hero-section {
  margin-bottom: 3rem;
  padding: 2rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.about-page .hero-section h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.about-page .hero-description {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 0;
}

/* About page feature cards - improved readability in dark mode */
.about-page .features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin: 3rem auto;
  max-width: 1200px;
  width: 100%;
  box-sizing: border-box;
}

/* Limit columns on larger screens to prevent excessive width */
@media (min-width: 1400px) {
  .about-page .features-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .about-page .features-grid {
    grid-template-columns: 1fr;
  }
}

.about-page .feature-card {
  background: var(--theme-panel-bg);
  border: 2px outset var(--theme-border-primary);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.about-page .feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  border-color: var(--rs-gold);
}

.about-page .feature-card .feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
  text-align: center;
}

.about-page .feature-card h3 {
  color: var(--rs-white);
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 1rem;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.about-page .feature-card p {
  color: var(--rs-white);
  line-height: 1.6;
  font-size: 1rem;
  margin: 0;
  text-align: center;
}

/* Architecture section styles */
.about-page .architecture-section {
  margin-top: 4rem;
}

.about-page .architecture-section h2 {
  color: var(--rs-gold);
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 2rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.about-page .architecture-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* Limit columns on larger screens */
@media (min-width: 1000px) {
  .about-page .architecture-features {
    grid-template-columns: repeat(auto-fit, minmax(300px, 400px));
  }
}

@media (max-width: 768px) {
  .about-page .architecture-features {
    grid-template-columns: 1fr;
  }
}

.about-page .arch-feature {
  background: var(--theme-panel-bg);
  border: 2px outset var(--theme-border-primary);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.about-page .arch-feature h4 {
  color: var(--rs-blue);
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 1rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.about-page .arch-feature p {
  color: var(--rs-white);
  line-height: 1.6;
  font-size: 0.95rem;
  margin: 0;
}

/* Comparison section styles - Why RunePilot AI Excels */
.about-page .comparison-section {
  margin-top: 4rem;
}

.about-page .comparison-section h2 {
  color: var(--rs-gold);
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 2rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.about-page .comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}

/* Limit columns on larger screens */
@media (min-width: 1000px) {
  .about-page .comparison-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 350px));
  }
}

@media (max-width: 768px) {
  .about-page .comparison-grid {
    grid-template-columns: 1fr;
  }
}

.about-page .comparison-item {
  background: var(--theme-panel-bg);
  border: 2px outset var(--theme-border-primary);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.about-page .comparison-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  border-color: var(--rs-gold);
}

.about-page .comparison-item .comparison-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.about-page .comparison-item h4 {
  color: var(--rs-blue);
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 1rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.about-page .comparison-item p {
  color: var(--rs-white);
  line-height: 1.6;
  font-size: 0.95rem;
  margin: 0;
}

/* Secondary Content - White text for readability */
.stats-content p,
.stats-content span,
.stats-content div,
.about-page .feature-card p,
.about-page .comparison-item p,
.about-page .arch-feature p {
  color: var(--rs-white) !important;
  opacity: 0.95 !important;
}

/* CTA Section - White text */
.about-page .cta-section h2,
.about-page .cta-section p {
  color: var(--rs-white) !important;
}

/* Links - Blue with Gold Hover */
.stats-content a,
.about-page a,
.dashboard-container a {
  color: var(--rs-blue);
  text-decoration: none;
  transition: color 0.3s ease;
}

.stats-content a:hover,
.about-page a:hover,
.dashboard-container a:hover {
  color: var(--rs-gold);
  text-decoration: underline;
}

/* Panel Titles - Subtle Gold */
.dashboard-container .rs-panel-title,
.about-page .rs-panel-title {
  color: var(--rs-gold);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Chat interface - preserve dark green/blue message styles */
/* Ensure chat interface text maintains proper colors */
#conversation-log,
.messages-container {
  color: inherit; /* Don't override message colors */
}

/* Mobile responsiveness for about page */
@media (max-width: 768px) {
  .about-page {
    padding: 10px;
  }
  
  .about-page .hero-section {
    padding: 1rem;
  }
  
  .about-page .hero-section h1 {
    font-size: 2rem;
  }
  
  .about-page .hero-description {
    font-size: 1rem;
  }
  
  .about-page .features-grid,
  .about-page .architecture-features,
  .about-page .comparison-grid {
    gap: 1rem;
  }
  
  .about-page .feature-card,
  .about-page .arch-feature,
  .about-page .comparison-item {
    padding: 1rem;
  }
}

.hero-content h1 {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

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

.feature-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.feature-text strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 5px;
}

/* Chat Demo */
.chat-demo {
  background-color: var(--theme-bg-secondary);
  border: 3px outset var(--theme-border-primary);
  border-radius: 8px;
  overflow: visible; /* Ensure content doesn't get cut off */
  width: 100%;
  margin-bottom: 2rem; /* Extra space for fixed footer */
}

.chat-demo-header {
  background: var(--rs-primary);
  padding: 15px 20px;
  border-bottom: 2px solid var(--theme-border-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-demo-title {
  font-weight: bold;
  color: white;
  font-size: 1.1rem;
}

.conversation-log {
  min-height: 250px;
  max-height: calc(100vh - 350px); /* Account for header, footer, and padding */
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  overflow: visible; /* Ensure content doesn't get cut off */
}

.messages-container {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background-color: var(--theme-bg-primary);
  max-height: calc(100vh - 400px); /* Prevent overflow with fixed footer */
}

.message-form {
  border-top: 1px solid var(--theme-border-primary);
  padding: 15px 20px;
  background-color: var(--theme-bg-secondary);
}

.message-input-container {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.demo-input {
  flex: 1;
  resize: none;
  min-height: 40px;
}

.demo-send-btn {
  flex-shrink: 0;
  padding: 10px 20px;
}

/* Flash Messages Container */
.flash-messages {
  margin-bottom: 20px;
}

.flash-messages .flash {
  margin-bottom: 10px;
}

.auth-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.main-content-column {
  flex: 1;
  min-width: 0; /* Allow flex item to shrink */
}

.login-sidebar {
  flex-shrink: 0;
  width: 400px;
  position: sticky;
  top: 60px;
  margin-top: 5rem;
}

.auth-panel {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  box-shadow: 
    inset 1px 1px 0 rgba(255, 255, 255, 0.2),
    inset -1px -1px 0 rgba(0, 0, 0, 0.4),
    4px 4px 16px rgba(0, 0, 0, 0.4);
}

.auth-logo-section {
  text-align: center;
  padding: 20px 20px 10px;
  border-bottom: 1px solid var(--theme-border-primary);
  margin-bottom: 10px;
}

.auth-logo {
  height: 80px;
  width: auto;
  max-width: 300px;
  margin: 0 auto;
  display: block;
}

.auth-logo-fallback {
  display: none; /* Hidden by default, shown via JS when image fails */
  font-size: 28px;
  font-weight: bold;
  color: var(--rs-gold);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  letter-spacing: 2px;
  margin: 20px 0;
}

.auth-form {
  padding: 25px;
}

.form-section {
  margin-bottom: 25px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--rs-gold);
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 14px;
}

.form-input {
  width: 100%;
  padding: 12px;
  border: 2px inset var(--theme-border-primary);
  border-radius: 6px;
  background-color: var(--theme-input-bg);
  color: var(--theme-text-primary);
  font-family: 'Courier New', monospace;
  font-size: 14px;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--rs-gold);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
  background-color: var(--theme-bg-primary);
}

.form-input::placeholder {
  color: var(--theme-text-secondary);
  opacity: 0.7;
}

/* Mobile Login Section */
.mobile-login-section {
  display: none;
}

@media (max-width: 768px) {
  .mobile-login-section {
    display: block;
    margin-top: 40px;
  }
}

.form-label {
  display: block;
  margin-bottom: 5px;
  color: var(--rs-white);
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 13px;
}

.form-input {
  width: 100%;
  padding: 10px;
  border: 2px inset var(--theme-border-primary);
  border-radius: 4px;
  background-color: var(--theme-input-bg);
  color: var(--rs-white);
  font-family: 'Courier New', monospace;
  font-size: 13px;
  box-sizing: border-box;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--rs-blue);
  box-shadow: 0 0 4px rgba(0, 102, 204, 0.3);
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
}

.form-checkbox {
  margin: 0;
  accent-color: var(--rs-gold);
}

.checkbox-label {
  margin: 0;
  font-size: 13px;
  color: var(--theme-text-secondary);
  cursor: pointer;
  transition: color 0.3s ease;
}

.checkbox-label:hover {
  color: var(--theme-text-primary);
}

.form-actions {
  text-align: center;
  margin-top: 25px;
}

/* Ensure buttons inside auth panels are perfectly centered (use flexbox for reliable centering)
   Scoped to .auth-panel so other forms/layouts aren't affected. */
.auth-panel .form-actions {
  display: flex;
  justify-content: center;
  align-items: center;
}

.rs-button-primary {
  background: linear-gradient(135deg, var(--rs-gold), #d4af37);
  color: var(--theme-bg-primary) !important;
  min-width: 140px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  box-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
  transition: all 0.3s ease;
}

.rs-button-primary:hover {
  background: linear-gradient(135deg, #d4af37, var(--rs-gold));
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(212, 175, 55, 0.4);
}

.rs-button-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
}

.auth-links {
  padding: 20px;
  text-align: center;
  border-top: 1px solid var(--theme-border-primary);
  margin-top: 15px;
}

.auth-links a {
  display: inline-block;
  font-size: 13px;
  color: var(--theme-text-secondary);
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 5px;
}

.auth-links a:hover {
  color: var(--rs-gold);
  text-decoration: underline;
}

.auth-link-item {
  margin: 8px 0;
}

.auth-link {
  display: inline-block;
  font-size: 12px;
  color: var(--rs-blue);
  text-decoration: none;
  transition: color 0.2s ease;
  padding: 4px 8px;
  border-radius: 3px;
}

.auth-link:hover {
  color: var(--rs-red);
  text-decoration: underline;
  background-color: rgba(220, 20, 60, 0.1);
}

.auth-link.oauth-button {
  background-color: var(--theme-bg-secondary);
  border: 1px solid var(--theme-border-primary);
  color: var(--rs-white);
  padding: 8px 12px;
  margin: 4px;
  transition: all 0.2s ease;
}

.auth-link.oauth-button:hover {
  background-color: var(--rs-blue);
  color: var(--rs-white);
  border-color: var(--rs-blue);
}

/* Error Messages */
.error-messages {
  background-color: rgba(220, 20, 60, 0.1);
  border: 1px solid var(--rs-red);
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 20px;
}

.error-header {
  margin-bottom: 10px;
}

.error-title {
  color: var(--rs-red);
  font-size: 14px;
  font-weight: bold;
  margin: 0;
  font-family: 'Courier New', monospace;
}

.error-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.error-item {
  color: var(--rs-white);
  font-size: 12px;
  margin: 5px 0;
  padding: 2px 0;
  font-family: 'Courier New', monospace;
}

.error-item:before {
  content: "⚠ ";
  color: var(--rs-red);
  font-weight: bold;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .dashboard-container {
    grid-template-columns: 1fr;
    gap: 15px;
    height: auto;
    min-height: 80vh;
  }
  
  .page-layout {
    grid-template-columns: 1fr 350px;
    gap: 30px;
    overflow: visible; /* Ensure content doesn't get cut off on tablet */
  }
  
  .chat-section .rs-panel {
    max-height: 600px;
  }
  
  .header-container {
    padding: 8px 15px;
  }
  
  .main-logo {
    height: 40px;
  }
  
  .app-controls {
    top: 15px;
    right: 15px;
    gap: 8px;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 10px;
    padding-top: 60px; /* Make room for floating controls */
  }
  
  .auth-main {
    padding: 10px;
    padding-top: 10px; /* Reset for auth pages */
    max-width: none;
  }
  
  .page-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    overflow: visible; /* Ensure content doesn't get cut off on mobile */
  }
  
  .right-section {
    position: static;
    order: -1; /* Move login form above the demo on mobile */
  }
  
  .hero-section {
    padding: 20px;
  }
  
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .hero-features {
    grid-template-columns: 1fr;
  }
  
  .chat-demo-header {
    padding: 10px 15px;
  }
  
  .conversation-log {
    min-height: 200px;
    max-height: 300px;
  }
  
  .chat-section .rs-panel {
    max-height: 400px;
  }
  
  #conversation-log {
    max-height: calc(100vh - 350px); /* Account for mobile header, footer, and margins */
    min-height: 300px;
  }
  
  .rs-panel-title {
    font-size: 12px;
  }
  
  .user-message,
  .assistant-message {
    padding: 8px;
    font-size: 12px;
  }
  
  .auth-container {
    padding: 10px;
    max-width: none;
  }
  
  .auth-layout {
    flex-direction: column;
    gap: 20px;
  }
  
  .login-sidebar {
    display: none;
  }
  
  .auth-panel {
    max-width: 100%;
  }
  
  .auth-form {
    padding: 15px;
  }
  
  .header-container {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }
  
  .header-nav {
    gap: 10px;
  }
  
  .main-logo {
    height: 36px;
  }
  
  .auth-logo {
    height: 60px;
  }
  
  .auth-logo-fallback {
    font-size: 24px;
  }
  
  .app-controls {
    top: 10px;
    right: 10px;
    flex-direction: column;
    gap: 5px;
    position: fixed;
    z-index: 1001;
  }
  
  .floating-toggle,
  .floating-signout {
    font-size: 10px;
    padding: 6px 8px;
  }
  
  .floating-toggle {
    min-width: 32px;
    font-size: 14px;
  }
  
  .main-content {
    padding-top: 100px; /* More space on mobile for stacked floating controls */
  }
  
  .auth-main {
    padding: 10px;
    padding-top: 20px; /* Keep auth pages normal */
  }
}

/* General content sections - ensure compatibility with fixed footer */
.content-section {
  margin-bottom: 2rem;
  overflow: visible !important;
  min-height: auto;
}

/* Dashboard section adjustments for fixed footer */
.dashboard-section {
  margin-bottom: 2rem;
  overflow: visible !important;
}

/* Auth container adjustments */
.auth-container {
  min-height: calc(100vh - 250px);
  padding-bottom: 2rem;
  overflow: visible !important;
}

/* Mobile styles for about page */
@media (max-width: 768px) {
  .about-page .features-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .about-page .feature-card {
    padding: 1.5rem;
  }
  
  .about-page .feature-card .feature-icon {
    font-size: 2.5rem;
  }
  
  .about-page .feature-card h3 {
    font-size: 1.2rem;
  }
  
  .about-page .architecture-features {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .about-page .arch-feature {
    padding: 1.25rem;
  }
  
  .about-page .comparison-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .about-page .comparison-item {
    padding: 1.25rem;
  }
  
  .about-page .comparison-item .comparison-icon {
    font-size: 2rem;
  }
}

/* Mobile responsiveness for dashboard */
@media (max-width: 1024px) {
  .dashboard-container {
    grid-template-columns: 1fr;
    gap: 15px;
    min-height: auto;
    padding-bottom: 1rem;
  }
  
  .chat-section {
    min-height: calc(100vh - 200px);
  }
  
  #conversation-log {
    max-height: calc(100vh - 350px);
    min-height: 400px;
  }
}

@media (max-width: 768px) {
  .dashboard-container {
    padding: 10px;
    gap: 10px;
  }
  
  .chat-section {
    min-height: calc(100vh - 250px);
  }
  
  #conversation-log {
    margin: 5px;
    max-height: calc(100vh - 400px);
    min-height: 350px;
  }
  
  .messages-container {
    padding: 10px;
  }
}

/* Ensure theme styles are applied consistently and prevent CSS breaking issues */
[data-theme="light"],
[data-theme="dark"] {
  /* Force theme application to prevent CSS conflicts */
  color: var(--theme-text-primary) !important;
}

[data-theme="light"] body,
[data-theme="dark"] body {
  background-color: var(--theme-bg-primary) !important;
  color: var(--theme-text-primary) !important;
}

/* Prevent theme conflicts during page transitions and sign out */
html {
  /* Ensure smooth theme transitions */
  transition: background-color 0.3s ease, color 0.3s ease;
}

html[data-theme] {
  /* Ensure theme attribute is respected */
  background-color: var(--theme-bg-primary);
  color: var(--theme-text-primary);
}

/* Force theme application for critical elements */
.theme-toggle,
.floating-signout,
.rs-button {
  /* Ensure buttons maintain theme colors */
  color: var(--rs-white) !important;
}

/* Subscription Management Styles */
.subscription-zone {
  margin-top: 20px;
  border-color: var(--rs-gold) !important;
}

.subscription-zone .rs-panel-title {
  background: linear-gradient(to bottom, var(--rs-gold), var(--rs-brown-medium));
  color: var(--rs-black);
}

.subscription-content {
  padding: 20px;
}

.subscription-status {
  margin-bottom: 25px;
  padding: 15px;
  background: var(--theme-panel-bg);
  border: 1px solid var(--theme-border-primary);
  border-radius: 6px;
}

.subscription-status h3 {
  color: var(--rs-gold);
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.subscription-status p {
  color: var(--theme-text-primary);
  margin: 5px 0;
  font-size: 0.95rem;
}

.subscription-actions {
  padding: 15px;
  background: rgba(107, 66, 38, 0.1);
  border: 1px solid var(--rs-brown-medium);
  border-radius: 6px;
}

.subscription-actions h4 {
  color: var(--rs-gold);
  margin-bottom: 10px;
  font-size: 1rem;
}

.subscription-actions p {
  color: var(--theme-text-primary);
  margin-bottom: 15px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.subscription-actions .rs-button.warning {
  background: linear-gradient(to bottom, #DAA520, #B8860B);
  border-color: #B8860B;
  color: var(--rs-black) !important;
}

.subscription-actions .rs-button.warning:hover {
  background: linear-gradient(to bottom, #FFD700, #DAA520);
  border-color: #DAA520;
}

/* Danger Zone Styles */
.danger-zone {
  margin-top: 20px;
  border-color: var(--rs-red) !important;
}

.danger-zone .rs-panel-title {
  background: linear-gradient(to bottom, var(--rs-red), #8B0000);
  color: var(--rs-white);
}

.danger-content {
  padding: 20px;
}

.danger-content h3 {
  color: var(--rs-red);
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.danger-content p {
  color: var(--theme-text-primary);
  margin-bottom: 15px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.danger-content .rs-button.danger {
  background: linear-gradient(to bottom, var(--rs-red), #8B0000);
  border-color: #8B0000;
  color: var(--rs-white) !important;
}

.danger-content .rs-button.danger:hover {
  background: linear-gradient(to bottom, #DC143C, var(--rs-red));
  border-color: var(--rs-red);
}

/* Edit Profile Page Styles */
.edit-profile-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.edit-profile-form {
  margin-bottom: 20px;
}

.page-navigation {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--theme-border-primary);
}

.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-button span {
  font-size: 0.9rem;
}

/* Quick Navigation */
.quick-navigation {
  margin-top: 30px;
  text-align: center;
  padding: 20px;
  background: var(--theme-panel-bg);
  border: 1px solid var(--theme-border-primary);
  border-radius: 8px;
}

.quick-navigation .rs-button {
  font-size: 1.1rem;
  padding: 12px 24px;
}

.form-section {
  margin-bottom: 25px;
  padding: 20px;
  background: var(--theme-panel-bg);
  border: 1px solid var(--theme-border-primary);
  border-radius: 6px;
}

.section-title {
  color: var(--rs-gold);
  margin-bottom: 15px;
  font-size: 1.2rem;
  font-weight: bold;
}

.section-description {
  color: var(--theme-text-secondary);
  margin-bottom: 15px;
  font-size: 0.9rem;
}

.form-group {
  margin-bottom: 15px;
}

.form-label {
  display: block;
  color: var(--theme-text-primary);
  margin-bottom: 5px;
  font-weight: bold;
  font-size: 0.95rem;
}

.form-hint {
  color: var(--theme-text-secondary);
  font-size: 0.85rem;
  margin-top: 3px;
}

.confirmation-notice {
  padding: 10px;
  background: rgba(218, 165, 32, 0.1);
  border: 1px solid var(--rs-gold);
  border-radius: 4px;
  margin-bottom: 15px;
  color: var(--theme-text-primary);
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 20px;
  background: var(--theme-panel-bg);
  border: 1px solid var(--theme-border-primary);
  border-radius: 6px;
  margin-top: 20px;
}

/* Responsive: stack fixed stats panels on narrow screens */
@media (max-width: 768px) {
  .stats-bottom {
    flex-direction: column;
    padding-top: 8px;
  }

  .stats-bottom .rs-panel {
    width: 100%;
    margin: 8px 0;
  }

  .stats-scroll {
    max-height: none; /* let scroll naturally on mobile */
    overflow-y: visible;
  }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *



 */

/* Layout */
html, body {
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

body {
  min-height: 100vh !important;
  position: relative !important;
}

body .main-content {
  padding-bottom: 280px !important; /* Increased space for fixed footer */
  min-height: calc(100vh - 120px) !important; /* Ensure content takes full height minus footer */
  width: 100% !important;
}

/* Footer Styles */
.app-footer {
  background-color: var(--theme-bg-secondary);
  border-top: 1px solid var(--theme-border-primary);
  padding: 1rem 0;
  font-size: 0.875rem;
  color: var(--theme-text-secondary);
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 1000 !important;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
  position: relative;
}

.footer-content p {
  margin: 0.5rem 0;
  line-height: 1.4;
  font-size: 0.8rem;
}

/* Game Toggle Styles */
.title-with-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.game-toggle {
  display: flex;
  gap: 2px;
  background: var(--rs-panel-bg);
  border: 1px solid var(--rs-panel-border);
  border-radius: 6px;
  padding: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.game-toggle-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--rs-text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 50px;
}

.game-toggle-btn:hover {
  background: var(--rs-gold);
  color: var(--rs-dark);
}

.game-toggle-btn.active {
  background: var(--rs-gold);
  color: var(--rs-dark);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.game-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-badge-osrs {
  background: linear-gradient(135deg, var(--rs-gold), var(--rs-gold-hover));
  color: var(--rs-dark);
  border: 1px solid var(--rs-gold);
}

.game-badge-rs3 {
  background: linear-gradient(135deg, var(--rs-green), var(--rs-green-hover));
  color: white;
  border: 1px solid var(--rs-green);
}

/* Game Version Indicator for Highscores */
.game-version-indicator {
  text-align: center;
  margin-bottom: 15px;
}

.game-version-indicator .game-badge {
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 20px;
  display: inline-block;
}

/* Current Chat Indicator */
.current-chat-indicator {
  margin: 0 15px;
}

.current-chat-indicator .game-badge {
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 12px;
}

/* Notification animations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 16px;
  border-radius: 6px;
  color: white;
  font-weight: 500;
  z-index: 10000;
  animation: slideIn 0.3s ease-out;
  max-width: 300px;
  word-wrap: break-word;
}

.notification-success {
  background-color: #4CAF50;
}

.notification-error {
  background-color: #f44336;
}

.notification-info {
  background-color: #2196F3;
}

/* Highscores table styles */
.highscores-container {
  margin: 20px 0;
}

.dashboard-grid .highscores-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--rs-panel-bg);
  border: 1px solid var(--rs-panel-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dashboard-grid .highscores-table th,
.dashboard-grid .highscores-table td {
  /* Increased padding to make the highscores table approximately 3x taller for better readability */
  padding: 36px 16px;
  text-align: left;
  border-bottom: 1px solid var(--rs-panel-border);
}

.dashboard-grid .highscores-table th {
  background: var(--rs-darker-bg);
  color: var(--rs-yellow);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dashboard-grid .highscores-table td {
  color: var(--rs-text);
  font-size: 0.9rem;
}

.dashboard-grid .highscores-table tr:last-child td {
  border-bottom: none;
}

.dashboard-grid .highscores-table tr:hover {
  background: var(--rs-darker-bg);
}

/* No stats message */
.no-stats-message {
  text-align: center;
  padding: 40px 20px;
  background: var(--rs-panel-bg);
  border: 1px solid var(--rs-panel-border);
  border-radius: 8px;
  color: var(--rs-text);
}

.no-stats-message p {
  margin: 0;
  font-size: 1rem;
}

.no-stats-message a {
  color: var(--rs-gold);
  text-decoration: none;
  font-weight: 500;
}

.no-stats-message a:hover {
  text-decoration: underline;
}

/* Error message styling */
.highscore-error {
  background: var(--rs-dark-bg);
  border: 1px solid var(--rs-red);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}

.highscore-error h3 {
  color: var(--rs-red);
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.highscore-error p {
  color: var(--rs-text);
  margin-bottom: 10px;
  line-height: 1.5;
}

.highscore-error .error-details {
  background: var(--rs-darker-bg);
  padding: 15px;
  border-radius: 6px;
  margin-top: 15px;
}

.highscore-error .error-details h4 {
  color: var(--rs-yellow);
  margin-bottom: 10px;
  font-size: 1rem;
}

.highscore-error .error-details ul {
  color: var(--rs-text);
  margin: 0;
  padding-left: 20px;
}

.highscore-error .error-details li {
  margin-bottom: 5px;
  line-height: 1.4;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .title-with-toggle {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .game-toggle {
    align-self: flex-end;
  }

  .current-chat-indicator {
    margin: 5px 0;
  }

  .dashboard-grid .highscores-table {
    font-size: 0.8rem;
  }

  .dashboard-grid .highscores-table th,
  .dashboard-grid .highscores-table td {
    /* Reduced mobile padding while still larger than original so the table remains usable on small screens */
    padding: 12px 12px;
  }

  .app-footer {
    padding: 0.5rem 0;
    font-size: 0.75rem;
  }

  .footer-content {
    padding: 0 0.5rem;
  }
}

/* Loading states */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--rs-panel-border);
  border-radius: 50%;
  border-top-color: var(--rs-gold);
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Utility classes */
.text-center {
  text-align: center;
}

.mb-3 {
  margin-bottom: 1rem;
}

.mt-3 {
  margin-top: 1rem;
}

/* Game Toggle Styles */
.title-with-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.game-toggle {
  display: flex;
  gap: 2px;
  background: var(--rs-panel-bg);
  border: 1px solid var(--rs-panel-border);
  border-radius: 6px;
  padding: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.game-toggle-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--rs-text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 50px;
}

.game-toggle-btn:hover {
  background: var(--rs-gold);
  color: var(--rs-dark);
}

.game-toggle-btn.active {
  background: var(--rs-gold);
  color: var(--rs-dark);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.game-toggle-btn.active:hover {
  background: var(--rs-gold-hover);
}

/* Game Message Indicators */
.message-game-indicator {
  margin-bottom: 8px;
  display: flex;
  justify-content: flex-end;
}

.game-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-badge-osrs {
  background: linear-gradient(135deg, var(--rs-gold), var(--rs-gold-hover));
  color: var(--rs-dark);
  border: 1px solid var(--rs-gold);
}

.game-badge-rs3 {
  background: linear-gradient(135deg, var(--rs-green), var(--rs-green-hover));
  color: white;
  border: 1px solid var(--rs-green);
}

/* Game Version Indicator for Highscores */
.game-version-indicator {
  text-align: center;
  margin-bottom: 15px;
}

.game-version-indicator .game-badge {
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 20px;
  display: inline-block;
}

/* Current Chat Indicator */
.current-chat-indicator {
  margin: 0 15px;
}

.current-chat-indicator .game-badge {
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 12px;
}

/* Notification animations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.notification {
  font-family: inherit;
}

/* Form enhancements */
.form-notice {
  margin-top: 16px;
  padding: 12px;
  background: rgba(0, 170, 0, 0.1);
  border: 1px solid var(--rs-green);
  border-radius: 6px;
}

.form-notice .form-hint {
  color: var(--rs-green);
  margin: 0;
}

/* Mobile footer adjustments */
@media (max-width: 768px) {
  /* General mobile optimizations */
  body {
    font-size: 14px;
    overflow-x: hidden;
  }
  
  body .main-content {
    padding-bottom: 300px !important; /* Extra space for mobile footer */
    padding-left: 10px;
    padding-right: 10px;
  }
  
  body .auth-main {
    padding-bottom: 140px !important;
  }
  
  h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
  }
  
  .app-footer {
    padding: 0.75rem 0 !important;
  }
  
  .footer-content p {
    font-size: 0.75rem !important;
  }

  /* Dashboard mobile layout - prioritize chat UI at top */
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 0;
    max-width: 100%;
  }

  /* Mobile order: Chat first, then skills, then lists, then admin controls */
  .left-column {
    order: 1;
    gap: 1rem;
  }

  .right-column {
    order: 2;
    gap: 1rem;
  }

  /* Chat panel optimizations - most important on mobile */
  .chat-panel {
    height: 65vh; /* Use viewport height for better mobile experience */
    min-height: 450px;
    max-height: 600px;
    margin-bottom: 0.5rem;
  }

  .chat-panel .conversation-log {
    height: calc(100% - 140px); /* Account for input area and memory bank */
    min-height: 280px;
    overflow-y: auto;
  }

  .chat-panel .memory-bank {
    height: 100px; /* Compact memory bank on mobile */
    font-size: 0.85rem;
  }

  .memory-bank-content {
    padding: 6px;
    font-size: 0.8rem;
  }

  /* Skills table mobile optimizations */
  .dashboard-grid .skills-table {
    height: auto; /* Remove fixed height for better content flow */
    min-height: 250px;
    margin-bottom: 1rem;
  }
  
  .skills-table .stats-content {
    padding: 8px;
    overflow-x: auto; /* Allow horizontal scroll for table if needed */
  }

  .highscores-table {
    font-size: 0.85rem;
    width: 100%;
    min-width: 280px; /* Ensure table doesn't get too compressed */
  }
  
  .highscores-table th,
  .highscores-table td {
    padding: 8px 4px;
    word-break: break-word;
  }
  
  .highscores-table th:first-child,
  .highscores-table td:first-child {
    width: 50%;
    min-width: 80px;
  }
  
  .highscores-table th:nth-child(2),
  .highscores-table td:nth-child(2),
  .highscores-table th:nth-child(3),
  .highscores-table td:nth-child(3) {
    width: 25%;
    min-width: 40px;
  }

  /* Progress overview mobile improvements */
  .progress-panel {
    height: auto; /* Allow content to determine height */
    min-height: 180px;
    margin-bottom: 1rem;
  }
  
  .progress-card .card-header {
    padding: 8px;
    flex-direction: column;
    gap: 10px;
  }
  
  .progress-card .btn-group {
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
  }
  
  .progress-card .rs-button {
    font-size: 0.75rem;
    padding: 6px 8px;
    min-width: 35px;
  }

  /* Lists panel mobile optimization - move to bottom */
  .lists-panel {
    order: 3; /* After skills on mobile */
    min-height: 120px;
    margin-bottom: 1rem;
  }
  
  .lists-panel .stats-content {
    padding: 8px;
  }

  /* Admin controls at very bottom */
  .dashboard-controls-panel {
    order: 4;
    min-height: 100px;
  }
  
  .dashboard-controls-panel .stats-content {
    padding: 8px;
  }

  /* Message input area mobile improvements */
  .message-form {
    padding: 8px;
    background: var(--theme-bg-secondary);
  }
  
  .message-input-container {
    gap: 8px;
    align-items: flex-end;
  }
  
  .message-input {
    font-size: 16px; /* Prevent zoom on iOS */
    min-height: 44px; /* iOS touch target minimum */
    resize: none;
    flex: 1;
  }
  
  .send-button {
    padding: 12px 16px;
    font-size: 0.9rem;
    min-height: 44px; /* iOS touch target minimum */
    flex-shrink: 0;
  }

  /* Panel titles optimized for mobile */
  .rs-panel-title {
    font-size: 0.9rem;
    padding: 8px 10px;
    text-align: center;
  }

  /* Game version toggle improvements for mobile */
  .game-version-toggle,
  .game-toggle {
    margin-bottom: 1rem;
  }
  
  .game-toggle-btn,
  .game-version-toggle .rs-button {
    font-size: 0.85rem;
    padding: 10px 14px;
    min-height: 44px; /* iOS touch target minimum */
    min-width: 60px;
  }

  /* Title area mobile optimization */
  .title-with-toggle {
    flex-direction: column;
    gap: 8px;
    align-items: center;
    text-align: center;
  }
  
  .title-with-toggle .game-toggle {
    width: 100%;
    justify-content: center;
  }

  /* Enhanced touch targets for mobile */
  .rs-button,
  button {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation; /* Prevent double-tap zoom */
  }
  
  /* Improve tap targets for mobile */
  .highscores-table tr {
    min-height: 44px;
  }
  
  .list-entry {
    min-height: 44px;
    padding: 8px;
  }
}

/* Ultra-wide mobile phones (Galaxy S25, iPhone 15 Pro Max, etc.) */
@media (max-width: 480px) {
  /* Even more mobile-optimized for narrow screens */
  .dashboard-grid {
    padding: 0 5px;
    gap: 0.75rem;
  }
  
  h1 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
  }

  /* Chat panel adjustments for very narrow screens */
  .chat-panel {
    height: 60vh;
    min-height: 400px;
    max-height: 500px;
  }

  .chat-panel .conversation-log {
    height: calc(100% - 120px);
    min-height: 250px;
  }

  .chat-panel .memory-bank {
    height: 80px;
    font-size: 0.8rem;
  }

  /* Skills table ultra-mobile */
  .highscores-table {
    font-size: 0.8rem;
  }
  
  .highscores-table th,
  .highscores-table td {
    padding: 6px 2px;
  }

  /* Progress buttons smaller for narrow screens */
  .progress-card .rs-button {
    font-size: 0.7rem;
    padding: 5px 6px;
    min-width: 30px;
  }

  /* Message input optimizations for narrow screens */
  .message-input {
    font-size: 16px;
    min-height: 48px; /* Larger touch target for narrow screens */
  }
  
  .send-button {
    padding: 10px 12px;
    min-height: 48px;
    font-size: 0.85rem;
  }

  /* Smaller panel titles */
  .rs-panel-title {
    font-size: 0.85rem;
    padding: 6px 8px;
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Dashboard Layout Styles */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Equal left and right columns */
  gap: 1.5rem;
  align-items: start;
  overflow-x: hidden;
  max-width: 1600px;
  margin: 0 auto;
}

.left-column,
.right-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}

/* Left column panels */
.chat-panel {
  min-height: 0;
  box-sizing: border-box;
  flex: 1 1 auto; /* Allow it to grow and take available space */
  display: flex;
  flex-direction: column;
  overflow: visible; /* Allow content to be visible */
}

.dashboard-grid .chat-panel .conversation-log {
  flex: 1 1 auto; /* Take most of the space */
  display: flex;
  flex-direction: column;
  min-height: 400px; /* Minimum height for chat area */
  overflow-y: auto; /* Only scroll vertically when needed */
}

.chat-panel .memory-bank {
  margin-top: 1rem; /* Add spacing between chat and memory bank */
  flex: 0 0 auto; /* Fixed size for memory bank */
  max-height: 200px; /* Maximum height for memory bank */
  overflow-y: auto; /* Scroll if content is too long */
}

.memory-bank-panel {
  /* This class is no longer used since memory bank is in chat panel */
  display: none;
}

.lists-panel {
  flex: 0 0 auto; /* Fixed size instead of flexible */
  /* Removed overflow and height constraints to allow dynamic growth */
}

/* List item styling */
.list-item-container {
  margin-bottom: 0.25rem;
}

.list-item-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  margin-bottom: 0;
}

.list-item-checkbox {
  margin: 0;
  margin-top: 0.1rem; /* Slight adjustment for alignment */
  flex-shrink: 0;
}

.list-item-text {
  flex: 1;
  transition: all 0.2s ease;
}

/* Completed list items styling */
.list-item-container.completed .list-item-text {
  text-decoration: line-through;
  opacity: 0.6;
  color: var(--rs-green);
}

/* Section headers in lists */
.list-section-header {
  border-bottom: 1px solid var(--rs-panel-border);
  padding-bottom: 0.25rem;
}

.list-section-header strong {
  font-size: 0.9rem;
  color: var(--rs-yellow) !important;
}

/* List delete button styling */
.list-delete-btn {
  background: none;
  border: 1px solid var(--rs-red);
  color: var(--rs-red);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
}

.list-delete-btn:hover {
  background: var(--rs-red);
  color: var(--rs-panel-bg);
  border-color: var(--rs-red);
}

/* Generating list loader */
.generating-list {
  padding: 0.75rem;
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid var(--rs-yellow);
  border-radius: 6px;
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { 
    background: rgba(255, 193, 7, 0.1);
    border-color: var(--rs-yellow);
  }
  50% { 
    background: rgba(255, 193, 7, 0.2);
    border-color: var(--rs-gold);
  }
}

/* List animations for SPA behavior */
.lists-panel li {
  transition: all 0.3s ease-out;
}

.lists-panel li[id^="list_"] {
  transform: translateY(0);
  opacity: 1;
}

.lists-panel li[id^="list_"].list-entering {
  transform: translateY(-10px);
  opacity: 0;
  animation: slideInFromTop 0.4s ease-out forwards;
}

@keyframes slideInFromTop {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.lists-panel li[id^="generating_list_"] {
  animation: slideInFromTop 0.3s ease-out;
}

/* Success indicator animation */
@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateY(-5px);
  }
  20%, 80% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-5px);
  }
}

/* Right column panels */
.dashboard-grid .skills-table {
  overflow: auto;
  min-height: 0;
  height: 350px; /* Fixed height for desktop */
  flex: 0 0 auto; /* Don't grow or shrink */
}

.progress-panel {
  height: 300px; /* Increased height for better data visibility */
  flex: 0 0 auto; /* Don't grow or shrink */
  overflow: auto;
}

.dashboard-controls-panel {
  min-height: 150px; /* Minimum height */
  flex: 1 1 auto; /* Allow it to grow and take remaining space */
  max-height: calc(100vh - 350px - 300px - 3rem); /* Updated calculation for larger progress panel */
  overflow: auto;
}

.dashboard-control-btn {
  margin-bottom: 10px;
}

/* Highscores Error Styles */
.highscore-error {
  text-align: center;
  padding: 20px;
  background: var(--rs-dark-bg);
  border: 1px solid var(--rs-red);
  border-radius: 8px;
  margin: 20px 0;
}

.dashboard-grid .error-title {
  color: var(--rs-red);
  margin-bottom: 15px;
}

.error-message {
  color: var(--rs-text);
  margin-bottom: 10px;
}

.error-tips {
  background: var(--rs-darker-bg);
  padding: 15px;
  border-radius: 6px;
  margin-top: 15px;
}

.tips-title {
  color: var(--rs-yellow);
  margin-bottom: 10px;
}

.tips-list {
  color: var(--rs-text);
  text-align: left;
  display: inline-block;
}

.refresh-btn {
  margin-top: 15px;
}

.error-text {
  color: var(--rs-text);
}

.error-timestamp {
  color: var(--rs-muted-text);
  font-size: 0.9em;
  margin-top: 15px;
}

.loading-highscores {
  text-align: center;
  padding: 40px;
  color: var(--rs-muted-text);
}

.loading-subtitle {
  font-size: 0.9em;
  margin-top: 10px;
}

.help-details {
  margin-top: 12px;
}

.help-summary {
  cursor: pointer;
}

.help-content {
  background: var(--rs-darker-bg);
  padding: 12px;
  border-radius: 6px;
  margin-top: 8px;
  color: var(--rs-text);
}

/* Memory Bank Styles */
.memory-bank {
  margin: 0; /* Remove the uneven margin that was causing alignment issues */
  background-color: var(--theme-panel-bg);
  border: 2px inset var(--theme-panel-border);
  border-radius: 4px;
  flex: 1;
  min-height: 150px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.memory-bank .rs-panel-title {
  background: linear-gradient(to bottom, var(--rs-brown-medium), var(--rs-brown-dark));
  color: var(--rs-gold);
  font-weight: bold;
  font-size: 14px;
  text-align: center;
  padding: 8px;
  border-bottom: 1px solid var(--theme-border-primary);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
  margin: 0;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.current-memory-indicator {
  margin: 0 10px;
}

.current-memory-indicator .game-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 8px;
}

.memory-bank-content {
  padding: 8px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.memory-bank-description {
  color: var(--theme-text-primary);
  opacity: 0.7;
  font-size: 10px;
  margin-bottom: 10px;
  font-style: italic;
  text-align: center;
}

.keywords-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keyword-tag {
  background: var(--theme-bg-secondary);
  border: 1px solid var(--theme-border-primary);
  color: var(--theme-text-primary);
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.keyword-tag:hover {
  background: var(--theme-bg-hover);
  border-color: var(--rs-gold);
  color: var(--rs-gold);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.keyword-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.keyword-remove {
  background: none;
  border: none;
  color: var(--rs-red);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.keyword-remove:hover {
  background: rgba(204, 0, 0, 0.2);
}

.keyword-count {
  background: var(--theme-bg-secondary);
  color: var(--theme-text-primary);
  border: 1px solid var(--theme-border-primary);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: bold;
  margin-left: 6px;
  min-width: 20px;
  text-align: center;
}

.clear-memory-btn {
  background: none;
  border: none;
  color: var(--rs-red);
  cursor: pointer;
  font-size: 10px;
  margin-left: 8px;
  padding: 2px;
  border-radius: 3px;
  transition: background-color 0.2s ease;
  opacity: 0.7;
}

.clear-memory-btn:hover {
  background: rgba(204, 0, 0, 0.2);
  opacity: 1;
}

.memory-bank-empty {
  text-align: center;
  color: var(--theme-text-primary);
  opacity: 0.6;
  font-style: italic;
  padding: 20px 15px;
  border: 1px dashed var(--theme-border-secondary);
  border-radius: 8px;
  margin: 10px 0;
}

.memory-bank-empty p {
  margin: 0;
  font-size: 11px;
}

/* Memory bank scrollbar */
.memory-bank-content::-webkit-scrollbar {
  width: 12px;
}

.memory-bank-content::-webkit-scrollbar-track {
  background: var(--theme-bg-secondary);
  border: 1px inset var(--theme-border-primary);
}

.memory-bank-content::-webkit-scrollbar-thumb {
  background: var(--rs-brown-medium);
  border: 1px outset var(--theme-border-primary);
  border-radius: 2px;
}

/* Chat Interface Styles - Dashboard specific */
.dashboard-grid .conversation-log {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.dashboard-grid .messages-container {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(60vh);
}

.message-form-container {
  flex: 0 0 auto;
}
