:root {
  color-scheme: light;
  font-family: Arial, Helvetica, system-ui, sans-serif;
  background: #f4d83d;
  color: #0b347f;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html,
body,
#experience {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body { background: #f4d83d; }

#experience {
  position: relative;
  min-width: 280px;
  isolation: isolate;
}

#world {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  outline: 0;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#world:focus-visible {
  box-shadow: inset 0 0 0 4px #ffffff, inset 0 0 0 7px #0b347f;
}

.skip-link {
  position: fixed;
  z-index: 20;
  left: 12px;
  top: 10px;
  min-height: 44px;
  padding: 14px 16px;
  color: #ffffff;
  background: #0b347f;
  font: 700 11px/1.2 Arial, Helvetica, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.edge-action,
#replay {
  position: absolute;
  z-index: 5;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-bottom: 2px solid currentColor;
  padding: 12px 3px 9px;
  color: #0b347f;
  background: #f8f7ef;
  font: 800 11px/1 Arial, Helvetica, sans-serif;
  letter-spacing: .13em;
  text-transform: uppercase;
  cursor: pointer;
}

.edge-action {
  right: max(15px, env(safe-area-inset-right));
  top: 50%;
  writing-mode: vertical-rl;
  transform: translateY(-50%);
  min-width: 48px;
  min-height: 178px;
  padding-inline: 13px;
  transition: opacity 140ms linear;
}

.edge-action:disabled {
  opacity: .52;
  cursor: not-allowed;
  color: #315a9c;
  background: rgba(248, 247, 239, .86);
}

.edge-action[aria-pressed="true"] { background: #f4d83d; }

.edge-action:focus-visible,
#replay:focus-visible {
  outline: 4px solid #ffffff;
  outline-offset: 4px;
  box-shadow: 0 0 0 7px #0b347f;
}

.ending {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

#replay {
  right: max(17px, calc(env(safe-area-inset-right) + 12px));
  bottom: max(15px, calc(env(safe-area-inset-bottom) + 10px));
  pointer-events: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.no-script {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: max(22px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  overflow: hidden;
  background: linear-gradient(#a8dff0 0 78%, #f8f7ef 78% 100%);
}

.no-script header,
.no-script p {
  display: flex;
  justify-content: space-between;
  max-width: 760px;
  margin: 0;
  color: #0b347f;
  font: 800 11px/1.35 Arial, Helvetica, sans-serif;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.no-script p { align-self: end; max-width: 520px; }

.static-plan {
  position: relative;
  place-self: center;
  width: min(78vw, 780px);
  height: min(66vh, 590px);
}

.wing {
  position: absolute;
  left: 46%;
  top: 43%;
  width: 43%;
  height: 14%;
  transform-origin: 9% 50%;
  box-shadow: 9px 9px 0 rgba(11, 52, 127, .14);
}

.wing-1 { background: #143fa5; transform: rotate(0deg); }
.wing-2 { background: #f26a5e; transform: rotate(60deg); }
.wing-3 { background: #f4d83d; transform: rotate(120deg); }
.wing-4 { background: #f8f7ef; transform: rotate(180deg); }
.wing-5 { background: #23b9bc; transform: rotate(240deg); }
.wing-6 { background: #398bd0; transform: rotate(300deg); }

.static-spiral {
  position: absolute;
  left: 34%;
  top: 25%;
  color: #0b347f;
  font: 400 min(31vw, 260px)/1 Arial, sans-serif;
  transform: rotate(24deg);
}

@media (max-width: 559px) {
  .edge-action {
    right: max(8px, env(safe-area-inset-right));
    min-width: 46px;
    min-height: 166px;
    font-size: 10px;
  }

  .static-plan { width: 84vw; height: 58vh; }
  .no-script p { max-width: 88vw; font-size: 10px; }
}

@media (pointer: coarse) {
  #world { cursor: default; }
  .edge-action { opacity: 1; }
  .edge-action:disabled { opacity: .66; }
}

@media (prefers-reduced-motion: reduce) {
  .edge-action { transition: none; }
  #world { cursor: default; }
}
