/* ============================================================================
   Maze Navigator - Game Specific Styles
   ============================================================================ */

/* Game Layout */
.maze-section {
  height: calc(100vh - 4.25rem);
  max-height: calc(100vh - 4.25rem);
  background: linear-gradient(135deg, var(--logik-green-light), var(--background));
  overflow: hidden;
}

.maze-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.game-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 320px 1fr 380px;
  height: 100%;
  overflow: hidden;
  gap: 0;
}

/* Left side - Activity Info */
.activity-info {
  background: linear-gradient(135deg, var(--surface) 0%, #f8f9fc 100%);
  border-right: 2px solid rgba(86, 177, 75, 0.4);
  padding: 2rem;
  overflow-y: auto;
  min-height: 0;
  box-shadow: inset -2px 0 0 rgba(86, 177, 75, 0.2);
}

.activity-header h2 {
  margin: 0 0 0.75rem 0;
  color: #2d6328;  /* Much darker green for better readability */
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.activity-meta {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  font-size: 0.85rem;
}

.activity-level {
  background: linear-gradient(135deg, var(--logik-green), #4a9e3d);
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(86, 177, 75, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.activity-theme {
  background: linear-gradient(135deg, var(--logik-yellow-light), #fef3cd);
  color: var(--logik-yellow-dark);
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-weight: 500;
  border: 1px solid var(--logik-yellow-dark);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.activity-description h3 {
  margin: 2rem 0 0.75rem 0;
  color: #2d6328;  /* Darker green for headers */
  font-size: 1.125rem;
  font-weight: 600;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid rgba(86, 177, 75, 0.3);
  position: relative;
}

.activity-description h3::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--logik-yellow);
}

.activity-description p {
  margin: 0 0 1.25rem 0;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.activity-description ul {
  margin: 0 0 1.5rem 0;
  padding-left: 0;
  list-style: none;
}

.activity-description li {
  margin: 0.75rem 0;
  color: var(--text-muted);
  line-height: 1.5;
  padding-left: 1.5rem;
  position: relative;
  font-size: 0.9rem;
}

.activity-description li::before {
  content: '▶';
  position: absolute;
  left: 0;
  color: #3a7d32;  /* Darker green for better visibility */
  font-size: 0.8rem;
  top: 0.125rem;
}

.activity-description strong {
  color: #3a7d32;  /* Darker green for better readability */
  font-weight: 600;
  background: rgba(86, 177, 75, 0.12);
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
}

/* Horizontal progress section below maze */
.activity-progress-horizontal {
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 0.75rem;
  border: 1px solid rgba(86, 177, 75, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  max-width: 400px;
  width: 100%;
}

.activity-progress-horizontal .progress-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}

.activity-progress-horizontal .stat-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-direction: row;
}

.stat-separator {
  color: rgba(86, 177, 75, 0.8);
  font-size: 1.5rem;
  line-height: 1;
  user-select: none;
  font-weight: 600;
}

.activity-progress-horizontal .stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  font-weight: 500;
}

.activity-progress-horizontal .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--logik-green);
  line-height: 1;
  min-width: 2ch;
  text-align: center;
}

.activity-progress h3 {
  margin: 0 0 1rem 0;
  color: var(--logik-green);
  font-size: 1.125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.activity-progress h3::before {
  content: '📊';
  font-size: 1rem;
}

.progress-stats {
  display: flex;
  gap: 0.75rem;
}

.progress-stats .stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: white;
  border-radius: 0.75rem;
  border: 1px solid rgba(86, 177, 75, 0.2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.progress-stats .stat-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-color: var(--logik-green);
}

.progress-stats .stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.progress-stats .stat-value {
  color: var(--logik-green);
  font-weight: 600;
  font-size: 1.1rem;
}

/* Center - Maze area */
.maze-main {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  overflow-y: auto;
  min-height: 0;
  align-items: center;
  justify-content: center;
}

.game-header {
  text-align: center;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.game-header h1 {
  color: var(--foreground);
  margin-bottom: 0.5rem;
  font-size: clamp(2rem, 4vw, 2.5rem);
}

.game-subtitle {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 600px;
  margin: 0 auto;
}

/* Right side - Fixed sidebar */
.prompt-sidebar {
  background: linear-gradient(225deg, var(--card) 0%, #f8f9fc 100%);
  border-left: 2px solid rgba(86, 177, 75, 0.4);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  box-shadow: inset 2px 0 0 rgba(86, 177, 75, 0.2);
}

/* Hide drawer handle, activity toggle, and mobile nav toggle on desktop */
.drawer-handle,
.activity-toggle,
.mobile-nav-toggle {
  display: none;
}

@media (max-width: 1024px) {
  /* Navigation updates for mobile */
  .nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
    position: relative;
  }
  
  .logo-section {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
  
  /* Activity toggle on the left */
  .activity-toggle {
    flex-shrink: 0;
    margin-right: 0;
  }
  
  /* Mobile navigation toggle on the right */
  .mobile-nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
  }
  
  .mobile-nav-toggle:hover {
    background-color: rgba(86, 177, 75, 0.1);
  }
  
  .hamburger-line {
    width: 24px;
    height: 2px;
    background-color: var(--logik-green);
    transition: all 0.3s ease;
    margin: 2px 0;
  }
  
  .mobile-nav-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }
  
  .mobile-nav-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-nav-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }
  
  /* Mobile navigation dropdown */
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    padding: 1rem 0;
    z-index: 1000;
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .nav-link {
    padding: 0.75rem 2rem;
    border-bottom: none;
    transition: background-color 0.3s ease;
  }
  
  .nav-link:hover {
    background-color: rgba(86, 177, 75, 0.05);
  }

  .maze-section {
    height: calc(100vh - 4.25rem);
    max-height: calc(100vh - 4.25rem);
  }
  
  .game-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    height: calc(100vh - 4.25rem);
    min-height: auto;
    max-height: calc(100vh - 4.25rem);
  }
  
  .activity-info {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--surface) 0%, #f8f9fc 100%);
  }
  
  .activity-description h3 {
    margin: 1rem 0 0.25rem 0;
  }
  
  .activity-description ul {
    margin: 0.5rem 0;
  }
  
  .activity-description li {
    margin: 0.25rem 0;
  }
  
  .maze-main {
    padding: 1rem;
    min-height: 0;
  }
  
  .maze-grid {
    width: min(320px, 85vw);
    height: min(320px, 85vw);
  }
  
  /* Mobile progress stats */
  .activity-progress-horizontal {
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
  }
  
  .activity-progress-horizontal .progress-stats {
    gap: 1rem;
  }
  
  .activity-progress-horizontal .stat-value {
    font-size: 1.5rem;
  }
  
  .activity-progress-horizontal .stat-label {
    font-size: 0.7rem;
  }
  
  .stat-separator {
    font-size: 1.25rem;
  }
  
  .prompt-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    max-height: 400px;
    min-height: 200px;
    border-left: none;
    border-top: 2px solid rgba(86, 177, 75, 0.3);
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.15), 0 -4px 15px rgba(0, 0, 0, 0.1);
    z-index: 100;
    transform: translateY(calc(100% - 60px));
    transition: transform 0.3s ease;
    background: transparent;
    overflow: hidden;
  }
  
  .prompt-sidebar.expanded {
    transform: translateY(0);
  }
  
  /* Drawer handle - only visible on mobile */
  .drawer-handle {
    display: block;
    background: transparent;
    border: none;
    touch-action: pan-y;
  }
  
  .drawer-handle:active {
    background: rgba(86, 177, 75, 0.1);
  }
  
  /* Mobile left sidebar collapsible */
  .activity-info {
    position: fixed;
    top: 4.25rem;
    left: 0;
    bottom: 0;
    width: 320px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 252, 0.98) 100%);
    border-right: 2px solid rgba(86, 177, 75, 0.4);
    padding: 1.5rem;
    overflow-y: auto;
    backdrop-filter: blur(20px);
  }
  
  .activity-info.expanded {
    transform: translateX(0);
  }
  
  /* Add activity toggle button for mobile nav */
  .activity-toggle {
    background: var(--logik-green);
    color: white;
    border: none;
    border-radius: 6px;
    width: 40px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(86, 177, 75, 0.3);
    transition: all 0.3s ease;
    margin-right: 1rem;
  }
  
  .activity-toggle:hover {
    background: var(--logik-green-hover);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(86, 177, 75, 0.4), 0 3px 6px rgba(0, 0, 0, 0.15);
  }
  
  /* Enhanced mobile sidebar content styling */
  .activity-info .activity-header h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
  }
  
  .activity-info .activity-meta {
    margin-bottom: 1.5rem;
  }
  
  .activity-info .activity-description h3 {
    margin: 1.5rem 0 0.5rem 0;
    font-size: 1rem;
  }
  
  .activity-info .activity-description p {
    font-size: 0.875rem;
    margin-bottom: 1rem;
  }
  
  .activity-info .activity-description li {
    font-size: 0.8rem;
    margin: 0.5rem 0;
    padding-left: 1.25rem;
  }
  
  .activity-info .activity-progress {
    margin-top: 1.5rem;
    padding: 1rem;
  }
  
  .activity-info .activity-progress h3 {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  /* Ensure navigation works properly on very small screens */
  .logo-section .logo-text {
    font-size: 1.2rem;
  }
  
  .activity-toggle {
    width: 36px;
    height: 28px;
  }
  
  .mobile-nav-toggle {
    width: 36px;
    height: 28px;
  }
}

