@font-face {
  font-family: 'Elice Digital Baeum';
  src: url('/snack-assets/fonts/EliceDigitalBaeum-Bold.otf') format('opentype');
  font-weight: 700;
  font-display: swap;
}

.playground-mode-row {
  --mode-icon-size: 50px;
  box-sizing: border-box;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: min(100%, 1800px);
  margin-inline: auto;
  padding: 6px 3%;
}

.playground-mode-row .site-brand-copy {
  width: auto;
  min-width: 0;
  flex: 1 1 auto;
  padding: 0;
  font-size: clamp(18px, 1.65vw, 24px);
}

.playground-mode-row .site-brand-copy strong {
  font-family: 'Elice Digital Baeum', sans-serif;
}

.playground-mode-slot .space-switch.mode-rendered {
  position: static !important;
  display: flex !important;
  flex-direction: row-reverse;
  gap: 8px;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: var(--mode-icon-size) !important;
  min-height: var(--mode-icon-size) !important;
  max-height: var(--mode-icon-size) !important;
  cursor: pointer;
  touch-action: manipulation;
}

.playground-mode-slot .space-switch.mode-rendered :is(.mode-art, .mode-art .mode-asset) {
  width: var(--mode-icon-size) !important;
  height: var(--mode-icon-size) !important;
}

.playground-mode-slot .space-switch .space-switch-hint {
  position: static;
  transform: none;
  padding: 5px 8px;
  font-size: 12px;
}

@media (max-width: 1050px) {
  /* Cover the top edge when the mobile viewport lands on a fractional pixel. */
  body > .site-header.unified-shell::before {
    content: "";
    position: absolute;
    inset: -8px 0 auto;
    height: 9px;
    background: #fffffa;
    pointer-events: none;
  }

  html:has(body[data-room-view] > .playground-mode-row) {
    scroll-padding-top: calc(var(--mode-mobile-header-height) + var(--mode-mobile-row-height));
  }

  body[data-room-view] > .playground-mode-row {
    --mode-icon-size: var(--mode-mobile-icon-size);
    position: sticky;
    top: var(--mode-mobile-header-height);
    z-index: 121;
    height: var(--mode-mobile-row-height);
    padding: 4px var(--mode-mobile-inset);
    background: var(--mode-mobile-background);
  }

  .playground-mode-row .site-brand-copy {
    font-size: var(--mode-mobile-title-size);
    line-height: 1.25;
  }
}

@layer compact-corrections {
  @media (max-width: 1050px) {
    html body[data-room-view] > .site-header.unified-shell {
      position: sticky !important;
      inset: 0 0 auto !important;
      height: var(--mode-mobile-header-height) !important;
      min-height: var(--mode-mobile-header-height) !important;
      z-index: 122;
      background: #fffffa;
    }

    html body[data-room-view] main .room-system :is(.approved-room-menu, .mobile-writing-strip) {
      position: relative !important;
      top: auto !important;
      z-index: auto;
    }

    html body[data-room-view] main .room-system .approved-room-menu .approved-room-link {
      --room-face: #e9ebdc;
      --room-edge: #cfd3be;
      border: 1px solid var(--room-edge) !important;
      background: var(--room-face) !important;
      box-shadow: 0 2px 0 var(--room-edge) !important;
      filter: saturate(.55);
      border-radius: 10px !important;
      background-image: none !important;
      transform: none !important;
    }

    html body[data-room-view] main .room-system .approved-room-menu .approved-room-link[href="#class-relay"] {
      --room-face: #e2eaeb;
      --room-edge: #cad8d9;
    }

    html body[data-room-view] main .room-system .approved-room-menu .approved-room-link[href="#class-poetry"] {
      --room-face: #eee5e8;
      --room-edge: #ded0d6;
    }

    html body[data-room-view] main .room-system .approved-room-menu .approved-room-link[href="#class-room-104"] {
      --room-face: #f2ebdd;
      --room-edge: #e1d5c1;
    }

    html body[data-room-view] main .room-system .approved-room-menu .approved-room-link::before,
    html body[data-room-view] main .room-system .approved-room-menu .approved-room-link::after {
      display: none !important;
    }

    html body[data-room-view] main .room-system .approved-room-menu .approved-room-link:is([aria-current="page"], .is-active) {
      filter: none !important;
      border-color: #385543 !important;
      box-shadow: inset 0 0 0 1px #385543, 0 3px 0 #385543, 0 5px 7px #263e3429 !important;
    }
  }
}

.playground-mode-row .site-brand-copy strong {
  font-size: calc(1em + 2px);
  white-space: nowrap;
}

.room-start-status {
  display: none;
}

body.room-starting > main > .story-classroom {
  visibility: hidden;
}

body.room-starting > main > .room-start-status {
  display: block;
  margin: 0;
  padding: 16px;
  color: #53665a;
  font: 13px/1.5 system-ui, sans-serif;
}

@layer compact-corrections {
  @media (max-width: 1050px) {
    html body[data-room-view] {
      padding-top: calc(var(--mode-mobile-header-height) + var(--mode-mobile-row-height)) !important;
    }

    html body[data-room-view] > .site-header.unified-shell,
    html body[data-room-view] > .playground-mode-row {
      position: fixed !important;
      inset-inline: 0 !important;
    }

    html body[data-room-view] > .site-header.unified-shell {
      top: 0 !important;
    }

    html body[data-room-view] > .playground-mode-row {
      top: var(--mode-mobile-header-height) !important;
    }
  }
}

@layer compact-corrections {
  @media (max-width: 1050px) {
    html body[data-room-view="room-104"] main > #room-104.room-system {
      position: relative !important;
      inset: auto !important;
      height: auto !important;
      max-height: none !important;
      overflow: visible !important;

      display: flex !important;
      flex-direction: column !important;
      align-items: stretch !important;

      min-height: calc(100dvh - var(--mode-mobile-header-height) - var(--mode-mobile-row-height));
      background: var(--room-canvas) !important;
      background-image: none !important;
      padding: 10px var(--mode-mobile-inset) 12px !important;
    }

    html body[data-room-view="room-104"] #room-104 > .story-sidebar {
      inset: auto !important;
      top: calc(var(--mode-mobile-header-height) + var(--mode-mobile-row-height)) !important;

      flex: 0 0 auto !important;
      height: auto !important;
      min-height: 0 !important;

      display: flex !important;
      flex-direction: column;
      position: sticky !important;
      order: -1 !important;
      z-index: 120;
      padding: 0 !important;
      margin: 0 !important;
      border: 0 !important;
      background: var(--room-canvas) !important;
      box-shadow: none !important;
    }

    html body[data-room-view="room-104"] #room-104 .story-sidebar :is(.room101-menu-heading, .room-topic-area) {
      display: none !important;
    }

    html body[data-room-view="room-104"] #room-104 > .reserved-room-status {
      order: 2 !important;
    }
  }
}
