:root {
  --bg: #050608;
  --bg-alt: #0b0d11;
  --card: #10121a;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --accent: #f6e05e;
  --accent-soft: rgba(246, 224, 94, 0.14);
  --text: #f9fafb;
  --muted: #9ca3af;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --shadow-soft: 0 22px 55px rgba(0, 0, 0, 0.7);
  --max-width: 1040px;
  --transition-fast: 160ms ease-out;
  --transition-med: 260ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* RESET / BASE */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  scroll-behavior: smooth;
  cursor: auto;
}

/* ANIMATED BACKGROUND */
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 0% 0%, #171b2a 0, #050608 45%) fixed,
    radial-gradient(circle at 100% 100%, #111827 0, #020617 55%) fixed;
  background-blend-mode: screen;
  animation: gradientShift 18s ease-in-out infinite alternate;
  position: relative;
  overflow-x: hidden;
}

@keyframes gradientShift {
  0% { background-position: 0% 0%, 100% 100%; }
  50% { background-position: 20% 10%, 80% 90%; }
  100% { background-position: 40% 20%, 60% 80%; }
}

/* GRID OVERLAY */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 40px 40px;
  mix-blend-mode: soft-light;
  opacity: 0.55;
  animation: gridScroll 24s linear infinite;
}

@keyframes gridScroll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-40px, -40px, 0); }
}

.page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 20px 64px;
  position: relative;
  z-index: 1;
}

/* HEADER / NAV */
.site-header {
  position: sticky; top: 12px; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; margin-bottom: 40px;
  border-radius: var(--radius-pill);
  background: rgba(5, 6, 8, 0.94);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(18px);
}

.logo {
  font-weight: 600; letter-spacing: 0.12em; font-size: 0.9rem;
  text-transform: uppercase; position: relative;
  text-decoration: none; color: var(--text);
}
.logo span { color: var(--accent); }
.logo::after {
  content: ""; position: absolute; inset: -4px; border-radius: inherit;
  border: 1px solid rgba(246, 224, 94, 0.25); opacity: 0; pointer-events: none;
  animation: logoPulse 7s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 40% { opacity: 0; transform: scale(0.96); }
  50% { opacity: 0.35; transform: scale(1.02); }
  60%, 100% { opacity: 0; transform: scale(0.98); }
}

.nav { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.85rem; }
.nav a {
  position: relative; text-decoration: none; color: var(--muted);
  padding: 6px 12px; border-radius: 999px; border: 1px solid transparent;
  transition: all 0.26s ease;
}
.nav a::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 4px;
  height: 2px; border-radius: 999px; background: var(--accent);
  transform: scaleX(0); opacity: 0; transition: transform 0.26s, opacity 0.26s;
}
.nav a:hover {
  color: var(--text); border-color: var(--border-subtle);
  background: rgba(15, 23, 42, 0.9); transform: translateY(-1px);
}
.nav a.active {
  color: var(--text); background: rgba(15, 23, 42, 0.9);
  border-color: var(--accent-soft);
}
.nav a.active::after { transform: scaleX(1); opacity: 1; }

/* HERO GENERAL (Used on inner pages) */
.page-hero {
  position: relative; padding: 48px 32px; margin-bottom: 56px;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, rgba(246, 224, 94, 0.35), transparent 55%),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.22), transparent 60%),
    linear-gradient(135deg, #050608 0, #050608 40%, #020617 100%);
  border: 1px solid rgba(250, 250, 250, 0.15);
  box-shadow: var(--shadow-soft);
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 32px; overflow: hidden;
}

/* Orbit light & Scanlines ONLY for .page-hero (Removed from Landing Hero) */
.page-hero::before {
  content: ""; position: absolute; width: 280px; height: 280px;
  border-radius: 50%; background: radial-gradient(circle, rgba(246, 224, 94, 0.18), transparent 70%);
  filter: blur(4px); animation: orbitLight 14s linear infinite; pointer-events: none;
}
.page-hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(to bottom, rgba(15, 23, 42, 0) 0, rgba(15, 23, 42, 0.45) 1px, rgba(15, 23, 42, 0) 2px);
  background-size: 100% 3px; opacity: 0.35; mix-blend-mode: soft-light;
  pointer-events: none; animation: scanlines 2.2s linear infinite;
}

