:root {
  /* Dynamic Variable Fallbacks / Rich Deep Purple Configuration */
  --accent: #8b00ff;
  --accent-hover: #a033ff;
  --bg-gradient: linear-gradient(135deg, #120024, #1a0033);
  --container-bg: rgba(26, 0, 51, 0.98);
  --text: #e0e0e0;
  
  /* Layout Architecture Color Tokens Linked to Theme Customizations */
  --bg-dashboard: #120024;   /* Deep Midnight Purple */
  --bg-sidebar: #1a0033;     /* Rich Indigo/Violet */
  --border-color: #3b1d70;   /* Vibrant Purple Border */
  --text-main: #e8e0ff;
  --text-muted: #b39ddb;
}

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

html {
  /* Prevent horizontal scroll on narrow / split viewports */
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-dashboard) !important;
  color: var(--text-main) !important;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  width: 100%;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.container { 
  border: 2px solid var(--accent-color, var(--accent)) !important; 
  background: var(--bg-sidebar) !important;
}

/* Dashboard Core Layout Fixes */
.dashboard {
  display: grid !important;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) minmax(200px, 280px);
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100vw;
  visibility: visible !important;
  position: relative;
  background: var(--bg-dashboard);
}

/* Sidebar Navigation Layout Realignment */
.left-nav {
  background: var(--bg-sidebar) !important;
  border-right: 1px solid var(--border-color) !important;
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.25s ease, border-color 0.25s ease;
  min-width: 0;
  overflow-x: hidden;
}

.logo {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 40px;
  color: var(--text-main);
  padding-left: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo {
  width: 100px;
  height: auto;
  max-width: 100%;
  border-radius: 8px;
  filter: drop-shadow(0 4px 12px var(--border-color));
  transition: transform 0.3s ease;
}

.site-logo:hover {
  transform: rotate(-3deg) scale(1.05);
}

nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item i {
  font-size: 1.1rem;
  width: 24px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--accent-color, var(--accent));
  padding-left: 22px;
}

.nav-item.active {
  background: var(--accent-color, var(--accent));
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Main Content Area Layout Settings */
.main-content {
  background: var(--bg-dashboard);
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0; /* Critical for grid children to shrink */
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  height: 100vh;
  height: 100dvh;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg-sidebar) !important;
  border-bottom: 1px solid var(--border-color) !important;
  position: sticky;
  top: 0;
  z-index: 90;
  transition: background 0.25s ease, border-color 0.25s ease;
  min-width: 0;
}

.greeting h1 {
  font-size: clamp(1.15rem, 2.5vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.greeting p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 2px;
}

.search-bar {
  flex: 1 1 280px;
  max-width: none;
  min-width: 180px;
  margin: 0;
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 10px;
  outline: none;
  font-size: 15px;
  transition: all 0.3s ease;
}

.search-bar input:focus {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 15px var(--border-color);
  border-color: var(--accent-color, var(--accent));
}

/* Featured Hero Styling Rules */
.hero {
  margin: 20px;
  padding: clamp(24px, 5vw, 60px);
  background: var(--bg-sidebar);
  border-radius: 24px;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  min-width: 0;
}

.hero::after {
  content: '';
  position: absolute;
  right: -50px;
  bottom: -50px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--accent-color, var(--accent)) 0%, transparent 70%);
  opacity: 0.25;
  filter: blur(40px);
}

.hero-content {
  position: relative;
  z-index: 5;
}

.badge {
  background: var(--accent-color, var(--accent));
  color: white;
  padding: 6px 20px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-block;
  margin-bottom: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.hero h2 {
  font-size: clamp(1.6rem, 4vw, 3rem);
  margin-bottom: 15px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-main);
  word-wrap: break-word;
}

.hero p,
.hero h3 {
  color: var(--text-main);
  opacity: 0.9;
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  max-width: 550px;
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions button {
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
}

.play-btn {
  background: var(--accent-color, var(--accent)) !important;
  color: white;
}

.play-btn:hover {
  transform: translateY(-3px) scale(1.02);
  filter: brightness(1.2);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color) !important;
  backdrop-filter: blur(5px);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  border-color: var(--accent-color, var(--accent)) !important;
}

/* Quick Action Row Controls */
.random-section {
  padding: 0 20px 20px;
}

