/* css/game.css */

/*
  This file contains styles specific to the game.html page.
  It includes styles for the game canvas, game controls, sidebars,
  and game-related modals.
*/

/* ===== GAME PAGE LAYOUT (game.html) ===== */
.game-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-primary); /* Ensure consistent background for game page */
}

/* Specific header for the game page */
.game-header {
  background: linear-gradient(90deg, var(--bg-primary), var(--bg-secondary)); /* Subtle gradient */
  border-bottom: 2px solid var(--primary-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: var(--z-header);
}

.game-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.game-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.game-logo .logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px var(--primary-glow));
}

.game-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: var(--primary-color);
  text-shadow: 0 0 15px var(--primary-glow);
  margin-bottom: 0;
  font-family: var(--font-mono); /* Use mono font for game title */
  font-weight: var(--font-weight-black);
}

.header-stats {
  display: flex;
  gap: var(--space-lg);
}

.header-stats .stat-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-sm) var(--space-md);
  box-shadow: var(--shadow-sm);
}

.header-stats .stat-icon {
  font-size: 1.2rem;
  color: var(--primary-color);
  filter: drop-shadow(0 0 5px var(--primary-glow));
}

.header-stats .stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-stats .stat-value {
  font-size: 1.1rem;
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.game-status {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-primary);
  font-size: 0.9rem;
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--text-muted);
  transition: background-color var(--transition-fast);
}

.status-indicator.ready { background-color: var(--info-color); }
.status-indicator.running { background-color: var(--success-color); animation: pulseGreen 1.5s infinite; }
.status-indicator.paused { background-color: var(--warning-color); animation: pulseYellow 1.5s infinite; }
.status-indicator.game-over { background-color: var(--danger-color); }

@keyframes pulseGreen {
  0%, 100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
}
@keyframes pulseYellow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(255, 193, 7, 0); }
}


/* Main Game Area Layout */
.main-game-area {
  flex-grow: 1;
  padding: var(--space-xl) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3xl); /* Increased gap for more spacing */
}

.game-layout {
  display: flex;
  flex-wrap: wrap; /* Allows wrapping on smaller screens */
  justify-content: center;
  align-items: flex-start; /* Align items to the top */
  gap: var(--space-3xl); /* Increased gap between game areas */
  width: 100%;
  max-width: 1400px; /* Allow overall game layout to be wider for larger canvas */
}

.game-main {
  flex-grow: 1; /* Main game section takes available space */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
  max-width: 1024px; /* Increased max width for the game canvas area */
}

.game-sidebar {
  flex-shrink: 0; /* Prevents shrinking */
  width: 280px; /* Default sidebar width */
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.sidebar-left, .sidebar-right {
  order: 2; /* Default order, will be adjusted by responsive.css */
}

.game-sidebar section {
  padding-bottom: var(--space-lg);
  border-bottom: 1px dashed var(--border-primary);
}

.game-sidebar section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.game-sidebar .section-title {
  font-size: 1.15rem;
  color: var(--primary-color);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  justify-content: flex-start;
}

.game-sidebar .title-icon {
  font-size: 1.1em;
}

/* Power-up Indicator (left sidebar) */
.powerup-section {
  text-align: center;
}

.powerup-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: center;
  margin-top: var(--space-md);
}

.powerup-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.powerup-placeholder .placeholder-icon {
  font-size: 2rem;
  color: var(--text-muted);
  opacity: 0.6;
}

.active-powerup {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--primary-color);
  border-radius: var(--radius-lg);
  padding: var(--space-sm) var(--space-md);
  width: 100%;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.3s ease-out;
}

.active-powerup .powerup-icon {
  font-size: 2rem;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px currentColor);
}

.active-powerup .powerup-details {
  flex-grow: 1;
}

.active-powerup .powerup-name {
  font-size: 1rem;
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.active-powerup .powerup-timer {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.timer-bar {
  flex-grow: 1;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-blue));
  border-radius: var(--radius-full);
  transition: width 0.5s linear;
}

.timer-text {
  font-family: var(--font-mono);
  font-weight: var(--font-weight-medium);
}

/* Next Target Info */
.target-section {
  text-align: center;
}

.target-info {
  margin-top: var(--space-md);
}

.target-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}

.target-icon {
  font-size: 3rem;
  filter: drop-shadow(0 0 15px rgba(255, 68, 68, 0.5));
}

.target-name {
  font-size: 1.2rem;
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.target-points {
  font-size: 0.95rem;
  color: var(--primary-color);
  font-weight: var(--font-weight-bold);
}

/* Mini Achievements */
.achievements-mini {
  text-align: center;
}

.achievement-progress-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.achievement-mini {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--space-xs) var(--space-sm);
  box-shadow: var(--shadow-sm);
}

.achievement-mini .achievement-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.achievement-mini .achievement-info {
  flex-grow: 1;
}

.achievement-mini .achievement-name {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
}

.progress-bar.mini {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 2px;
}

.progress-bar.mini .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-yellow), var(--accent-orange));
  border-radius: var(--radius-full);
  transition: width 0.5s ease-out;
}