@keyframes orbitLight {
  0% { transform: translate(-40%, -60%); opacity: 0.7; }
  25% { transform: translate(60%, -50%); opacity: 0.9; }
  50% { transform: translate(70%, 40%); opacity: 0.7; }
  75% { transform: translate(-30%, 50%); opacity: 0.6; }
  100% { transform: translate(-40%, -60%); opacity: 0.7; }
}
@keyframes scanlines {
  0% { background-position-y: 0; } 100% { background-position-y: 3px; }
}

/* === LANDING HERO (CENTERED & CLEAN) === */
.hero.landing-hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 65vh;
  background: transparent; border: none; box-shadow: none; padding: 0;
}
.hero-main {
  display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 800px;
}
.hero-main h1, .page-hero h1 {
  font-size: clamp(2.4rem, 3.3vw + 0.8rem, 3.4rem);
  margin: 8px 0 16px; line-height: 1.02; letter-spacing: -0.02em;
}
.hero-main h1 span, .page-hero h1 span { color: var(--accent); }

.hero-subtitle {
  color: var(--muted); max-width: 32rem; font-size: 0.98rem; line-height: 1.6;
  margin-left: auto; margin-right: auto;
}

.eyebrow {
  text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.74rem; color: var(--muted);
}

/* Landing specific layout */
.landing-cta {
  display: flex; justify-content: center; gap: 16px; margin-top: 26px; width: 100%;
}
.landing-tags {
  display: flex; justify-content: center; gap: 10px; margin-top: 24px;
}

/* META CARDS */
.hero-meta { display: flex; flex-direction: column; gap: 14px; }
.meta-card {
  padding: 14px 16px; border-radius: 14px;
  background: rgba(15, 23, 42, 0.9); border: 1px solid var(--border-subtle);
  font-size: 0.82rem; transition: all 0.26s ease;
  animation: floatLight 10s ease-in-out infinite;
}
.hero-meta .meta-card:nth-child(2) { animation-delay: 2.5s; }
@keyframes floatLight {
  0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); }
}
.meta-card:hover {
  border-color: rgba(246, 224, 94, 0.45);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.9);
  background: linear-gradient(135deg, rgba(246, 224, 94, 0.08), #020617);
}
.meta-card .label { display: block; text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.7rem; color: var(--muted); margin-bottom: 6px; }
.meta-card .value { font-weight: 500; }