@media (max-width: 375px) {
  /* Ultra-small screens - prevent horizontal scrolling */
  .activity-info {
    width: 100vw;
    max-width: 100vw;
  }
  
  .maze-main {
    padding: 0.25rem;
  }
  
  .maze-wrapper {
    padding: 0;
    margin: 0;
  }
  
  .maze-grid {
    width: min(280px, 95vw);
    height: min(280px, 95vw);
    margin: 0 auto;
  }
  
  .logo-section .logo-text {
    font-size: 1rem;
  }
  
  .activity-toggle {
    width: 32px;
    height: 24px;
  }
  
  .mobile-nav-toggle {
    width: 32px;
    height: 24px;
  }
  
  .hamburger-line {
    width: 20px;
  }
  
  /* Reduce nav container padding on ultra-small screens */
  .nav-container {
    padding: 0 0.5rem;
  }
}

/* ============================================================================
   Maze Grid
   ============================================================================ */

.maze-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.maze-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 0;
  background: var(--primary);
  border: 3px solid var(--primary);
  border-radius: 0.75rem;
  padding: 0;
  width: min(70vh, 80vw);
  height: min(70vh, 80vw);
  aspect-ratio: 1;
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.maze-cell {
  background: linear-gradient(135deg, #C4A57B 0%, #B8975F 50%, #CDB380 100%); /* Dirt path gradient */
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
  aspect-ratio: 1;
}

.maze-cell.wall {
  background: var(--primary);
  overflow: hidden;
}

/* Scale up brick wall images to fill the cell */
.wall img {
  transform: scale(1.5);
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.maze-cell.goal {
  background: var(--logik-green);
  position: relative;
}

/* Gold glow for treasure chests in adventure mode */
.maze-cell.goal img[src*="treasure"] {
  filter: drop-shadow(0 0 15px gold) drop-shadow(0 0 25px #FFD700);
  animation: treasure-glow 2s ease-in-out infinite;
}

@keyframes treasure-glow {
  0%, 100% {
    filter: drop-shadow(0 0 15px gold) drop-shadow(0 0 25px #FFD700);
  }
  50% {
    filter: drop-shadow(0 0 20px gold) drop-shadow(0 0 35px #FFD700) brightness(1.1);
  }
}

.maze-cell.goal.classic-goal::after {
  content: '🎯';
  font-size: 1.5rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Adventure goal should not have the emoji overlay */
.maze-cell.goal.adventure-goal::after {
  display: none;
}

.maze-cell.goal.adventure-goal {
  background: transparent;
  padding: 0;
}

/* Adventure Theme Tiles */
.maze-cell.water {
  background: #E6F3FF;
  padding: 0;
  overflow: hidden;
  position: relative;
}

/* Water sparkle effects */
.maze-cell.water::before,
.maze-cell.water::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, white 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0;
  z-index: 10;
  pointer-events: none;
}

.maze-cell.water::before {
  top: 20%;
  left: 30%;
  animation: sparkle-1 3s ease-in-out infinite;
}

.maze-cell.water::after {
  top: 60%;
  right: 25%;
  animation: sparkle-2 2.5s ease-in-out infinite 1s;
}

@keyframes sparkle-1 {
  0%, 80%, 100% { opacity: 0; transform: scale(0.5); }
  10%, 30% { opacity: 0.8; transform: scale(1.2); }
  50% { opacity: 1; transform: scale(1.5); }
}

@keyframes sparkle-2 {
  0%, 85%, 100% { opacity: 0; transform: scale(0.3); }
  15%, 35% { opacity: 0.9; transform: scale(1.0); }
  60% { opacity: 1; transform: scale(1.3); }
}

/* Water animation for adventure sprites */
.water img {
  animation: water-flow 3s ease-in-out infinite;
  transform: scale(1.3);
  z-index: 1;
  position: relative;
}

/* Stagger water animations for ripple effect */
.water:nth-child(odd) img {
  animation-delay: 0.5s;
}

.water:nth-child(even) img {
  animation-delay: 1s;
}

.water:nth-child(3n) img {
  animation-delay: 1.5s;
}

@keyframes water-flow {
  0%, 100% {
    transform: scale(1.3) translateY(0) translateX(0);
    filter: brightness(1.1) hue-rotate(0deg) saturate(1.2) contrast(1.05);
  }
  20% {
    transform: scale(1.32) translateY(-3px) translateX(1px);
    filter: brightness(1.2) hue-rotate(8deg) saturate(1.3) contrast(1.1);
  }
  40% {
    transform: scale(1.38) translateY(2px) translateX(-2px);
    filter: brightness(0.95) hue-rotate(-12deg) saturate(1.1) contrast(0.95);
  }
  60% {
    transform: scale(1.35) translateY(-1px) translateX(2px);
    filter: brightness(1.15) hue-rotate(15deg) saturate(1.35) contrast(1.15);
  }
  80% {
    transform: scale(1.33) translateY(1px) translateX(-1px);
    filter: brightness(1.05) hue-rotate(-5deg) saturate(1.25) contrast(1.05);
  }
}

.maze-cell.door {
  background: #8B7355;
  padding: 0;
}

.maze-cell.door-opened {
  background: var(--card);
  padding: 0;
}

.maze-cell.portal {
  background: #2C1A3D;
  padding: 0;
  animation: portal-glow 2s ease-in-out infinite alternate;
}

/* Ensure Level 2 cells have no padding for full sprite coverage */
.maze-cell:has(.adventure-sprite) {
  padding: 0;
}

/* Fallback for browsers that don't support :has() */
.maze-cell.player,
.maze-cell.goal.adventure-goal,
.maze-cell.wall,
.maze-cell.water,
.maze-cell.door,
.maze-cell.portal {
  padding: 0;
  margin: 0;
}

/* Override flex centering for sprite containers */
.maze-cell:has(.adventure-sprite),
.maze-cell.player,
.maze-cell.goal.adventure-goal,
.maze-cell.wall,
.maze-cell.water,
.maze-cell.door,
.maze-cell.portal {
  align-items: stretch;
  justify-content: stretch;
}

/* Adventure Sprites */
.adventure-sprite {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  display: block;
  border-radius: 0.25rem; /* Match cell border radius */
  margin: 0;
  padding: 0;
}

.dirt-sprite {
  z-index: 1;
}

.player-sprite {
  z-index: 10;
  position: relative;
  transform: scale(1.2);
}

.maze-cell.player {
  background-image: url('assets/dirt.png');
  background-size: cover;
  background-position: center;
}

.portal-sprite {
  animation: portal-spin 4s linear infinite;
}

@keyframes portal-glow {
  0% { 
    box-shadow: 0 0 5px rgba(155, 89, 182, 0.5);
  }
  100% { 
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.8), 0 0 25px rgba(155, 89, 182, 0.4);
  }
}

.tile-emoji {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.portal-animated {
  animation: portal-spin 3s linear infinite;
}

@keyframes portal-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.adventure-player,
.adventure-goal {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Level 2 special styling */
.maze-cell.wall .tile-emoji {
  color: #666;
}

.maze-cell.player {
  animation: pulse 2s infinite;
}

.player-bug {
  width: 80%;
  height: 80%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s ease-in-out;
  transform: scale(1.2);
}

/* Character movement animation */
.player-bug.moving {
  animation: moveCharacter 0.3s ease-in-out;
}

@keyframes moveCharacter {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1) translateY(-2px);
  }
  100% {
    transform: scale(1);
  }
}

/* Directional movement animations */
.player-bug.moving-right,
.player-sprite.moving-right {
  animation: moveRight 0.3s ease-in-out;
}

.player-bug.moving-left,
.player-sprite.moving-left {
  animation: moveLeft 0.3s ease-in-out;
}

.player-bug.moving-up,
.player-sprite.moving-up {
  animation: moveUp 0.3s ease-in-out;
}

.player-bug.moving-down,
.player-sprite.moving-down {
  animation: moveDown 0.3s ease-in-out;
}

@keyframes moveRight {
  0% { transform: translateX(0) scale(1); }
  25% { transform: translateX(2px) scale(1.05); }
  50% { transform: translateX(4px) scale(1.1) rotateZ(5deg); }
  75% { transform: translateX(2px) scale(1.05); }
  100% { transform: translateX(0) scale(1); }
}

@keyframes moveLeft {
  0% { transform: translateX(0) scale(1); }
  25% { transform: translateX(-2px) scale(1.05); }
  50% { transform: translateX(-4px) scale(1.1) rotateZ(-5deg); }
  75% { transform: translateX(-2px) scale(1.05); }
  100% { transform: translateX(0) scale(1); }
}

@keyframes moveUp {
  0% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-2px) scale(1.05); }
  50% { transform: translateY(-4px) scale(1.1); }
  75% { transform: translateY(-2px) scale(1.05); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes moveDown {
  0% { transform: translateY(0) scale(1); }
  25% { transform: translateY(2px) scale(1.05); }
  50% { transform: translateY(4px) scale(1.1); }
  75% { transform: translateY(2px) scale(1.05); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 215, 0, 0);
  }
}

/* Maze Legend */
.maze-legend {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.legend-icon {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
}

.legend-start {
  background: var(--logik-yellow-light);
  border: 1px solid var(--logik-yellow-dark);
}

.legend-goal {
  background: var(--logik-green);
}

.legend-wall {
  background: var(--primary);
}

/* Adventure Theme Legend Icons */
.legend-water {
  background: linear-gradient(135deg, #4A90E2, #357ABD);
  border: 1px solid #2E5A87;
}

.legend-door {
  background: linear-gradient(135deg, #8B4513, #A0522D);
  border: 1px solid #654321;
}

.legend-portal {
  background: radial-gradient(circle, #9B59B6, #8E44AD);
  border: 1px solid #6C3483;
  animation: legend-portal-glow 2s ease-in-out infinite alternate;
}

@keyframes legend-portal-glow {
  0% { box-shadow: 0 0 2px rgba(155, 89, 182, 0.5); }
  100% { box-shadow: 0 0 6px rgba(155, 89, 182, 0.8); }
}

.legend-adventure-start {
  background: var(--logik-yellow-light);
  border: 1px solid var(--logik-yellow-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.legend-adventure-goal {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border: 1px solid #FF8C00;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

/* Legend Sprite Styling */
.legend-sprite-container {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
}

.legend-sprite {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Legacy game stats - removed, now using activity progress sidebar */

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--logik-green);
}

/* ============================================================================
   Prompt Sidebar
   ============================================================================ */

.prompt-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* AI Assistant */
.ai-assistant {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(86, 177, 75, 0.08) 0%, rgba(86, 177, 75, 0.03) 100%);
  border-bottom: 2px solid rgba(86, 177, 75, 0.5);
  border-left: none;
  border-right: none;
  border-top: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  margin-bottom: 0;
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 3;
  transition: box-shadow 0.3s ease;
}

.ai-header.scrolled {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(86, 177, 75, 0.2);
}

.ai-header-left {
  display: flex;
  align-items: center;
}

.ai-header-actions {
  display: flex;
  gap: 0.5rem;
}

.ai-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background: var(--card);
  padding: 0.25rem;
}

.ai-chat-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: contain;
  background: white;
  padding: 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.ai-header h3 {
  margin: 0;
  color: var(--logik-green);
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--logik-green), #4a9e3d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.025em;
}

.ai-status {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin: 0;
}

.chat-history {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(15px);
  position: relative;
  box-shadow: inset 0 8px 12px -8px rgba(86, 177, 75, 0.3);
}

.chat-history::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to bottom, rgba(248, 249, 252, 0.8), transparent);
  pointer-events: none;
  z-index: 1;
}

.chat-history::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to top, rgba(248, 249, 252, 0.8), transparent);
  pointer-events: none;
  z-index: 1;
}

/* Message Wrappers */
.ai-message-wrapper,
.user-message-wrapper {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.ai-message-wrapper {
  margin-top: 1rem;
}

.ai-message-wrapper:first-child {
  margin-top: 0;
}

.user-message-wrapper {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.375rem;
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.ai-avatar-custom {
  width: 1.5rem;
  height: 1.5rem;
  background: linear-gradient(135deg, var(--logik-green), var(--logik-green-hover));
  border: 1.5px solid var(--primary);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  margin-top: 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Antennae - curved arcs like the logo */
.ai-avatar-custom::before,
.ai-avatar-custom::after {
  content: '';
  position: absolute;
  width: 0.3rem;
  height: 0.3rem;
  background: transparent;
  border: 1.5px solid var(--primary);
  border-radius: 50%;
  top: -0.25rem;
  z-index: 1;
}

.ai-avatar-custom::before {
  left: 0.25rem;
  border-right: none;
  border-bottom: none;
  transform: rotate(-45deg);
}

.ai-avatar-custom::after {
  right: 0.25rem;
  border-left: none;
  border-bottom: none;
  transform: rotate(45deg);
}

/* Face with eyes and smile */
.ai-avatar-custom .face {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 50%;
}

/* Eyes */
.ai-avatar-custom .face::before,
.ai-avatar-custom .face::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--primary);
  border-radius: 50%;
  top: 0.5rem;
}

.ai-avatar-custom .face::before {
  left: 0.375rem;
}

.ai-avatar-custom .face::after {
  right: 0.375rem;
}

/* Smile - using a small curved element */
.ai-avatar-custom .smile {
  position: absolute;
  bottom: 0.375rem;
  left: 50%;
  transform: translateX(-50%);
  width: 0.5rem;
  height: 0.25rem;
  border: 1px solid var(--primary);
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
}

.user-avatar {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--logik-green);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-top: 0.25rem;
}

/* Message Bubbles */
.ai-message,
.user-message {
  padding: 0.75rem;
  border-radius: 0.75rem;
  max-width: 85%;
  word-wrap: break-word;
}

.ai-message {
  background: linear-gradient(135deg, var(--card) 0%, rgba(255, 255, 255, 0.9) 100%);
  border: 1px solid rgba(86, 177, 75, 0.2);
  border-radius: 1rem 1rem 1rem 0.25rem;
  padding: 0 1rem 0.75rem 1rem;
  max-width: 90%;
  align-self: flex-start;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(86, 177, 75, 0.1);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 2;
  color: var(--foreground);
}

.user-message {
  background: linear-gradient(135deg, var(--logik-green) 0%, #4a9e3d 100%);
  color: white;
  border-radius: 1rem 1rem 0.25rem 1rem;
  padding: 1rem 1.25rem;
  max-width: 90%;
  align-self: flex-end;
  box-shadow: 0 4px 12px rgba(86, 177, 75, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 2;
  margin-left: auto;
}

.ai-message p,
.user-message p {
  margin-bottom: 0.5rem;
  margin: 0;
}

.ai-message p:not(:last-child) {
  margin-bottom: 0.5rem;
}

.ai-message ul {
  margin: 0.5rem 0 0 0;
  padding-left: 1.25rem;
}

.ai-message li {
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}

/* Loading Animation */
.loading-message {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--accent);
  border-radius: 0.75rem;
  border-bottom-left-radius: 0.25rem;
  max-width: 85%;
}

.loading-dots {
  display: flex;
  gap: 0.25rem;
}

.loading-dot {
  width: 0.375rem;
  height: 0.375rem;
  background: var(--muted-foreground);
  border-radius: 50%;
  animation: loading-pulse 1.4s infinite ease-in-out;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes loading-pulse {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Typing effect */
.typing-text {
  overflow: hidden;
  border-right: 2px solid var(--logik-green);
  white-space: nowrap;
  animation: typing 0.02s steps(1, end), blink-caret 1s step-end infinite;
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--logik-green); }
}

/* Prompt Input */
.prompt-input-section {
  position: relative;
  padding: 1rem;
  border-top: 2px solid rgba(86, 177, 75, 0.5);
  border-bottom: 2px solid rgba(86, 177, 75, 0.5);
  border-left: none;
  border-right: none;
  flex-shrink: 0;
}

.input-label {
  font-weight: 500;
  color: var(--foreground);
}

.input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.action-buttons-header {
  position: absolute;
  top: 0.44rem;
  right: 1rem;
  z-index: 10;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

/* Icon-only buttons for header actions */
.btn-icon-only {
  padding: 0.5rem;
  min-width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-only .btn-icon {
  width: 1rem;
  height: 1rem;
}

/* Input Container with Embedded Button */
.input-container {
  position: relative;
  display: flex;
  align-items: stretch;
  background: var(--background);
  border: 3px solid rgba(68, 134, 59, 0.7);
  border-radius: 1.5rem;
  transition: all 0.2s ease;
  overflow: hidden;
  box-shadow: 
    inset 8px 8px 20px rgba(68, 134, 59, 0.12),
    inset -8px -8px 20px rgba(255, 255, 255, 0.9),
    inset 8px -8px 20px rgba(68, 134, 59, 0.06),
    inset -8px 8px 20px rgba(255, 255, 255, 0.5);
}


.input-container:focus-within {
  border: 3px solid rgba(56, 177, 75, 0.9);
  box-shadow: 
    inset 10px 10px 25px rgba(56, 177, 75, 0.18),
    inset -10px -10px 25px rgba(255, 255, 255, 0.95),
    inset 10px -10px 25px rgba(56, 177, 75, 0.1),
    inset -10px 10px 25px rgba(255, 255, 255, 0.6),
    0 0 0 3px rgba(56, 177, 75, 0.2);
}

.command-input-large {
  flex: 1;
  padding: 1.25rem 4rem 1.25rem 1.5rem;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-family: inherit;
  color: var(--foreground);
  resize: none;
  min-height: 2.5rem;
  line-height: 1.6;
  transition: height 0.2s ease;
  overflow-y: hidden;
}

.command-input-large:focus {
  outline: none;
}

.command-input-large::placeholder {
  color: var(--muted-foreground);
  font-style: normal;
}

/* Send Button (Inside Input) */
.btn-send {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.75rem;
  background: var(--logik-green);
  color: white;
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-send:hover {
  background: var(--logik-green-hover);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-send:active {
  transform: translateY(-50%) scale(0.95);
}

.btn-send .btn-icon {
  width: 1rem;
  height: 1rem;
}


/* Hint Section */
.hint-section {
  overflow: hidden;
  flex-shrink: 0;
}

.hint-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: none;
  border: none;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hint-toggle:hover {
  background: var(--accent);
  color: var(--foreground);
}

.hint-icon {
  width: 1rem;
  height: 1rem;
}

/* Enhanced Hint Modal Styling */
#hintModal .modal-header {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: white;
  padding: 1.75rem 2rem;
  border-radius: 1rem 1rem 0 0;
}

#hintModal .modal-header h2 {
  color: white;
  font-size: 1.5rem;
  margin: 0;
  font-weight: 700;
}

#hintModal .modal-close {
  color: white;
  opacity: 0.9;
  font-size: 1.75rem;
  top: 1.5rem;
  right: 1.5rem;
  transition: all 0.3s ease;
}

#hintModal .modal-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

#hintModal .modal-body {
  padding: 2rem;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.hint-content {
  padding: 0;
  border: none;
  background: transparent;
}

.hint-content h4 {
  color: #92400e;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #f59e0b;
  position: relative;
}

.hint-content h4::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 30px;
  height: 2px;
  background: #f97316;
}

.hint-content h4:first-child {
  margin-top: 0;
}

.hint-content ul {
  margin: 0 0 1.5rem 0;
  padding-left: 0;
  list-style: none;
}

.hint-content li {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 0.5rem;
  border-left: 4px solid #f59e0b;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  padding-left: 2.5rem;
}

.hint-content li::before {
  content: '💡';
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  font-size: 1rem;
}

.hint-content li strong {
  color: #92400e;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.1);
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
}

.hint-content p {
  color: #78716c;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0.5rem 0;
}

/* ============================================================================
   Success Modal
   ============================================================================ */

.success-modal .modal-content {
  max-width: 36rem;
}

/* Enhanced Modal Styling */
#successModal .modal-header,
#notifyModal .modal-header {
  background: linear-gradient(135deg, var(--logik-green), var(--logik-green-hover));
  color: white;
  padding: 1.75rem 2rem;
  border-radius: 1rem 1rem 0 0;
}

#successModal .modal-header h2,
#notifyModal .modal-header h2 {
  color: white;
  font-size: 1.5rem;
  margin: 0;
}

#successModal .modal-close,
#notifyModal .modal-close {
  color: white;
  opacity: 0.9;
  font-size: 1.75rem;
  top: 1.5rem;
  right: 1.5rem;
}