.quick-action-btn {
  width: 100%;
  padding: 16px 20px;
  background: var(--accent-color, var(--accent)) !important;
  border: none;
  border-radius: 15px;
  color: white;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.quick-action-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow: 0 0 20px var(--border-color);
}

/* Grid & Display Cards Configurations */
.section-title {
  padding: 0 20px;
  margin: 20px 0 25px;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-grid, .games-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
  gap: 16px;
  padding: 0 16px 40px;
  min-height: 200px;
  width: 100%;
  box-sizing: border-box;
}

.game-card {
  position: relative;
  background: var(--bg-sidebar) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 16px;
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background-clip: padding-box;
  min-width: 0;
}

.game-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-color, var(--accent)) !important;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.game-card h3 {
  color: var(--text-main);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  font-weight: 700;
  text-align: center;
  padding: 0 12px;
  z-index: 2;
  word-break: break-word;
}

.game-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
  z-index: 2;
}

.game-desc-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-dashboard);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.game-card:hover .game-desc-overlay {
  opacity: 1;
}

/* Profile Form Block Setup */
.profile-card {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  padding: 24px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 100%;
  box-sizing: border-box;
}

.avatar-upload-section {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

#pfp-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.upload-inputs label {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.upload-inputs label:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--accent);
}

.upload-inputs input[type="file"] {
  display: none;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.username-static-display {
  padding: 12px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-weight: bold;
}

.input-group textarea {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  color: white;
  font-family: inherit;
  resize: none;
  height: 80px;
  outline: none;
}

.input-group textarea:focus {
  border-color: var(--accent);
}

.meta-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0,0,0,0.15);
  padding: 15px;
  border-radius: 8px;
  font-size: 13px;
}

.info-row {
  display: flex;
  justify-content: space-between;
}

.info-row span {
  color: var(--text-muted);
}

.actions-row {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

/* Unblockers Portal Cards Grid */
.unblocker-card {
  background: var(--bg-sidebar) !important;
  border: 1px solid var(--border-color) !important;
  padding: 20px;
  border-radius: 12px;
  width: 180px;
  max-width: 100%;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.unblocker-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-color, var(--accent)) !important;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4), 0 0 15px rgba(139, 0, 255, 0.2);
}

.unblocker-card h4 {
  color: var(--text-main);
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 600;
}

.unblocker-card span {
  color: var(--accent-color, var(--accent));
  font-weight: bold;
  font-size: 14px;
  transition: color 0.2s ease;
}

.unblocker-card:hover span {
  color: var(--accent-hover);
}

/* Right Sidebar Rules */
.right-sidebar {
  background: var(--bg-sidebar) !important;
  border-left: 1px solid var(--border-color) !important;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100vh;
  height: 100dvh;
  position: sticky;
  top: 0;
  overflow: hidden;
  transition: background 0.25s ease, border-color 0.25s ease;
  min-width: 0;
}

.signin-btn, .settings-btn {
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.signin-btn {
  background: var(--accent-color, var(--accent)) !important;
  color: white;
}

.signin-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 0 15px var(--border-color);
}

.settings-btn {
  background: var(--bg-dashboard) !important;
  color: var(--text-muted);
  border: 1px solid var(--border-color) !important;
}

.settings-btn:hover {
  filter: brightness(1.2);
  border-color: var(--accent-color, var(--accent)) !important;
  color: var(--text-main);
}

/* Communications Block Module */
.form-wrapper {
  background: var(--bg-sidebar) !important; 
  border: 2px solid var(--accent-color, var(--accent)); 
  border-radius: 25px;
  padding: 40px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
  margin: 20px 30px 40px;
  position: relative;
}

.form-title {
  color: var(--accent-color, var(--accent));
  text-align: center;
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 0 10px var(--border-color);
}

.form-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 17px;
  margin-bottom: 40px;
  font-weight: 500;
}

.google-form-iframe {
  border-radius: 16px;
  background: #ffffff; 
  border: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: block;
}

/* Global Navigation System Scrollbars */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dashboard);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
  border: 2px solid var(--bg-dashboard);
  transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color, var(--accent));
}

/* ==========================================================================
   RESPONSIVE — split-screen & smaller viewports
   ========================================================================== */