/* GLITCH TEXT */
.glitch-text { position: relative; display: inline-block; text-shadow: 0 0 10px rgba(246, 224, 94, 0.6); animation: glitch 1.9s infinite; }
.glitch-text::before, .glitch-text::after {
  content: attr(data-text); position: absolute; top: 0; left: 0; opacity: 0.6; clip-path: inset(0 0 0 0);
}
.glitch-text::before { color: #22c55e; transform: translate(-1px, -1px); mix-blend-mode: screen; }
.glitch-text::after { color: #38bdf8; transform: translate(1px, 1px); mix-blend-mode: screen; }

@keyframes glitch {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(2px, -1px); }
  40% { transform: translate(-2px, 1px); }
  60% { transform: translate(1px, -1px); }
  80% { transform: translate(-1px, 1px); }
}

/* SECTIONS & CARDS */
main { margin-top: 16px; }
.section { margin: 56px 0; }
.section-narrow { max-width: 640px; }
.text-muted { color: var(--muted); }

.card {
  background: var(--bg-alt); border-radius: var(--radius-md);
  padding: 22px 22px 20px; border: 1px solid var(--border-subtle);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  transition: all 0.26s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.tilt-card { transform-style: preserve-3d; --rx: 0deg; --ry: 0deg; --tz: 0px; transform: perspective(800px) rotateX(var(--rx)) rotateY(var(--ry)) translateZ(var(--tz)); }
.card:hover {
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.85); border-color: var(--accent-soft);
  background: linear-gradient(135deg, rgba(246, 224, 94, 0.06), #020617);
}

.grid-2 { display: grid; gap: 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 24px; grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* BUTTONS */
.btn {
  --tx: 0px; --ty: 0px; display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; border-radius: var(--radius-pill); border: 1px solid transparent;
  font-size: 0.86rem; text-decoration: none; cursor: pointer;
  transform: translate3d(var(--tx), var(--ty), 0);
  transition: background 0.26s, color 0.26s, border-color 0.26s, box-shadow 0.26s, transform 0.12s;
}
.btn.primary { background: var(--accent); color: #111827; font-weight: 500; box-shadow: 0 14px 40px rgba(246, 224, 94, 0.35); }
.btn.primary:hover { box-shadow: 0 20px 55px rgba(246, 224, 94, 0.45); }
.btn.ghost { border-color: rgba(250, 250, 251, 0.22); background: rgba(15, 23, 42, 0.95); color: var(--text); }
.btn.ghost:hover { background: rgba(31, 41, 55, 1); }
.click-animate.clicked { transform: translate3d(var(--tx), calc(var(--ty) + 1px), 0) scale(0.97); filter: brightness(0.96); }
.btn.ripple { position: relative; overflow: hidden; }
.ripple-circle {
  position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.25);
  transform: scale(0); animation: ripple 450ms ease-out; pointer-events: none;
}
@keyframes ripple { to { transform: scale(3); opacity: 0; } }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 0.76rem; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(148, 163, 184, 0.5); color: var(--muted); background: rgba(15, 23, 42, 0.9); }

/* FOOTER */
.site-footer {
  margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--border-subtle);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  font-size: 0.8rem; color: var(--muted);
}
.footer-right { display: flex; gap: 5px; align-items: center; }

/* Footer Trap Link - UPDATED to be invisible/seamless */
#trap-trigger { color: inherit; text-decoration: none; cursor: pointer; }

/* SCROLL REVEAL */
.reveal { opacity: 0; transform: translateY(18px) translateZ(0); transition: opacity 520ms ease-out, transform 520ms ease-out; }
.reveal.visible { opacity: 1; transform: translateY(0) translateZ(0); }

/* CUSTOM CURSOR */
a:hover, button:hover, .btn:hover, .click-animate:hover { cursor: url('sword.svg') 8 2, pointer; }

/* CHAOS MODE */
body.chaos-mode { animation: chaosHue 0.35s infinite alternate; filter: hue-rotate(90deg) contrast(1.6) saturate(1.8); }
body.chaos-mode .page-wrapper { filter: blur(2px); transform: scale(1.02); }
@keyframes chaosHue {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-4px, 3px) rotate(-0.4deg); }
  50% { transform: translate(4px, -3px) rotate(0.4deg); }
  75% { transform: translate(-2px, 2px) rotate(-0.7deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
.trap-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: repeating-linear-gradient(0deg, #000, #000 2px, #020617 2px, #020617 4px),
              radial-gradient(circle at center, rgba(250, 204, 21, 0.18), transparent 55%);
  display: flex; align-items: center; justify-content: center; mix-blend-mode: screen; pointer-events: none;
}
.trap-message {
  pointer-events: auto; font-size: clamp(2.2rem, 5vw + 1rem, 4.2rem); font-weight: 800; color: #f9fafb;
  text-align: center; text-transform: uppercase; letter-spacing: 0.25em; padding: 0 1.5rem;
  text-shadow: 0 0 10px rgba(248, 250, 252, 0.9), 0 0 25px rgba(250, 204, 21, 0.9);
  animation: trapGlitch 0.7s infinite steps(2, jump-start);
}
@keyframes trapGlitch {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 3px) skewX(-8deg); }
  40% { transform: translate(6px, -3px) skewX(8deg); }
}
.chaos-target {
  animation: elementChaos 0.2s infinite alternate; mix-blend-mode: screen;
  text-shadow: 0 0 6px rgba(248, 250, 252, 0.9), 0 0 14px rgba(250, 204, 21, 0.9);
}
@keyframes elementChaos {
  0% { transform: translate(-4px, -2px) rotate(-1deg) scale(0.98); filter: hue-rotate(60deg); }
  100% { transform: translate(4px, 2px) rotate(1deg) scale(1.05); filter: hue-rotate(180deg); }
}

/* =========================================
   PAGE LAYOUTS & UPDATES
   ========================================= */

/* ABOUT PAGE: CENTERED STACK */
.about-single-col {
  max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; gap: 2.5rem; align-items: center;
}
.hero-meta.horizontal {
  flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 1.5rem; width: 100%;
}
.about-content { width: 100%; }

