/* Common Styles */
body {
  margin: 0;
  padding: 20px;
  font-family: Arial, sans-serif;
  background-color: #f0f0f0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  text-align: center;
  padding: 30px 20px;
  background: #333;
  color: white;
  margin-bottom: 40px;
}

.site-header h1 {
  margin: 0;
  font-size: 2.5em;
}

.site-header p {
  margin: 10px 0 0;
  font-size: 1.2em;
  opacity: 0.9;
}

.game-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

canvas {
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,0,0,0.2);
  max-width: 100%;
}

.score-container {
  padding: 20px;
  background: #1a1a1a;
  border: 2px solid #333;
  min-width: 200px;
  border-radius: 10px;
  color: white;
  box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

#scoreHistory {
  list-style-type: none;
  padding: 0;
}

#scoreHistory li {
  padding: 5px 0;
  border-bottom: 1px solid #333;
}

.clear-buttons-container {
  display: flex;
  gap: 10px;
  margin: 20px auto;
  justify-content: center;
  max-width: 800px;
}

.clear-button {
  padding: 8px 15px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.clear-button:hover {
  background-color: #c82333;
}

.reset-button {
  padding: 8px 15px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.reset-button:hover {
  background-color: #218838;
}

/* Modern Menu */
.modern-menu {
  background: rgba(51, 51, 51, 0.95);
  padding: 15px 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s ease-in-out;
}

.modern-menu.hidden {
  transform: translateY(-100%);
}

.menu-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.menu-logo {
  color: white;
  text-decoration: none;
  font-size: 1.5em;
  font-weight: bold;
  transition: color 0.3s ease;
}

.menu-logo:hover {
  color: #4CAF50;
}

.menu-items {
  display: flex;
  gap: 20px;
  position: relative;
}

.game-category {
  position: relative;
}

.game-category:hover .submenu {
  display: block;
}

.category-label {
  display: block;
  padding: 8px 15px;
  font-weight: bold;
  color: white;
  cursor: pointer;
}

.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(51, 51, 51, 0.95);
  min-width: 200px;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 1000;
}

.menu-items a {
  color: white;
  text-decoration: none;
  padding: 10px 15px;
  display: block;
  transition: background 0.3s ease;
}

.menu-items a:hover {
  background: rgba(255,255,255,0.1);
}

.menu-items a:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.menu-toggle {
  display: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.menu-toggle:hover {
  transform: scale(1.1);
}

/* Modern FAQ Section */
.faq-section {
  max-width: 800px;
  margin: 40px auto;
  padding: 30px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  transform: translateY(0);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.faq-section:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.faq-section h2 {
  font-size: 2em;
  color: #333;
  margin-bottom: 30px;
  text-align: center;
  position: relative;
  padding-bottom: 15px;
}

.faq-section h2:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: #4CAF50;
  border-radius: 2px;
}

.faq-item {
  margin-bottom: 20px;
  border: 1px solid #eee;
  border-radius: 15px;
  padding: 20px;
  transition: all 0.3s ease;
  background: #fff;
}

.faq-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  border-color: #4CAF50;
}

.faq-item h3 {
  color: #2196F3;
  font-size: 1.2em;
  margin-bottom: 10px;
  position: relative;
  padding-left: 25px;
}

.faq-item h3:before {
  content: '?';
  position: absolute;
  left: 0;
  color: #4CAF50;
  font-weight: bold;
}

.faq-item p {
  color: #666;
  line-height: 1.6;
  margin: 0;
  padding-left: 25px;
}

@media (max-width: 768px) {
  .menu-items {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(51, 51, 51, 0.95);
    flex-direction: column;
    padding: 20px;
    backdrop-filter: blur(10px);
  }

  .menu-items.active {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  .menu-items a {
    padding: 15px;
    text-align: center;
    width: 100%;
  }

  .faq-section {
    margin: 20px;
    padding: 20px;
  }
}

.modern-menu.hidden {
  transform: translateY(-100%);
}

body {
  padding-top: 70px;
}

.menu-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.menu-logo {
  color: white;
  text-decoration: none;
  font-size: 1.5em;
  font-weight: bold;
}

.menu-items {
  display: flex;
  gap: 20px;
}

.menu-items a {
  color: white;
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 20px;
  transition: all 0.3s ease;
}

.menu-items a:hover {
  background: rgba(255,255,255,0.1);
}

.menu-toggle {
  display: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

/* Modern FAQ Section */
.faq-section {
  max-width: 800px;
  margin: 40px auto;
  padding: 30px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.faq-section h2 {
  font-size: 2em;
  color: #333;
  margin-bottom: 30px;
  text-align: center;
}

.faq-item {
  margin-bottom: 20px;
  border: 1px solid #eee;
  border-radius: 15px;
  padding: 20px;
  transition: all 0.3s ease;
}

.faq-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.faq-item h3 {
  color: #2196F3;
  font-size: 1.2em;
  margin-bottom: 10px;
}

.faq-item p {
  color: #666;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .menu-items {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(51, 51, 51, 0.95);
    flex-direction: column;
    padding: 20px;
  }

  .menu-items.active {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }
}

/* Game Instructions */
.game-instructions {
  max-width: 800px;
  margin: 40px auto;
  padding: 30px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  transform: translateY(0);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.control-button {
  padding: 10px 20px;
  font-size: 16px;
  margin: 10px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.control-button:hover {
  background: #45a049;
}

/* Fullscreen canvas styling */
#gameCanvas:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
}

#gameCanvas:-moz-full-screen {
  width: 100vw;
  height: 100vh;
}

#gameCanvas:-ms-fullscreen {
  width: 100vw;
  height: 100vh;
}

#gameCanvas:fullscreen {
  width: 100vw;
  height: 100vh;
}

/* Screenshots Section */
.screenshots-section {
  max-width: 800px;
  margin: 0 auto 40px;
  padding: 20px;
  background: #fff;
  border: 2px solid #333;
}

.screenshot-item {
  margin: 20px 0;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #f9f9f9;
}

.screenshot-item img {
  max-width: 100%;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 10px;
}

/* Blog Section */
.blog-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background: #fff;
  border: 2px solid #333;
  line-height: 1.6;
}

