@import url('https://fonts.googleapis.com/css2?family=Jersey+25&family=Press+Start+2P&display=swap');

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

  :root {
    --orange: #E8722A;
    --blue: #5B8DD9;
    --green: #7BBF5E;
    --red: #D94F4F;
    --yellow: #E8C84A;
    --gray-bg: #C8C8C8;
    --card-bg: #D0D0D0;
    --pixel: 'Jersey 25', monospace;
  }

  body { font-family: 'Jersey 25', sans-serif; margin: 0; padding: 0; }

  /* NAV — fixed/floating on both desktop and mobile */
  .nav {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 999;
    display: flex;
    align-items: flex-start;
    background: transparent;
    padding: 0;
  }

  .nav-bag {
    background: #E8E8E8;
    border: none;
    border-radius: 0;
    padding: 0;
    font-size: 34px;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: -2px 2px 0px rgba(0,0,0,0.2), 2px 2px 0px rgba(0,0,0,0.2);
  }

  /* Desktop layout:
       row 1: bag + download + about
       row 2: gameplay + items          */
  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .nav-top-row {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  /* Desktop row 2 (gameplay/items): hidden until open */
  .nav-bottom-row {
    display: flex;
    flex-direction: row;
    gap: 12px;
  }

  /* nav-links (download/about beside bag): hidden until open */
  .nav-links {
    display: flex;
    flex-direction: row;
    gap: 12px;
  }

  .nav-tab {
    font-family: 'Jersey 25', sans-serif;
    font-size: 26px;
    padding: 0 26px;
    height: 58px;
    display: flex;
    align-items: center;
    border: none;
    cursor: pointer;
    background: #E8E8E8;
    color: #333;
    border-radius: 0;
    white-space: nowrap;
    box-shadow: -2px 2px 0px rgba(0,0,0,0.2), 2px 2px 0px rgba(0,0,0,0.2);
  }

  /* Nav tabs always in layout but invisible when closed */
  .nav-links,
  .nav-bottom-row {
    overflow: visible;
  }

  /* All animatable tabs start hidden */
  .nav-links .nav-tab,
  .nav-bottom-row .nav-tab {
    opacity: 0;
    transform: translateX(-24px);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity   0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                visibility 0s linear 0.4s;
    visibility: hidden;
    pointer-events: none;
  }

  /* download + about: animate when nav-links gets .open */
  .nav-links.open .nav-tab {
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity   0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                visibility 0s linear 0s;
  }
  .nav-links.open .nav-tab:nth-child(2) { transition-delay: 0.08s; }
  .nav-links.open .nav-tab:nth-child(3) { transition-delay: 0.16s; }

  /* gameplay + items: animate when nav-bottom-row gets .open */
  .nav-bottom-row.open .nav-tab {
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity   0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                visibility 0s linear 0s;
  }
  .nav-bottom-row.open .nav-tab:nth-child(2) { transition-delay: 0.08s; }
  .nav-tab[data-section="download"] { color: #6879E5; }
  .nav-tab[data-section="about"]    { color: #59AB3C; }
  .nav-tab[data-section="gameplay"] { color: #CB4848; }
  .nav-tab[data-section="items"]    { color: #E6C84D; }

  /* Four tabs now share the top row, so let it wrap instead of running off
     the side of a narrow screen. */
  .nav { max-width: calc(100vw - 24px); }
  .nav-top-row,
  .nav-links,
  .nav-bottom-row { flex-wrap: wrap; }

  /* "portal login" is an anchor, not a button: strip link styling so it reads
     exactly like the other tabs. */
  .nav-tab-portal {
    color: #CB4848;
    text-decoration: none;
  }

  /* MOBILE: nav anchored bottom-left (320px - 425px)
     Visual layout (open):
       [ download ] [ items    ]   ← nav-bottom-row (gameplay/items) shown above
       [ 🎒 bag  ] [ gameplay ] [ about ]   ← nav-top-row (bag row) at bottom
  */
  @media (max-width: 425px) {
    .nav {
      top: auto;
      bottom: 12px;
      left: 12px;
      flex-direction: column-reverse; /* flip: top-row at bottom, bottom-row above */
      align-items: flex-start;
      gap: 12px;
    }
    /* On mobile, nav-top-row (bag+download+about) is always visible */
    .nav-top-row {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 12px;
    }
    /* On mobile, nav-bottom-row (gameplay+items) sits above when open */
    .nav-bottom-row {
      display: flex;
      flex-direction: row;
      gap: 12px;
    }
    .nav-links {
      display: flex;
      flex-direction: row;
      gap: 12px;
    }
    .nav-bag {
      font-size: 36px;
      padding: 0;
      width: 62px;
      height: 62px;
      box-shadow: -2px 2px 0px rgba(0,0,0,0.2), 2px 2px 0px rgba(0,0,0,0.2);
    }
    .nav-tab {
      border-radius: 0;
      box-shadow: -2px 2px 0px rgba(0,0,0,0.2), 2px 2px 0px rgba(0,0,0,0.2);
      font-size: 22px;
      padding: 0 20px;
      height: 62px;
    }
  }

  /* EQUAL HEIGHT SECTIONS (desktop). On small screens these should be auto-sized */
  .hero,
  .section-blue,
  .section-green,
  .section-red,
  .section-yellow {
    min-height: 100vh;
    box-sizing: border-box;
  }

  /* HERO */
  .hero {
    background: #E8E8E8;
    padding: 4vw 5vw;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1vw;
    position: relative;
    overflow: hidden;
  }

  /* On tablets/phones do not force full viewport height — allow stacking and remove gaps (mobile to tablet: 320-768px) */
  @media (max-width: 768px) {
    .hero,
    .section-blue,
    .section-green,
    .section-red,
    .section-yellow {
      min-height: auto;
      height: auto;
      padding-top: 28px;
      padding-bottom: 28px;
    }
    .hero { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 18px; }
    .hero-left { width: 100%; }
    .bag-scene { width: 100%; }
    .bag-container { width: min(100%, 680px); }
    .hero-tagline { margin-left: 0; text-align: left; white-space: normal; }
  }
  .hero-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: min(68vw, 980px);
    min-width: 0;
  }
  .bag-scene {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(4px, 0.6vw, 8px);
  }
  .bag-container {
    position: relative;
    width: min(100%, 48vw);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #display-bag {
    display: block;
    width: 100;
    height: 100%;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
  }
  .pouch-zone {
    position: absolute;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  }
  .pouch-zone:hover,
  .pouch-zone:focus-visible,
  .pouch-zone.active {
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
    outline: none;
  }
  #top-zone    { top: 12%; left: 26%; width: 48%; height: 20%; }
  #middle-zone { top: 50%; left: 29%; width: 42%; height: 26%; }
  #bottom-zone { top: 80%; left: 35%; width: 30%; height: 14%; }
  #side-zone   { top: 43%; right: 5%; width: 18%; height: 28%; }
  #side-2-zone { top: 43%; left: 5%; width: 18%; height: 28%; }
  .bag-caption {
    font-family: 'Jersey 25', sans-serif;
    font-size: clamp(12px, 1.3vw, 18px);
    color: #555;
    text-align: center;
    max-width: 100%;
  }
  .hero-tagline {
    font-family: var(--pixel);
    font-size: clamp(14px, 2vw, 30px);
    color: #FFFFFF;
    text-align: right;
    line-height: 2;
    white-space: nowrap;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    margin-left: auto;
    flex: 0 0 15vw;
    width: min(15vw, 230px);
  }

  /* BLUE */
  .section-blue { background: var(--blue); padding: clamp(16px, 2.5vw, 40px); display: flex; flex-direction: column; }
  .card { background: #E8E8E8; border-radius: 16px; padding: clamp(16px, 2vw, 32px); flex: 1; display: flex; flex-direction: column; }
  .trailer-box {
    background: transparent;
    border-radius: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    margin-bottom: clamp(12px, 1.5vw, 24px);
    font-family: var(--pixel);
    font-size: clamp(14px, 1.5vw, 24px);
    color: #666;
    gap: clamp(12px, 1.5vw, 24px);
  }
  .btn-download {
    display: block;
    margin: 0 auto;
    background: #5B8DD9;
    color: #fff;
    border: none;
    padding: clamp(14px, 1.6vw, 24px) clamp(40px, 4vw, 70px);
    font-family: 'Jersey 25', sans-serif;
    font-size: clamp(18px, 2vw, 32px);
    border-radius: 10px;
    cursor: pointer;
  }

  /* GREEN */
  .section-green { background: var(--green); padding: clamp(16px, 2.5vw, 40px); display: flex; flex-direction: column; }
  .about-card { background: #E8E8E8; border-radius: 16px; padding: clamp(20px, 2.5vw, 48px); flex: 1; display: flex; flex-direction: column; overflow: hidden; }
  .about-card h2 {
    font-family: 'Jersey 25', sans-serif;
    font-size: clamp(22px, 3vw, 48px);
    color: var(--green);
    margin-bottom: clamp(10px, 1.2vw, 22px);
    flex-shrink: 0;
  }
  .about-card p { font-family: 'Jersey 25', sans-serif; font-size: clamp(14px, 1.4vw, 22px); color: #333; line-height: 1.7; overflow-y: auto; flex: 1; }

  /* RED */
  .section-red { background: var(--red); padding: clamp(16px, 2.5vw, 40px); display: flex; flex-direction: column; }
  .gameplay-grid {
    display: grid;
    grid-template-columns: 0.25fr 0.5fr 0.25fr;
    gap: clamp(10px, 1.2vw, 20px);
    flex: 1;
    min-height: auto;
  }
  .gameplay-left {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1vw, 16px);
    align-items: center;
    flex: 1;
  }
  .gameplay-label {
    font-family: 'Jersey 25', sans-serif;
    font-size: clamp(18px, 2vw, 32px);
    color: #fff;
    background: #E8E8E8;
    color: var(--red);
    width: 100%;
    text-align: center;
    padding: clamp(8px, 1vw, 14px) 0;
    border-radius: 10px;
    flex-shrink: 0;
  }
  .character-container {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1vw, 16px);
    align-items: center;
    flex: 1;
    width: 100%;
    background: #E8E8E8;
    padding: clamp(8px, 1vw, 16px);
    border-radius: 10px;
  }
.char-thumb, .char-thumb2 {
  background: #BEBEBE;
  border-radius: 12px;
  width: 100%;
  aspect-ratio: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Combine image selectors for pixel art rendering */
.char-animation, .char-animation2 {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
  .char-label { font-family: 'Jersey 25', sans-serif; font-size: clamp(14px, 1.4vw, 22px); color: #D94F4F; text-align: center; }
  .gameplay-right { display: flex; flex-direction: column; gap: clamp(8px, 1vw, 16px); }
  .movement-card {
    background: #E8E8E8;
    border-radius: 12px;
    padding: clamp(12px, 1.4vw, 22px) clamp(16px, 1.8vw, 28px);
    font-family: 'Jersey 25', sans-serif;
    font-size: clamp(16px, 1.6vw, 26px);
    color: #D94F4F;
    flex: 1;
  }

.movement-card {
  display: flex;
  flex-direction: column;
  padding: 20px !important;
  height: auto; /* Force full height of the parent */
}
.loop-title {
  margin-bottom: 15px;
}

/* The stack that fills the remaining vertical space */
.loop-vertical-stack {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px; /* Space between the rounded rectangles */
  flex: 1; /* Take up remaining space */
}

/* Individual Phase Cards */
.loop-phase-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  background: white;
  border-radius: 12px; /* Rounded rectangle shape */
  padding: 10px;
  flex: 1;
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
  gap: 12px;
}

.loop-phase-card:hover {
  transform: scale(1.02);
}

/* Image container within the card */
.phase-image-container {
  width: clamp(70px, 8vw, 120px);
  height: clamp(70px, 8vw, 120px);
  flex-shrink: 0;
  display: flex;
  background: #f0f0f0;
  border-radius: 8px; /* Internal rounded rectangle */
  overflow: hidden;
  border: 2px solid #ccc;
}

.phase-image-container {
  flex-shrink: 0;
  display: flex;
  background: #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #ccc;
  width: auto;
  height: auto;
  max-height: clamp(70px, 8vw, 120px);
}

.phase-text-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.phase-label {
  font-size: 18px;
  color: var(--red); /* Using your site's primary red */
  margin-bottom: 4px;
}

.phase-desc {
  font-size: 13px;
  color: #333;
  line-height: 1.4;
  margin: 0;
}


.phase-image-container img {
  width: auto;
  height: 100%;
  max-height: clamp(70px, 8vw, 120px);
  object-fit: contain;
  image-rendering: pixelated;
}

.phase-image-container.dual-image {
  flex-direction: column;
  gap: 4px;
  padding: 2px;
}

.phase-image-container.dual-image img {
  height: calc(50% - 2px);
  width: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

/* Custom scrollbar to keep it looking clean */
.movement-card::-webkit-scrollbar {
  width: 5px;
}
.movement-card::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 10px;
}
.gameplay-areas {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1vw, 16px);
  flex: 0 0 auto;
  align-self: stretch;
}

.area-card {
  background: #E8E8E8;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  min-height: 0;
}

.area-1, .area-2 {
  display: block;
  width: 100%;
  height: 100%;
  transform: none;
  border-radius: 12px;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.area-vid {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

 /* YELLOW */
.section-yellow { 
  background: var(--yellow); 
  padding: clamp(16px, 2.5vw, 40px); 
  display: flex; 
  flex-direction: column; 
}
.items-grid-layout { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: clamp(10px, 1.2vw, 20px); 
  flex: 1; 
}
.items-grid-card { 
  background: transparent; 
  border-radius: 16px; 
  display: flex; 
  flex-direction: column; 
  gap: clamp(20px, 2vw, 32px); 
}
.items-grid-title {
  font-family: 'Jersey 25', sans-serif;
  font-size: clamp(16px, 1.6vw, 26px);
  color: #E8C84A;
  text-align: center;
  background: #E8E8E8;
  color: var(--yellow);
  border-radius: 8px;
  padding: clamp(4px, 0.6vw, 10px) 0;
  flex-shrink: 0;
}
.items-grid {
  display: grid; 
  grid-template-columns: repeat(6, 1fr); 
  gap: clamp(6px, 0.7vw, 12px); 
  flex: 1; 
  align-content: start; 
}
.item-cell { 
  background: #fff; 
  border-radius: 10px; 
  aspect-ratio: 1; 
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15); 
  cursor: pointer; 
  transition: all 0.2s ease; 
  border: 3px solid transparent; 
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.item-cell:hover { 
  transform: scale(1.05); 
  box-shadow: 0 4px 12px rgba(0,0,0,0.2), inset 0 2px 4px rgba(0,0,0,0.15); 
}
.item-cell.active { 
  border-color: #E8C84A; 
  box-shadow: 0 0 12px rgba(232, 200, 74, 0.6), inset 0 2px 4px rgba(0,0,0,0.15); 
  transform: scale(1.08); 
}
.item-cell img.item {
  width: 100%;
  height: 100%;
  object-fit: contain; 
  padding: 15%;        
  display: block;
  image-rendering: pixelated; 
  image-rendering: crisp-edges;
}

/* MODIFIED: Tighter Card Layout to remove the bottom white gap */
.item-detail-card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: inset 0 3px 8px rgba(0,0,0,0.15);
  height: fit-content; /* Ensures the card only grows as much as the content */
  align-self: start;   /* Prevents the card from stretching to fill the vertical height */
}

/* MODIFIED: Uniform Preview Dimension */
.item-preview { 
  background: #bbb; 
  border-radius: 10px; 
  width: 100%;
  aspect-ratio: 16 / 9; /* Locks the dimension regardless of the image shape */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

/* ADDED: Ensures the preview image follows the uniform size rules */
.item-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10%;
  image-rendering: pixelated;
}

.item-name { 
  font-family: 'Jersey 25', sans-serif; 
  font-size: clamp(16px, 1.6vw, 26px); 
  color: #555; 
  margin: 0; /* Removed default margins */
}

.item-meta { 
  font-family: 'Jersey 25', sans-serif; 
  font-size: clamp(13px, 1.3vw, 20px); 
  color: #888; 
  margin: 0; /* Tightened spacing */
  line-height: 1.2;
}
  /* Mobile Small to Mobile Large (320px - 425px) */
  @media (max-width: 425px) {
    .hero { flex-direction: column; align-items: flex-start; height: auto; min-height: 100vh; }
    .hero-left { width: 100%; }
    .hero-tagline { 
      position: relative;
      top: auto;
      right: auto;
      text-align: left;
      white-space: normal;
    }
    .bag-scene { width: 100%; align-items: center; }
    .bag-container { width: min(100%, 520px); }
    .gameplay-grid {
      display: grid;
      grid-template-columns: 0.4fr 0.6fr;
      gap: clamp(10px, 1.2vw, 20px);
    }
    .gameplay-left {
      display: flex;
      flex-direction: column;
      gap: clamp(8px, 1vw, 16px);
      align-items: center;
      grid-column: 1;
      grid-row: 1;
      flex: 1;
    }
    .gameplay-areas {
      grid-column: 2;
      grid-row: 1;
      display: flex;
      flex-direction: column;
      gap: clamp(8px, 1vw, 16px);
      flex: 1;
      align-self: stretch;
    }
    .movement-card {
      grid-column: 1 / -1;
      grid-row: 2;
    }
    .items-grid-layout { 
      display: grid; 
      grid-template-columns: 1fr;
      grid-template-rows: auto auto auto auto;
      gap: clamp(12px, 1.5vw, 20px);
    }
    .items-grid-card { 
      display: contents;
    }
    .items-grid-title { 
      grid-row: 1;
      text-align: center;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .items-grid { 
      grid-row: 4;
    }
    .item-detail-card { 
      display: grid;
      grid-template-columns: 1fr;
      grid-template-rows: auto auto;
      gap: clamp(12px, 1.5vw, 20px);
      grid-row: 2 / 4;
    }
    .nav-bag img {
      width: 70% !important;
      height: 70% !important;
    }
  }

  /* Laptop Large+ (1025px - 1439px) */
  @media (min-width: 1025px) and (max-width: 1439px) {
    .hero {
      padding: 2.5vw 4vw;
      gap: 1vw;
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      max-width: 100vw;
      margin: 0 auto;
    }

    .hero-left {
      width: 100%;
      flex-basis: auto;
      align-items: center;
    }

    .bag-scene {
      width: min(100%, 50vw);
    }

    .bag-container {
      width: min(100%, 44vw);
    }

    .hero-tagline {
      font-size: clamp(18px, 1.5vw, 34px);
      flex-basis: auto;
      width: auto;
      margin-left: 0;
      position: absolute;
      top: 28px;
      right: 4vw;
      text-align: right;
      order: 0;
      max-width: 30vw;
    }

    .section-blue,
    .section-green,
    .section-red,
    .section-yellow {
      padding: 48px;
    }
  }

  /* Desktop Large (1440px+) - Fixed responsiveness for ultra-wide screens */
  @media (min-width: 1440px) {
    .hero {
      padding: 3vw 5vw;
      gap: 2vw;
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      max-width: 1400px;
      margin: 0 auto;
    }

    .hero-left {
      width: 45%;
      flex-basis: auto;
      align-items: flex-start;
    }

    .bag-scene {
      width: 50%;
      max-width: 600px;
    }

    .bag-container {
      width: 100%;
      max-width: 550px;
    }

    .hero-tagline {
      font-size: 32px;
      flex-basis: auto;
      width: auto;
      margin-left: 0;
      position: relative;
      top: auto;
      right: auto;
      text-align: right;
      order: 0;
      max-width: 100%;
      white-space: nowrap;
    }

    .section-blue,
    .section-green,
    .section-red,
    .section-yellow {
      padding: 60px 80px;
    }

    .gameplay-grid {
      grid-template-columns: 0.2fr 0.6fr 0.2fr;
      max-width: 1200px;
    }

    .items-grid {
      grid-template-columns: repeat(8, 1fr);
      max-width: 1200px;
    }

    .card {
      padding: 40px;
    }

    .about-card {
      padding: 48px;
    }
  }

  /* Laptop (769px - 1024px) */
  @media (min-width: 769px) and (max-width: 1024px) {
    .hero {
      padding: 3vw 3.5vw;
      gap: 1vw;
      flex-direction: column;
      align-items: flex-start;
      justify-content: flex-start;
    }

    .hero-left {
      width: 100%;
      flex-basis: auto;
      align-items: center;
    }

    .bag-scene {
      width: min(100%, 56vw);
    }

    .bag-container {
      width: min(100%, 42vw);
    }

    .hero-tagline {
      font-size: clamp(16px, 1.8vw, 26px);
      flex-basis: auto;
      width: auto;
      margin-left: 0;
      /* pin to top-right in this range */
      position: absolute;
      top: 22px;
      right: 3.5vw;
      text-align: right;
      max-width: 34vw;
      order: 0;
    }

    .gameplay-grid {
      grid-template-columns: 0.3fr 0.45fr 0.25fr;
    }

    .items-grid {
      grid-template-columns: repeat(5, 1fr);
    }
  }

  /* Tablet (426px - 768px) */
  @media (min-width: 426px) and (max-width: 768px) {
    .nav {
      top: auto;
      bottom: 12px;
      left: 12px;
      flex-direction: column-reverse;
      align-items: flex-start;
      gap: 10px;
    }

    .nav-top-row,
    .nav-bottom-row,
    .nav-links {
      display: flex;
      flex-direction: row;
      gap: 10px;
    }

    .nav-bag {
      width: 60px;
      height: 60px;
    }

    .bag-scene {
      width: 100%;
    }

    .bag-container {
      width: min(100%, 640px);
    }
    .nav-tab {
      font-size: 20px;
      height: 58px;
      padding: 0 18px;
    }

    .hero {
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 28px 20px;
      gap: 18px;
      min-height: 100vh;
    }
    .bag-scene { width: min(100%, 560px); }
    .bag-container { width: min(100%, 520px); }

    .hero-tagline {
      position: absolute;
      top: 20px;
      right: 20px;
      white-space: normal;
      text-align: right;
      font-size: clamp(16px, 3vw, 22px);
      max-width: 34vw;
    }

    .section-blue,
    .section-green,
    .section-red,
    .section-yellow {
      padding: 24px;
    }
    .section-yellow {
      padding-bottom: 100px;
    }
    .gameplay-grid {
      grid-template-columns: 0.38fr 0.62fr;
    }

    .gameplay-left {
      grid-column: 1;
      grid-row: 1;
    }

    .gameplay-areas {
      grid-column: 2;
      grid-row: 1;
    }

    .movement-card {
      grid-column: 1 / -1;
      grid-row: 2;
    }

    .items-grid-layout {
      grid-template-columns: 1fr;
    }

    .items-grid-card {
      gap: 20px;
    }

    .item-detail-card {
      grid-template-columns: 1fr 1fr;
    }
    #top-zone    { top: 12%; left: 26%; width: 48%; height: 20%; }
    #middle-zone { top: 50%; left: 29%; width: 42%; height: 26%; }
    #bottom-zone { top: 80%; left: 35%; width: 30%; height: 14%; }
    #side-zone   { top: 43%; right: 5%; width: 18%; height: 28%; }
    #side-2-zone { top: 43%; left: 5%; width: 18%; height: 28%; }
  }

  /* Mobile S to Mobile L extra refinements (320px - 425px) */
  @media (max-width: 425px) {
    .hero {
      flex-direction: column;
      align-items: center;
      height: auto;
      min-height: 100vh;
      padding: 24px 16px 20px;
    }
    .bag-scene {
      width: min(100%, 520px);
    }
    .bag-container {
      width: min(96vw, 500px);
    }
    .bag-caption {
      font-size: 12px;
      max-width: 92vw;
      margin-top: 8px;
    }
    .hero-tagline {
      position: relative;
      top: auto;
      right: auto;
      text-align: center;
      white-space: normal;
      max-width: 34vw;
      line-height: 1.4;
      font-size: clamp(12px, 2.8vw, 18px);
      margin: 0 0 12px 0;
      order: -1;
    }
    #top-zone    { top: 12%; left: 26%; width: 48%; height: 20%; }
    #middle-zone { top: 50%; left: 29%; width: 42%; height: 26%; }
    #bottom-zone { top: 80%; left: 35%; width: 30%; height: 14%; }
    #side-zone   { top: 43%; right: 5%; width: 18%; height: 28%; }
    #side-2-zone { top: 43%; left: 5%; width: 18%; height: 28%; }
    .section-yellow {
      padding-bottom: 80px;
    }
  }

  /* ensure caption sits under the bag and stays visible */
  .bag-caption {
    margin-top: clamp(6px, 0.8vw, 12px);
    z-index: 2;
  }