@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap");

html {
  font-size: clamp(6px, min(1.5vw, 2vh), 20px);
}

:root {
  --border: 2px;
  /* --vh100/--vw100 are set by JS (core.js) from window.innerHeight/Width
     on load/resize/orientationchange — iOS standalone (Add to Home Screen)
     mode has a known bug where a dvh/dvw-based calc() chain like this one
     can stick with its pre-rotation value instead of recomputing after
     rotating. In landscape specifically, a stale (too-narrow, portrait-era)
     100dvw would wrongly win the min() below over the correct height-based
     constraint. Computing both ourselves from plain, always-current DOM
     properties sidesteps the question of whether/when WebKit recomputes
     dvh/dvw entirely. Falls back to the dv units directly until that JS
     runs once on load. */
  --player-w: min(var(--vw100, 100dvw), calc(var(--vh100, 100dvh) * 1.14));
  --player-h: calc(var(--player-w) / 1.14);
  --status-h: calc(var(--player-h) * 0.075);
  --stats-h: 0px;
  --border-count: 3;
  --text-h: calc(var(--player-h) * 0.26);
  --input-h: calc(var(--player-h) * 0.07);
  --img-h: calc(
    var(--player-h) - var(--status-h) - var(--stats-h) - var(--text-h) - var(--input-h) -
      var(--border) * var(--border-count)
  );
}

/* Only games that actually show the attribute readout (Beyond Zork) should
   have its height carved out of the image area — otherwise (Zork I/II/III
   and everything else without one) this leaves a permanent dead gap at the
   bottom for a bar that never appears. */
.player.has-stats-line {
  --stats-h: calc(var(--player-h) * 0.055);
  --border-count: 4;
  /* --img-h's calc() only re-resolves nested var()s at the scope where
     --img-h itself is declared — since that's :root, it permanently bakes
     in :root's own --stats-h/--border-count (always 0px/3) no matter what
     a descendant overrides them to. Redeclaring the same formula here,
     at the same scope as the override, is what actually makes it apply. */
  --img-h: calc(
    var(--player-h) - var(--status-h) - var(--stats-h) - var(--text-h) - var(--input-h) -
      var(--border) * var(--border-count)
  );
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
[hidden] {
  display: none !important;
}

html,
body {
  height: 100dvh;
  overflow: hidden;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Rapid taps to advance text/continue otherwise read as a double-tap-zoom
     gesture on mobile Safari/Chrome, throwing off the fixed layout.
     "manipulation" alone still permits pinch-zoom by spec — pan-x pan-y
     omits it from the allowed gesture list entirely. */
  touch-action: pan-x pan-y;
}

/* ── Drop overlay ─────────────────────────────── */
.drop-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  background: #000;
  z-index: 100;
}

.drop-target {
  border: 2px solid #444;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  padding: 3rem 5rem;
  text-align: center;
  transition: border-color 0.1s;
}

.drop-target:hover,
.drop-overlay.is-dragging .drop-target {
  border-color: #fff;
}

.drop-title {
  font-family: "Press Start 2P", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  line-height: 2.2;
}

.drop-sub {
  font-family: "VT323", monospace;
  color: #555;
  font-size: 1.6rem;
  letter-spacing: 0.06em;
}

.drop-target input {
  display: none;
}

/* ── Drop screen settings ─────────────────────── */
.drop-settings {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 28rem;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.setting-label {
  font-family: "Press Start 2P", monospace;
  font-size: 0.45rem;
  letter-spacing: 0.1em;
  color: #666;
  width: 6rem;
  flex-shrink: 0;
  text-align: right;
}

.setting-select,
.setting-input {
  flex: 1;
  background: #111;
  border: 1px solid #444;
  color: #ccc;
  color-scheme: dark;
  font-family: "VT323", monospace;
  font-size: 1.3rem;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.6rem;
  outline: none;
}

/* Custom dropdown chevron so it sits a comfortable distance from the right
   edge (the native arrow hugs the border). */
.setting-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cccccc' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 0.85rem;
  padding-right: 2.4rem;
}

.setting-select:focus,
.setting-input:focus {
  border-color: #888;
  color: #fff;
}
/* Masks the API key without using type="password", which would make Chrome
   treat the page as a login form and offer to save a password every time the
   player types a command (see launchPanel.js). Applied only when the browser
   supports it; otherwise the input stays type="password". */
