/* Modern Design for Computational Memory Lab
   Inspired by neuroscience and cognitive research themes
   Created 2025 - Dark Mode Only */

html {
  scroll-padding-top: 70px; /* Added for fixed header offset */
}

:root {
    --primary-color: #7cb3f1;
    --accent-color: #5b8fd9;
    --neural-green: #00d68f;
    --text-dark: #e1e8ed;
    --text-light: #B7C0C9;
    --bg-light: #06080D;
    --bg-white: #1A1E29;
    --border-light: #3a4254;
    --neural-gradient: linear-gradient(135deg, #5b8fd9 0%, #00d68f 100%);
    
    --header-bg: #1A1E29;
    --sidebar-bg: #1a1f2e;
    --footer-bg: #0f1419;
    --footer-text: #B7C0C9;
    --code-bg: #2d3447;
    --shadow-color: rgba(0,0,0,0.5);
    --shadow-hover: rgba(0,0,0,0.4);
}

[data-theme="light"] {
    --primary-color: #2a7de9;
    --accent-color: #4a90e2;
    --neural-green: #00b36b;
    --text-dark: #2c3e50;
    --text-light: #576c7f;
    --bg-light: #f4f7fa;
    --bg-white: #ffffff;
    --border-light: #e0e6ed;
    --header-bg: #ffffff;
    --sidebar-bg: #f0f3f7;
    --footer-bg: #e9edf1;
    --footer-text: #576c7f;
    --code-bg: #e8ecf3;
    --shadow-color: rgba(44, 62, 80, 0.1);
    --shadow-hover: rgba(44, 62, 80, 0.15);
}

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

html:not([data-theme-ready]) *,
html:not([data-theme-ready]) *::before,
html:not([data-theme-ready]) *::after {
  transition: none !important;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-light); /* Use background-color for the base color */
  min-height: 100vh;
  --grain-bleed: 10vh;

  /* Define background layers separately for clarity */
  background-image:
    /* Layer 1: Top-left gradient */
    radial-gradient(circle at 20% 80%, rgba(44, 90, 160, 0.1) 0%, transparent 25%),
    /* Layer 2: Top-right gradient */
    radial-gradient(circle at 80% 20%, rgba(0, 168, 107, 0.1) 0%, transparent 25%),
    /* Layer 3: Your SVG */
    url('images/theta_wave_group.svg');

  background-size:
    cover, /* For gradient 1 */
    cover, /* For gradient 2 */
    150% auto; /* For SVG: 100% width, auto height to maintain aspect ratio */

  background-position:
    0 0, /* For gradient 1 */
    0 0, /* For gradient 2 */
    center; /* For SVG: center horizontally and vertically */

  background-repeat:
    no-repeat, /* For gradient 1 */
    no-repeat, /* For gradient 2 */
    no-repeat; /* For SVG: prevent tiling */

  transition: background-color 0.3s ease, color 0.3s ease;
  filter: brightness(1.0);
  position: relative;
}



/* Overlay to fade theta waves in light mode */
body:before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: calc(-1 * var(--grain-bleed));
  left: 0;
  background: var(--bg-light);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition: none;
}

/* Show overlay in light mode to fade theta waves */
body[data-theme="light"]::before,
html[data-theme="light"] body::before {
  opacity: 0.7;
}

/* Grainy noise layer above overlay */
body:after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: calc(-1 * var(--grain-bleed));
  left: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.25' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' fill='white'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 300px 300px;
  opacity: 0.1;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
  animation: grain 8s steps(10) infinite;
}

/* Boost grain visibility in light mode only */
body[data-theme="light"]::after,
html[data-theme="light"] body::after {
  opacity: 0.2;
  mix-blend-mode: multiply;
}

/* Ensure content is above the overlay and noise */
#header-wrapper,
#logo,
#page {
  position: relative;
  z-index: 2;
}





@keyframes grain {
  0%, 100% { background-position: 0 0; }
  10% { background-position: -5% -10%; }
  20% { background-position: -15% 5%; }
  30% { background-position: 7% -25%; }
  40% { background-position: -5% 25%; }
  50% { background-position: -15% 10%; }
  60% { background-position: 15% 0%; }
  70% { background-position: 0% 15%; }
  80% { background-position: 3% -10%; }
  90% { background-position: -10% 5%; }
}



