/* Live 21 Nov 2026.
   Device fixes for phones, tablets and iPad (portrait and landscape).
   No content changes. Keeps the dark, modest look. */

/* 1. Use the hamburger and solid header through 1023px.
   This covers iPad Pro 11 portrait (834) and large phones in landscape
   (852-932), where the desktop link row used to appear. See 1b for the quiz. */
@media (max-width: 1023px) {
  nav ul { display: none !important; }
  .mm-btn { display: flex !important; }
  nav {
    mix-blend-mode: normal;
    height: 64px;
    padding: 0 72px 0 5vw;
    background: rgba(17,17,17,.88);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(247,245,240,.12);
    color: #F7F5F0;
  }
  .mm-btn {
    top: 8px;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .lang {
    /* No transform: a transform would make position:fixed children
       (the language menu on phones) size against this 44px box. */
    top: 10px;
    right: 56px;
    transform: none;
  }
  .lang-menu {
    top: calc(100% + 22px);
    right: -52px;
  }
  .lang-menu::before { right: 68px; }
  .cover { padding-top: 80px; }
}

/* 2. Language menu must scroll when the list is taller than the screen
   (every phone in landscape, and short tablets). */
.lang-menu {
  max-height: calc(100vh - 76px);
  max-height: calc(100dvh - 76px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 3. Language button: 44px hit area, flag stays 26x13. */
.lang-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  overflow: visible;
}
.lang-btn svg {
  width: 26px;
  height: 13px;
  flex: none;
  box-shadow: 0 0 0 .5px rgba(247,245,240,.25);
  border-radius: 1.5px;
  overflow: hidden;
}

/* 4. When the desktop link row is shown, do not wrap mid-word
   (Japanese on iPad was wrapping character by character) and
   give links a 44px-tall hit area. */
@media (min-width: 1024px) {
  nav ul { flex-wrap: nowrap; }
  nav ul a {
    white-space: nowrap;
    /* Taller hit area without moving the text or the row. */
    padding-top: 15px;
    padding-bottom: 15px;
    margin-top: -15px;
    margin-bottom: -15px;
  }
  /* Keep the flag exactly where it was on wide screens; the 44px hit
     area extends around it without moving it. */
  .lang-btn { margin: -15.5px -9px; }
}

/* 1b. Quiz switched to the hamburger at 1100px. Show the link row from
   1024px, the same as every other page. */
@media (min-width: 1024px) and (max-width: 1100px) {
  nav ul { display: flex !important; }
  .mm-btn { display: none !important; }
  nav { padding: 16px 4vw; }
}

/* 5. Play video label was 8px below 760px. */
@media (max-width: 760px) {
  .kk-still .kv-b { font-size: 12px !important; }
  .kk-still .kv-b span { padding: 8px 12px 8px 10px; gap: 6px; }
}

/* 6. Ticket / blueprint panel sits above the hamburger (2147483646). */
body > .ixo-portal { z-index: 2147483647 !important; }

/* 7. Quiz page: fixed corner copyrights sit on the level cards and
   "Read the text" on short or mid widths. The footer already carries
   the copyright line. */
@media (max-height: 850px), (max-width: 1023px) {
  .corner { display: none !important; }
}

/* 8. "Read the text" and firsts summaries: easier to tap. */
details.rt summary,
details.kk-fd summary {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* 9. Full-width, scrollable language sheet on narrow or short screens.
   Comes last so it wins over the 1023px dropdown offsets. 100% top on a
   position:fixed menu would otherwise push the list below the viewport. */
@media (max-width: 600px), (max-height: 600px) {
  .lang-menu {
    position: fixed !important;
    top: 64px !important;
    left: 12px !important;
    right: 12px !important;
    min-width: 0 !important;
    max-height: calc(100vh - 76px);
    max-height: calc(100dvh - 76px);
    overflow-y: auto;
  }
  .lang-menu::before { display: none !important; }
}