.setting-input-masked {
  -webkit-text-security: disc;
}

.setting-key-wrap {
  flex: 1;
  display: flex;
  gap: 0.5rem;
}
.setting-key-wrap .setting-input {
  flex: 1;
}

.setting-validate-btn {
  font-family: "Press Start 2P", monospace;
  font-size: 0.4rem;
  letter-spacing: 0.08em;
  padding: 0 0.8rem;
  background: #111;
  border: 1px solid #666;
  color: #ccc;
  cursor: pointer;
  white-space: nowrap;
}
.setting-validate-btn:hover:not(:disabled) {
  border-color: #fff;
  color: #fff;
}
.setting-validate-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.setting-status {
  font-family: "VT323", monospace;
  font-size: 1.1rem;
  color: #888;
  text-align: right;
  margin-top: -0.3rem;
}

.setting-toggle {
  display: none;
}
.setting-toggle-wrap {
  display: flex;
  align-items: center;
  cursor: pointer;
}
.setting-toggle-track {
  width: 3rem;
  height: 1.4rem;
  background: #222;
  border: 1px solid #444;
  position: relative;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.setting-toggle:checked + .setting-toggle-track {
  background: #1a3a1a;
  border-color: #4a4;
}
.setting-toggle-thumb {
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 0.9rem;
  height: 0.9rem;
  background: #555;
  transition:
    left 0.15s,
    background 0.15s;
}
.setting-toggle:checked + .setting-toggle-track .setting-toggle-thumb {
  left: 1.8rem;
  background: #4c4;
}

/* ── Shared launch panel (root launcher + boot() run screen) ─── */
.launch-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

.launch-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.launch-title-block {
  border: 2px solid #444;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  padding: 3rem 5rem;
  text-align: center;
}

.launch-game-title {
  font-family: "Press Start 2P", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  line-height: 2.2;
}

.launch-run-btn {
  font-family: "Press Start 2P", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  padding: 0.9rem 2.4rem;
  background: #111;
  border: 2px solid #666;
  color: #ccc;
  cursor: pointer;
  transition:
    border-color 0.1s,
    color 0.1s;
}
.launch-run-btn:hover {
  border-color: #fff;
  color: #fff;
}

.launch-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.launch-error-title {
  font-family: "Press Start 2P", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: #f44;
}

.launch-error-msg {
  font-family: "VT323", monospace;
  font-size: 1.4rem;
  color: #888;
  text-align: center;
  max-width: 28rem;
}

.launch-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  border: 2px solid #444;
  padding: 3rem 5rem;
}

.launch-locked-msg {
  font-family: "VT323", monospace;
  font-size: 1.4rem;
  color: #888;
  text-align: center;
  max-width: 26rem;
  overflow-wrap: break-word;
}

.launch-retry {
  font-family: "Press Start 2P", monospace;
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  padding: 0.8rem 2rem;
  background: #111;
  border: 1px solid #666;
  color: #ccc;
  cursor: pointer;
  margin-top: 0.4rem;
}

/* Back-to-site link, pinned to the top-left of the launch overlay. */
.launch-back {
  position: absolute;
  top: 1.6rem;
  left: 1.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Press Start 2P", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: #777;
  text-decoration: none;
  transition: color 0.1s;
}
.launch-back:hover {
  color: #fff;
}
.launch-back svg {
  display: block;
}

/* SAVE/RESTORE hint pinned to the bottom of the launch overlay. */
.launch-hint {
  position: absolute;
  bottom: 1.6rem;
  left: 0;
  right: 0;
  text-align: center;
  padding: 0 1.2rem;
  font-family: "VT323", monospace;
  font-size: 1.3rem;
  letter-spacing: 0.03em;
  color: #666;
}
.launch-hint b {
  color: #34d399;
  font-weight: normal;
}

/* ── Provide-your-own launch idle (drop target + recognized releases) ── */
.launch-provide {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
}

.launch-idlist {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}

.launch-idlist-title {
  font-family: "Press Start 2P", monospace;
  font-size: 0.45rem;
  letter-spacing: 0.14em;
  color: #666;
}

.launch-idlist-rows {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  max-width: 30rem;
}