#successModal .modal-close:hover,
#notifyModal .modal-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

#successModal .modal-body,
#notifyModal .modal-body {
  padding: 2rem;
}

.success-message {
  text-align: center;
  padding: 1rem 0;
}

.success-bug {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  animation: bounce 1s ease-in-out;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.success-message p {
  font-size: 1.125rem;
  color: var(--foreground);
  margin-bottom: 1.5rem;
}

.success-stats {
  background: var(--accent);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.success-stats p {
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--foreground);
}

.success-stats p:last-child {
  margin-bottom: 0;
}

.success-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Notify Modal Styling */
#notifyModal .modal-content {
  max-width: 42rem;
  width: 95%;
}

@media (max-height: 700px) {
  #notifyModal .modal-content {
    max-height: 100vh;
    height: 100vh;
    margin: 0 auto;
    border-radius: 0;
    overflow-y: auto;
  }
}

@media (max-width: 640px) {
  #notifyModal .modal-content {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
  }
  
  #notifyModal .modal-body {
    padding: 1rem;
  }
  
  #notifyModal .notify-content {
    padding: 1.5rem;
    margin: 1rem 0;
  }
}

.notify-content {
  margin: 1.5rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, var(--logik-green-light), rgba(86, 177, 75, 0.05));
  border-radius: 1rem;
  border: 2px solid rgba(86, 177, 75, 0.3);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.notify-content h4 {
  color: var(--foreground);
  margin-bottom: 1rem;
  text-align: center;
  font-size: 1.25rem;
}

