.prototype-body {
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(255, 219, 77, 0.3), transparent 25rem),
    radial-gradient(circle at 92% 14%, rgba(85, 223, 255, 0.22), transparent 23rem),
    linear-gradient(180deg, #edf7ff 0%, #f8fbff 46%, #ffffff 100%);
  background-attachment: fixed;
  padding-left: 0;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

@media (min-width: 1024px) {
  body.prototype-body {
    padding-left: 0;
  }
}

.prototype-shell {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 14px 16px 30px;
}

.prototype-header,
.prototype-user,
.detail-heading,
.audio-card-heading,
.detail-pdf,
.map-preserved-copy {
  display: flex;
  align-items: center;
}

.prototype-header {
  justify-content: space-between;
  gap: 10px;
  min-height: 82px;
  margin-bottom: 16px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 14px 34px rgba(31, 47, 79, 0.1);
  backdrop-filter: blur(14px);
}

.prototype-header .brand {
  width: clamp(210px, 26vw, 270px);
  aspect-ratio: 560 / 314;
  flex: 0 0 auto;
}

.prototype-header .brand-logo {
  width: 100%;
  height: auto;
  max-width: none;
  filter: none;
  transform: none;
}

.prototype-user {
  justify-content: flex-end;
  gap: 8px;
}

.world-avatar-button {
  position: relative;
  display: block;
  width: 66px;
  height: 66px;
  flex: 0 0 auto;
  padding: 3px;
  border: 2px solid rgba(85, 223, 255, 0.72);
  border-radius: 50%;
  color: #102754;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 0 rgba(8, 27, 66, 0.1), 0 9px 20px rgba(8, 27, 66, 0.12);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.world-avatar-button:hover,
.world-avatar-button:focus-visible {
  outline: 3px solid rgba(85, 223, 255, 0.48);
  outline-offset: 2px;
  box-shadow: 0 7px 0 rgba(8, 27, 66, 0.1), 0 13px 24px rgba(8, 27, 66, 0.16);
  transform: translateY(-2px);
}

.world-avatar-button:active {
  box-shadow: 0 2px 0 rgba(8, 27, 66, 0.1), 0 6px 14px rgba(8, 27, 66, 0.12);
  transform: translateY(2px);
}

.world-avatar-image {
  width: 100%;
  height: 100%;
  border: 2px solid white;
  border-radius: 50%;
  background: #eaf9ff;
  box-shadow: inset 0 -4px 0 rgba(8, 27, 66, 0.08);
  object-fit: cover;
}

.world-avatar-edit {
  position: absolute;
  right: -3px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 2px solid white;
  border-radius: 50%;
  color: #102754;
  background: #ffdb4d;
  box-shadow: 0 3px 7px rgba(8, 27, 66, 0.2);
  font-size: 0.72rem;
  font-weight: 900;
}

.world-logout-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-height: 42px;
  padding: 5px 10px;
  border: 1px solid #dce5f2;
  border-radius: 999px;
  color: #53627a;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 4px 12px rgba(8, 27, 66, 0.09);
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.world-logout-button:hover,
.world-logout-button:focus-visible {
  outline: 3px solid rgba(85, 223, 255, 0.42);
  outline-offset: 2px;
  color: #102754;
  background: white;
  transform: translateY(-1px);
}

.world-logout-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.world-logout-icon {
  font-size: 1.05rem;
  font-weight: 900;
}

.world-logout-copy {
  display: grid;
  line-height: 1;
  text-align: left;
}

.world-logout-copy strong {
  font-size: 0.7rem;
  font-weight: 900;
}

.world-logout-copy small {
  margin-top: 3px;
  font-size: 0.57rem;
  font-weight: 800;
}

.prototype-screen {
  animation: prototype-screen-in 180ms ease both;
}

#prototypeMain:focus {
  outline: none;
}

.world-board {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  background-color: #5ee2f5;
  background-image: url("assets/worlds/tortilla-three-islands-world-v1.jpg");
  background-position: center;
  background-size: cover;
  box-shadow: 0 18px 0 rgba(8, 27, 66, 0.1), 0 28px 60px rgba(8, 27, 66, 0.2);
}

.world-board::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(180deg, transparent 55%, rgba(13, 44, 87, 0.08));
  pointer-events: none;
}

