/* Main menu, loading, pause menu, settings, help and intro screen. */
:root {
  --acc: #ffd23f;
  --red: #e63946;
  --ink: #0b0e17;
  --panel: #0f131e;
  --line: rgba(255, 255, 255, 0.11);
  --text: #e9edf7;
  --mute: #9aa3b8;
  --disp: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
}
.nojs {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: var(--ink);
  font-size: 18px;
}
#verbadge {
  position: fixed;
  right: 10px;
  bottom: 5px;
  font: 500 10.5px Inter, Arial, sans-serif;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 0 3px #000;
  z-index: 11;
  pointer-events: none;
}

/* ---------- start screen ---------- */
#start {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: var(--text);
}
/* shown while the world is being built (nothing is rendered yet), fades away to reveal the city */
.ms-back {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(64deg, transparent 0 78px, rgba(255, 255, 255, 0.028) 78px 80px),
    repeating-linear-gradient(-31deg, transparent 0 118px, rgba(255, 255, 255, 0.028) 118px 120px),
    radial-gradient(120% 90% at 78% 40%, #1c2742 0%, #0e1322 55%, #07090f 100%);
  transition: opacity 1.4s ease;
}
#start.ready .ms-back {
  opacity: 0;
}
.ms-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 9, 15, 0.93) 0%, rgba(7, 9, 15, 0.78) 26%, rgba(7, 9, 15, 0.2) 58%, rgba(7, 9, 15, 0) 76%),
    linear-gradient(0deg, rgba(7, 9, 15, 0.85) 0%, rgba(7, 9, 15, 0) 24%);
}
.ms-main {
  position: relative;
  width: min(470px, 100%);
  margin-left: max(env(safe-area-inset-left), clamp(22px, 6.5vw, 110px));
  padding: 16px 0 44px;
}
.ms-kicker {
  font: 700 11.5px Inter, sans-serif;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--mute);
  display: flex;
  align-items: center;
  gap: 10px;
}
.ms-kicker::before {
  content: '';
  width: 26px;
  height: 2px;
  background: var(--acc);
}
#start h1 {
  font-family: var(--disp);
  font-weight: 400;
  font-size: clamp(64px, 10.4vw, 142px);
  line-height: 0.86;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--acc);
  margin: 12px 0 0 -3px;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.55), 0 0 60px rgba(255, 210, 63, 0.16);
}
#start h1 .sub {
  display: block;
  width: fit-content;
  font-size: 0.34em;
  line-height: 1;
  letter-spacing: 0.3em;
  color: #fff;
  background: var(--red);
  padding: 0.2em 0.1em 0.1em 0.42em;
  margin: 0.34em 0 0 3px;
  text-shadow: none;
  vertical-align: top;
  transform: skewX(-8deg);
}
.ms-tag,
.ms-menu .mi,
#tip {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
#start:not(.has-save) #play,
#start.has-save #cont {
  text-shadow: none;
}
.ms-tag {
  font-size: 15px;
  font-weight: 500;
  color: #c9d0e0;
  margin: 14px 0 0;
  letter-spacing: 0.01em;
}
.ms-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-top: clamp(16px, 4.5vh, 40px);
}
.mi {
  font-family: var(--disp);
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  color: rgba(233, 237, 247, 0.82);
  background: none;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  padding: 7px 22px 4px 14px;
  margin-left: -17px;
  cursor: pointer;
  transition:
    transform 0.14s ease,
    color 0.14s ease,
    background-color 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}
