/* 🌿 Color Theme */
:root {
  --primary-color: #5c913b; /* Green */
  --secondary-color: #f5deb3; /* Wheat */
  --text-color: #333;
  --bg-color: #f4f4f4;
  --accent-color: #e67e22; /* Orange */
}

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

p {
  font-size: small;
}

html,
body {
  height: 100%;
  font-family: "Arial", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* 🎩 Header */
header {
  text-align: center;
  padding: 5px;
  background-color: var(--primary-color);
  color: white;
  font-size: 22px;
}

/* 📌 Layout */
.container {
  display: flex;
  max-width: 1200px;
  margin: 5px auto;
  gap: 20px;
  align-items: flex-start;
}

.main-content {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 🎮 Game Section */
/* Ensures the canvas and controls stack vertically */
.game-section {
  display: flex; /* enable flexbox */
  flex-direction: column;
  justify-content: center; /* center horizontally */
  align-items: center; /* center vertically */
  width: 100%;
  min-height: 400px; /* optional, gives it room */
  padding: 5px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
  position: relative;
  transition: all 0.3s ease-in-out;
}

nav {
  background: #2e7d32;
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 0.5em;
}

nav a {
  color: #28560b;
  text-decoration: underline;
  font-weight: bold;
  margin: 0 15px;
  font-size: medium;
}

a {
  color: #28560b;
  text-decoration-color: #28560b;
  font-size: large;
}

nav a:hover {
  color: var(--accent-color);
}

ol li {
  color: #333;
  text-decoration-color: #333;
  font-size: small !important;
}

li {
  color: #333;
  text-decoration-color: #333;
  font-size: small !important;
  text-align: justify;
  margin-top: 5px;
  padding: 5px;
  font-size: 10px;
  font-weight: 100;
}

canvas {
  display: block; /* remove inline gaps */
  max-width: 100%;
  height: auto;
  background-color: lightblue;
  border: 2px solid var(--primary-color);
}

/* 📜 Sidebar */
.sidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--secondary-color);
  padding: 10px;
  border-radius: 10px;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
  min-height: 600px;
}

/* 🎯 Ad Slots */
.responsive_header_unit {
  min-width: 150px;
}

.adslot_2 {
  display: inline-block;
  width: 336px;
  height: 280px;
}
@media (max-width: 336px) {
  .adslot_2 {
    width: 300px;
    height: 250px;
  }
}
@media (min-width: 500px) {
  .adslot_2 {
    display: none;
  }
}
@media (max-width: 900px) {
  .container {
    flex-direction: column;
  }

  .main-content,
  .sidebar {
    width: 100%;
  }
}
.ad-slot {
  width: 100%;
  min-width: 200px;
  min-height: 200px;
  background-color: #444;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 2px solid white;
  border-radius: 5px;
}

.content {
  flex-grow: 1;
  text-align: center;
  padding: 10px;
  min-height: 300px;
  font-size: 16px;
  font-weight: bold;
  color: var(--text-color);
}

/* 👣 Footer */
footer {
  text-align: center;
  padding: 20px;
  background-color: var(--primary-color);
  color: white;
  font-size: 18px;
  margin-top: 20px;
}

.instructions {
  background-color: white;
  border-radius: 10px;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
  padding: 20px;
  line-height: 1.8;
  max-width: 800px;
  min-height: 600px;
  margin: 30px auto;

  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.instructions ol {
  padding-left: 25px;
}

.instructions li {
  margin-bottom: 15px;
  font-size: medium;
  color: #333;
  text-decoration-color: #333;
}

.back-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
  align-content: end;
}

.back-link:hover {
  color: var(--accent-color);
}

.back-link-small {
  display: inline-block;
  margin-top: 20px;
  font-size: 1rem;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

/* 📱 Responsive Design */
@media (max-width: 900px) {
  .container {
    flex-direction: column;
    align-items: center;
  }
  .sidebar {
    width: 100%;
    height: auto;
  }
  .game-section {
    width: 100%;
  }
}

/* Position buttons horizontally under the canvas */
.mobile-controls {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* Button styles */
.arrow-btn {
  font-size: 24px;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  color: var(--primary-color);
  cursor: pointer;
}

/* Show only on small screens */
@media (max-width: 768px) {
  .mobile-controls {
    display: flex;
  }
}

@media (min-width: 768px) {
  .mobile-controls {
    display: none;
  }
}

.action-btn {
  background-color: rgba(76, 175, 80, 0.9);
  color: white;
  font-size: 26px;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease;
}

.action-btn.active {
  background-color: rgba(255, 193, 7, 0.9); /* yellow to indicate active */
}
