[data-theme="light"] {
  --bg-color: white;
  --text-color: black;
  --select-bg: #f0f0f0;
  --menu-bg: rgba(220, 220, 220, 0.5);
}

[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: white;
  --select-bg: #2d2d2d;
  --menu-bg: rgba(50, 50, 50, 0.5);
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-color);
    color: var(--text-color);
    transition: background 0.3s ease;
    padding: 2rem;
    margin: 0;
    box-sizing: border-box;
}

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

.main {
    width: 100%;
    background: transparent;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 92vh;
}

.content-container {
    flex: 1;
    position: relative;
}

.logo a{
    text-decoration: none;
    color: var(--text-color);
    font-family: Arial;
    padding-left: 0px;
    float: left;
    padding-top: 0px;
}

.navbar {
  width: 100%;
  margin: 0 auto;
  padding: 20px 50px;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
}

.menu {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 14px;
  padding-left: 48%;
}

.menu ul {
  display: flex;
  list-style: none;
  gap: 40px;
  margin: 0;
  padding: 0;
}

.theme-selector {
  padding: 8px 5px;
  border-radius: 5px;
  background-color: var(--select-bg);
  color: var(--text-color);
  border: none;
  outline: none;
  font-weight: bold;
  transition: transform 0.3s ease;
}

ul li a{
    text-decoration: none;
    color: var(--text-color);
    font-family: Arial;
    font-weight: bold;
    position: relative;
    padding-bottom: 4px;
    display: inline-block;
}

ul li a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    border-radius: 5px;
    background: var(--text-color);
    transform: scaleX(0);
    transition: transform 0.5s ease;
}

ul li a:hover::after {
    transform: scaleX(1);
}

.greeting {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.greeting-text {
    display: block;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-family: "Gill Sans", sans-serif;
    margin-bottom: 20px;
    animation: fadeIn 1.5s ease-in;
}

.abc {
    display: block;
    font-size: clamp(1rem, 2vw, 1.2rem);
    animation: fadeIn 1.5s ease-in;
    opacity: 0.8;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hamburger {
  display: none;
}

.dropdown-menu {
  position: fixed;
  right: -100%;
  top: 30%;
  width: 45%;
  background: var(--menu-bg);
  backdrop-filter: blur(5px);
  border-radius: 10px 0 0 10px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.dropdown-menu.active {
  right: 0;
  opacity: 1;
  visibility: visible;
}

.dropdown-menu ul {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  list-style: none;
}

.dropdown-menu li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(0,0,0,0.2);
}

@keyframes menuItemFade {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.site-footer {
  width: 100%;
  background-color: transparent;
  color: transparent;
  font-family: Arial;
  padding: 40px 20px 20px;
  flex-shrink: 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-section {
  flex: 1;
  min-width: 250px;
  margin-bottom: 30px;
  padding: 0 15px;
}

.footer-section h3 {
  color: var(--text-color);
  margin-bottom: 15px;
  font-size: 18px;
  font-weight: 500;
}

.footer-section p {
  line-height: 1.6;
  margin-bottom: 10px;
  color: var(--text-color);
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 8px;
}

.footer-section ul li a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section ul li a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    border-radius: 5px;
    background: var(--text-color);
    transform: scaleX(0);
    transition: transform 0.5s ease;
}

.footer-section ul li a:hover::after {
    transform: scaleX(1);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #333;
  margin-top: 20px;
  color: var(--text-color);
  font-size: 14px;
}

/* --- Pixel game section --- */
.game-section {
  padding: 4rem 1rem 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.game-title {
  text-align: center;
  font-size: clamp(1.25rem, 2vw + 1rem, 2rem);
  margin: 0 0 .5rem;
}

.game-wrapper {
  display: grid;
  grid-template-columns: auto;
  gap: .75rem;
  place-items: center;
}

#aboutCanvas {
  border: 3px solid currentColor;
  border-radius: 8px;
  image-rendering: pixelated;         /* crispy pixels */
  image-rendering: crisp-edges;
  background: #2a2a2a;                /* will be drawn over */
}

.hud {
  display: grid;
  gap: .5rem;
  max-width: 540px;
  text-align: center;
}

#gameText {
  margin: 0;
  line-height: 1.4;
}

/* Touch controls (hidden on wide screens) */
.touch-controls {
  display: grid;
  grid-template-areas:
    ".  up   ."
    "left . right"
    ". down .";
  gap: .4rem;
  margin-top: .25rem;
}

.touch-controls .up    { grid-area: up; }
.touch-controls .left  { grid-area: left; }
.touch-controls .right { grid-area: right; }
.touch-controls .down  { grid-area: down; }

.touch-controls .btn {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 2px solid currentColor;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  touch-action: manipulation;
}

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

/* Optional: keep this section nicely centered within your layout */
.content-container + .game-section {
  scroll-margin-top: 72px; /* if navbar is sticky */
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
  }
  
  .footer-section {
    margin-bottom: 25px;
  }
  
  .greeting {
    font-size: 2.5rem;
    width: 90%;
    top: 40%;
  }
  
  ul li a::after {
    width: 0;
  }
  
  .menu {
    display: none;
  }
  
  .theme-selector-mobile {
    width: 100%;
    margin-top: 15px;
    padding: 10px 2px;
    border-radius: 5px;
    background-color: var(--menu-bg);
    backdrop-filter: blur(5px);
    color: var(--text-color);
    border: none;
    outline: none;
    font-weight: bold;
    font-size: 14px;
    transition: transform 0.3s ease;
  }
}