.world-island {
  position: absolute;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 64px;
  padding: 8px 10px;
  border: 3px solid rgba(255, 255, 255, 0.96);
  border-radius: 20px;
  color: #172033;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 7px 0 rgba(8, 27, 66, 0.18), 0 14px 28px rgba(8, 27, 66, 0.2);
  text-align: left;
  transform: translate(-50%, -50%);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.world-island:hover,
.world-island:focus-visible {
  z-index: 4;
  outline: 4px solid rgba(85, 223, 255, 0.66);
  outline-offset: 3px;
  box-shadow: 0 9px 0 rgba(8, 27, 66, 0.18), 0 20px 34px rgba(8, 27, 66, 0.24);
  transform: translate(-50%, calc(-50% - 4px)) scale(1.02);
}

.world-island:active {
  box-shadow: 0 3px 0 rgba(8, 27, 66, 0.18), 0 10px 20px rgba(8, 27, 66, 0.2);
  transform: translate(-50%, calc(-50% + 3px));
}

.world-island-class {
  top: 53%;
  left: 29%;
  width: min(29%, 270px);
}

.world-island-scenarios {
  top: 31%;
  left: 73%;
  width: min(28%, 260px);
}

.world-island-backpack {
  top: 76%;
  left: 76%;
  width: min(25%, 230px);
}

.world-island-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  color: #102754;
  background: #55dfff;
  box-shadow: inset 0 -5px 0 rgba(8, 27, 66, 0.12);
  font-size: 1.2rem;
  font-weight: 900;
}

.world-island-scenarios .world-island-icon {
  background: #ffdb4d;
}

.world-island-backpack .world-island-icon {
  color: white;
  background: #7c5cff;
}

.world-island-copy {
  display: grid;
  min-width: 0;
  line-height: 1.05;
}

.world-island-copy strong {
  font-size: clamp(0.78rem, 1.45vw, 1.12rem);
}

.world-island-copy > span {
  margin-top: 3px;
  color: #596882;
  font-size: clamp(0.64rem, 1vw, 0.82rem);
  font-weight: 900;
}

.world-island-copy small {
  width: max-content;
  max-width: 100%;
  margin-top: 5px;
  padding: 4px 7px;
  overflow: hidden;
  border-radius: 999px;
  color: #0d7d49;
  background: #e5f9ef;
  font-size: clamp(0.58rem, 0.85vw, 0.72rem);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-island-scenarios .world-island-copy small {
  color: #7a4f00;
  background: #fff0bd;
}

.prototype-title-block {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

.prototype-title-block h1,
.detail-heading h1 {
  margin: 0;
  font-size: clamp(1.8rem, 9vw, 3rem);
  line-height: 1.02;
}

.prototype-title-block p,
.detail-heading p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.scenario-notice {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  margin-bottom: 14px;
  padding: 13px;
  border: 1px solid rgba(255, 159, 28, 0.28);
  border-radius: 22px;
  color: var(--ink);
  background: linear-gradient(135deg, #fff6d8, #ffffff 58%, #eafaf1);
  box-shadow: var(--small-shadow);
  text-align: left;
}

.scenario-notice.is-read small {
  color: var(--green-dark);
}

.scenario-notice-icon,
.access-card-icon {
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: white;
  background: linear-gradient(135deg, var(--orange), var(--coral));
  box-shadow: 0 10px 20px rgba(255, 112, 93, 0.2);
  font-size: 1.4rem;
}

.scenario-notice-icon {
  width: 48px;
  height: 48px;
}

.scenario-notice > span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.scenario-notice small,
.scenario-level {
  color: #9a5d00;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.scenario-notice strong {
  font-size: 1rem;
}

.scenario-notice span span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.scenario-notice-arrow {
  color: #9a5d00;
  font-size: 1.35rem;
  font-weight: 900;
}

.access-grid,
.scenario-library,
.backpack-list,
.audio-grid,
.support-list {
  display: grid;
  gap: 12px;
}

.access-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--small-shadow);
  text-align: left;
}

.access-card > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.access-card small {
  color: var(--muted);
  font-weight: 800;
}

.access-card-icon {
  grid-row: 1 / span 2;
  width: 50px;
  height: 50px;
}

.access-card-backpack .access-card-icon {
  background: linear-gradient(135deg, var(--blue), var(--purple));
}

.access-count {
  grid-column: 2;
  justify-self: start;
  padding: 5px 9px;
  border-radius: 999px;
  color: #0d7d49;
  background: #e5f9ef;
  font-size: 0.76rem;
  font-weight: 900;
}

.map-preserved {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 17px;
  border: 2px dashed rgba(63, 140, 255, 0.25);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.58);
}