.blog-section h2 {
  color: #333;
  margin-bottom: 20px;
}

.blog-section h3 {
  color: #444;
  margin: 25px 0 15px;
}

.blog-section p {
  margin-bottom: 15px;
  color: #666;
}

/* Modern Dialog Styles */
dialog {
  padding: 25px;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  background: white;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.dialog-content {
  text-align: center;
}

.dialog-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.dialog-buttons button {
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.dialog-confirm {
  background: #dc3545;
  color: white;
}

.dialog-confirm:hover {
  background: #c82333;
}

.dialog-cancel {
  background: #6c757d;
  color: white;
}

.dialog-cancel:hover {
  background: #5a6268;
}

/* Footer */
.site-footer {
  margin-top: auto;
  text-align: center;
  padding: 20px;
  background: #333;
  color: white;
}

.site-footer a {
  color: white;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* Mobile Controls */
.mobile-controls {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.horizontal-controls {
  display: flex;
  gap: 20px;
}

.direction-btn {
  width: 80px;
  height: 80px;
  font-size: 32px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.direction-btn:active {
  background: #45a049;
  transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 850px) {
  .game-container {
    flex-direction: column;
    align-items: center;
  }

  canvas {
    width: 100%;
    height: auto;
    max-height: 80vh;
  }

  .game-instructions {
    font-size: 14px;
    padding: 10px;
    margin: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
}

/* Time Jumper Specific Styles */
#gameOver {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 20px 40px;
  border-radius: 10px;
  text-align: center;
  z-index: 1000;
}

#gameOver.hidden {
  display: none;
}

#currentTimeline {
  color: #4CAF50;
  font-weight: bold;
}

.timeline-past #currentTimeline {
  color: #4CAF50;
}

.timeline-future #currentTimeline {
  color: #00ff00;
}

/* Added for mobile touch controls and fullscreen */
.fullscreen-button {
  position: absolute;
  top: 10px;
  right: 10px;
}