:root {
  --bg: #f5efec;
  --ink: #7f4f54;
  --green: #91cf72;
  --panel: #ffffff;
  --shadow: 0 10px 24px rgba(126, 83, 80, 0.1);
  --ad-rail: 160px;
  --footer-h: 52px;
  --desktop-min: 769px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.site {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.siteMain {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 16px;
  padding: 12px;
  min-height: 0;
}

.adRail {
  flex: 0 0 var(--ad-rail);
  width: var(--ad-rail);
  min-height: 600px;
  display: none;
}

.adRail ins {
  display: block;
  min-height: 600px;
}

.gameShell {
  flex: 1 1 auto;
  width: 100%;
  max-width: 520px;
  min-height: calc(100vh - var(--footer-h) - 24px);
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gameFrame {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  background: var(--bg);
}

.siteFooter {
  flex: 0 0 auto;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  background: var(--panel);
  border-top: 1px solid rgba(126, 83, 80, 0.08);
}

.storeBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  line-height: 0;
  transition: opacity 0.15s ease;
}

.storeBtn:hover {
  opacity: 0.88;
}

.storeBtn img {
  display: block;
  height: 40px;
  width: auto;
}

.footerLink {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  opacity: 0.75;
  padding: 0 4px;
}

.footerLink:hover {
  opacity: 1;
  text-decoration: underline;
}

@media (min-width: 769px) {
  .siteFooter {
    display: flex;
  }

  .gameShell {
    min-height: calc(100vh - var(--footer-h) - 24px);
  }
}

@media (min-width: 1100px) {
  .adRail {
    display: block;
  }

  .gameShell {
    max-width: 480px;
  }
}

@media (max-width: 768px) {
  .siteMain {
    padding: 0;
  }

  .gameShell {
    max-width: none;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}