/* SKILLS: HOVER EFFECTS & LAYOUT */
.spec-sheet { display: flex; flex-direction: column; }
.spec-row {
  display: grid; grid-template-columns: 250px 1fr; gap: 2rem; padding: 2rem 0;
  border-bottom: 1px solid var(--border-subtle); align-items: center;
}
.spec-row:first-child { border-top: 1px solid var(--border-subtle); }
.spec-title { font-size: 1.2rem; font-weight: 600; color: var(--text); }
.spec-desc { font-size: 0.9rem; color: var(--muted); margin-top: 0.5rem; line-height: 1.4; }

.tag { transition: all 0.2s ease-out; cursor: default; }
.tag:hover {
  border-color: var(--accent); color: var(--text);
  background: rgba(246, 224, 94, 0.15); transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(246, 224, 94, 0.2);
}

/* PROJECTS: ZIG-ZAG LAYOUT */
.zigzag-grid { display: flex; flex-direction: column; gap: 4rem; }
.zigzag-item { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.project-visual {
  background: var(--bg-alt); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); height: 200px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-family: monospace; position: relative; overflow: hidden;
}
.project-visual::before {
  content: "// SYSTEM ONLINE \000A >> INITIALIZING... \000A >> 200 OK";
  white-space: pre; opacity: 0.1; font-size: 0.8rem; position: absolute; left: 20px; top: 20px;
}

/* EXPERIENCE PAGE TIMELINE */
.timeline {
  display: flex; flex-direction: column; gap: 32px;
  border-left: 1px solid var(--border-subtle); padding-left: 20px;
}
.timeline-item { position: relative; padding-left: 4px; }
.timeline-item::before {
  content: ""; position: absolute; left: -26px; top: 1.5rem;
  width: 11px; height: 11px; border-radius: 999px;
  background: var(--accent); box-shadow: 0 0 0 7px rgba(246, 224, 94, 0.18);
}
.timeline-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.timeline-date {
  font-size: 0.85rem; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}
.timeline-role { font-size: 1.1rem; font-weight: 600; color: var(--text); }
.timeline p { margin: 0; color: var(--muted); line-height: 1.6; }

/* CONTACT PAGE: CENTERED & CLEAN */
.contact-card { padding: 2.5rem; }
.contact-form { display: flex; flex-direction: column; gap: 1.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; text-align: left; }
.form-group label {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 500;
}
.contact-form input, .contact-form textarea {
  width: 100%; background: rgba(5, 6, 8, 0.6); border: 1px solid var(--border-subtle);
  border-radius: 8px; padding: 12px 16px; color: var(--text);
  font-family: inherit; font-size: 0.95rem; transition: all 0.2s ease;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px rgba(246, 224, 94, 0.3); background: rgba(5, 6, 8, 0.9);
}
.clean-link {
  color: var(--accent); text-decoration: none; font-weight: 500; position: relative; transition: color 0.2s;
}
.clean-link::after {
  content: ''; position: absolute; width: 100%; height: 1px; bottom: -2px; left: 0;
  background-color: var(--accent); transform: scaleX(0); transform-origin: bottom right; transition: transform 0.25s ease-out;
}
.clean-link:hover::after { transform: scaleX(1); transform-origin: bottom left; }

@media (min-width: 900px) {
  .zigzag-item { grid-template-columns: 1fr 1fr; align-items: center; gap: 4rem; }
  .zigzag-item:nth-child(even) .project-content { order: -1; text-align: right; }
  .zigzag-item:nth-child(even) .project-visual { order: 1; }
  .zigzag-item:nth-child(even) .tag-row { justify-content: flex-end; }
}

@media (max-width: 900px) {
  .split-layout, .spec-row { grid-template-columns: 1fr; gap: 1.5rem; }
  .sticky-header { position: relative; top: 0; margin-bottom: 2rem; }
  .zigzag-item:nth-child(even) .project-content { text-align: left; }
  .zigzag-item:nth-child(even) .tag-row { justify-content: flex-start; }
}

@media (max-width: 600px) {
  .hero-meta.horizontal { flex-direction: column; align-items: stretch; }
  .form-row { grid-template-columns: 1fr; }
  .contact-card { padding: 1.5rem; }
}



/* =========================================
   CONTACT PAGE FIXES
   ========================================= */

/* Force the Page Hero to center its content (overrides the default grid) */
.page-hero.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Ensure the text container is centered and not too wide */
.page-hero.centered .hero-main {
  align-items: center;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
}