img {
    opacity: 1;
}

.cml-logo, .cml-logo:hover {
    opacity: 1;
    transition: none;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
  line-height: 1.2;
}

h1 {
  font-size: 3rem;
  color: var(--primary-color);
  text-transform: none;
}

h2 {
  font-size: 2rem;
  color: var(--primary-color);
  text-transform: none;
  position: relative;
  padding-bottom: 10px;
  margin-bottom: 20px;
  display: inline-block;
}

h2:after {
  content: '';
  position: absolute;
  left: 0;
  top: calc(100% + 4px); /* 8px below the bottom of the h2 */
  width: 100%;
  height: 3px;
  background: var(--neural-gradient);
  border-radius: 2px;
}

h3 {
  font-size: 1.5rem;
  color: var(--accent-color);
}

h4 {
  font-size: 1.2rem;
  color: var(--text-dark);
}

p {
  margin-bottom: 1.2rem;
  color: var(--text-light);
  text-align: left;
  line-height: 1.8;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

a:hover {
  color: var(--primary-color);
}

/* Header and Navigation */
#header-wrapper {
  background: var(--header-bg);
  box-shadow: 0 2px 10px var(--shadow-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 2px solid transparent;
  transition: background-color 0.3s ease;
}

#header-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--neural-gradient);
  z-index: 999; /* Lower than #menu a's z-index (1001) */
}

#header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 70px;
}

#menu {
  flex: 1;
  display: flex;
  justify-content: center;
}

#menu ul {
  list-style: none;
  display: flex;
  gap: 5px;
  margin: 0;
  padding: 0;
}

#menu li {
  background: none;
}

#menu a {
  display: block;
  padding: 25px 20px 23px; /* Reduced bottom padding */
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1001;
}

#menu a:before {
  content: '';
  position: absolute;
  bottom: 0; /* Align with parent's bottom */
  left: 50%;
  width: 0;
  height: 3px; /* Same height as blue line */
  background: var(--neural-gradient);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

#menu a:hover:before {
  width: 80%;
  background: var(--text-dark);
}

/* Fix for current page indicator - only apply to actual current page */
/* Remove the default current_page_item styling */
#menu .current_page_item a {
  color: var(--text-dark);
  font-weight: 500;
}

/* Page-specific current page styling */
/* These will be activated based on which HTML file is being viewed */
body.page-home #menu li:nth-child(1) a,
body.page-research #menu li:nth-child(2) a,
body.page-team #menu li:nth-child(3) a,
body.page-publications #menu li:nth-child(4) a,
body.page-courses #menu li:nth-child(5) a,
body.page-resources #menu li:nth-child(6) a,
body.page-games #menu li:nth-child(7) a,
body.page-contact #menu li:nth-child(8) a {
  color: var(--primary-color);
  font-weight: 600;
}

body.page-home #menu li:nth-child(1) a:before,
body.page-research #menu li:nth-child(2) a:before,
body.page-team #menu li:nth-child(3) a:before,
body.page-publications #menu li:nth-child(4) a:before,
body.page-courses #menu li:nth-child(5) a:before,
body.page-resources #menu li:nth-child(6) a:before,
body.page-games #menu li:nth-child(7) a:before,
body.page-contact #menu li:nth-child(8) a:before {
  width: 80%;
  background: var(--text-dark);
}

/* Remove search section completely */
#search {
  display: block !important;
}

#theme-toggle {
    background: var(--primary-color);
    color: var(--bg-white);
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#theme-toggle:hover {
    background: var(--accent-color);
}


/* Logo Section */
#logo {
  width: 100%;
  margin: 0;
  padding: 60px 20px 60px; /* Increased bottom padding */
  text-align: center;
  position: relative;
  background: none;
  height: auto;
  display: flex; /* Added to enable flexbox */
  justify-content: center; /* Centers the whole group horizontally */
  align-items: center; /* Aligns the logo and text vertically in the middle */
  gap: 30px; /* Space between the logo and text */
}

.logo-text-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Left-justifies the text */
}

/* Custom styles for the logo image */
.cml-logo {
  height: 120px;
  width: auto;
}

/* Styling for the title */
#logo h1 {
  font-size: 3.5rem;
  margin: 0;
  animation: fadeInUp 0.8s ease;
  line-height: 1.1;
}

