/* ============================================================
   Wordabix – responsive layout
   Portrait canvas, ads above (mobile) or either side (desktop)
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #121213;
}

/* ---- Outer wrapper ---------------------------------------- */
#page-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 4px 0;
}

/* ---- Ad slots --------------------------------------------- */
.ad-slot {
  background: #484848; /* DEV: visible background — remove when live */
  overflow: hidden;
}

/* ---- Game canvas holder ----------------------------------- */
#holder {
  width: 100%;
  max-width: 420px;
  flex: 0 1 420px;
}

/* ZIM injects a canvas – keep it fluid inside the holder */
#holderCanvas {
  width: 100% !important;
  display: block;
}

/* ---- Main layout row -------------------------------------- */
#main-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  flex: 1;
}

/* ============================================================
   Mobile  240px+
   Top banner 320x50, no side ads
   ============================================================ */
@media (min-width: 240px) {

  #ad-top {
    display: block;
    width: 320px;
    height: 50px;
    margin: 0 auto 4px;
  }

  .ad-side {
    display: none;
  }

  #holder {
    flex: 0 1 420px;
    width: 100%;
    max-width: 420px;
  }
}

/* ============================================================
   Large mobile  460px+
   Top banner 468x60, no side ads
   ============================================================ */
@media (min-width: 460px) {

  #ad-top {
    width: 468px;
    height: 60px;
  }
}

/* ============================================================
   Desktop  1000px+
   Side ads 160px, top banner hidden
   ============================================================ */
@media (min-width: 1000px) {

  #ad-top {
    display: none;
  }

  #main-layout {
    gap: 16px;
    padding: 0 16px;
  }

  .ad-side {
    display: block;
    width: 160px;
    height: 600px;
    flex-shrink: 0;
  }

  #holder {
    flex: 0 0 420px;
    width: 420px;
  }
}

/* ============================================================
   Large desktop  1400px+
   Side ads 300px (half page)
   ============================================================ */
@media (min-width: 1400px) {

  #main-layout {
    gap: 24px;
  }

  .ad-side {
    width: 300px;
    height: 600px;
  }
}