/* Large tablet / narrow desktop / wide split-screen */
@media (max-width: 1200px) {
  .dashboard {
    grid-template-columns: 72px minmax(0, 1fr) minmax(180px, 240px);
  }
  .left-nav {
    padding: 12px 8px;
  }
  .logo {
    justify-content: center;
    padding: 0;
    margin-bottom: 24px;
  }
  .site-logo {
    width: 48px;
  }
  .nav-item {
    justify-content: center;
    padding: 12px;
  }
  .nav-item:hover {
    padding-left: 12px;
  }
  /* Hide text labels on left nav, keep icons */
  .left-nav .nav-item {
    font-size: 0;
  }
  .left-nav .nav-item i {
    font-size: 1.15rem;
    width: auto;
    margin: 0 !important;
  }
  .hero {
    margin: 16px;
  }
  .top-bar-stats {
    display: none !important; /* free space in split view */
  }
}

/* Typical split-screen / medium width */
@media (max-width: 980px) {
  .dashboard {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .right-sidebar {
    display: none !important;
  }
  .hero {
    margin: 12px;
    padding: 24px;
  }
  .hero h2 {
    font-size: clamp(1.4rem, 5vw, 2rem);
  }
  .game-grid, .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 0 12px 32px;
  }
  .game-card {
    height: 140px;
  }
  .search-bar {
    max-width: none;
    flex: 1 1 140px;
  }
}

/* Phone / very narrow split / small window */
@media (max-width: 700px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  .left-nav,
  .right-sidebar {
    display: none !important;
  }
  .main-content {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .top-bar {
    padding: 12px 14px;
    flex-direction: column;
    align-items: stretch;
  }
  .greeting h1 {
    font-size: 1.2rem;
  }
  .search-bar {
    max-width: 100%;
    margin: 0;
  }
  .hero {
    margin: 10px;
    padding: 20px;
    border-radius: 16px;
  }
  .hero h2 {
    font-size: 1.35rem;
  }
  .hero-actions button {
    padding: 10px 20px;
    font-size: 14px;
    width: 100%;
  }
  .random-section {
    padding: 0 10px 16px;
  }
  .game-grid, .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    padding: 0 10px 24px;
  }
  .game-card {
    height: 130px;
    border-radius: 12px;
  }
  /* Countdown matrix cards scale down */
  .matrix-card {
    width: 56px !important;
    height: 52px !important;
  }
  .matrix-value {
    font-size: 1.6rem !important;
  }
  .flip-clock {
    gap: 8px !important;
  }
  .countdown-title {
    font-size: 1rem !important;
    letter-spacing: 2px !important;
  }
}

/* Extra-small (narrow split half on small laptop) */
@media (max-width: 480px) {
  .game-grid, .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-actions {
    flex-direction: column;
  }
  .modal-content,
  .warning-modal-content {
    width: 92vw !important;
    max-width: 340px;
    padding: 20px !important;
  }
}

