/* ═══════════════════════════════════════
   SHELL — Shared layout for all pages
   Game fills available screen. Ads on sides.
   ═══════════════════════════════════════ */

:root {
  --shell-bg: #1b1128;
  --shell-surface: #231736;
  --shell-border: rgba(255,255,255,0.06);
  --shell-text: #e8dff5;
  --shell-text-dim: #7a6b8a;
  --shell-accent: #ff6b9d;
  --ad-width: 160px;
}

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

html {
  height: 100%;
  background: var(--shell-bg);
  color: var(--shell-text);
  font-family: 'Outfit', sans-serif;
  /* Prevent font size inflation on mobile */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--shell-bg);
  color: var(--shell-text);
  font-family: 'Outfit', sans-serif;
  /* Use dvh when available for accurate mobile viewport */
  height: 100dvh;
}

/* ════════════════════════════════════════
   LAYOUT: 3-column on desktop, stacked on mobile
   [Left Ad] [Game Content] [Right Ad]
   ════════════════════════════════════════ */
.page-layout {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* ── SIDE AD COLUMNS ── */
.ad-slot {
  background: rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 50;
}

.ad-side {
  width: var(--ad-width);
  border-right: 1px solid var(--shell-border);
  flex-direction: column;
  gap: 16px;
  padding: 16px 8px;
}
.ad-side.ad-right {
  border-right: none;
  border-left: 1px solid var(--shell-border);
}

/* ── MOBILE BOTTOM AD BANNER ── */
.ad-bottom {
  display: none;
  width: 100%;
  min-height: 60px;
  background: rgba(0,0,0,0.25);
  border-top: 1px solid var(--shell-border);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 50;
  padding: 4px 0;
}
/* AD UNIT: Mobile banner (320x50 or 320x100)
<ins class="adsbygoogle" style="display:block"
     data-ad-client="ca-pub-XXXXXXXXXXXXXXXX" data-ad-slot="XXXXXXXXXX"
     data-ad-format="banner"></ins>
<script>(adsbygoogle = window.adsbygoogle || []).push({});</script>
*/

.ad-placeholder {
  color: rgba(255,255,255,0.08);
  font-size: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 3px;
  padding: 8px;
  writing-mode: vertical-lr;
}
.ad-bottom .ad-placeholder {
  writing-mode: horizontal-tb;
}

/* ── POST-GAME AD (inside game overlays) ── */
.ad-postgame {
  width: 100%;
  max-width: 340px;
  min-height: 70px;
  margin: 12px auto;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--shell-border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-postgame .ad-placeholder {
  writing-mode: horizontal-tb;
}

/* ── CONTENT AREA (center column) ── */
.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  min-width: 0;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}

/* ── NAV BAR ── */
.game-nav {
  width: 100%;
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid var(--shell-border);
  flex-shrink: 0;
  flex-wrap: nowrap;
  overflow: visible;
}

.nav-home {
  text-decoration: none;
  color: var(--shell-text);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-home:hover { background: rgba(255,255,255,0.13); border-color: rgba(255,255,255,0.2); }

/* Mobile — bigger touch target */
@media (max-width: 599px) {
  .nav-home {
    font-size: 0.82rem;
    padding: 8px 14px;
    min-height: 38px;
    background: rgba(255,107,157,0.1);
    border-color: rgba(255,107,157,0.3);
    color: var(--shell-accent);
  }
  .nav-home:hover { background: rgba(255,107,157,0.18); }
}

.nav-sep { color: rgba(255,255,255,0.1); font-size: 0.65rem; flex-shrink: 0; }
.nav-title { font-weight: 700; font-size: 0.8rem; white-space: nowrap; flex-shrink: 0; }

.nav-games { margin-left: auto; display: flex; gap: 4px; flex-shrink: 0; }
.nav-game-link {
  text-decoration: none; font-size: 0.65rem;
  padding: 2px 7px; border-radius: 5px;
  color: var(--shell-text-dim);
  background: rgba(255,255,255,0.03);
  border: 1px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-game-link:hover { color: var(--shell-text); border-color: rgba(255,255,255,0.08); }
.nav-game-link.active { color: var(--shell-accent); border-color: rgba(255,107,157,0.2); background: rgba(255,107,157,0.05); }

/* ── GAME CONTAINER ── */
.game-container {
  flex: 1;
  width: 100%;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 4px 4px;
  /* Smooth scrolling on iOS */
  -webkit-overflow-scrolling: touch;
}

/* ── TOUCH TARGET MINIMUM ── */
/* Apply to interactive elements but not inline nav links */
button {
  touch-action: manipulation;
}
a {
  touch-action: manipulation;
}

/* ── REPORT BUTTON (in game nav) ── */
.nav-report-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  padding: 3px 9px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 5px;
  color: var(--shell-text-dim);
  font-family: 'Outfit', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-report-btn:hover {
  color: var(--shell-text);
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
}

/* ═══════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════ */

/* ── MOBILE (< 600px) ── */
@media (max-width: 599px) {
  /* Hide side ads, show bottom banner */
  .ad-side { display: none; }
  .ad-bottom { display: flex; }

  /* Nav: hide game links to save space, keep home + title */
  .nav-games { display: none; }
  .nav-sep   { display: none; }

  /* Report button: icon only on mobile */
  .nav-report-btn { padding: 3px 6px; }
  .nav-report-btn span { display: none; }
}

/* ── TABLET (600px – 900px) ── */
@media (min-width: 600px) and (max-width: 900px) {
  /* Hide side ads, show bottom banner */
  .ad-side { display: none; }
  .ad-bottom { display: flex; min-height: 90px; }

  /* Narrower nav game links */
  .nav-game-link { font-size: 0.6rem; padding: 2px 5px; }
}

/* ── SMALL DESKTOP / TABLET LANDSCAPE (901px – 1200px) ── */
@media (min-width: 901px) and (max-width: 1200px) {
  :root { --ad-width: 120px; }
}

/* ── WIDE DESKTOP (> 1200px) ── */
@media (min-width: 1201px) {
  :root { --ad-width: 160px; }
}
