:root {
  --tile: 160px;
  --c1: #b8f28c;
  --c2: #56d46a;
  --c3: #1faa54;
  --c4: #0e7b3a;
  --wood:#8e5b3a;
  --wood-dark:#6e452c;
  --text:#fff;
  --panel-bg: url('../images/main_menu_bg.jpg');
}

html, body {
  margin:0;
  height:100%;
  overflow:hidden;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
}

/* MAIN MENU */
#mainMenu {
  min-height: 100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  max-width:960px;
  margin:0 auto;
  padding:0 160px; /* desktop gutters */
  position:relative;
}

#mainMenu::before {
  content:"";
  position:fixed; inset:-20vmax;
  z-index:-1;
  background-image: url("data:image/svg+xml;utf8,\
    <svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'>\
      <rect width='200' height='200' fill='%231faa54'/>\
      <rect x='0' y='0' width='100' height='100' fill='%2356d46a'/>\
      <rect x='100' y='0' width='100' height='100' fill='%230e7b3a'/>\
      <rect x='0' y='100' width='100' height='100' fill='%230e7b3a'/>\
      <rect x='100' y='100' width='100' height='100' fill='%23b8f28c'/>\
    </svg>");
  background-size: var(--tile) var(--tile);
  transform: rotate(45deg) scale(1.25);
  image-rendering: crisp-edges;
}

#logo { 
  width:min(520px,70vw);
  height:auto;
  margin-bottom:-40px;
  user-select:none;
  -webkit-user-drag:none;
}
.menu-buttons {
  display:flex;
  flex-direction:column;
  gap:20px;
  width:min(420px,90vw);
}

/* Button */
.btn {
  appearance:none;
  border:none;
  cursor:pointer;
  padding:6px 26px;
  border-radius:999px;
  font-size:clamp(20px,2.6vw,34px);
  font-weight:800;
  color:var(--text);
  background:
    radial-gradient(120% 200% at 50% 0%, #ffffff18 0%, #0000 60%),
    linear-gradient(#a77957,#8a6042);
  box-shadow:0 8px 0 0 var(--wood-dark), 0 14px 24px #0004;
  transition:transform .06s ease, box-shadow .06s ease, filter .2s ease;
}
.btn:hover { filter:brightness(1.06); }
.btn:active {
  transform:translateY(4px);
  box-shadow:0 4px 0 0 var(--wood-dark), 0 8px 16px #0003;
}

/* Ads */
.ad-rail {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 120px;
  height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
.ad-left { left:20px; }
.ad-right { right:20px; }

.mobile-top-ad {
  display:none;
  width:100%;
  text-align:center;
  margin-top:10px;
}

/* Hide/show ads depending on screen */
@media (max-width:1023px) {
  .ad-rail { display:none; }
  .mobile-top-ad { display:block; }
  #mainMenu { padding:0 24px; }
}

@media (max-width:480px) {
  #mainMenu { padding:0 16px; }
}

/* Modal */
#settingsModal {
  position:fixed; inset:0; display:none;
  align-items:center; justify-content:center;
  background:rgba(0,0,0,.35);
  backdrop-filter:blur(4px);
  z-index:50;
}
.settings-panel {
  background: var(--panel-bg) center/cover no-repeat;
  border-radius: 18px;
  padding: 22px;
  width: min(520px,92vw);
  box-shadow: 0 20px 50px #0006;
  color: #fff;
}
.row-box {
  background: rgba(255,255,255,0.45);
  border-radius:10px;
  padding:16px 18px;
  text-align:center;
}
.row-box a {
  color:#e7faff;
  font-weight:700;
  text-decoration:underline;
}

/* Credits */
.credit {
  position: fixed;
  left:50%; transform:translateX(-50%);
  bottom:10px;
  font-size:22px;
  display:flex;
  align-items:center;
  gap:8px;
  color:#000;
  text-shadow:rgba(0,0,0,0.192) 2px 2px 1px;
}
.credit a {
  text-decoration:none;
  font-size:20px;
  width:34px; height:34px;
  border-radius:50%;
  text-align:center; line-height:34px;
  background:rgba(255,255,255,0.363);
  backdrop-filter:blur(4px);
  color:#000;
  transition:transform .2s ease, background .2s ease;
}
.credit a:hover {
  transform:scale(1.15);
  background:rgba(255,255,255,0.45);
}

@media (max-width: 768px) {
  #mainMenu {
    padding: 0 24px;
    transform: translateY(-100px); /* raise everything 50px */
  }
}