.flex-center { display: flex; align-items: center; justify-content: center; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.text-accent { color: var(--accent-color, var(--accent)); }
.bg-dark { background: var(--bg-dashboard) !important; }

/* Stealth Button Layout Alignment */
.cloak-btn {
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  border: 1px solid var(--accent-color, var(--accent));
  color: var(--text-main);
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.cloak-btn:hover {
  background: var(--accent-color, var(--accent));
  box-shadow: 0 0 20px var(--border-color);
  transform: translateY(-2px);
}

/* Updates News Container Feed Parameters */
.news-sidebar {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  text-align: left;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0; 
  max-height: calc(100vh - 200px);
  max-height: calc(100dvh - 200px);
}

.news-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-left: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.news-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.news-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
  overflow-y: hidden !important; 
  overflow-x: hidden !important;
  padding-right: 4px;
  scroll-behavior: smooth;
  min-height: 0;
}

.news-feed:hover {
  overflow-y: auto !important;
}

.news-feed::-webkit-scrollbar {
  width: 6px;
}

.news-feed::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.news-feed::-webkit-scrollbar-thumb {
  background: var(--accent-color, var(--accent));
  border-radius: 4px;
}

.news-feed::-webkit-scrollbar-thumb:hover {
  background: var(--text-main);
}

.news-card {
  background: var(--bg-dashboard) !important;
  border: 1px solid var(--border-color) !important;
  padding: 14px;
  border-radius: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  flex-shrink: 0; 
}

.news-card:hover {
  border-color: var(--accent-color, var(--accent)) !important;
  background: var(--bg-sidebar) !important;
  transform: translateX(4px);
}

.news-tag {
  background: var(--accent-color, var(--accent));
  color: white;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 800;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 8px;
  letter-spacing: 1px;
  font-size: 11px;
}

.news-card p {
  font-size: 13px;
  margin-bottom: 10px;
  color: var(--text-main);
  line-height: 1.45;
}

.news-date {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.news-title::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pulseNews 2s infinite;
}

@keyframes pulseNews {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

.news-card, .cloak-btn {
  animation: fadeInUpSmall 0.5s ease-out forwards;
}

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

/* Fullscreen Academic Overlay Shield */
#educational-cloak {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background-color: #ffffff !important;   
  background: #ffffff !important;
  z-index: 2147483647 !important;          
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Times New Roman', Times, serif;
  padding: 16px;
  box-sizing: border-box;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.educational-content-card {
  background: #ffffff !important;
  border: 2px solid #000000 !important;              
  box-shadow: none;                                                        
  width: 92%;
  max-width: 950px;                                      
  height: 85vh;
  max-height: 85dvh;                                                           
  display: flex;
  flex-direction: column;
  border-radius: 0px;                                     
}

.educational-header {
  padding: 20px 24px 12px;
  border-bottom: 2px solid #000000;       
  background: #ffffff;
}

.educational-header h1 {
  font-size: clamp(1.1rem, 3vw, 1.65rem);
  margin: 0 0 6px 0;
  color: #000000 !important;              
  font-weight: bold;
  letter-spacing: -0.5px;
}

.academic-subheading {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #000000 !important;              
  font-weight: bold;
}

.educational-scroll-body {
  padding: 20px 24px;
  overflow-y: auto;                                      
  flex-grow: 1;
  text-align: justify;
  line-height: 1.6;
}

.educational-scroll-body p {
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  margin: 0 0 16px 0;
  color: #000000 !important;              
}

.timer-subtext-sticky {
  padding: 12px 24px;
  background: #ffffff;                                    
  border-top: 2px solid #000000;          
  font-style: italic;
  font-size: 0.9rem;
  color: #000000 !important;              
  display: flex;
  align-items: center;
  justify-content: flex-end;            
}

.timer-subtext-sticky span {
  color: #000000 !important;              
  font-weight: bold;
  margin-left: 5px;
  font-size: 1rem;
}

.educational-scroll-body::-webkit-scrollbar {
  width: 8px;
}
.educational-scroll-body::-webkit-scrollbar-track {
  background: #ffffff;
}
.educational-scroll-body::-webkit-scrollbar-thumb {
  background: #000000;                    
}

/* Sidebar Embedded System Terminal Integration Styles */
.terminal-container {
  margin-top: auto; 
  background: var(--bg-dashboard) !important; 
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  font-family: 'Courier New', Courier, monospace;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  width: 100%;
}

.terminal-header {
  background: var(--bg-sidebar);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border-color);
}

.terminal-circle {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.terminal-circle.red { background: #ff5f56; }
.terminal-circle.yellow { background: #ffbd2e; }
.terminal-circle.green { background: #27c93f; }

.terminal-title {
  color: var(--text-muted);
  font-size: 10px;
  margin-left: 4px;
}

.terminal-body {
  padding: 10px;
  height: 130px; 
  overflow-y: auto;
  font-size: 11px;
  color: var(--text-main); 
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.command-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.terminal-prompt {
  color: #10b981; 
  white-space: nowrap;
}

#terminalInput {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: var(--text-main);
  font-family: inherit;
  font-size: inherit;
  flex: 1;
  padding: 0;
  margin: 0;
}

#custom-context-menu {
  position: fixed;
  background: var(--bg-sidebar) !important;
  border: 1px solid var(--accent-color, var(--accent));
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  z-index: 10000;
  width: 160px;
  padding: 6px 0;
}

.context-menu-item {
  padding: 10px 16px;
  color: var(--text-main);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

.context-menu-item:hover {
  background: var(--accent-color, var(--accent)) !important;
  color: white !important;
}

#ctx-delete:hover {
  background: #ff3333 !important;
}

.game-card.is-favorite {
  border-color: #ffd700 !important; 
}
.game-card.is-favorite::before {
  content: '★';
  position: absolute;
  top: 10px;
  right: 15px;
  color: #ffd700;
  font-size: 16px;
  z-index: 5;
}

/* Floating Console Styling */
#console-toggle-btn {
  position: fixed;
  bottom: 15px;
  left: 15px;
  background: #8b00ff;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 20px;
  font-family: monospace;
  font-weight: bold;
  cursor: pointer;
  z-index: 99999;
  box-shadow: 0 4px 12px rgba(139, 0, 255, 0.4);
}

#site-console {
  position: fixed;
  bottom: 60px;
  left: 15px;
  width: min(90vw, 500px);
  height: min(40vh, 300px);
  background: #0d0d13;
  border: 1px solid #8b00ff;
  border-radius: 8px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  font-family: monospace;
  font-size: 13px;
}

#console-header {
  background: #180e29;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(139, 0, 255, 0.3);
  color: #a033ff;
  font-weight: bold;
}

#console-header button {
  background: transparent;
  border: none;
  color: #aaa;
  cursor: pointer;
  margin-left: 8px;
}