.map-preserved-copy {
  gap: 12px;
}

.map-preserved-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 16px;
  color: #2367c7;
  background: #e9f2ff;
  font-size: 1.35rem;
  font-weight: 900;
}

.map-preserved p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.35;
}

.secondary-action,
.download-button,
.detail-pdf button,
.complete-button,
.detail-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 16px;
  font-weight: 900;
}

.secondary-action {
  color: #2367c7;
  background: #e9f2ff;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin: -2px -16px 16px;
  padding: 2px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--muted);
  background: white;
  box-shadow: 0 6px 14px rgba(31, 47, 79, 0.07);
  font-size: 0.84rem;
  font-weight: 900;
}

.filter-chip.is-active {
  color: white;
  background: linear-gradient(135deg, var(--green), var(--teal));
}

.scenario-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: white;
  box-shadow: var(--small-shadow);
}

.library-empty {
  display: grid;
  gap: 4px;
  padding: 22px;
  border: 1px dashed rgba(63, 140, 255, 0.32);
  border-radius: 22px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.library-empty strong {
  color: var(--ink);
}

.scenario-card > button {
  display: grid;
  width: 100%;
  padding: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.scenario-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e9f2ff;
}

.scenario-card-media img,
.detail-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scenario-status {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #7a4f00;
  background: #fff0bd;
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.scenario-card-media .scenario-status {
  position: absolute;
  top: 10px;
  left: 10px;
  box-shadow: 0 6px 16px rgba(31, 47, 79, 0.12);
}

.scenario-status[data-status="in_progress"] {
  color: #2367c7;
  background: #e9f2ff;
}

.scenario-status[data-status="completed"] {
  color: #0d7d49;
  background: #e5f9ef;
}

.scenario-card-body {
  display: grid;
  gap: 5px;
  padding: 15px;
}

.scenario-card h2,
.backpack-card h2,
.support-card h2 {
  margin: 0;
}

.scenario-card h2 {
  font-size: 1.35rem;
  line-height: 1.08;
}

.scenario-card p,
.backpack-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.scenario-card-body > small {
  margin-top: 6px;
  color: #2367c7;
  font-weight: 900;
}

.resource-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.resource-chips span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #46556f;
  background: #f1f5fb;
  font-size: 0.72rem;
  font-weight: 900;
}

.backpack-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: white;
  box-shadow: var(--small-shadow);
}

.backpack-file-icon,
.detail-pdf-icon {
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: white;
  background: linear-gradient(135deg, var(--coral), var(--orange));
  font-size: 0.72rem;
  font-weight: 900;
}

.backpack-file-icon {
  width: 52px;
  height: 58px;
}

.backpack-card h2 {
  font-size: 1.05rem;
  line-height: 1.15;
}

.backpack-card p {
  margin-top: 4px;
  font-size: 0.84rem;
}

.download-button {
  grid-column: 1 / -1;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--purple));
}

.detail-back {
  margin: 0 0 14px;
  padding-left: 0;
  color: #2367c7;
  background: transparent;
}