.mi:hover,
.mi:focus-visible,
.mi:focus {
  outline: none;
  color: var(--acc);
  border-left-color: var(--acc);
  background: linear-gradient(90deg, rgba(255, 210, 63, 0.2), rgba(255, 210, 63, 0));
  transform: translateX(8px);
}
.mi:disabled {
  opacity: 0.32;
  cursor: default;
  transform: none;
  background: none;
  border-left-color: transparent;
  color: rgba(233, 237, 247, 0.82);
}
.mi[hidden] {
  display: none;
}
/* the primary action: Pokračovat when a save exists, otherwise Nová hra */
#start:not(.has-save) #play,
#start.has-save #cont,
.pmenu .mi[data-a='resume'] {
  font-size: 40px;
  color: #14110a;
  background: var(--acc);
  border-left: 0;
  margin: 0 0 10px 0;
  padding: 10px 30px 6px 20px;
  min-width: 250px;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.75);
  clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.6));
}
#start:not(.has-save) #play:focus,
#start.has-save #cont:focus,
.pmenu .mi[data-a='resume']:focus {
  background: var(--acc);
  color: #14110a;
  transform: translateX(8px);
}
#start:not(.has-save) #play:hover,
#start.has-save #cont:hover,
.pmenu .mi[data-a='resume']:hover {
  background: #fff;
  color: #14110a;
  transform: translateX(8px);
}
#start:not(.has-save) #play:disabled,
#start.has-save #cont:disabled {
  background: var(--acc);
  color: #14110a;
  transform: none;
}
#contBox {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
#contInfo {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--acc);
  margin: -2px 0 12px 1px;
  letter-spacing: 0.01em;
}
#start:not(.has-save) #contBox {
  display: none !important;
}

/* loading */
.ms-load {
  width: min(330px, 86vw);
  margin-top: 22px;
  transition: opacity 0.5s;
}
#start.ready .ms-load {
  opacity: 0;
  visibility: hidden;
}
.ms-loadrow {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #c9d0e0;
  min-height: 18px;
}
#loadpct {
  font-variant-numeric: tabular-nums;
  color: var(--acc);
  font-weight: 700;
}
#loadbar {
  height: 4px;
  margin-top: 7px;
  background: rgba(255, 255, 255, 0.13);
  overflow: hidden;
}
#loadbar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--acc);
  transition: width 0.3s ease;
}
.ms-fatal {
  width: min(430px, 90vw);
  margin-top: 20px;
  padding: 14px 16px 16px;
  background: rgba(40, 6, 12, 0.88);
  border-left: 3px solid var(--red);
}
.ms-fatal b {
  font-family: var(--disp);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: 0.04em;
  color: #ff8a80;
}
.ms-fatal p {
  font-size: 14px;
  line-height: 1.5;
  margin: 4px 0 8px;
}
.ms-fatal small {
  display: block;
  font: 11.5px ui-monospace, Menlo, Consolas, monospace;
  color: var(--mute);
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}
.ms-fatal small:empty {
  display: none;
}
#fatalRetry,
.pb,
#storyGo,
.ovx {
  font-family: var(--disp);
  font-size: 22px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  color: #14110a;
  background: var(--acc);
  border: 2px solid var(--acc);
  border-radius: 3px;
  padding: 9px 18px 6px;
  cursor: pointer;
}
#fatalRetry:hover,
.pb:hover,
#storyGo:hover,
#fatalRetry:focus-visible,
.pb:focus-visible,
#storyGo:focus-visible {
  background: #fff;
  border-color: #fff;
  outline: none;
}
.ghost,
.ovx {
  background: none;
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.28);
}
.ghost:hover,
.ovx:hover,
.ghost:focus-visible,
.ovx:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--acc);
  color: var(--acc);
  outline: none;
}
#start.failed .ms-menu {
  display: none;
}

.ms-foot {
  position: absolute;
  left: max(env(safe-area-inset-left), clamp(22px, 6.5vw, 110px));
  right: 16px;
  bottom: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 12.5px;
  color: var(--mute);
}
#tip {
  color: #dfe4f0;
  font-weight: 500;
  min-height: 18px;
}
#tip .tg {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 7px 2px;
  margin-right: 9px;
  color: #fff;
  vertical-align: 1px;
}
.tg-k {
  background: #c8303c;
}
.tg-z {
  background: #7d49c9;
}
.tg-m {
  background: #1f877b;
}
.tg-t {
  background: #c9722c;
}
.ms-credit {
  white-space: nowrap;
  font-size: 11.5px;
}
.ms-credit a {
  color: #c3cbe0;
}