/* Styling for the subtitle */
#logo p {
  color: var(--text-light);
  font-size: 1.1rem;
  font-style: italic;
  text-align: left;
  margin: 0;
  padding-top: 5px;
}

#logo::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 750px;
  height: 750px;
  background: radial-gradient(circle, rgba(91, 143, 217, 0.1) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  z-index: -1;
}

/* Remove the hr element completely */
hr {
  display: none !important;
}

/* Main Content Area */
#page {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg-white);
  border-radius: 50px;
  box-shadow: 0 10px 60px var(--shadow-color);
  margin-bottom: 40px;
  transition: background-color 0.3s ease;
}

#page-bgtop {
  padding: 60px;
  background: var(--bg-white);
  display: flex;
  gap: 60px;
  transition: background-color 0.3s ease;
  border-radius: 50px;
  overflow: hidden;
}

#content {
  flex: 1;
  width: auto;
  float: none;
}

.post {
  margin-bottom: 60px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border-light);
  animation: fadeIn 0.6s ease;
}

.post:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.post .title {
  background: none;
  padding: 0;
  height: auto;
  margin-bottom: 25px;
  position: relative;
}

.post .title a {
  color: var(--primary-color);
  font-size: 2rem;
  font-weight: 700;
  display: inline-block;
  transition: all 0.3s ease;
}

.post .title a:hover {
  /* Hover animation removed */
}

.post .entry {
  padding: 0;
  line-height: 1.8;
}

.post .entry img {
  border-radius: 15px !important;
  box-shadow: 0 5px 20px var(--shadow-color);
  margin: 20px 0;
  max-width: 100%;
  height: auto;
  transition: transform 0.3s ease;
  display: block;
}

.post .entry img:hover {
  transform: scale(1.02);
}

/* Sidebar */
#sidebar {
  width: 300px;
  float: none;
}

#sidebar ul {
  list-style: none;
  padding: 0;
}

#sidebar > ul > li {
  background: var(--sidebar-bg);
  border-radius: 10px;
  padding: 25px;
  margin-bottom: 30px;
  border: 1px solid var(--border-light);
  transition: all 0.3s ease;
}

#sidebar > ul > li:hover {
  box-shadow: 0 5px 20px var(--shadow-hover);
  transform: translateY(-2px);
}

#sidebar h2 {
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-light);
}

#sidebar h2:after {
  display: none;
}

#sidebar li li {
  padding: 12px 0 12px 25px;
  border-bottom: 1px solid var(--border-light);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%237cb3f1' viewBox='0 0 16 16'%3E%3Cpath d='M6 12l4-6H7V4l-4 6h3z'/%3E%3C/svg%3E") no-repeat left center;
  background-size: 14px;
  transition: all 0.3s ease;
  margin: 0;
}

#sidebar li li:hover {
  padding-left: 30px;
  background-position: 5px center;
}

#sidebar li li:last-child {
  border-bottom: none;
}

#sidebar p {
  line-height: 1.6;
  border-left: 3px solid var(--accent-color);
  padding-left: 15px;
  margin: 15px 0;
}

#sidebar h2 a {
  color: inherit;
}

/* Footer */
#footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  text-align: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
  transition: background-color 0.3s ease;
  border-bottom-left-radius: 50px;
  border-bottom-right-radius: 50px;
}

#footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--neural-gradient);
}

#footer p {
  color: var(--footer-text);
  text-align: center;
  margin: 0;
  padding: 0;
  font-weight: normal; /* Ensure the text is not bold */
}

#footer a {
  color: var(--accent-color);
}

/* Team Page Styles */
.team-member-grid {
	display: grid;
	grid-template-columns: 30% 1fr;
	gap: 40px;
	margin-bottom: 40px;
  align-items: center;
  padding-top: 70px; /* For fixed header offset */
  margin-top: -70px; /* For fixed header offset */
}

.post .team-member-grid img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
  border-radius: 30px;
  overflow: hidden;
  display: block;
}

.post .entry pre {
  font-family: 'Inter', sans-serif;
  white-space: pre-wrap;
  background: none;
  padding: 0;
  margin: 0;
  line-height: 1.6;
}

.post .entry img[align="left"] {
  float: left;
  margin-right: 30px;
  margin-bottom: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 20px var(--shadow-color);
}