/* Ensure the subtitle is centered */
.page-hero.centered .hero-subtitle {
  margin-left: auto;
  margin-right: auto;
}



/* PROJECTS: ZIG-ZAG LAYOUT */
.zigzag-grid {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.zigzag-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

/* The Container for the Image */
.project-visual {
  background: var(--bg-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  /* Height is auto now to fit image, or fixed if you prefer uniform rows */
  height: 250px; 
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden; /* Ensures image doesn't spill out */
  padding: 0; /* Removed padding so image hits edges */
}

/* The Image itself */
.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensures image fills the box without stretching */
  transition: transform 0.5s ease, opacity 0.3s ease;
  opacity: 0.8; /* Slightly dim by default to blend with dark theme */
}

/* Hover Effect: Brighten and Zoom slightly */
.project-visual:hover .project-img {
  opacity: 1;
  transform: scale(1.03);
}

/* Remove the old ::before text content code */
.project-visual::before {
  display: none;
}

@media (min-width: 900px) {
  .zigzag-item {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
  }
  /* Even items: Text on left */
  .zigzag-item:nth-child(even) .project-content {
    order: -1; 
    text-align: right;
  }
  .zigzag-item:nth-child(even) .project-visual {
    order: 1;
  }
  /* Align tags for right-aligned text */
  .zigzag-item:nth-child(even) .tag-row {
    justify-content: flex-end;
  }
}

@media (max-width: 900px) {
  .zigzag-item:nth-child(even) .project-content { text-align: left; }
  .zigzag-item:nth-child(even) .tag-row { justify-content: flex-start; }
}




/* =========================================
   CHAOS MODE & SNAKE TRAP (FIXED BOTTOM)
   ========================================= */

/* 1. The Glitch State */
body.chaos-mode {
  filter: hue-rotate(90deg) contrast(1.6) saturate(1.8);
  overflow: hidden;
}

/* 2. Shake the CONTENT (Initial 2s only) */
body.chaos-mode .page-wrapper {
  animation: chaosShake 0.35s infinite alternate;
  filter: blur(2px);
  pointer-events: none;
}

/* 3. FORCE STOP ALL SHAKING when Game Starts */
body.game-active,
body.game-active .page-wrapper,
body.game-active * {
  animation: none !important;       /* Kill all movement */
  transform: none !important;       /* Reset positions */
  transition: none !important;      /* Kill transitions */
}

/* Dim background to focus on game */
body.game-active .page-wrapper {
  filter: blur(5px) grayscale(80%) !important;
  opacity: 0.3;
}

@keyframes chaosShake {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-4px, 3px) rotate(-0.4deg); }
  50% { transform: translate(4px, -3px) rotate(0.4deg); }
  75% { transform: translate(-2px, 2px) rotate(-0.7deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* 4. The Trap Overlay - ALIGNED TO BOTTOM */
.trap-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: flex-end; /* Pushes content to the bottom */
  justify-content: center;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.5s ease-out;
  padding-bottom: 5vh; /* Lift slightly off the bottom edge */
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 5. Snake Game Layout */
.snake-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
  width: 100%;
  max-width: 500px;
  background: rgba(10, 12, 16, 0.9); /* Dark backing to make text pop */
  padding: 20px;
  border-radius: 12px 12px 0 0; /* Rounded top corners */
  border-top: 1px solid #ef4444;
}

.trap-message {
  font-size: 2rem;
  font-weight: 800;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
  margin: 0;
  text-align: center;
}

/* Instruction Box */
.game-instructions {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--accent);
  padding: 8px 16px;
  border-radius: 4px;
  text-align: center;
  width: 100%;
  margin-bottom: 5px;
}

.game-instructions h3 {
  color: var(--accent);
  margin: 0;
  font-size: 1rem;
  text-transform: uppercase;
}

.game-instructions p {
  color: #ccc;
  font-size: 0.8rem;
  margin: 4px 0 0 0;
  font-family: monospace;
}

#snake-canvas {
  background-color: rgba(5, 6, 8, 1);
  border: 2px solid #ef4444;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
  image-rendering: pixelated;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1 / 1;
}

.snake-score {
  font-family: monospace;
  font-size: 1.5rem;
  font-weight: bold;
  color: #fff;
}