/* short screens (phones in landscape) */
@media (max-height: 520px) {
  .ms-main {
    padding: 8px 0 38px;
  }
  #start h1 .sub {
    display: inline-block;
  }
  #start h1 {
    font-size: clamp(46px, 15vh, 76px);
    margin-top: 6px;
  }
  .ms-tag .ms-desc {
    display: none;
  }
  .ms-menu {
    margin-top: 12px;
    gap: 0;
  }
  .mi {
    font-size: 25px;
    padding: 6px 20px 3px 14px;
  }
  #start:not(.has-save) #play,
  #start.has-save #cont,
  .pmenu .mi[data-a='resume'] {
    font-size: 31px;
    padding: 8px 28px 4px 18px;
    margin-bottom: 6px;
    min-width: 210px;
  }
  #contInfo {
    margin-bottom: 6px;
  }
  .ms-load,
  .ms-fatal {
    margin-top: 10px;
  }
  .ms-foot {
    bottom: 18px;
  }
}
@media (max-height: 360px) {
  .ms-kicker {
    display: none;
  }
  .mi {
    font-size: 22px;
    padding: 4px 18px 2px 14px;
  }
}
/* portrait phones: title on top, menu at the bottom, the city in between */
@media (max-width: 620px) and (orientation: portrait) {
  #start {
    align-items: stretch;
  }
  .ms-scrim {
    background:
      linear-gradient(180deg, rgba(7, 9, 15, 0.9) 0%, rgba(7, 9, 15, 0.55) 26%, rgba(7, 9, 15, 0) 42%),
      linear-gradient(0deg, rgba(7, 9, 15, 0.96) 0%, rgba(7, 9, 15, 0.86) 36%, rgba(7, 9, 15, 0) 62%);
  }
  .ms-main {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: max(env(safe-area-inset-top), 28px) 22px 96px;
  }
  #start h1 {
    font-size: min(21.5vw, 104px);
  }
  .ms-menu {
    margin-top: auto;
  }
  .ms-foot {
    left: 22px;
    right: 22px;
    bottom: 24px;
    flex-direction: column;
    align-items: flex-start;
  }
  .ms-credit {
    white-space: normal;
  }
}

/* ---------- overlays (pause, settings, help, confirm) ---------- */
.ov {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left));
  background: rgba(6, 8, 14, 0.74);
  color: var(--text);
  animation: ovin 0.16s ease-out;
}
.ov.under {
  visibility: hidden;
}
#settings,
#help {
  z-index: 41;
}
#uiConfirm {
  z-index: 42;
}
@keyframes ovin {
  from {
    opacity: 0;
  }
}
.ovp {
  display: flex;
  flex-direction: column;
  max-height: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--acc);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}
.ovh {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px 10px 22px;
  border-bottom: 1px solid var(--line);
}
.ov h3 {
  font-family: var(--disp);
  font-weight: 400;
  font-size: 36px;
  line-height: 1;
  letter-spacing: 0.05em;
  color: var(--acc);
  margin: 4px 0 0;
}
.ovx {
  font-size: 18px;
  padding: 7px 14px 4px;
  flex: none;
}
.ov h4 {
  font: 800 11px Inter, sans-serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--acc);
}

/* pause */
.pp {
  width: min(430px, 100%);
  padding: 20px 26px 22px 30px;
  overflow: auto;
  touch-action: pan-y;
}
.ph {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.pp h3 {
  font-size: 64px;
  line-height: 0.85;
}
.pstats {
  display: flex;
  gap: 18px;
  text-align: right;
}
.pstats small {
  display: block;
  font: 700 10px Inter, sans-serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mute);
}
.pstats b {
  font-family: var(--disp);
  font-weight: 400;
  font-size: 25px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pstats b.low {
  color: #ff6a5f;
}
#pauseMoney {
  color: #9be37a;
}
.pnote {
  font-size: 13px;
  color: var(--mute);
  margin: 10px 0 16px;
}
.pmenu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.pmenu .mi[data-a='quit'] {
  margin-top: 8px;
  color: rgba(233, 237, 247, 0.6);
  font-size: 24px;
}
.pmenu .mi[data-a='quit']:hover,
.pmenu .mi[data-a='quit']:focus {
  color: #ff8a80;
  border-left-color: #ff8a80;
  background: linear-gradient(90deg, rgba(230, 57, 70, 0.22), rgba(230, 57, 70, 0));
}

