body {
  font-family: 'Roboto', Arial, sans-serif;
  background: #1a472a;
  color: #e0e0e0;
  margin: 0;
  padding: 0 10px;
  height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
  position: relative;
  box-sizing: border-box;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

#game-container {
  display: flex;
  flex-direction: column;
  align-items: left;
  min-height: 100vh;
  padding: 0;
  gap: 5px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  transform: translateZ(0);
  will-change: transform;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 40px;
  padding: 0px 0;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

#menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 10px;
}

.menu-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.title {
  font-size: clamp(16px, 2vw, 28px);
  /* Responsive font size */
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  margin-right: clamp(10px, 1vw, 20px);
  /* Responsive margin */
  font-family: 'Poppins', sans-serif;
  letter-spacing: clamp(0.5px, 0.15vw, 1.5px);
  /* Responsive letter spacing */
}

#new-game,
#undo-move {
  text-decoration: none;
  color: white;
  font-weight: 600;
  background-color: #4CAF50;
  padding: clamp(2px, 0.3vw, 4px) clamp(6px, 0.8vw, 12px);
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  font-size: clamp(11px, 0.9vw, 13px);
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  min-width: max-content;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#undo-move {
  background-color: #3d8b40;
}

#new-game:hover,
#undo-move:hover {
  background-color: #45a049;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

#new-game:active,
#undo-move:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#stats-container {
  font-size: clamp(11px, 0.9vw, 14px);
  color: #ffffff;
  background: rgba(0, 0, 0, 0.2);
  padding: clamp(2px, 0.3vw, 4px) clamp(6px, 0.8vw, 12px);
  border-radius: 30px;
  display: flex;
  gap: clamp(5px, 1vw, 15px);
  align-items: center;
  flex-wrap: wrap;
  height: 28px;
  box-sizing: border-box;
}

#timer,
#score,
#moves {
  font-weight: bold;
  color: #4CAF50;
}

