.home-screen[hidden]{display:none}.home-screen{position:absolute;inset:0;z-index:6;display:flex;flex-direction:column;align-items:center;overflow:auto;padding:max(30px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left));background:linear-gradient(180deg,#10132666 0%,#10132630 30%,#101326ba 58%,#101326 80%),url('assets/arcade-tall.webp') center 40%/cover no-repeat;isolation:isolate}.is-home>.mobile-header,.is-home>main,.is-home>.control-dock{visibility:hidden}.home-brand{text-align:center;position:relative;z-index:1}.home-eyebrow{margin:0 0 17px;color:#b8aecb;font-size:10px;letter-spacing:3px}.home-brand h1{margin:0;color:#fff0cc;font-size:clamp(30px,9vw,44px);font-weight:950;line-height:1.2;letter-spacing:-1px;text-shadow:3px 3px #101428,4px 4px #101428}.home-brand h1 span{color:#ffdb72}.home-brand h1 i{font-style:normal;display:inline-block;transform:rotate(9deg);color:#ffdb72;margin-left:3px}.home-tagline{font-size:12px;color:#e1d3dc;letter-spacing:2px;margin:14px 0 0}.home-hero{position:relative;display:flex;flex:1 0 120px;min-height:120px;width:210px;max-height:310px;justify-content:center;align-items:flex-end;padding-bottom:12px;margin-top:12px}.home-character{width:90px;height:108px;overflow:visible;filter:drop-shadow(3px 4px #101428)}.home-speech{position:absolute;bottom:135px;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:11px;font-weight:700;background:#fff0ce;color:#282039;padding:8px 12px;border:2px solid #272139;box-shadow:3px 3px #15162b;clip-path:polygon(0 4px,4px 4px,4px 0,calc(100% - 4px) 0,calc(100% - 4px) 4px,100% 4px,100% 100%,0 100%)}.home-speech:after{content:'';position:absolute;bottom:-7px;left:58%;width:8px;height:8px;background:#fff0ce}.home-ledge{position:absolute;bottom:0;width:170px;height:15px;border-top:4px solid #c3e9b0;border-bottom:4px solid #25495f;background:repeating-linear-gradient(90deg,#3c8290 0 29px,#213b54 29px 33px);box-shadow:0 4px #131b32}.home-bottom{width:min(300px,100%);flex:none;margin-top:28px;text-align:center}.home-records{display:grid;grid-template-columns:repeat(3,1fr);padding:0 8px 18px;border-bottom:1px solid #6c5c7d66}.home-records>div{display:flex;flex-direction:column;gap:5px}.home-records>div+div{border-left:1px solid #6c5c7d55}.home-records strong{font:700 21px ui-monospace,monospace;color:#f3dbac}.home-records span{font-size:10px;color:#a59bb9}.home-start-group{display:flex;flex-direction:column;align-items:center;margin:20px 0 19px;gap:8px}.home-start-group strong{font-size:14px;letter-spacing:1px;color:#ffe6ab}.home-start-group small{font-size:10px;color:#afa2bd}.home-screen button{display:grid;place-items:center;width:38px;height:38px;padding:0;min-height:0;flex-shrink:0;border-radius:50%;border:1px solid #8e7a9e;background:#24243ddb;color:#f7e6c7;box-shadow:none;clip-path:none}.home-screen button svg,.menu-home-row button svg{width:18px;height:18px;fill:currentColor}.home-screen #home-start{width:56px;height:56px;border-color:#ffe5a3;background:#f5d17c;color:#29233a}.home-screen #home-start svg{width:24px;height:24px}.home-screen button:active{transform:translateY(2px);background:#5b496c}.home-screen #home-start:active{background:#d8b15c}.home-screen button[aria-pressed=false]{opacity:.6}.home-nav{display:flex;justify-content:center;gap:40px}.home-nav>div{display:flex;flex-direction:column;align-items:center;gap:7px;font-size:10px;color:#c0b4cc}.home-footnote{font-size:9px;line-height:1.6;color:#897f9c;letter-spacing:1px;margin:20px 0 0}.menu-home-row{border-top:1px solid #51435f;padding-top:12px;display:flex;align-items:center;justify-content:center;gap:10px}.menu-home-row button{width:34px;height:34px;padding:0;border:1px solid #796483;border-radius:50%;background:#302b46;color:#fff0cf;display:grid;place-items:center}.menu-home-row>span{font-size:11px}.menu-home-row small{display:block;font-size:9px;margin-top:3px;color:#a99cb8}.home-instructions{padding-left:20px;margin:16px 0;font-size:12px;line-height:1.6}.home-instructions li{padding:0 0 12px 4px;color:#f5dca8}.home-instructions strong{font-size:12px}.home-instructions p{margin:5px 0 0;color:#b9adc9;font-size:11px}.home-keyboard{font-size:10px;line-height:1.6;color:#b9adc9;border-top:1px solid #51435f;padding-top:12px}.is-home>.save-warning{z-index:8}
@media(max-height:700px) and (orientation:portrait){.home-screen{padding-top:max(22px,env(safe-area-inset-top));padding-bottom:max(12px,env(safe-area-inset-bottom))}.home-eyebrow{margin-bottom:10px}.home-tagline{margin-top:9px}.home-hero{flex-basis:104px;min-height:104px;max-height:190px;margin-top:6px}.home-character{width:65px;height:78px}.home-speech{bottom:100px;font-size:10px;padding:5px 9px}.home-ledge{width:140px;height:12px}.home-bottom{margin-top:17px}.home-records{padding-bottom:12px}.home-records strong{font-size:18px}.home-start-group{margin:12px 0;gap:6px}.home-screen #home-start{width:48px;height:48px}.home-footnote{margin-top:12px}}
@media(orientation:landscape) and (min-width:500px) and (max-height:500px){.home-screen{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto 1fr;column-gap:48px;padding:22px max(32px,env(safe-area-inset-right)) 16px max(32px,env(safe-area-inset-left));background-position:center 48%}.home-brand{grid-column:1;align-self:start}.home-brand h1{font-size:32px}.home-eyebrow{margin-bottom:10px}.home-tagline{margin-top:10px}.home-hero{grid-column:1;grid-row:2;justify-self:center;align-self:stretch;min-height:120px;margin-top:0}.home-character{width:70px;height:84px}.home-speech{bottom:108px}.home-bottom{grid-column:2;grid-row:1 / 3;justify-self:center;align-self:center;margin:0}.home-records{padding-bottom:12px}.home-start-group{margin:14px 0}.home-footnote{margin-top:12px}}

/* Keep the home actions within the game frame on touch screens and in short embeds. */
.home-screen {
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.home-brand {
  inline-size: min(100%, 42rem);
}

.home-brand h1 {
  font-size: clamp(26px, 7.2vw, 44px);
  letter-spacing: normal;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.home-eyebrow {
  margin-block-end: 10px;
  letter-spacing: .12em;
}

.home-tagline {
  margin-block-start: 9px;
  letter-spacing: .06em;
}

.home-hero {
  flex: 1 0 144px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-block-size: 144px;
  inline-size: min(280px, 100%);
  margin-block-start: 8px;
}

.home-character {
  flex: 0 0 auto;
}

.home-speech {
  position: relative;
  inset: auto;
  transform: none;
  max-inline-size: 100%;
  white-space: normal;
  text-align: center;
  text-wrap: balance;
}

.home-bottom {
  inline-size: min(360px, 100%);
  margin-block-start: clamp(10px, 2.8dvh, 24px);
}

.home-records {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-inline: 0;
}

.home-records > div {
  padding-inline: 4px;
  overflow-wrap: anywhere;
}

.home-records > div + div {
  border: 0;
  border-inline-start: 1px solid #6c5c7d55;
}

.home-screen .home-nav button {
  inline-size: 44px;
  block-size: 44px;
  touch-action: manipulation;
}

.home-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.home-nav > div,
.round-item > span {
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.home-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-block-start: 10px;
}

.home-meta .home-footnote {
  margin: 0;
  font-size: 10px;
  letter-spacing: normal;
  color: #b9adc9;
}

.game-language {
  max-inline-size: min(144px, 40vw);
  min-block-size: 44px;
  block-size: 44px;
  padding-inline: 8px;
  border: 1px solid #8e7a9e;
  border-radius: 10px;
  color: #fff0cf;
  background-color: #24243d;
  font-size: 16px;
  touch-action: manipulation;
}

.mobile-header {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
}

.mobile-header .hud-button,
.mobile-header .chapter button {
  min-inline-size: 44px;
  min-block-size: 44px;
}

.mobile-header .chapter button {
  inline-size: 44px;
}

.mobile-header .edition {
  max-inline-size: min(180px, 44vw);
}

.level-bar h1 {
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-bar #deaths {
  flex: none;
}

.run-status {
  max-inline-size: calc(100% - 28px);
  overflow-wrap: anywhere;
}

/* Directions remain physical, including when the interface language is RTL. */
.control-dock .touch-controls {
  direction: ltr;
}

.touch-controls .dpad button {
  min-inline-size: 44px;
  min-block-size: 44px;
}

.touch-controls #jump .jump-word {
  max-inline-size: calc(100% - 8px);
  font-size: clamp(13px, 3.8vw, 17px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

dialog.mobile-sheet {
  max-block-size: calc(100vh - 28px);
  max-block-size: calc(100dvh - 28px);
}

.mobile-sheet .modal-top button {
  flex-basis: 44px;
  width: 44px;
  height: 44px;
  touch-action: manipulation;
}

#level-jump {
  grid-template-columns: minmax(0, 1fr) auto;
}

#level-number,
#level-jump button {
  min-block-size: 44px;
}

#level-jump button {
  inline-size: auto;
  min-inline-size: 44px;
  padding-inline: 10px;
  border-radius: 10px;
}

.death-feedback > div {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.death-feedback button {
  inline-size: auto;
  min-inline-size: 44px;
  min-block-size: 44px;
  max-inline-size: 6rem;
  padding-inline: 8px;
  border-radius: 12px;
  overflow-wrap: anywhere;
}

[dir="rtl"] .level-bar h1 {
  border-left: 0;
  border-inline-start: 3px solid #dc4f95;
}

[dir="rtl"] .run-status {
  left: auto;
  inset-inline-start: 14px;
}

[dir="rtl"] .home-instructions {
  padding-inline: 20px 0;
}

@media (pointer: coarse) and (min-width: 700px) and (min-height: 501px) {
  .control-dock {
    padding-inline: max(32px, env(safe-area-inset-left)) max(32px, env(safe-area-inset-right));
  }

  .control-dock .dpad {
    --pad-size: 120px;
  }

  .control-dock #jump {
    inline-size: 80px;
    block-size: 80px;
  }
}

@media (max-height: 615px) and (orientation: portrait) {
  .home-screen {
    padding-block: max(12px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-bottom));
  }

  .home-hero {
    min-block-size: 104px;
    flex-basis: 104px;
    gap: 4px;
    padding-block-end: 10px;
  }

  .home-character {
    width: 54px;
    height: 65px;
  }

  .home-bottom {
    margin-block-start: 12px;
  }

  .home-records {
    padding-block-end: 8px;
  }

  .home-start-group {
    gap: 4px;
    margin-block: 10px;
  }

  .home-meta {
    margin-block-start: 6px;
  }
}

@media (max-width: 370px) and (max-height: 525px) {
  .home-screen {
    padding-block-start: max(8px, env(safe-area-inset-top));
  }

  .home-brand h1 {
    font-size: 23px;
  }

  .home-eyebrow {
    margin-block-end: 6px;
  }

  .home-tagline {
    margin-block-start: 4px;
  }

  .home-hero {
    min-block-size: 68px;
    flex-basis: 68px;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    margin-block-start: 6px;
    padding-block-end: 8px;
  }

  .home-speech {
    max-inline-size: 140px;
  }

  .home-character {
    width: 43px;
    height: 52px;
  }

  .home-bottom {
    margin-block-start: 10px;
  }

  .home-start-group {
    margin-block: 6px;
  }
}

@media (orientation: landscape) and (min-width: 500px) and (max-height: 500px) {
  .home-screen {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(16px, 5vw, 44px);
    padding-block: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-bottom));
  }

  .home-brand h1 {
    font-size: clamp(24px, 4.8vw, 38px);
  }

  .home-hero {
    flex-basis: 112px;
    min-block-size: 112px;
    padding-block-end: 12px;
  }

  .home-bottom {
    margin-block-start: 0;
  }

  .home-records {
    padding-block-end: 6px;
  }

  .home-start-group {
    margin-block: 8px;
    gap: 4px;
  }

  .home-screen #home-start {
    inline-size: 48px;
    block-size: 48px;
  }

  .home-meta {
    margin-block-start: 6px;
  }

  .run-status {
    top: 41px;
  }

  .dialog-layer {
    padding-inline: clamp(80px, 17vw, 136px);
  }

  .death-feedback {
    max-inline-size: calc(100% - min(260px, 38vw));
  }
}