.launch-idlist-item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid #2a2a2a;
  background: #0c0c0c;
}

.launch-idlist-item.is-recommended {
  border-color: #2f6b3a;
  background: #0d1a0f;
}

.launch-idlist-serial {
  font-family: "VT323", monospace;
  font-size: 1.3rem;
  line-height: 1;
  letter-spacing: 0.06em;
  color: #9a9a9a;
}

.launch-idlist-item.is-recommended .launch-idlist-serial {
  color: #7ee787;
}

.launch-idlist-badge {
  font-family: "Press Start 2P", monospace;
  font-size: 0.4rem;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.45rem;
  background: #34d399;
  color: #05130d;
}

/* ── Player — 1.14:1 landscape container ──────── */
.player {
  width: var(--player-w);
  height: var(--player-h);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ── Version notice ───────────────────────────── */
/* Overlaid rather than laid out in flow, so it never disturbs the fixed
   status-bar/scene/text/input height split above. */
.version-notice {
  position: absolute;
  top: var(--status-h);
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  background: #3a2f00;
  color: #ffd54a;
  border-bottom: var(--border) solid #665400;
  font-family: "VT323", monospace;
  font-size: clamp(9px, 1rem, 22px);
  letter-spacing: 0.02em;
  padding: 0.4rem 0.8rem;
}

.version-notice-close {
  background: none;
  border: none;
  color: #ffd54a;
  font-size: 1.4em;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.3rem;
  flex-shrink: 0;
}
.version-notice-close:hover {
  color: #fff;
}

/* ── Status bar ───────────────────────────────── */
.status-bar {
  height: var(--status-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #c0c0c0;
  color: #000;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(9px, 0.85rem, 20px);
  letter-spacing: 0.06em;
  padding: 0 0.8rem;
  text-transform: uppercase;
  border: var(--border) solid #c0c0c0;
}

/* Character-attribute readout (Beyond Zork's "EN:16 ST:08 ..." line) — a
   second, persistent status strip below the room title bar. */
.stats-line {
  height: var(--stats-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #3a2f00;
  color: #ffd54a;
  font-family: "VT323", monospace;
  font-size: clamp(9px, 1rem, 22px);
  letter-spacing: 0.04em;
  padding: 0 0.8rem;
  border: var(--border) solid #c0c0c0;
  border-top: none;
}

/* ── Scene image ──────────────────────────────── */
.scene-wrap {
  height: var(--img-h);
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: var(--border) solid #c0c0c0;
  border-top: none;
  overflow: hidden;
  background: #000;
}

.scene-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.09) 2px,
    rgba(0, 0, 0, 0.09) 3px
  );
  pointer-events: none;
  z-index: 2;
}

/* Small ascii-art "sensory" icon (Beyond Zork) — its own corner box, like
   real terminal/graphics interpreters show it, instead of splicing into
   the room description. */
.sensory-panel {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  margin: 0;
  padding: 0.3rem 0.5rem;
  background: #000;
  border: var(--border) solid #c0c0c0;
  color: #c0c0c0;
  font-family: "VT323", monospace;
  font-size: clamp(10px, 1.3rem, 22px);
  line-height: 1.2;
  white-space: pre;
  text-align: center;
  z-index: 3;
  pointer-events: none;
}

.scene-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  image-rendering: pixelated;
}

.scene-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
}

.gen-drive-bezel {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: 2px solid #333;
  padding: 0.5rem 1.1rem;
  background: #111;
}

.gen-in-use {
  font-family: "Press Start 2P", monospace;
  font-size: 0.35rem;
  color: #555;
  letter-spacing: 0.08em;
}

