:root {
  color-scheme: light;
  --paper: #f8f3df;
  --ink: #233f2c;
  --green: #2c623d;
  --sage: #eef4dc;
  --line: #d9dec8;
  --gold: #ffb81c;
  font-family: ui-rounded, "Arial Rounded MT Bold", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #233f2c;
  color: var(--ink);
}

body {
  display: flex;
  flex-direction: column;
}

[hidden] {
  display: none !important;
}

/* Top Sovereign Strip */
.arcade-top {
  flex: 0 0 auto;
  height: 44px;
  background: #1d3524;
  color: #fff8e7;
  border-bottom: 1px solid rgba(255, 248, 231, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  z-index: 30;
}

.arcade-top-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.arcade-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #fff8e7;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: -0.3px;
  flex: 0 0 auto;
}

.arcade-brand img {
  border-radius: 6px;
  display: block;
}

.switcher-wrap {
  position: relative;
}

.switcher-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 248, 231, 0.28);
  background: rgba(255, 248, 231, 0.12);
  color: #fff8e7;
  font: 700 12px/1 system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}

.switcher-pill:hover,
.switcher-pill:focus-visible {
  background: rgba(255, 248, 231, 0.22);
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.switcher-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: min(290px, 86vw);
  max-height: 75dvh;
  overflow-y: auto;
  background: #fff8e7;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  z-index: 50;
}

.switcher-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--ink);
  font: 700 13px/1.25 system-ui, sans-serif;
}

.switcher-item:hover,
.switcher-item:focus-visible {
  background: #e6ebd3;
  outline: none;
}

.switcher-item.active {
  background: #2c623d;
  color: #fff8e7;
}

.switcher-item small {
  font: 600 11px/1 system-ui, sans-serif;
  opacity: 0.78;
}

.adfree-cta {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--gold);
  color: #17291e;
  text-decoration: none;
  font: 800 11.5px/1.1 system-ui, sans-serif;
  white-space: nowrap;
  flex: 0 0 auto;
}

.adfree-cta:hover,
.adfree-cta:focus-visible {
  filter: brightness(1.06);
  outline: 2px solid #fff8e7;
  outline-offset: 2px;
}

.cta-short {
  display: none;
}

/* Middle Row: Rails + Center Game Stage */
.arcade-middle {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 6px 12px;
  background: radial-gradient(ellipse at 50% 40%, #2f543b, #1d3524);
}

.rail {
  display: none;
  flex: 0 0 300px;
  width: 300px;
  height: min(600px, 100%);
  align-items: center;
  justify-content: center;
}

@media (min-width: 1180px) {
  .rail {
    display: flex;
  }
}

.stage-wrap {
  position: relative;
  flex: 1 1 auto;
  max-width: 600px;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 16px;
  background: #cde8ae;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

/* Bottom Anchor Banner (strictly outside #game-frame / #stage) */
.arcade-bottom {
  flex: 0 0 auto;
  background: #17291e;
  border-top: 1px solid rgba(255, 248, 231, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px calc(3px + env(safe-area-inset-bottom));
  z-index: 30;
}

.ad-slot {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #233f2c;
}

.ad-slot-rail {
  width: 300px;
  height: min(600px, 100%);
  border: 1.5px solid rgba(255, 248, 231, 0.18);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.ad-slot-banner {
  width: 728px;
  max-width: 100%;
  height: 90px;
  border: 1px solid rgba(255, 248, 231, 0.18);
}

/* House Ad Cards */
.house-ad-link {
  display: flex;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: #fff8e7;
  background: linear-gradient(160deg, #2d5139, #1c3324);
  position: relative;
}

.house-ad-rail {
  flex-direction: column;
  justify-content: space-between;
}

.house-ad-rail .house-ad-media {
  flex: 1 1 auto;
  min-height: 0;
  background: #1b3123;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.house-ad-rail .house-ad-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.house-ad-rail .house-ad-body {
  padding: 14px 16px;
  background: #fff8e7;
  color: var(--ink);
  border-top: 2px solid var(--gold);
}

.house-ad-badge {
  display: inline-block;
  font: 800 10px/1 system-ui, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #4b793f;
  margin-bottom: 4px;
}

.house-ad-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.15;
}

.house-ad-tagline {
  margin: 0 0 10px;
  font: 500 12.5px/1.35 system-ui, sans-serif;
  color: #3f5240;
}

.house-ad-cta {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  background: #2c623d;
  color: #fff8e7;
  font: 800 12px/1 system-ui, sans-serif;
}

/* Bottom Banner House Ad */
.house-ad-banner {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 14px;
  background: linear-gradient(90deg, #fff8e7, #eef4dc);
  color: var(--ink);
}

.house-ad-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.house-ad-banner-thumb {
  width: 68px;
  height: 68px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1.5px solid #c5cfb4;
}

.house-ad-banner-text {
  min-width: 0;
}

.house-ad-banner-text strong {
  display: block;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.house-ad-banner-text span {
  display: block;
  font: 500 12px/1.3 system-ui, sans-serif;
  color: #3f5240;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Post-Breath Inter-Level Bumper */
.bumper-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 41, 30, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 40;
  border-radius: 16px;
}

.bumper-card {
  width: 100%;
  max-width: 360px;
  background: #fff8e7;
  color: var(--ink);
  border: 3px solid #fff;
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.bumper-eyebrow {
  margin: 0 0 10px;
  font: 800 11px/1.2 system-ui, sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4b793f;
}

.bumper-spotlight {
  background: #eef4dc;
  border: 1.5px solid #d9dec8;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}

.bumper-spotlight img {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  margin-bottom: 8px;
}

.bumper-spotlight h3 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 900;
}

.bumper-spotlight p {
  margin: 0;
  font: 500 12.5px/1.4 system-ui, sans-serif;
  color: #3f5240;
}

.bumper-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.bumper-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 12px;
  font: 800 13px/1.2 system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
  border: 0;
}

.bumper-btn.primary {
  background: #2c623d;
  color: #fff8e7;
}

.bumper-btn.secondary {
  background: #e6ebd3;
  color: var(--ink);
}

.bumper-optin {
  width: 100%;
  border: 1.5px dashed #4b793f;
  background: transparent;
  color: #2c623d;
  border-radius: 10px;
  padding: 8px 10px;
  font: 700 12px/1.2 system-ui, sans-serif;
  cursor: pointer;
}

/* Mobile Responsive (< 768px) */
@media (max-width: 767px) {
  .arcade-top {
    height: 40px;
    padding: 0 8px;
  }

  .arcade-brand span {
    display: none;
  }

  .switcher-pill {
    padding: 0 9px;
    font-size: 11px;
  }

  .cta-full {
    display: none;
  }

  .cta-short {
    display: inline;
  }

  .arcade-middle {
    padding: 4px;
  }

  #game-frame {
    border-radius: 10px;
  }

  .ad-slot-banner {
    width: 320px;
    height: 50px;
  }

  .house-ad-banner {
    padding: 4px 8px;
    gap: 8px;
  }

  .house-ad-banner-thumb {
    width: 38px;
    height: 38px;
    border-radius: 6px;
  }

  .house-ad-banner-text strong {
    font-size: 12px;
  }

  .house-ad-banner-text span {
    font-size: 10px;
  }

  .house-ad-banner .house-ad-cta {
    padding: 5px 8px;
    font-size: 10.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