/* confirm */
.cf {
  width: min(430px, 100%);
  padding: 22px 26px 24px;
}
.cf p {
  font-size: 15px;
  line-height: 1.5;
  margin: 10px 0 20px;
  color: #cfd5e4;
}
.cfb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* settings */
.sp {
  width: min(640px, 100%);
}
.sbody {
  overflow: auto;
  touch-action: pan-y;
  padding: 6px 22px 10px;
}
.sbody section {
  padding: 14px 0 6px;
}
.sbody section + section {
  border-top: 1px solid var(--line);
}
.srow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  padding: 9px 0;
}
.sl {
  font-size: 15px;
  font-weight: 600;
  min-width: 0;
}
.sl small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--mute);
  margin-top: 2px;
  line-height: 1.35;
}
.sc2 {
  flex: none;
}
.seg {
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 3px;
  overflow: hidden;
}
.seg button {
  font: 600 13.5px Inter, sans-serif;
  color: var(--text);
  background: none;
  border: 0;
  padding: 9px 14px;
  cursor: pointer;
}
.seg button + button {
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}
.seg button.on {
  background: var(--acc);
  color: #14110a;
}
.seg button:not(.on):hover {
  background: rgba(255, 255, 255, 0.1);
}
.tgl,
.sflash {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 13.5px Inter, sans-serif;
  color: var(--mute);
  background: none;
  border: 0;
  padding: 6px 0 6px 6px;
  cursor: pointer;
}
.tgl .tv {
  min-width: 62px;
  text-align: left;
}
.sw {
  position: relative;
  flex: none;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #2a3145;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  transition: background-color 0.15s;
}
.sw::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c9d0e0;
  transition: transform 0.15s;
}
.tgl.on,
.sflash input:checked ~ span {
  color: var(--text);
}
.tgl.on .sw,
.sflash input:checked + .sw {
  background: var(--acc);
}
.tgl.on .sw::after,
.sflash input:checked + .sw::after {
  transform: translateX(20px);
  background: #14110a;
}
.rng {
  display: flex;
  align-items: center;
  gap: 12px;
}
.rng input {
  width: min(210px, 38vw);
  height: 28px;
  accent-color: var(--acc);
  cursor: pointer;
  touch-action: pan-y;
}
.rng output {
  min-width: 46px;
  text-align: right;
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.sfoot {
  padding: 12px 22px 16px;
  border-top: 1px solid var(--line);
}
.sfoot .pb {
  font-size: 17px;
  padding: 7px 14px 4px;
}
.seg button:focus-visible,
.tgl:focus-visible,
.rng input:focus-visible,
.htabs button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -3px;
}
.seg button:focus-visible,
.sflash input:focus-visible + .sw,
.ms-credit a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
@media (max-width: 520px) {
  .srow {
    flex-direction: column;
    align-items: flex-start;
  }
  .tgl {
    padding-left: 0;
  }
}