#gameCanvas {
  width: 70vw;
  /* Responsive width with maximum */
  height: 90vh;
  /* Responsive height with maximum */
  background: linear-gradient(145deg, #1e502f, #234a2f);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

h2 {
  margin-top: 0;
}

p {
  margin-bottom: 15px;
}

.win-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.win-popup-content {
  background: linear-gradient(145deg, #1e502f, #234a2f);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  border: 2px solid #4CAF50;
  max-width: 90%;
  width: 400px;
}

.win-popup h2 {
  color: #4CAF50;
  margin-bottom: 1.5rem;
}

.win-popup p {
  color: #ffffff;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.win-popup button {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.win-popup button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.menu-left {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.menu-right {
  display: flex;
  align-items: center;
  height: 100%;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: clamp(10px, 2vw, 20px);
  padding: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
  z-index: 9999;
}

.footer-nav .nav-link {
  color: #ffffff;
  text-decoration: none;
  font-size: clamp(14px, 1.2vw, 16px);
  padding: 6px 12px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.footer-nav .nav-link:hover {
  background: rgba(76, 175, 80, 0.1);
}

.nav-link {
  color: #ffffff;
  text-decoration: none;
  font-size: clamp(14px, 1.2vw, 16px);
  padding: 6px 12px;
  border-radius: 4px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover {
  background: rgba(76, 175, 80, 0.1);
}

.nav-link.active {
  color: #4CAF50;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: #4CAF50;
  border-radius: 2px;
}

@media (max-width: 768px) {
  #menu {
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    height: auto;
    gap: 10px;
  }

  .menu-left {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .menu-buttons {
    justify-content: center;
  }

  .title {
    font-size: 18px;
    margin-right: 0;
    text-align: center;
  }

  #stats-container {
    font-size: 12px;
    padding: 4px 8px;
    height: auto;
    justify-content: center;
  }
}

.blog-index {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.blog-posts {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.blog-preview {
  background: rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.blog-preview:hover {
  transform: translateY(-2px);
}

.blog-preview h2 {
  margin: 0 0 1rem 0;
}

.blog-preview h2 a {
  color: #4CAF50;
  text-decoration: none;
}

.blog-preview h2 a:hover {
  text-decoration: underline;
}

.post-meta {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.read-more {
  display: inline-block;
  color: #4CAF50;
  text-decoration: none;
  margin-top: 1rem;
}

.read-more:hover {
  text-decoration: underline;
}

.blog-post {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.blog-post h1 {
  color: #4CAF50;
  margin-bottom: 2rem;
}

.post-content {
  line-height: 1.8;
}

.post-content h2,
.post-content h3 {
  color: #4CAF50;
  margin: 2rem 0 1rem;
}

.post-content ul {
  margin-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.cta-section {
  margin: 2.5rem 0;
  padding: 2rem;
  background: rgba(76, 175, 80, 0.1);
  border-radius: 12px;
  text-align: center;
  border: 1px solid rgba(76, 175, 80, 0.2);
  backdrop-filter: blur(10px);
}

.cta-section p {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: #ffffff;
  line-height: 1.6;
}

.cta-button,
.rules-link {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 2rem;
  background: linear-gradient(145deg, #4CAF50, #45a049);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
}

.cta-button:hover,
.rules-link:hover {
  transform: translateY(-2px);
  background: linear-gradient(145deg, #45a049, #388e3c);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.cta-button:active,
.rules-link:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(76, 175, 80, 0.2);
}

.cta-button svg {
  transition: transform 0.3s ease;
}

.cta-button:hover svg {
  transform: translateX(4px);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .cta-section {
    margin: 1.5rem 0;
    padding: 1.5rem;
    border-radius: 8px;
  }

  .cta-section p {
    font-size: 1rem;
    margin-bottom: 1.2rem;
  }

  .cta-button,
  .rules-link {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    justify-content: center;
    text-align: center;
    word-break: break-word;
  }
}

.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(26, 71, 42, 0.95);
  padding: 1rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  backdrop-filter: blur(10px);
}

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  color: #ffffff;
}

.cookie-content p {
  margin: 0;
  flex: 1;
  min-width: 280px;
}

.cookie-buttons {
  display: flex;
  gap: 1rem;
}

.cookie-buttons button {
  padding: 0.5rem 1.5rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.accept-cookies {
  background: #4CAF50;
  color: white;
}

.reject-cookies {
  background: transparent;
  color: white;
  border: 1px solid white !important;
}

.cookie-buttons button:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.game-rules {
  width: min(70vw, 1200px);
  margin: 20px 0;
  padding: 2rem;
  background: linear-gradient(145deg, rgba(30, 80, 47, 0.95), rgba(35, 74, 47, 0.95));
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-rules h1 {
  color: #4CAF50;
  font-size: clamp(24px, 3vw, 32px);
  margin-bottom: 2rem;
  text-align: center;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  line-height: 1.3;
}

.rules-content {
  color: #e0e0e0;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

.rules-intro {
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.8;
  margin-bottom: 2.5rem;
  color: #ffffff;
  text-align: center;
  letter-spacing: 0.3px;
}

.game-rules p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
  font-size: clamp(15px, 1vw, 16px);
}

/* Update mobile styles */
@media (max-width: 768px) {
  .game-rules {
    width: calc(100% - 20px);
    margin: 10px;
    padding: 1.5rem;
  }

  .game-rules h1 {
    font-size: 22px;
    margin-bottom: 1.5rem;
  }

  .rules-content {
    padding: 0;
  }

  .rules-intro {
    font-size: 15px;
    margin-bottom: 2rem;
  }

  .game-rules p {
    font-size: 14px;
    margin-bottom: 1.2rem;
  }
}

/* Update game canvas for mobile */
@media (max-width: 768px) {
  #gameCanvas {
    width: 100%;
    height: 60vh;
    margin: 10px 0;
  }

  .game-layout {
    padding: 0;
  }
}

/* Update cookie consent for mobile */
@media (max-width: 768px) {
  .cookie-consent {
    padding: 10px;
  }

  .cookie-content {
    flex-direction: column;
    gap: 10px;
  }

  .cookie-buttons {
    width: 100%;
    justify-content: space-between;
  }

  .cookie-buttons button {
    flex: 1;
    margin: 0 5px;
  }
}

/* Update blog layout for mobile */
@media (max-width: 768px) {
  .blog-post {
    padding: 15px;
  }

  .blog-preview {
    padding: 15px;
  }

  .blog-post h1 {
    font-size: 24px;
  }

  .post-content {
    font-size: 14px;
  }

  .cta-section {
    padding: 15px;
    margin: 20px 0;
  }
}

/* Mobile-specific styles */
@media (max-width: 768px) {
  #game-container {
    padding: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  header {
    padding: 15px;
  }

  #menu {
    flex-direction: column;
    gap: 5px;
  }

  .menu-left {
    width: 100%;
    text-align: center;
  }

  .title {
    font-size: 16px;
    margin: 0;
    padding: 0;
    line-height: 1.2;
  }

  /* Hide buttons in header on mobile */
  .menu-buttons {
    display: none;
  }

  .menu-right {
    width: 100%;
  }

  #stats-container {
    width: 100%;
    justify-content: center;
    font-size: 12px;
    padding: 5px;
    height: auto;
    min-height: 24px;
  }

  /* Mobile game area adjustments */
  #gameCanvas {
    width: 100%;
    height: 60vh;
    margin: 0;
  }

  .game-layout {
    padding: 10px;
  }

  /* Mobile buttons styling */
  .mobile-buttons {
    display: flex !important;
    gap: 10px;
    padding: 10px;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
  }

  /* Style mobile buttons same as desktop */
  #new-game-mobile,
  #undo-move-mobile {
    text-decoration: none;
    color: white;
    font-weight: 600;
    background-color: #4CAF50;
    padding: clamp(2px, 0.3vw, 4px) clamp(6px, 0.8vw, 12px);
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: clamp(11px, 0.9vw, 13px);
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    min-width: max-content;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #undo-move-mobile {
    background-color: #3d8b40;
  }

  .cta-section {
    margin-top: 2.5rem;
    text-align: center;
    padding: 1.5rem;
    background: transparent;
    color: white;
  }

  .rules-link {
    display: inline-block;
    max-width: 90%;
    box-sizing: border-box;
  }
}

/* Hide mobile buttons on desktop */
@media (min-width: 769px) {
  .mobile-buttons {
    display: none;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #rules-container {
    width: 95vw;
    padding: 10px 20px;
    border-radius: 8px;
    backdrop-filter: none;
    /* Remove blur for better readability on small screens */
  }

  #rules-content {
    font-size: 14px;
  }

  #rules-content h3 {
    font-size: 16px;
  }

  #rules-content ul {
    margin-left: 1rem;
  }

  #rules-content li {
    margin-bottom: 0.5rem;
  }

  #rules-content p {
    margin-bottom: 0.5rem;
  }
}

/* Update mobile styles */
@media (max-width: 768px) {
  #game-container {
    padding: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .game-rules {
    width: auto;
    margin: 20px 10px;
    box-sizing: border-box;
  }

  #gameCanvas {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .blog-post,
  .blog-preview,
  .cookie-content,
  #rules-container {
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
    margin-left: 10px;
    margin-right: 10px;
  }
}

