    :root {
      --amber: #f39a12;
      --amber-soft: #ffc05a;
      --amber-dim: #9b5c05;
      --bg: #050403;
      --panel: #080603;
      --danger: #ff6b2b;
      --ok: #ffd17a;
      color-scheme: dark;
      font-family: "Courier New", Courier, monospace;
    }

    * {
      box-sizing: border-box;
    }

    html,
    body {
      width: 100%;
      min-height: 100%;
      margin: 0;
      overflow: hidden;
      background:
        radial-gradient(circle at 20% 10%, rgba(243, 154, 18, 0.12), transparent 26rem),
        radial-gradient(circle at 80% 85%, rgba(155, 92, 5, 0.1), transparent 22rem),
        var(--bg);
      color: var(--amber);
    }

    body::before {
      content: "";
      position: fixed;
      inset: 0;
      pointer-events: none;
      background:
        repeating-linear-gradient(0deg, rgba(255, 174, 42, 0.05) 0 1px, transparent 1px 4px),
        linear-gradient(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.42));
      mix-blend-mode: screen;
      opacity: 0.65;
      z-index: 5;
    }

    button,
    input {
      font: inherit;
    }

    .shell {
      height: 100svh;
      min-height: 0;
      padding: clamp(1rem, 2.2vw, 2.2rem);
      position: relative;
      display: flex;
      flex-direction: column;
      gap: clamp(0.8rem, 1.5vw, 1.4rem);
      text-shadow: 0 0 0.35rem rgba(243, 154, 18, 0.65);
    }

    .exit-button {
      position: absolute;
      top: clamp(1.75rem, 3.4vw, 3.1rem);
      right: clamp(1.75rem, 3.4vw, 3.1rem);
      z-index: 20;
      display: grid;
      place-items: center;
      width: 2.15rem;
      height: 2.15rem;
      border: 0.12rem solid var(--amber);
      background: rgba(5, 4, 3, 0.92);
      color: var(--amber);
      text-decoration: none;
      font-weight: 800;
      line-height: 1;
      text-shadow: 0 0 0.35rem rgba(243, 154, 18, 0.65);
      box-shadow: inset 0 0 0.8rem rgba(243, 154, 18, 0.06);
    }

    .exit-button:active,
    .exit-button:focus-visible {
      outline: 0.12rem solid var(--amber-soft);
      color: var(--amber-soft);
    }

    .path {
      flex: 0 0 auto;
      font-size: clamp(1rem, 2vw, 2rem);
      font-weight: 700;
      letter-spacing: 0;
      white-space: nowrap;
    }

    .terminal {
      flex: 1;
      min-height: 0;
      position: relative;
      display: grid;
      grid-template-rows: auto 1fr auto;
      border: 0.28rem double var(--amber);
      background:
        linear-gradient(90deg, rgba(243, 154, 18, 0.05), transparent 18%, transparent 82%, rgba(243, 154, 18, 0.04)),
        rgba(3, 3, 2, 0.9);
      box-shadow:
        inset 0 0 2rem rgba(243, 154, 18, 0.08),
        0 0 2rem rgba(0, 0, 0, 0.7);
    }

    .title {
      padding: clamp(1rem, 2.2vw, 2rem) clamp(1rem, 2.5vw, 2.4rem) 0;
      text-align: center;
      font-size: clamp(1.1rem, 2.1vw, 2.1rem);
      font-weight: 800;
      line-height: 1.1;
    }

    .title::after {
      content: "------------------------------";
      display: block;
      margin-top: 0.45rem;
      color: var(--amber);
      font-weight: 400;
    }

    .screen {
      --card-terminal-gap: clamp(0.8rem, 2vw, 1.5rem);
      --card-fit-reserve: clamp(0.75rem, 1.6vw, 1.35rem);
      height: 100%;
      min-height: 0;
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      grid-template-rows: minmax(0, 1fr);
      gap: clamp(1rem, 4vw, 6rem);
      align-items: stretch;
      overflow: hidden;
      padding: clamp(1rem, 2.5vw, 2.6rem) clamp(1rem, 6vw, 7rem);
    }

    .card-panel {
      --card-panel-width: 100%;
      --card-panel-height: 100%;
      display: none;
      width: var(--card-panel-width);
      height: var(--card-panel-height);
      min-width: 0;
      min-height: 0;
      justify-self: center;
      align-self: center;
      overflow: hidden;
      border: 0.12rem solid var(--amber);
      background: rgba(0, 0, 0, 0.42);
      box-shadow: inset 0 0 1rem rgba(243, 154, 18, 0.06);
    }

    .card-art {
      --card-font-size: 0.4rem;
      width: 100%;
      height: 100%;
      margin: 0;
      padding: clamp(0.9rem, 1.8vw, 1.4rem);
      overflow: hidden;
      color: var(--amber-soft);
      font-size: var(--card-font-size);
      line-height: 0.92;
      white-space: pre;
      text-shadow: none;
      scrollbar-color: var(--amber-dim) transparent;
    }

    .is-ascii-mode .screen {
      grid-template-rows: minmax(0, 1fr) auto;
      gap: var(--card-terminal-gap);
      padding-inline: clamp(1rem, 4vw, 4rem);
    }

    .is-ascii-mode .card-panel {
      display: grid;
    }

    .is-ascii-mode .console {
      height: auto;
      max-width: none;
      grid-template-rows: auto auto;
      gap: clamp(0.45rem, 1vw, 0.75rem);
      font-size: clamp(1rem, 1.8vw, 2rem);
      padding-top: clamp(0.7rem, 1.5vw, 1.2rem);
    }

    .is-ascii-mode .scrollback {
      overflow: hidden;
    }

    .is-ascii-mode .line:first-child {
      margin-top: 0;
    }

    .console {
      min-width: 0;
      min-height: 0;
      display: grid;
      grid-template-rows: minmax(0, 1fr) auto;
      gap: clamp(0.65rem, 1.5vw, 1rem);
      font-size: clamp(1.2rem, 2.35vw, 2.6rem);
      line-height: 1.25;
      font-weight: 700;
      width: 100%;
      height: 100%;
      max-width: 58rem;
      justify-self: center;
      align-self: stretch;
      overflow: hidden;
    }

    .scrollback {
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow-y: auto;
      overscroll-behavior: contain;
      padding-right: 0.8rem;
      scrollbar-color: var(--amber-dim) transparent;
    }

    .scrollback::-webkit-scrollbar {
      width: 0.5rem;
    }

    .scrollback::-webkit-scrollbar-thumb,
    .card-art::-webkit-scrollbar-thumb {
      background: var(--amber-dim);
    }

    .line {
      margin: 0 0 0.45em;
      overflow-wrap: anywhere;
    }

    .line:first-child {
      margin-top: auto;
    }

    .line.answer {
      color: var(--amber-soft);
    }

    .line.good {
      color: var(--ok);
    }

    .line.bad {
      color: var(--danger);
    }

    .line.system {
      color: var(--amber-soft);
    }

    .entry {
      display: flex;
      align-items: baseline;
      gap: 0.2em;
      min-height: 1.5em;
      border-top: 0.12em solid var(--amber-dim);
      padding-top: 0.55em;
    }

    .caret {
      display: inline-block;
      width: 0.55em;
      height: 0.22em;
      background: currentColor;
      animation: blink 0.9s steps(2, start) infinite;
      transform: translateY(0.06em);
    }

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

    .answer-input {
      --answer-ch: 0;
      width: min(calc((var(--answer-ch) + 1) * 1ch), 100%);
      min-width: 0;
      border: 0;
      border-bottom: 0.12em solid transparent;
      outline: 0;
      background: transparent;
      color: var(--amber-soft);
      text-transform: lowercase;
      caret-color: transparent;
      text-shadow: inherit;
    }

    .answer-input.has-value {
      border-bottom-color: var(--amber-dim);
    }

    .answer-input:disabled {
      opacity: 0.8;
    }

    .choices {
      border: 0.12rem solid var(--amber);
      padding: clamp(0.8rem, 1.5vw, 1.35rem);
      background: rgba(0, 0, 0, 0.42);
      box-shadow: inset 0 0 1rem rgba(243, 154, 18, 0.06);
      display: none;
      align-content: center;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0.5rem;
      width: min(100%, 31rem);
      justify-self: center;
    }

    .choices.is-mode-picker {
      display: grid;
      width: 100%;
      max-width: 52rem;
      grid-template-columns: minmax(0, 1fr);
    }

    .mode-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 0.5rem;
      width: 100%;
    }

    .guide-grid > .mode-grid {
      grid-column: 1 / -1;
    }

    .mode-grid-terminal {
      align-self: center;
    }

    .mode-choice {
      text-align: center;
      min-height: 3.1rem;
    }

    .choice-group {
      display: grid;
      gap: 0.5rem;
      min-width: 0;
    }

    .single-choice-group {
      grid-column: 1 / -1;
    }

    .choice {
      min-height: 2.45rem;
      border: 0.08rem solid var(--amber);
      background: rgba(18, 11, 2, 0.88);
      color: var(--amber);
      cursor: pointer;
      text-align: left;
      padding: 0.5rem 0.65rem;
      line-height: 1.08;
      overflow-wrap: anywhere;
      text-shadow: inherit;
      box-shadow: inset 0 0 0.8rem rgba(243, 154, 18, 0.05);
    }

    .choice:active,
    .choice.is-selected,
    .choice:focus-visible {
      outline: 0.12rem solid var(--amber-soft);
      color: var(--amber-soft);
    }

    .choice:disabled {
      cursor: default;
      opacity: 0.45;
    }

    .footer {
      display: grid;
      grid-template-columns: 12rem 15rem 12rem 1fr;
      border-top: 0.12rem solid var(--amber);
      font-size: clamp(0.95rem, 1.8vw, 1.9rem);
      font-weight: 700;
    }

    .key {
      min-width: 0;
      padding: 0.35rem 1rem;
      border-right: 0.12rem solid var(--amber);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .mode-key {
      appearance: none;
      background: transparent;
      color: inherit;
      cursor: pointer;
      text-align: left;
      text-shadow: inherit;
    }

    .mode-key:focus-visible {
      outline: 0.12rem solid var(--amber-soft);
      color: var(--amber-soft);
    }

    .guide-button {
      position: fixed;
      right: max(0.8rem, env(safe-area-inset-right));
      bottom: max(0.8rem, env(safe-area-inset-bottom));
      z-index: 35;
      border: 0.12rem solid var(--amber);
      background: rgba(5, 4, 3, 0.9);
      color: var(--amber);
      padding: 0.45rem 0.8rem;
      cursor: pointer;
      font-weight: 700;
      text-shadow: 0 0 0.35rem rgba(243, 154, 18, 0.65);
      box-shadow: inset 0 0 0.8rem rgba(243, 154, 18, 0.06);
    }

    .guide-button:focus-visible {
      outline: 0.12rem solid var(--amber-soft);
      color: var(--amber-soft);
    }

    .guide-overlay {
      position: fixed;
      inset: 0;
      z-index: 25;
      display: none;
      place-items: center;
      padding: clamp(1rem, 3vw, 2.5rem);
      background:
        radial-gradient(circle at 50% 35%, rgba(243, 154, 18, 0.13), transparent 28rem),
        rgba(0, 0, 0, 0.86);
      color: var(--amber);
      text-shadow: 0 0 0.35rem rgba(243, 154, 18, 0.75);
      cursor: pointer;
    }

    .guide-overlay.is-visible {
      display: grid;
    }

    .guide-panel {
      width: min(48rem, 100%);
      max-height: min(88svh, 44rem);
      overflow: auto;
      border: 0.24rem double var(--amber);
      background:
        linear-gradient(90deg, rgba(243, 154, 18, 0.05), transparent 20%, transparent 80%, rgba(243, 154, 18, 0.04)),
        rgba(3, 3, 2, 0.94);
      padding: clamp(1rem, 3vw, 2rem);
      box-shadow:
        inset 0 0 1.6rem rgba(243, 154, 18, 0.08),
        0 0 2rem rgba(0, 0, 0, 0.8);
    }

    .guide-title {
      margin: 0 0 0.8rem;
      text-align: center;
      font-size: clamp(1.35rem, 3.8vw, 2.45rem);
      line-height: 1.1;
    }

    .guide-rule {
      margin: 0 0 1.2rem;
      text-align: center;
      color: var(--amber-soft);
      font-size: clamp(0.9rem, 2vw, 1.15rem);
    }

    .guide-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0.35rem 1rem;
      font-size: clamp(0.85rem, 2vw, 1.15rem);
      line-height: 1.25;
    }

    .guide-row {
      display: grid;
      grid-template-columns: minmax(7.2rem, max-content) minmax(0, 1fr);
      gap: 0.9rem;
      min-width: 0;
    }

    .guide-rank {
      color: var(--amber-soft);
    }

    .guide-heading {
      grid-column: 1 / -1;
      margin: 0.8rem 0 0.2rem;
      color: var(--amber-soft);
      font-size: 1em;
      line-height: 1.1;
    }

    .guide-heading:first-child {
      margin-top: 0;
    }

    .guide-dismiss {
      margin-top: 1.25rem;
      border-top: 0.12rem solid var(--amber-dim);
      padding-top: 0.75rem;
      color: var(--amber-soft);
      text-align: center;
      font-size: clamp(0.9rem, 2vw, 1.1rem);
    }

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

    @media (max-height: 520px) and (orientation: landscape) {
      html,
      body {
        overflow: hidden;
      }

      .shell {
        height: 100svh;
        min-height: 0;
        padding: 0.45rem 0.6rem;
        gap: 0.35rem;
      }

      .exit-button {
        top: 0.85rem;
        right: 1rem;
        width: 1.6rem;
        height: 1.6rem;
        font-size: 0.75rem;
      }

      .path {
        font-size: clamp(0.85rem, 2.6vw, 1.2rem);
      }

      .terminal {
        border-width: 0.16rem;
      }

      .title {
        padding: 0.55rem 0.75rem 0;
        font-size: clamp(0.9rem, 3vw, 1.25rem);
      }

      .title::after {
        margin-top: 0.2rem;
      }

      .screen {
        grid-template-columns: minmax(0, 1fr) minmax(17rem, 42vw);
        grid-template-rows: minmax(0, 1fr);
        gap: 0.75rem;
        padding: 0.55rem 0.75rem;
        align-items: stretch;
      }

      .is-ascii-mode .screen {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) auto;
        --card-terminal-gap: 0.55rem;
        --card-fit-reserve: 0.5rem;
      }

      .is-ascii-mode .card-art {
        padding: 0.45rem;
      }

      .is-ascii-mode .console {
        gap: 0.45rem;
        font-size: clamp(0.85rem, 2.8vw, 1.1rem);
        padding-top: 0.45rem;
      }

      .console {
        gap: 0.55rem;
        font-size: clamp(1rem, 4.1vw, 1.55rem);
        width: auto;
        max-width: none;
        justify-self: stretch;
      }

      .scrollback {
        padding-right: 0.35rem;
      }

      .answer-input {
        display: none;
      }

      .entry {
        min-height: 1.4em;
      }

      .choices {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.24rem;
        align-content: stretch;
        height: 100%;
        min-height: 0;
        padding: 0.35rem;
        font-size: clamp(0.62rem, 2.05vw, 0.84rem);
        line-height: 1;
      }

      .choices.is-mode-picker {
        grid-column: 1 / -1;
        width: min(100%, 34rem);
        height: auto;
        justify-self: center;
      }

      .choices.is-mode-picker .mode-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .choice-group {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: repeat(4, minmax(0, 1fr));
        gap: 0.24rem;
        min-height: 0;
      }

      .choice {
        min-height: 0;
        padding: 0.18rem 0.4rem;
        overflow: hidden;
      }

      .footer {
        grid-template-columns: minmax(0, 6.3rem) minmax(0, 7.3rem) minmax(0, 1fr) minmax(3.2rem, auto);
        font-size: clamp(0.72rem, 2.4vw, 0.95rem);
      }

      .key {
        padding: 0.25rem 0.45rem;
      }

      .guide-button {
        right: 0.45rem;
        bottom: 0.45rem;
        padding: 0.25rem 0.45rem;
        font-size: clamp(0.72rem, 2.4vw, 0.95rem);
      }

      .guide-overlay {
        padding: 0.6rem;
      }

      .guide-panel {
        max-height: 92svh;
        padding: 0.8rem;
      }

      .guide-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.22rem 0.7rem;
        font-size: clamp(0.62rem, 2.1vw, 0.82rem);
      }

      .guide-row {
        grid-template-columns: minmax(5.8rem, max-content) minmax(0, 1fr);
        gap: 0.5rem;
      }

      .guide-title {
        margin-bottom: 0.35rem;
        font-size: clamp(1rem, 3.6vw, 1.35rem);
      }

      .guide-rule,
      .guide-dismiss {
        font-size: clamp(0.65rem, 2.1vw, 0.82rem);
      }

      .guide-rule {
        margin-bottom: 0.55rem;
      }

      .guide-dismiss {
        margin-top: 0.6rem;
        padding-top: 0.45rem;
      }
    }

    @media (min-width: 761px) and (max-width: 1100px) and (min-height: 521px) {
      .screen {
        grid-template-columns: minmax(0, 1fr);
        padding-inline: clamp(1rem, 3vw, 3rem);
        gap: clamp(1rem, 2vw, 2rem);
      }

      .footer {
        grid-template-columns: 10rem 12rem 10rem 1fr;
      }
    }

    @media (max-width: 760px) and (orientation: portrait) {
      .shell {
        padding: max(0.6rem, env(safe-area-inset-top)) max(0.6rem, env(safe-area-inset-right)) max(0.6rem, env(safe-area-inset-bottom)) max(0.6rem, env(safe-area-inset-left));
        gap: 0.45rem;
      }

      .exit-button {
        top: max(0.95rem, calc(env(safe-area-inset-top) + 0.35rem));
        right: max(0.95rem, calc(env(safe-area-inset-right) + 0.35rem));
        width: 1.55rem;
        height: 1.55rem;
        font-size: 0.72rem;
      }

      .path {
        font-size: clamp(0.78rem, 3.3vw, 1rem);
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .terminal {
        border-width: 0.16rem;
      }

      .title {
        padding: 0.65rem 0.65rem 0;
        font-size: clamp(0.98rem, 4.2vw, 1.3rem);
      }

      .title::after {
        margin-top: 0.25rem;
      }

      .screen {
        grid-template-rows: minmax(0, 1fr) auto;
        gap: 0.6rem;
        padding: 0.65rem;
      }

      .is-ascii-mode .screen {
        --card-terminal-gap: 0.55rem;
        --card-fit-reserve: 0.5rem;
      }

      .is-ascii-mode .card-art {
        padding: 0.45rem;
      }

      .is-ascii-mode .console {
        font-size: clamp(0.85rem, 3.6vw, 1rem);
        padding-top: 0.45rem;
      }

      .console {
        gap: 0.45rem;
        font-size: clamp(1rem, 5vw, 1.35rem);
        max-width: none;
      }

      .scrollback {
        padding-right: 0.35rem;
      }

      .answer-input {
        display: none;
      }

      .entry {
        min-height: 1.35em;
      }

      .choices {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        padding: 0.4rem;
        gap: 0.35rem;
        font-size: clamp(0.76rem, 3.4vw, 0.95rem);
      }

      .choices.is-mode-picker .mode-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
      }

      .choices.is-mode-picker .mode-choice {
        min-height: 2.7rem;
        padding-inline: 0.25rem;
        text-align: center;
      }

      .choice-group {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem;
      }

      .single-choice-group {
        grid-column: 1 / -1;
        width: 100%;
      }

      .choice {
        min-height: 2.45rem;
        padding: 0.35rem 0.45rem;
      }

      .footer {
        grid-template-columns: minmax(0, 4.7rem) minmax(0, 5.7rem) minmax(0, 1fr) minmax(2.8rem, auto);
        font-size: clamp(0.62rem, 2.8vw, 0.78rem);
      }

      .key {
        padding: 0.22rem 0.35rem;
      }

      .guide-button {
        right: max(0.45rem, env(safe-area-inset-right));
        bottom: max(0.45rem, env(safe-area-inset-bottom));
        padding: 0.25rem 0.45rem;
        font-size: clamp(0.68rem, 3vw, 0.82rem);
      }

      .guide-overlay {
        padding: 0.6rem;
      }

      .guide-panel {
        max-height: 92svh;
        padding: 0.8rem;
      }

      .guide-grid {
        grid-template-columns: 1fr;
        gap: 0.25rem;
        font-size: clamp(0.72rem, 3.2vw, 0.88rem);
      }

      .guide-row {
        grid-template-columns: minmax(6rem, max-content) minmax(0, 1fr);
        gap: 0.55rem;
      }

      .guide-title {
        margin-bottom: 0.4rem;
        font-size: clamp(1rem, 5vw, 1.35rem);
      }

      .guide-rule,
      .guide-dismiss {
        font-size: clamp(0.72rem, 3.2vw, 0.88rem);
      }

      .guide-rule {
        margin-bottom: 0.6rem;
      }

      .guide-dismiss {
        margin-top: 0.65rem;
        padding-top: 0.45rem;
      }
    }