/* help */
.hp {
  width: min(840px, 100%);
  height: min(540px, 100%);
}
.hbody {
  display: grid;
  grid-template-columns: 218px 1fr;
  min-height: 0;
  flex: 1;
}
.htabs {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  border-right: 1px solid var(--line);
  overflow: auto;
}
.htabs button {
  font-family: var(--disp);
  font-size: 22px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
  color: rgba(233, 237, 247, 0.7);
  background: none;
  border: 0;
  border-left: 3px solid transparent;
  padding: 9px 16px 6px 19px;
  cursor: pointer;
}
.htabs button:hover {
  color: #fff;
}
.htabs button.on {
  color: var(--acc);
  border-left-color: var(--acc);
  background: linear-gradient(90deg, rgba(255, 210, 63, 0.16), rgba(255, 210, 63, 0));
}
.hpanes {
  overflow: auto;
  touch-action: pan-y;
  padding: 18px 24px 20px;
  font-size: 14.5px;
  line-height: 1.5;
}
.hpanes h4 {
  margin-bottom: 10px;
}
.hpanes .lead {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 12px;
}
.hpanes b {
  color: #ffe27a;
  font-weight: 700;
}
.hl {
  list-style: none;
}
.hl li {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.hl li:first-child {
  border-top: 0;
}
.hk {
  color: var(--acc);
  font-weight: 700;
  white-space: nowrap;
}
[data-pane='cil'] .hl li,
[data-pane='prachy'] .hl li,
[data-pane='pozor'] .hl li,
[data-pane='mobil'] .hl li {
  grid-template-columns: 34px 1fr;
}
@media (max-width: 680px) {
  .hbody {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .htabs {
    flex-direction: row;
    padding: 0 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    touch-action: pan-x;
  }
  .htabs button {
    font-size: 19px;
    border-left: 0;
    border-bottom: 3px solid transparent;
    padding: 10px 11px 5px;
  }
  .htabs button.on {
    border-bottom-color: var(--acc);
    background: none;
  }
  .hpanes {
    padding: 14px 16px 18px;
  }
  .hl li {
    grid-template-columns: 96px 1fr;
    gap: 10px;
  }
}
@media (max-height: 440px) {
  .ovh {
    padding: 8px 16px 5px 20px;
  }
  .ov h3 {
    font-size: 28px;
  }
  .htabs {
    padding: 4px 0;
  }
  .htabs button {
    font-size: 19px;
    padding: 6px 14px 4px 17px;
  }
  .hpanes {
    padding: 12px 20px 14px;
  }
  .pp {
    padding: 12px 22px 14px 26px;
  }
  .pp h3 {
    font-size: 44px;
  }
  .pnote {
    display: none;
  }
  .ph {
    margin-bottom: 10px;
  }
  .sfoot {
    padding: 8px 22px 10px;
  }
}

/* ---------- intro / story ---------- */
#story {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  overflow: auto;
  touch-action: pan-y;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left));
  background: rgba(6, 8, 14, 0.84);
  color: var(--text);
  animation: ovin 0.2s ease-out;
}
#story .sc {
  margin: auto;
  width: min(820px, 100%);
  display: flex;
  gap: 26px;
  align-items: flex-start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--acc);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  padding: 24px 26px;
}
#story canvas {
  flex: none;
  width: 200px;
  height: auto;
  border: 2px solid var(--acc);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.6);
  background: #1a2238;
  transform: rotate(-1.5deg);
  margin-top: 6px;
}
#story .st {
  flex: 1;
  min-width: 0;
}
#story h3 {
  font-family: var(--disp);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 46px);
  line-height: 0.95;
  letter-spacing: 0.04em;
  color: var(--acc);
  margin: 10px 0 10px;
}
#story p {
  font-size: 15px;
  line-height: 1.55;
  color: #dfe4f0;
  margin: 0 0 8px;
}
#story .goal {
  display: inline-block;
  font-family: var(--disp);
  font-size: 22px;
  letter-spacing: 0.08em;
  line-height: 1;
  background: var(--red);
  color: #fff;
  padding: 7px 12px 4px;
  margin: 4px 0 14px;
  transform: skewX(-8deg);
}
#story .photo {
  border-left: 3px solid var(--acc);
  background: rgba(255, 210, 63, 0.08);
  padding: 10px 12px 6px;
  margin-bottom: 10px;
}
#story .photo p {
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 2px;
}
#story .photo b {
  color: var(--acc);
}
.sflash {
  padding-left: 0;
  position: relative;
}
.sflash input {
  position: absolute;
  opacity: 0;
  width: 44px;
  height: 24px;
  margin: 0;
  cursor: pointer;
}
#story .warn {
  border-left: 3px solid var(--red);
  background: rgba(230, 57, 70, 0.08);
  padding: 10px 12px;
  margin: 0 0 16px;
  max-height: 104px;
  overflow: auto;
  touch-action: pan-y;
}
#story .warn .wh {
  display: block;
  color: #ff8a80;
  font-size: 12px;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}