.icon-button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 5px;
  margin-right: 10px;
}

.icon-button:hover {
  opacity: 0.8;
}

#site-title a {
  text-decoration: none;
  color: inherit;
}

/* Add these new styles for blog images */
.blog-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  aspect-ratio: 16/9;
}

/* Update mobile styles */
@media (max-width: 768px) {
  .blog-post {
    padding: 15px;
  }

  .blog-image {
    margin: 1rem 0;
    border-radius: 4px;
  }
}

/* Add these new styles */
.back-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  text-decoration: none;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  margin: 20px 0;
  width: fit-content;
  transition: all 0.3s ease;
}

.back-link:hover {
  background: rgba(0, 0, 0, 0.3);
  transform: translateX(-4px);
}

.back-link svg {
  width: 20px;
  height: 20px;
}

/* Update blog post container to allow space for back link */
.blog-post {
  margin-top: 0;
}

/* Mobile responsiveness for back link */
@media (max-width: 768px) {
  .back-link {
    margin: 10px;
    font-size: 14px;
    padding: 8px 15px;
  }
}

/* Add these new styles */
.faq-section {
  margin: 2rem 0;
  position: relative;
  padding-top: 0;
}

.faq-wrapper {
  position: relative;
  padding-top: 3rem;
}

.faq-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  height: 1px;
  background: linear-gradient(to right,
      transparent,
      rgba(76, 175, 80, 0.3),
      rgba(76, 175, 80, 0.5),
      rgba(76, 175, 80, 0.3),
      transparent);
}