#console-output {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.console-entry {
  word-break: break-all;
  white-space: pre-wrap;
}

.console-entry.log { color: #e0e0e0; }
.console-entry.warn { color: #f59e0b; }
.console-entry.error { color: #ef4444; }
.console-entry.input { color: #a033ff; font-weight: bold; }

#console-input-container {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  background: #12091c;
  border-top: 1px solid rgba(139, 0, 255, 0.3);
  gap: 8px;
}

#console-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: monospace;
  outline: none;
}


/* ===== Game card images: fill media box, never spill past borders ===== */
.game-card {
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  overflow: hidden !important;
  height: auto !important;
  min-height: 0 !important;
}

.game-card .game-card-img,
.game-card .game-card-img-placeholder {
  width: 100%;
  height: 120px;
  flex-shrink: 0;
  display: block;
  border-radius: 14px 14px 0 0;
  background: #0a0a12;
}

.game-card .game-card-img {
  object-fit: cover;
  object-position: center;
  /* Stay inside the card — no overflow, no stretch past edges */
  max-width: 100%;
  max-height: 120px;
}

.game-card .game-card-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f1f2e, #0d0d13);
  color: #888;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.05em;
}

.game-card > h3 {
  width: 100%;
  margin: 0 !important;
  padding: 8px 10px 12px !important;
  font-size: 0.85rem !important;
  line-height: 1.25;
  text-align: center;
  z-index: 2;
}

/* ===== Featured hero: show game art ===== */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 200px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--hero-bg, none);
  background-size: cover;
  background-position: center;
  opacity: 0.45;
  z-index: 0;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 6, 20, 0.95) 0%, rgba(10, 6, 20, 0.75) 45%, rgba(10, 6, 20, 0.35) 100%);
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

/* ===== System News: hide sidebar feed; use modal instead ===== */
.news-sidebar {
  display: none !important;
}

#system-news-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(139, 0, 255, 0.45);
  background: rgba(139, 0, 255, 0.15);
  color: #e8e0ff;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
  margin-right: 4px;
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.top-bar .greeting {
  flex-shrink: 0;
}

.top-bar .search-bar {
  flex: 1 1 auto;
}

#system-news-btn:hover {
  background: rgba(139, 0, 255, 0.3);
  border-color: #a033ff;
}

#system-news-btn .news-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

#system-news-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.75);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#system-news-modal.show {
  display: flex;
}

#system-news-modal .snm-box {
  width: min(420px, 94vw);
  max-height: min(80vh, 640px);
  background: var(--bg-sidebar, #1a0033);
  border: 1px solid var(--border-color, #3b1d70);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#system-news-modal .snm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color, #3b1d70);
}

#system-news-modal .snm-header h3 {
  margin: 0;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-main, #e8e0ff);
}

#system-news-modal .snm-close {
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}

#system-news-modal .snm-close:hover {
  color: #fff;
}

#system-news-modal .snm-feed {
  overflow-y: auto;
  padding: 12px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#system-news-modal .snm-feed .news-card {
  flex-shrink: 0;
}