.detail-heading {
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.detail-heading h1 {
  font-size: clamp(1.75rem, 8vw, 2.8rem);
}

.detail-visual {
  aspect-ratio: 16 / 9;
  margin: 0 0 14px;
  overflow: hidden;
  border-radius: 24px;
  background: #e9f2ff;
  box-shadow: var(--small-shadow);
}

.audio-card,
.support-card,
.detail-pdf {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
  box-shadow: 0 10px 24px rgba(31, 47, 79, 0.08);
}

.audio-card {
  display: grid;
  gap: 12px;
  padding: 13px;
}

.audio-card-heading {
  gap: 10px;
}

.audio-card-heading > span:first-child {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  color: white;
  background: linear-gradient(135deg, var(--green), var(--teal));
  font-size: 1.2rem;
}

.audio-card-heading > span:last-child {
  display: grid;
}

.audio-card small,
.detail-pdf small {
  color: var(--muted);
  font-weight: 800;
}

.audio-card audio {
  width: 100%;
  height: 42px;
}

.support-card {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 15px;
}

.support-list > div {
  display: grid;
  gap: 2px;
  padding: 11px 12px;
  border-radius: 16px;
  background: #f6f8fc;
}

.support-list span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.detail-pdf {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 11px;
  margin-top: 14px;
  padding: 13px;
}

.detail-pdf-icon {
  grid-row: 1 / span 2;
  width: 48px;
  height: 52px;
}

.detail-pdf > span:nth-child(2) {
  display: grid;
}

.detail-pdf button {
  grid-column: 1 / -1;
  color: #2367c7;
  background: #e9f2ff;
}

.complete-button {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  color: white;
  background: linear-gradient(135deg, var(--green), var(--teal));
  box-shadow: 0 12px 24px rgba(20, 184, 166, 0.2);
}

.complete-button.is-completed {
  color: #0d7d49;
  background: #e5f9ef;
  box-shadow: none;
}

.prototype-toast {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: 16px;
  z-index: 40;
  max-width: 460px;
  margin: 0 auto;
  padding: 13px 16px;
  border-radius: 18px;
  color: white;
  background: #172033;
  box-shadow: var(--shadow);
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 180ms ease;
}

.prototype-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.prototype-error {
  padding: 24px;
  border-radius: 24px;
  background: white;
  box-shadow: var(--small-shadow);
}

.prototype-error p {
  margin: 6px 0 0;
  color: var(--muted);
}

@media (min-width: 700px) {
  .prototype-shell {
    padding-top: 22px;
  }

  .access-grid,
  .audio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scenario-card > button {
    grid-template-columns: minmax(280px, 44%) minmax(0, 1fr);
  }

  .scenario-card-media {
    min-height: 230px;
  }

  .backpack-card {
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
  }

  .download-button {
    grid-column: 3;
  }

  .map-preserved {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

}

@media (max-width: 560px) {
  .prototype-shell {
    padding: 10px 12px 26px;
  }

  .prototype-header {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 72px;
    margin-bottom: 12px;
    padding: 7px 8px;
    border-radius: 22px;
  }

  .prototype-header .brand {
    width: min(58vw, 200px);
    justify-self: center;
  }

  .prototype-user {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 58px auto;
    gap: 7px;
    width: 100%;
    align-items: center;
  }

  .world-avatar-button {
    width: 58px;
    height: 58px;
  }

  .world-logout-button {
    min-height: 40px;
    padding-inline: 8px;
  }

  .world-board {
    aspect-ratio: 941 / 1672;
    border-width: 3px;
    border-radius: 22px;
    background-image: url("assets/worlds/tortilla-three-islands-world-mobile-v1.jpg");
  }

  .world-island {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px;
    min-height: 60px;
    padding: 8px 10px;
    border-width: 2px;
    border-radius: 17px;
    box-shadow: 0 6px 0 rgba(8, 27, 66, 0.2), 0 12px 22px rgba(8, 27, 66, 0.2);
  }

  .world-island-class {
    top: 29%;
    left: 50%;
    width: 78%;
  }

  .world-island-scenarios {
    top: 62%;
    left: 50%;
    width: 78%;
  }

  .world-island-backpack {
    top: 87%;
    left: 50%;
    width: 74%;
  }

  .world-island-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 1rem;
  }

  .world-island-copy strong {
    font-size: 0.88rem;
  }

  .world-island-copy > span {
    margin-top: 2px;
    font-size: 0.68rem;
  }

  .world-island-copy small {
    margin-top: 4px;
    padding: 3px 6px;
    font-size: 0.6rem;
  }

  .prototype-user .pill {
    max-width: 100%;
    overflow: hidden;
    padding-inline: 12px;
    font-size: 0.86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 380px) {
  .prototype-header {
    grid-template-columns: 1fr;
  }

  .prototype-header .brand {
    width: min(68vw, 190px);
    justify-self: center;
  }

  .prototype-user {
    grid-template-columns: minmax(0, 1fr) 58px auto;
    width: 100%;
    align-items: center;
  }

  .prototype-user .pill {
    justify-self: start;
  }
}

@keyframes prototype-screen-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