.faq-item {
  margin-bottom: 1.5rem;
}

.faq-item h3 {
  color: #4CAF50;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.faq-item p {
  margin-top: 0.5rem;
  line-height: 1.6;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .faq-wrapper {
    padding-top: 2rem;
  }

  .faq-wrapper::before {
    width: 95%;
  }
}

#content-container {
  width: 70vw;
  margin: 0;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.content-wrapper {
  padding: 1rem;
  width: 100%;
}

.content-wrapper .intro {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 2rem auto;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #ffffff;
}

#content-container h1 {
  color: #4CAF50;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.content-wrapper h2 {
  color: #4CAF50;
  margin: 2rem 0 1rem;
}

.content-wrapper h3 {
  color: #4CAF50;
  margin: 1.5rem 0 1rem;
}

.content-wrapper p {
  margin-bottom: 1rem;
  line-height: 1.6;
  max-width: 800px;
}

.content-wrapper ul {
  list-style-type: disc;
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
  max-width: 800px;
  text-align: left;
  /* Keep list items left-aligned for better readability */
}

/* Update mobile styles */
@media (max-width: 768px) {
  #content-container {
    width: 95vw;
    padding: 10px 20px;
    border-radius: 8px;
    backdrop-filter: none;
  }

  .content-wrapper {
    font-size: 14px;
  }

  .content-wrapper h3 {
    font-size: 16px;
  }

  .content-wrapper ul {
    margin-left: 1rem;
  }
}

.floating-home-button {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) !important;
  background: #4CAF50;
  color: white;
  padding: 0 30px;
  height: 60px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: bottom 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  z-index: 9999;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.2rem;
  white-space: nowrap;
  margin: 0 !important;
}

.floating-home-button:hover {
  background: #45a049;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.floating-home-button:active {
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

@media (max-width: 768px) {
  .floating-home-button {
    bottom: 15px;
    padding: 0 20px;
    height: 50px;
    font-size: 1.1rem;
    width: auto;
    max-width: none;
  }
}

.cookie-consent {
  z-index: 9998;
}

.blog-preview h3 {
  margin: 0 0 1rem 0;
  font-size: 1.4rem;
  line-height: 1.3;
}

.blog-preview h3 a {
  color: #4CAF50;
  text-decoration: none;
  transition: color 0.3s ease;
}

.blog-preview h3 a:hover {
  color: #45a049;
  text-decoration: underline;
}

.blog-post img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
  display: block;
}

.blog-image {
  width: 100%;
  max-width: 800px;
  height: auto;
  margin: 1.5rem auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

figure {
  margin: 1.5rem 0;
  width: 100%;
  max-width: 800px;
}

figure img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 0;
}

figcaption {
  text-align: center;
  margin-top: 0.5rem;
  color: #999;
  font-size: 0.9rem;
}