/* Game Canvas Area */
.game-canvas-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
  width: 100%;
}

.canvas-container {
  position: relative;
  width: 100%;
  max-width: 1024px; /* Adjusted to make the game field bigger */
  aspect-ratio: 4 / 3; /* 800x600 aspect ratio maintained for visual consistency */
  background: #000; /* Fallback for canvas background */
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow:
    var(--shadow-xl),
    0 0 0 2px var(--border-primary),
    inset 0 0 0 2px rgba(255, 255, 255, 0.1);
  transition: all var(--transition-normal);
}

.canvas-container:focus-within {
  box-shadow:
    var(--shadow-xl),
    0 0 0 3px var(--primary-color), /* Stronger focus border */
    0 0 40px var(--primary-glow), /* Glow on focus */
    inset 0 0 0 2px rgba(255, 255, 255, 0.1);
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #000000;
  image-rendering: pixelated; /* Keep pixel art sharp */
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  cursor: crosshair;
  transition: filter var(--transition-fast);
}

#game-canvas:focus {
  outline: none; /* Remove default outline on focus */
}

/* Performance Indicators */
.performance-indicators {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  display: flex;
  gap: var(--space-md);
  z-index: 10;
}

.fps-counter, .ping-indicator {
  background: rgba(0, 0, 0, 0.7);
  color: var(--primary-color);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: var(--font-weight-medium);
  display: flex;
  align-items: center;
  gap: 4px;
}

.fps-good { color: var(--success-color); }
.fps-medium { color: var(--warning-color); }
.fps-low { color: var(--danger-color); }

.ping-indicator .ping-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success-color); /* Default online */
  border-radius: 50%;
  animation: pingPulse 1.5s infinite;
}

.ping-indicator.low .ping-dot { background-color: var(--warning-color); }
.ping-indicator.high .ping-dot { background-color: var(--danger-color); }

@keyframes pingPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}

/* Game Overlay */
.game-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: all var(--transition-normal);
  text-align: center;
  z-index: 20; /* Above canvas */
}

.game-overlay.active {
  opacity: 1;
  visibility: visible;
}

.game-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.overlay-content {
  text-align: center;
  padding: var(--space-2xl);
  max-width: 500px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), 0 0 50px var(--primary-glow);
  animation: popIn 0.5s var(--transition-spring) forwards;
}

.overlay-header {
  margin-bottom: var(--space-xl);
}

.overlay-title {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: var(--font-weight-black);
  margin-bottom: var(--space-md);
  background: var(--accent-rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: pulse 2s ease-in-out infinite;
  text-shadow: 0 0 15px var(--primary-glow);
}

.overlay-message {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.overlay-body {
  margin-bottom: var(--space-2xl);
  width: 100%;
}

.difficulty-selection {
  margin-top: var(--space-xl);
}

.selection-title {
  font-size: 1.1rem;
  color: var(--primary-color);
  margin-bottom: var(--space-md);
}

.difficulty-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
}

.difficulty-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  flex: 1 1 120px; /* Flexible sizing */
  max-width: 150px;
  box-shadow: var(--shadow-sm);
}

.difficulty-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), var(--primary-shadow);
  border-color: var(--primary-color);
}

.difficulty-btn.active {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--bg-primary);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md), 0 0 20px var(--primary-glow);
  transform: scale(1.02);
}

.difficulty-btn .difficulty-icon {
  font-size: 2rem;
  margin-bottom: var(--space-xs);
  filter: drop-shadow(0 0 10px currentColor);
}

.difficulty-btn.active .difficulty-icon {
  filter: none; /* No extra glow when active, for contrast */
}

.difficulty-name {
  font-size: 1.1rem;
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.difficulty-btn.active .difficulty-name {
  color: var(--bg-primary);
}

.difficulty-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.difficulty-btn.active .difficulty-desc {
  color: rgba(255, 255, 255, 0.8);
}

.overlay-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.overlay-hints {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px dashed var(--border-primary);
}

.hint-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-lg);
}

.hint-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.hint-item kbd {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-inset);
}

/* Particle Effects Container */
.particle-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1; /* Below overlay, above canvas */
}

/* Game Controls Main */
.game-controls-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
  width: 100%;
}

.control-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
}

.primary-controls {
  gap: var(--space-lg); /* Larger gap for main buttons */
}

/* ===== MOBILE TOUCH CONTROLS (game.html) ===== */
.mobile-controls-section {
  display: flex; /* Display by default, hidden by responsive.css on larger screens */
  flex-direction: column;
  align-items: center;
  margin-top: var(--space-2xl);
  width: 100%;
}

.mobile-controls {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
  width: 100%;
  max-width: 400px; /* Max width for mobile controls */
  transition: all var(--transition-normal);
}

.mobile-controls.collapsed {
  max-height: 80px; /* Collapse to show only header */
  overflow: hidden;
  padding-bottom: var(--space-md);
}

.controls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.controls-title {
  font-size: 1.2rem;
  color: var(--primary-color);
  margin-bottom: 0;
}