.notify-content p {
  color: var(--foreground);
  text-align: center;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-size: 1rem;
}

.notify-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem auto;
  max-width: 24rem;
}

.notify-form .form-input {
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.notify-form .form-input:focus {
  border-color: var(--logik-green);
  box-shadow: 0 0 0 3px rgba(86, 177, 75, 0.1);
}

.notify-form .btn-primary {
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.notify-privacy {
  font-size: 0.8rem !important;
  color: var(--muted-foreground) !important;
  font-style: italic;
  margin-bottom: 0 !important;
  text-align: center;
  opacity: 0.8;
}

/* ============================================================================
   Navigation Updates
   ============================================================================ */

.nav-link-active {
  color: var(--logik-green) !important;
  font-weight: 600;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
  .game-header {
    margin-bottom: 1rem;
  }
  
  .game-header h1 {
    font-size: 1.75rem;
  }
  
  .game-subtitle {
    font-size: 0.95rem;
  }
  
  .maze-wrapper {
    padding-bottom: 80px; /* Space for collapsed drawer */
  }
  
  .maze-grid {
    width: min(400px, 85vw);
    grid-gap: 0;
    padding: 0;
  }
  
  .maze-cell.goal::after {
    font-size: 1rem;
  }
  
  .maze-legend {
    gap: 0.75rem;
    font-size: 0.8rem;
  }
  
  .legend-item {
    font-size: 0.75rem;
  }
  
  /* Legacy game-stats removed */
  
  .stat-item {
    flex-direction: row;
    gap: 0.5rem;
  }
  
  .stat-label {
    font-size: 0.75rem;
  }
  
  .stat-value {
    font-size: 1.25rem;
  }
  
  .ai-header {
    padding: 0.75rem;
  }
  
  .ai-header h3 {
    font-size: 1rem;
  }
  
  .ai-status {
    font-size: 0.75rem;
  }
  
  .chat-history {
    padding: 0.75rem;
    font-size: 0.8rem;
  }
  
  .ai-message,
  .user-message {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
  
  .prompt-input-section {
    padding: 0.75rem;
  }
  
  .input-label {
    font-size: 0.875rem;
  }
  
  .command-input-large {
    padding: 1rem 3.5rem 1rem 1rem;
    min-height: 3.5rem;
    font-size: 0.9rem;
  }
  
  .btn-send {
    width: 2.25rem;
    height: 2.25rem;
    right: 0.75rem;
  }
}

@media (max-width: 640px) {
  /* Hide nav links on very small screens */
  .nav-links {
    display: none;
  }
  
  .logo-section {
    margin: 0 auto;
  }
  
  .maze-section {
    padding-top: 0.5rem;
  }
  
  .maze-main {
    padding: 0.5rem;
  }
  
  .game-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
  }
  
  .game-subtitle {
    font-size: 0.875rem;
    line-height: 1.3;
  }
  
  .maze-grid {
    width: min(320px, 90vw);
    padding: 0;
    border-width: 2px;
  }
  
  .maze-legend {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .legend-item {
    font-size: 0.7rem;
  }
  
  .legend-icon {
    width: 0.875rem;
    height: 0.875rem;
  }
  
  /* Legacy game-stats removed */
  
  .stat-value {
    font-size: 1.125rem;
  }
  
  /* Modal adjustments */
  #successModal .modal-content,
  #notifyModal .modal-content {
    width: 100%;
    height: 100vh;
    margin: 0;
    border-radius: 0;
  }
  
  .modal-header {
    padding: 1.25rem 1rem;
  }
  
  .modal-header h2 {
    font-size: 1.25rem;
  }
  
  .modal-body {
    padding: 1.25rem 1rem;
  }
  
  /* Prompt sidebar adjustments */
  .prompt-sidebar {
    height: 50%;
    max-height: 350px;
  }
  
  .ai-header {
    padding: 0.6rem;
  }
  
  .ai-header h3 {
    font-size: 0.9rem;
  }
  
  .btn-icon-only {
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0.375rem;
  }
  
  .btn-icon-only .btn-icon {
    width: 0.875rem;
    height: 0.875rem;
  }
}

/* ============================================================================
   Connected Component Outlines
   ============================================================================ */

/* Wall outlines - solid pulsing border */
.wall-outline {
  position: relative;
  z-index: 10;
}

.wall-outline-top {
  filter: drop-shadow(0 -3px 6px rgba(0, 0, 0, 1));
}

.wall-outline-right {
  filter: drop-shadow(3px 0 6px rgba(0, 0, 0, 1));
}

.wall-outline-bottom {
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 1));
}

.wall-outline-left {
  filter: drop-shadow(-3px 0 6px rgba(0, 0, 0, 1));
}


/* Corner radius for smooth connected outlines */
.wall-outline.wall-outline-top.wall-outline-left {
  border-top-left-radius: 4px;
}

.wall-outline.wall-outline-top.wall-outline-right {
  border-top-right-radius: 4px;
}

.wall-outline.wall-outline-bottom.wall-outline-left {
  border-bottom-left-radius: 4px;
}

.wall-outline.wall-outline-bottom.wall-outline-right {
  border-bottom-right-radius: 4px;
}

.water-outline.water-outline-top.water-outline-left {
  border-top-left-radius: 6px;
}

.water-outline.water-outline-top.water-outline-right {
  border-top-right-radius: 6px;
}

.water-outline.water-outline-bottom.water-outline-left {
  border-bottom-left-radius: 6px;
}

.water-outline.water-outline-bottom.water-outline-right {
  border-bottom-right-radius: 6px;
}