/* Publications Page */
.post .entry h3 {
  color: var(--primary-color);
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 10px;
  margin: 30px 0 20px;
}


/* Special styling for course prerequisites */
p[style*="color:red"] {
  background: linear-gradient(120deg, rgba(255, 234, 167, 0.1) 0%, rgba(253, 203, 110, 0.1) 100%);
  padding: 10px 20px;
  border-radius: 5px;
  border-left: 4px solid #fdcb6e;
  color: #ffeaa7 !important;
  font-weight: 500;
  margin: 20px 0;
}

/* Light theme override for prerequisites */
[data-theme="light"] p[style*="color:red"] {
  background: linear-gradient(120deg, rgba(253, 203, 110, 0.3) 0%, rgba(251, 166, 45, 0.3) 100%);
  border-left: 4px solid #d68910;
  color: #9c6500 !important;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Responsive Design */
@media (max-width: 1024px) {
  #page-bgtop {
    flex-direction: column;
    padding: 40px;
  }
  
  #sidebar {
    width: 100%;
  }
  
  #logo h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  html {
    scroll-padding-top: 120px;
  }

  body {
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
    background-size: cover, cover, 1000% auto;
  }

  #header {
    flex-direction: column;
    height: auto;
    padding: 12px 12px 6px;
    gap: 12px;
    align-items: stretch;
  }

  #menu {
    width: 100%;
    justify-content: flex-start;
  }
  
  #menu ul {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    padding: 4px 2px 8px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
  }

  #menu ul::-webkit-scrollbar {
    display: none;
  }

  #menu li {
    scroll-snap-align: center;
  }
  
  #menu a {
    padding: 12px 16px;
    font-size: 0.95em;
    min-height: 44px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-light);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #menu a:before {
    display: none;
  }

  body.page-home #menu li:nth-child(1) a,
  body.page-research #menu li:nth-child(2) a,
  body.page-team #menu li:nth-child(3) a,
  body.page-publications #menu li:nth-child(4) a,
  body.page-courses #menu li:nth-child(5) a,
  body.page-resources #menu li:nth-child(6) a,
  body.page-games #menu li:nth-child(7) a,
  body.page-contact #menu li:nth-child(8) a {
    background: var(--neural-gradient);
    border-color: transparent;
    color: var(--text-dark);
    font-weight: 600;
  }

  #search {
    display: none !important;
  }

  #theme-toggle {
    display: none;
  }

  #logo {
    padding: 40px 20px 30px;
    flex-direction: column;
    gap: 16px;
    text-align: center;
    overflow: hidden;
  }

  #logo::before {
    width: 90vw;
    height: 90vw;
    max-width: 360px;
    max-height: 360px;
  }

  .logo-text-wrapper {
    align-items: center;
  }

  #logo h1 {
    font-size: 2.35rem;
    text-align: center;
  }

  #logo p {
    text-align: center;
    font-size: 1.15rem;
  }

  .cml-logo {
    height: 96px;
  }

  #page {
    margin: 0 0 24px;
    border-radius: 0;
    width: 100%;
  }
  
  #page-bgtop {
    padding: 26px 18px 30px;
    border-radius: 0;
    gap: 32px;
  }
  
  .post .title a {
    font-size: 1.75rem;
  }
  
  h1 {
    font-size: 2.2rem;
  }
  
  h2 {
    font-size: 1.7rem;
  }

  h3 {
    font-size: 1.35rem;
  }

  h4 {
    font-size: 1.1rem;
  }

  .team-member-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 120px;
    margin-top: -120px;
  }

  .team-member-grid img {
    margin-bottom: 0;
  }

  .post .team-member-grid img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    height: auto;
  }

  .post .entry img[align="left"] {
    float: none;
    margin: 20px auto;
    display: block;
  }

  .post .entry img {
    margin: 18px 0;
  }

  #page .post .entry ul {
    padding-left: 22px;
  }

  #sidebar .sidebar-team-list {
    display: none;
  }

  #sidebar .sidebar-collaborators {
    display: none;
  }

  #footer {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  button,
  input[type="text"],
  input[type="email"],
  input[type="search"],
  textarea,
  select {
    font-size: 1em;
  }

  button {
    min-height: 44px;
  }

  body .game-embed button {
    padding: 14px 18px;
    font-size: 1em;
  }

  body #game-container {
    font-size: 1em;
  }

  body #results-chart {
    width: 100%;
    max-width: 100%;
    height: 240px;
  }

  #recognition-phase button {
    min-width: 120px;
    margin: 8px 6px;
  }

  #distractor-answer {
    width: 100%;
    max-width: 240px;
  }
}