.gen-led {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(circle at 38% 32%, #4a0000 0%, #1e0000 55%, #0a0000 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 80, 80, 0.12),
    inset 0 -1px 3px rgba(0, 0, 0, 0.8),
    0 0 0 1px #080000,
    0 1px 0 rgba(255, 255, 255, 0.06);
}

.gen-led.active {
  background: radial-gradient(
    circle at 38% 32%,
    #ffaa88 0%,
    #ff3300 38%,
    #cc1100 70%,
    #880000 100%
  );
  box-shadow:
    inset 0 1px 4px rgba(255, 210, 170, 0.65),
    inset 0 -1px 3px rgba(0, 0, 0, 0.45),
    0 0 0 1px #080000,
    0 0 5px #ff2200,
    0 0 14px #ff220077;
}

.gen-drive-label {
  font-family: "Press Start 2P", monospace;
  font-size: 0.5rem;
  color: #666;
  letter-spacing: 0.06em;
  font-style: italic;
}

.gen-status {
  font-family: "VT323", monospace;
  font-size: clamp(16px, 2rem, 36px);
  color: #33ff33;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  width: 100%;
}

.scene-room-title {
  display: none;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(11px, 1.4rem, 26px);
  color: #444;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.9;
  padding: 0 3rem;
}

.scene-placeholder.no-image .gen-drive-bezel,
.scene-placeholder.no-image .gen-status {
  display: none;
}
.scene-placeholder.no-image .scene-room-title {
  display: block;
}

/* ── Description text ─────────────────────────── */
.scene-text {
  height: var(--text-h);
  flex-shrink: 0;
  border: var(--border) solid #c0c0c0;
  border-top: none;
  padding: 0.35rem 0.8rem;
  font-family: "VT323", monospace;
  font-size: clamp(15px, 1.7rem, 32px);
  letter-spacing: 0.04em;
  line-height: 1.4;
  white-space: pre-line;
  position: relative;
  overflow: hidden;
  /* JS drives scrollTop directly on touchmove (see text.js), the same way it
     already does for wheel — overflow:hidden blocks native scrolling either
     way. touch-action: none hands the whole gesture to JS immediately
     instead of racing a native pan attempt first. */
  touch-action: none;
}

/* ── Grid view (real @read_char screen: forms, menus) ─────────────── */
.grid-view {
  overflow: hidden;
}
/* These screens have no associated room image, and are often taller than
   the narrow description strip (Bureaucracy's ~19-row form, Beyond Zork's
   menu + instructions) — expand into the image area's space, which is
   hidden while the grid view is showing, instead of scrolling critical
   content out of view. */
.grid-view.grid-expanded {
  height: calc(var(--img-h) + var(--text-h) + var(--border));
}
.grid-inner {
  margin: 0;
  font-family: "VT323", monospace;
  font-size: clamp(15px, 1.7rem, 32px);
  /* letter-spacing must be exactly 0 — cursor position math places the
     cursor at N * 1ch, which doesn't include any letter-spacing. .grid-view
     inherits 0.04em from the shared .scene-text class, so this can't just
     omit the property; it has to explicitly override the inherited value
     or every character adds a fraction of drift and the cursor lands
     further and further from the real text as the column grows. */
  letter-spacing: normal;
  line-height: 1.4;
  white-space: pre;
}
.grid-cursor {
  position: absolute;
  width: 1ch;
  height: 1lh;
  background: #c0c0c0;
  mix-blend-mode: difference;
  pointer-events: none;
}
/* Reverse-video runs (e.g. the highlighted item in Beyond Zork's character
   menu) — some menus move the selection this way alone, with no other
   visible change, so this isn't optional decoration. */
/* Bold and emphasis must not change glyph advance width. The cursor is placed
   at N * 1ch (see .grid-inner's letter-spacing note), so a synthesized bold
   weight that widened characters would drift the cursor away from the text it
   is supposed to sit on. A shadow thickens strokes without touching metrics,
   and text-decoration never affects them. Base grid text is already #fff, so
   "brighter for bold" isn't available the way it is on a real terminal. */
.grid-bold {
  text-shadow: 0.5px 0 0 currentColor;
}
.grid-em {
  text-decoration: underline;
}
.grid-rv {
  background: #c0c0c0;
  color: #000;
}

/* ── Continue / input row ─────────────────────── */
.cmd-row {
  height: var(--input-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  border: var(--border) solid #c0c0c0;
  border-top: none;
  padding: 0 0.8rem;
  gap: 0.5rem;
  font-family: "VT323", monospace;
  font-size: clamp(15px, 1.7rem, 32px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.prompt {
  user-select: none;
}

.cmd-display {
  text-transform: uppercase;
  white-space: pre;
}

.cmd-cursor {
  display: none;
  width: 0.55em;
  height: 0.85em;
  vertical-align: text-bottom;
  margin-left: -0.25em;
  background: #fff;
}

.cmd-cursor.shown {
  display: inline-block;
  animation: blink-cur 1.1s ease-in-out infinite;
}

@keyframes blink-cur {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.cmd-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Mobile command input — pinned to the top of the viewport, revealed on tap
   while the game awaits a command (core.js toggles .shown). Sized in px, not
   rem, since it lives outside the retro-scaled player. */
.mobile-cmd {
  display: none;
}
.mobile-cmd.shown {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 150;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: #000;
  border-bottom: 2px solid #c0c0c0;
}
.mobile-cmd-prompt {
  color: #fff;
  font-family: "VT323", monospace;
  font-size: 22px;
  line-height: 1;
}
.mobile-cmd-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: "VT323", monospace;
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mobile-cmd-input::placeholder {
  color: #555;
  text-transform: none;
  font-size: 18px;
}
.mobile-cmd-history-btn {
  position: relative;
  flex-shrink: 0;
  /* Matched to the prompt/input's own natural row height — anything taller
     grows the whole bar to fit it, since the row's align-items: center
     sizes to its tallest child. Verified: 51px bar height either way. */
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  /* A crisp inline SVG chevron (same treatment as the launch screen's BACK
     arrow and the settings dropdown's chevron) instead of a text glyph —
     no font-fallback mismatches to worry about. A soft border keeps this
     from reading as a harsh UI block against the rest of the bar. */
  border: 1px solid #333;
  color: #888;
  cursor: pointer;
}
/* Widens the actual tappable area well past the visible 25x25px box
   without changing how it looks or touching layout — position: absolute
   takes this out of flow entirely, so it can't grow the bar the way a real
   padding/size increase just got fixed for doing. A tap anywhere in this
   invisible region still lands on the button itself (event.target is the
   host element, not the pseudo-element), same as any other overflow. */
.mobile-cmd-history-btn::before {
  content: "";
  position: absolute;
  top: -12px;
  left: -12px;
  right: -12px;
  bottom: -12px;
}
.mobile-cmd-history-btn:active {
  border-color: #666;
  color: #fff;
}

.continue-hint {
  color: #aaa;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Launch/config screen on touch devices: this overlay isn't the scaled player,
   so its rem-based type collapses to a few px on a phone. Bump to legible px.
   Desktop (hover-capable) never matches, so it stays untouched. */
@media (hover: none) and (pointer: coarse) {
  .drop-overlay {
    padding: 12px 14px;
    justify-content: safe center;
    overflow-y: auto;
  }
  /* Constrain the launch containers to the viewport so nothing overflows off
     the right edge — long titles, long model names, or the API-key + validate
     row. Flex children get min-width:0 so they can shrink and truncate.
     Capped at 420px: this was tuned for narrow portrait widths, where
     100vw-28px is naturally small — in landscape on the same touch device,
     100vw is the wide dimension, and stretching this to nearly the full
     width looked broken rather than just permissive. */
  .launch-provide,
  .drop-settings {
    width: min(calc(100vw - 28px), 420px);
    max-width: min(calc(100vw - 28px), 420px);
    box-sizing: border-box;
  }
  .setting-row {
    width: 100%;
  }
  .setting-select,
  .setting-input,
  .setting-key-wrap {
    min-width: 0;
  }
  .drop-target {
    max-width: 100%;
    box-sizing: border-box;
  }

  .launch-game-title {
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
    width: 100%;
    overflow-wrap: anywhere;
  }
  .setting-label {
    width: 95px;
    white-space: nowrap;
    font-size: 9px;
  }
  .drop-title {
    font-size: 12px;
  }
  .drop-sub {
    font-size: 17px;
  }
  .launch-back {
    font-size: 11px;
  }
  .launch-hint {
    font-size: 15px;
  }
  .setting-select,
  .setting-input {
    font-size: 17px;
  }
  .setting-validate-btn {
    font-size: 9px;
  }
  .setting-status {
    font-size: 15px;
  }
  .launch-idlist-title {
    font-size: 9px;
  }
  .launch-idlist-serial {
    font-size: 17px;
  }
  .launch-idlist-badge {
    font-size: 8px;
  }
  .launch-error-title {
    font-size: 10px;
  }
  .launch-error-msg,
  .launch-locked-msg {
    font-size: 15px;
  }
  .launch-retry {
    font-size: 9px;
  }
}