.controls-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-full);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.controls-toggle:hover {
  background: var(--primary-color);
  color: var(--bg-primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

.toggle-icon {
  font-size: 1.5rem;
  color: var(--text-primary);
  transition: transform var(--transition-fast);
}

.controls-toggle:hover .toggle-icon {
  transform: rotate(15deg);
}


.dpad-container {
  background: var(--bg-secondary);
  border: 2px solid var(--border-primary);
  border-radius: var(--radius-2xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg), inset 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto;
  grid-template-columns: auto auto auto;
  gap: var(--space-sm);
  place-items: center;
}

.dpad-btn {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
  border: 2px solid var(--border-primary);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  position: relative;
  box-shadow: var(--shadow-md), inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

.dpad-btn:active,
.dpad-btn.pressed { /* Class for active visual feedback from JS */
  background: var(--primary-color);
  color: var(--bg-primary);
  transform: scale(0.95);
  box-shadow: 0 0 30px var(--primary-glow), inset 0 2px 4px rgba(0, 0, 0, 0.3);
  border-color: var(--primary-color);
}

.dpad-icon {
  width: 24px;
  height: 24px;
  pointer-events: none;
  fill: currentColor; /* Ensure SVG color matches button text color */
}

.dpad-up { grid-row: 1; grid-column: 2; }
.dpad-left { grid-row: 2; grid-column: 1; }
.dpad-right { grid-row: 2; grid-column: 3; }
.dpad-down { grid-row: 3; grid-column: 2; }

.dpad-center {
  width: 48px;
  height: 48px;
  background: radial-gradient(circle, var(--bg-primary), var(--bg-tertiary));
  border-radius: 50%;
  border: 2px solid var(--border-primary);
  grid-row: 2;
  grid-column: 2;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.dpad-joystick {
  position: absolute;
  inset: 10%;
  background: var(--primary-color);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 20px var(--primary-glow);
  animation: joystickGlow 2s ease-in-out infinite;
}

@keyframes joystickGlow {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}

.touch-actions {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  width: 100%;
}

.touch-btn {
  flex: 1;
  max-width: 150px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.touch-btn:hover {
  background: var(--primary-color);
  color: var(--bg-primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

.swipe-hint {
  text-align: center;
  margin-top: var(--space-md);
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* ===== INFO TABS (bottom of game.html) ===== */
.game-info-bottom {
  width: 100%;
  max-width: 900px;
  margin-top: var(--space-2xl);
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.info-tabs {
  display: flex;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) var(--bg-tertiary);
}

.info-tabs::-webkit-scrollbar {
  height: 4px;
}

.info-tabs::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

.info-tabs::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: var(--radius-full);
}

.info-tabs::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

.info-tab {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-normal);
  font-weight: var(--font-weight-medium);
  position: relative;
  white-space: nowrap;
}

.info-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--primary-color);
  transform: translateX(-50%);
  transition: width var(--transition-normal);
}

.info-tab:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.info-tab.active {
  background: var(--primary-color);
  color: var(--bg-primary);
  font-weight: var(--font-weight-bold);
}

.info-tab.active::after {
  width: 100%;
}

.tab-icon {
  font-size: 1.25rem;
}

.info-content {
  padding: var(--space-2xl);
}

.info-tab-content {
  display: none;
  animation: tabFadeIn var(--transition-normal);
}

.info-tab-content.active {
  display: block;
}

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

/* Tips Carousel */
.tips-carousel {
  position: relative;
  height: 80px; /* Fixed height for carousel */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tip-item {
  position: absolute;
  width: 100%;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease-in-out;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  text-align: left;
}

.tip-item.active {
  opacity: 1;
  transform: translateY(0);
}

.tip-item .tip-icon {
  font-size: 2.5rem;
  color: var(--info-color);
  flex-shrink: 0;
}

.tip-item .tip-text {
  font-size: 1rem;
  color: var(--text-primary);
}

/* Powerup Info Grid */
.powerup-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
}

.powerup-info-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.powerup-info-item .powerup-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.powerup-info-item .powerup-name {
  font-size: 1.1rem;
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.powerup-info-item .powerup-effect {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Controls Info Grid */
.controls-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.control-group-info {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.control-group-info .control-group-title {
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: var(--space-lg);
}

.control-group-info .control-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.control-group-info .control-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.95rem;
  color: var(--text-primary);
}

.control-group-info .control-item kbd {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-inset);
}

.control-group-info .control-item .touch-icon {
  font-size: 1.5rem;
  color: var(--accent-blue);
}

/* Side AdSense Banner (game.html) */
.ad-container.ad-sidebar {
  width: 160px; /* Standard sidebar ad width */
  min-height: 600px; /* Standard sidebar ad height */
  flex-shrink: 0;
  display: none; /* Hidden by default, enable on large screens */
}

/* ===== GAME SPECIFIC ANIMATIONS ===== */
.canvas-wrapper.shake {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--fall-x, 100px), var(--fall-y, 300px)) rotate(720deg);
  }
}

/* Specific styles for elements that trigger animations */
.level-up-effect {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
  animation: levelUp 1s ease-out;
}

@keyframes levelUp {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  20% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}