#story .warn p {
  font-size: 12px;
  line-height: 1.45;
  margin: 0 0 6px;
  color: #b9c0d2;
}
#story .warn p:last-child {
  margin: 0;
}
.sbtns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
#storyGo {
  font-size: 30px;
  padding: 11px 26px 7px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.7);
}
#storyBack {
  font-family: var(--disp);
  font-size: 20px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 3px;
  padding: 9px 16px 6px;
  cursor: pointer;
}
@media (max-width: 640px), (max-height: 520px) {
  .sbtns {
    position: sticky;
    bottom: -12px;
    margin: 0 -8px -8px;
    padding: 10px 8px 12px;
    background: var(--panel);
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 640px) {
  #story .sc {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 18px 18px 20px;
  }
  #story canvas {
    width: 120px;
    align-self: flex-start;
  }
}
@media (max-height: 440px) {
  #story .sc {
    padding: 14px 20px;
    gap: 20px;
  }
  #story canvas {
    width: 130px;
  }
  #story p {
    font-size: 13.5px;
    margin-bottom: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ms-back,
  .mi,
  .ov,
  #story,
  #loadbar i {
    transition: none;
    animation: none;
  }
  .mi:hover,
  .mi:focus {
    transform: none;
  }
}

/* ---------- mode choice for a new game (src/play/modes.js) ---------- */
.ms-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 4px -2px;
}
.ms-modes [role='radio'] {
  font: 700 12px/1 Inter, Arial, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(233, 237, 247, 0.78);
  background: rgba(7, 9, 15, 0.45);
  border: 1px solid rgba(233, 237, 247, 0.26);
  padding: 7px 11px 6px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transform: skewX(-8deg);
  transition:
    color 0.14s ease,
    background-color 0.14s ease,
    border-color 0.14s ease;
}
.ms-modes [role='radio']:hover {
  color: var(--acc);
  border-color: var(--acc);
}
.ms-modes [role='radio'][aria-checked='true'] {
  color: #14110a;
  background: var(--acc);
  border-color: var(--acc);
}
.ms-modes [role='radio']:focus {
  outline: none;
}
.ms-modes [role='radio']:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}
.ms-modeinfo {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--mute);
  margin: 2px 0 10px 1px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
#start:not(.ready) .ms-modes,
#start:not(.ready) .ms-modeinfo {
  opacity: 0.32;
  pointer-events: none;
}
@media (max-height: 440px) {
  .ms-modes [role='radio'] {
    font-size: 11px;
    padding: 5px 9px 4px;
  }
  .ms-modeinfo {
    margin-bottom: 4px;
  }
}
@media (max-height: 360px) {
  .ms-modeinfo {
    display: none;
  }
}

/* the author's original description under the title */
.ms-tag {
  max-width: 34em;
  line-height: 1.5;
}
.ms-tag b {
  display: block;
  color: #fff;
  font-weight: 700;
}
.ms-tag .ms-desc {
  display: block;
  margin-top: 2px;
}
@media (max-height: 760px) {
  .ms-tag {
    max-width: 56em;
    font-size: 13px;
    line-height: 1.4;
    margin-top: 8px;
  }
  #start h1 {
    font-size: clamp(46px, 13vh, 84px);
  }
  .ms-menu {
    margin-top: 10px;
  }
}
@media (max-height: 520px) {
  .ms-tag .ms-desc {
    display: none;
  }
}