/* Hover Effects and Interactions */
.post .entry a:not([href*=".pdf"]):hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.post .entry a[href*=".pdf"]::after {
  content: " 📄";
  font-size: 0.9em;
}

/* Loading Animation */
body {
  animation: fadeIn 0.5s ease;
}

/* Research Images Enhancement */
.post .entry img[alt="Positional Code"],
.post .entry img[alt="Brain Activity"],
.post .entry img[alt="Verbal Memory"],
.post .entry img[alt="Neural Basis"] {
  width: 100%;
  max-width: 600px;
  height: auto;
  object-fit: cover;
  margin: 30px auto;
  display: block;
}

/* Contact Info Styling */
.post .entry br + br {
  line-height: 0.5;
}

/* Course Page Enhancements */
.post .entry ul {
  padding-left: 30px;
  margin: 20px 0;
}

.post .entry ul li {
  margin: 10px 0;
  color: var(--text-light);
  position: relative;
}

.post .entry ul li::before {
  /* Custom triangle bullets removed - using standard circular bullets */
}

/* ===== Games Page ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
  margin-top: 32px;
}

.game-card {
  background: var(--sidebar-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--shadow-hover);
}

.game-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.game-card-thumb--brainwave  { background: linear-gradient(135deg, #0f2044 0%, #1a3a6e 50%, #00d68f22 100%); }
.game-card-thumb--memory     { background: linear-gradient(135deg, #1a1230 0%, #2d1b69 50%, #7cb3f122 100%); }
.game-card-thumb--erp        { background: linear-gradient(135deg, #0d2010 0%, #1a4020 50%, #00d68f33 100%); }
.game-card-thumb--recall     { background: linear-gradient(135deg, #1a1020 0%, #3d1a60 50%, #f5a62322 100%); }

.game-card-thumb svg {
  width: 80%;
  height: 80%;
  opacity: 0.7;
}

.game-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.game-card-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.game-card-desc {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.6;
  flex: 1;
  margin-bottom: 16px;
}

.game-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.game-tag {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-light);
  color: var(--text-light);
  border: 1px solid var(--border-light);
}

.game-card-play {
  display: block;
  text-align: center;
  padding: 10px 20px;
  background: var(--neural-gradient);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.game-card-play:hover {
  opacity: 0.85;
  color: #fff;
  text-decoration: none;
}

/* ===== Leaderboard Widget ===== */
.leaderboard-widget {
  background: var(--sidebar-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
  margin-top: 24px;
}

.leaderboard-widget h3 {
  color: var(--primary-color);
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.leaderboard-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.leaderboard-tab {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
}

.leaderboard-tab.active,
.leaderboard-tab:hover {
  background: var(--neural-gradient);
  border-color: transparent;
  color: #fff;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th {
  text-align: left;
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-light);
}

.leaderboard-table td {
  padding: 8px;
  color: var(--text-dark);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-light);
}

.leaderboard-table tr:last-child td {
  border-bottom: none;
}

.leaderboard-rank {
  font-weight: 700;
  color: var(--accent-color);
  width: 32px;
}

.leaderboard-rank--gold   { color: #f5a623; }
.leaderboard-rank--silver { color: #b0b8c8; }
.leaderboard-rank--bronze { color: #cd7c4b; }

.leaderboard-loading {
  text-align: center;
  color: var(--text-light);
  padding: 20px;
  font-size: 0.9rem;
}

.lb-submit-form {
  text-align: center;
  padding: 20px;
}

.lb-submit-form p {
  text-align: center;
  color: var(--text-dark);
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.lb-submit-form input[type="text"] {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  color: var(--text-dark);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  margin-right: 8px;
  width: 200px;
}

.lb-submit-form button {
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  margin: 4px;
  transition: all 0.2s ease;
}

.lb-submit-form #lb-submit-btn {
  background: var(--neural-gradient);
  color: #fff;
  border-color: transparent;
}

.lb-submit-form #lb-skip-btn {
  background: transparent;
  color: var(--text-light);
}

@media (max-width: 768px) {
  .games-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
