:root {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  color: #f8f5e6; font-synthesis: none;
  --ink: #173f3e; --gold: #efd18c; --cream: #f8f3df;
  --glass: rgba(17, 52, 49, .76);
  --edge: 14px; --safe-bottom: max(10px, env(safe-area-inset-bottom));
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #7eac81; }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 3px solid #fff5b7; outline-offset: 4px; }
button:disabled { cursor: wait; opacity: .65; }
[hidden] { display: none !important; }
i { font-style: normal; }
#game { position: fixed; inset: 0; display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 50% 42%, transparent 40%, #051c2618); }
.glass { background: var(--glass); border: 1px solid #f2dd9f33; box-shadow: 0 3px 14px #0c282821; backdrop-filter: blur(7px); }
.eyebrow { color: var(--gold); font-size: 10px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }

/* Battle information stays on the outer edges. The centre belongs to the world. */
.hud { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.brand { position: absolute; top: var(--edge); left: var(--edge); display: flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 10px; }
.brand-orbit { display: grid; place-items: center; width: 24px; height: 24px; color: var(--gold); border: 1px solid #efd18c55; border-radius: 50%; font-size: 18px; }
.brand h1 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: 1px; line-height: 1.3; }
.brand p { margin: 2px 0 0; font-size: 9px; color: #d2e2d3; letter-spacing: 1px; }
.run-clock { position: absolute; top: var(--edge); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; min-height: 39px; padding: 6px 12px; border-radius: 10px; white-space: nowrap; }
.run-clock > span { font: 600 22px/1.1 "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.run-clock small { color: #d0ddca; font-size: 10px; }
.run-clock b { color: var(--gold); font-weight: 550; }
.run-clock i { display: inline-block; vertical-align: middle; width: 2px; height: 2px; margin: 0 4px; background: var(--gold); border-radius: 50%; }
.top-actions { position: absolute; top: var(--edge); right: var(--edge); display: flex; gap: 6px; pointer-events: auto; }
.icon-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 50%; color: var(--cream); font-size: 20px; transition: background .2s; }
.icon-button:hover { background: #35655d; }
.icon-button.muted { opacity: .55; }
.pause-icon { width: 10px; height: 12px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }

.bottom-hud { position: absolute; bottom: var(--safe-bottom); left: 50%; transform: translateX(-50%); display: grid; gap: 5px; width: min(490px, calc(100% - 28px)); padding: 8px 12px 9px; border-radius: 12px; }
.orb-stats { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 18px; }
.orb-mark { color: var(--gold); font-size: 18px; line-height: 1; }
.stats-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.stats-row > span { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.stats-row b { color: #fff3c9; font: 600 12px/1.2 "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; }
.stats-row small { color: #c4d4c8; font-size: 10px; }
.stats-row .size-stat b { color: #d5dfcc; font-size: 11px; }
.stats-row .size-stat small { color: #afc5b8; }
.weapons { min-height: 14px; text-align: center; }
.empty-loadout { color: #b8cbbf; font-size: 10px; line-height: 14px; letter-spacing: .5px; }
.weapon-grid { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; }
.weapon { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 3px 8px; color: #f5efd5; background: #94c1af12; border: 1px solid #deebc81c; border-radius: 6px; }
.weapon:not(.owned) { display: none; }
.weapons:has(.weapon.owned) .empty-loadout { display: none; }
.weapon-icon { flex: 0 0 auto; width: 18px; color: #b6e7dd; font-family: Georgia, serif; font-size: 20px; line-height: 20px; text-align: center; }
.weapon-info { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.weapon-name { white-space: nowrap; font-size: 10px; }
.weapon small { overflow: hidden; color: var(--gold); font: 10px/1.4 "Segoe UI", system-ui, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.vitals { display: grid; grid-template-columns: 1fr 1.25fr; gap: 15px; padding-top: 5px; border-top: 1px solid #e3e9c323; }
.health-card, .xp-card { min-width: 0; }
.health-card > div:first-child, .xp-card > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 4px; white-space: nowrap; }
.health-card strong { color: #e1ebdc; font-size: 11px; font-weight: 550; }
.health-card #hp-value { color: #d5e6d8; font: 11px "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; }
.xp-card strong { color: #fff0b6; font: 600 12px "Segoe UI", sans-serif; }
.xp-card #xp-value { color: #c8d7c6; font: 10px "Segoe UI", system-ui, sans-serif; }
.meter { width: 100%; overflow: hidden; border-radius: 5px; background: #072c2a99; }
.meter i { display: block; width: 0; height: 100%; border-radius: inherit; transition: width .15s linear; }
.hp-meter, .xp-meter { height: 4px; }
.hp-meter i { width: 100%; background: linear-gradient(90deg, #7cc9ad, #c6e7bd); }
.health-card.danger .hp-meter i { background: linear-gradient(90deg, #dc8d6a, #f4c095); }
.xp-meter i { background: linear-gradient(90deg, #ceaa68, #fff1ba); }
.controls-hint { position: absolute; right: var(--edge); bottom: var(--safe-bottom); display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px 10px; width: 240px; color: #fff9e1; font-size: 10px; line-height: 1.8; text-shadow: 0 1px 4px #0a3427, 0 1px 12px #143d30; }
kbd { margin-right: 3px; padding: 1px 4px; border: 1px solid #e8efd14d; border-radius: 4px; color: inherit; font: inherit; }
.announcements { position: absolute; top: 66px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 5px; width: min(310px, 78vw); text-align: center; }
.toast { padding: 7px 13px; background: #173f3ee0; border: 1px solid #efd18c55; border-radius: 9px; box-shadow: 0 3px 15px #102f2c25; animation: toast-in .3s ease; }
.toast strong { font-size: 12px; font-weight: 600; letter-spacing: .5px; }
.toast small { display: block; margin-top: 3px; color: #d1dec5; font-size: 10px; line-height: 1.45; }
.toast.boss { background: #572f2eea; border-color: #e1ac81; }
.toast.out { opacity: 0; transform: translateY(-8px); transition: opacity .3s, transform .3s; }
.pickup-hint { position: absolute; bottom: 118px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; max-width: 90%; padding: 7px 13px; border: 1px solid #fff9df; border-radius: 9px; background: #faf3dfed; box-shadow: 0 4px 17px #153e3e2b; color: #244e47; }
.pickup-hint > span { color: #aa8740; font-size: 21px; }
.pickup-hint strong { font-size: 12px; font-weight: 600; white-space: nowrap; }
.pickup-hint small { display: block; margin-top: 2px; color: #658076; font-size: 9px; }

/* Start screen. */
.intro-layer { position: fixed; inset: 0; z-index: 5; display: flex; align-items: center; padding: 60px 8vw; }
.intro-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, #102f2bef 0%, #12392cc7 27%, #143a2d35 61%, #132f2608 100%); }
.intro-content { position: relative; width: 520px; max-width: 85vw; padding-bottom: 5vh; }
.intro-eyebrow { display: flex; align-items: center; gap: 10px; color: #e1dfbc; font-size: 10px; letter-spacing: 2.5px; }
.intro-eyebrow > span { color: var(--gold); font-size: 24px; }
.intro-eyebrow i { width: 25px; height: 1px; background: #d8c8888c; }
.intro-content h2 { margin: 29px 0 22px; font-size: clamp(42px, 4.7vw, 70px); font-weight: 600; line-height: 1.28; letter-spacing: 4px; text-shadow: 0 4px 25px #09271c44; }
.intro-content h2 span { color: #f0d690; }
.intro-copy { margin: 0; color: #c8d8bd; font-size: 13px; line-height: 2.05; letter-spacing: .6px; }
.intro-chips { display: flex; gap: 8px; margin-top: 22px; }
.intro-chips span { padding: 6px 11px; border: 1px solid #eee7bf32; border-radius: 30px; color: #dce2bf; font-size: 10px; letter-spacing: 1px; }
.primary-button { display: flex; align-items: center; justify-content: space-between; gap: 30px; min-height: 45px; padding: 11px 18px; border: 0; border-radius: 9px; background: linear-gradient(110deg, #eed59b, #f6e5ba); box-shadow: 0 6px 20px #112a222e; color: #244d43; font-size: 13px; font-weight: 650; letter-spacing: 1px; transition: transform .2s, filter .2s; }
.primary-button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.07); }
.primary-button > span:last-child { font-size: 23px; font-weight: 400; line-height: 1; }
.intro-content > .primary-button { width: 245px; margin-top: 29px; }
.text-button { display: block; padding: 10px 0; border: 0; background: none; color: inherit; font-size: 11px; letter-spacing: .5px; }
.text-button:hover { color: var(--gold); }
.intro-content > .text-button { margin-top: 7px; color: #d7dfbe; }
.text-button span { margin-left: 12px; }
.load-status { min-height: 16px; margin-top: 12px; color: #a6c3a5; font-size: 10px; letter-spacing: 1px; }
.load-status.error { color: #ffd3bc; font-size: 12px; line-height: 1.8; letter-spacing: 0; }
.intro-caption { position: absolute; bottom: 30px; left: 8vw; display: flex; align-items: center; gap: 8px; color: #b6cdb3; font-size: 10px; letter-spacing: 1px; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: #e2d88c; box-shadow: 0 0 10px #ecdf8c; }
.intro-version { position: absolute; right: 32px; bottom: 29px; display: flex; flex-direction: column; gap: 7px; color: #e0e5c6; font-size: 11px; letter-spacing: 2px; }
.intro-version span { color: #b6c7ad; font-size: 8px; letter-spacing: 2.5px; }

/* Menus pause combat, so their controls keep comfortable hit targets. */
.modal-layer { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 18px; overflow: auto; background: #0b292a94; backdrop-filter: blur(6px); }
.modal-card { position: relative; width: 350px; max-width: 100%; padding: 27px 30px; border: 1px solid #fff6db; border-radius: 18px; background: var(--cream); box-shadow: 0 22px 70px #092b2655; color: #2a5148; text-align: center; }
.modal-star { display: block; margin-bottom: 13px; color: #baa069; font-size: 28px; line-height: 1; }
.modal-card .eyebrow, .choice-panel .eyebrow { color: #ab925b; font-size: 9px; letter-spacing: 2px; }
.modal-card h2 { margin: 9px 0 10px; font-size: 24px; font-weight: 600; line-height: 1.5; letter-spacing: 1px; }
.modal-card p { margin: 0 0 18px; color: #7e8f7f; font-size: 12px; line-height: 1.8; }
.modal-card .primary-button { width: 100%; margin-top: 17px; }
.secondary-button { width: 100%; min-height: 43px; margin-top: 8px; border: 1px solid #44695b44; border-radius: 9px; background: #e6e8d8; color: #46685a; font-size: 12px; }
.secondary-button:hover { background: #dce4d1; }
.modal-card > .text-button { margin: 7px auto 0; color: #6f8775; }
.modal-footnote { display: block; margin-top: 10px; color: #94a08c; font-size: 10px; }
.choice-panel { width: 100%; max-width: 920px; padding: 26px 27px 20px; border: 1px solid #fff2c8; border-radius: 20px; background: #f8f3e4; box-shadow: 0 24px 80px #092b2655; color: #2a5148; text-align: center; }
.choice-panel h2 { margin: 9px 0; font-size: 28px; font-weight: 600; letter-spacing: 2px; }
.choice-panel > p { margin: 0 0 20px; color: #81927f; font-size: 12px; line-height: 1.5; }
.choice-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.choice-card { position: relative; display: flex; flex-direction: column; min-height: 220px; padding: 19px 20px 16px; border: 1px solid #52765b2b; border-radius: 13px; background: linear-gradient(150deg, #f6f2dc, #edeedc); color: #305a4c; text-align: left; transition: transform .2s, background .2s, border-color .2s; }
.choice-card:hover { transform: translateY(-4px); border-color: #c8ad70; background: #fff7db; }
.choice-num { color: #b39354; font-size: 10px; font-weight: 600; letter-spacing: 1px; }
.choice-glyph { margin: 13px 0 8px; color: #a38e57; font-size: 28px; }
.choice-card h3 { margin: 0 0 8px; font-size: 18px; font-weight: 650; letter-spacing: 1px; }
.choice-card p { margin: 0; color: #6d826e; font-size: 12px; line-height: 1.7; }
.choice-card small { display: block; margin-top: 6px; color: #8f9f87; font-size: 10px; }
.choice-action { display: flex; justify-content: space-between; margin-top: auto; padding-top: 16px; color: #537254; font-size: 11px; font-weight: 600; }
.choice-footer { display: block; margin-top: 16px; color: #8c9c86; font-size: 10px; line-height: 1.5; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px -7px; }
.result-grid span { display: flex; flex-direction: column; gap: 6px; }
.result-grid b { color: #426b59; font: 600 24px "Segoe UI", sans-serif; }
.result-grid small { color: #8da08c; font-size: 10px; }
.help-layer { z-index: 20; }
.help-card { width: 690px; padding: 28px 34px; text-align: left; }
.help-card h2 { font-size: 27px; }
.help-card .primary-button { max-width: 230px; }
.close-button { position: absolute; top: 11px; right: 15px; width: 32px; height: 32px; border: 0; background: none; color: #7d9380; font-size: 25px; }
.help-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 15px; }
.help-columns h3 { margin: 12px 0 6px; color: #526f58; font-size: 14px; font-weight: 600; }
.help-columns p { margin: 0 0 12px; color: #71856e; font-size: 12px; line-height: 1.8; }
.help-shortcuts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 7px; padding-top: 14px; border-top: 1px solid #b7c3a755; color: #7b8e72; font-size: 10px; }
.help-shortcuts kbd { border-color: #9bad8c; color: #637a60; }

/* Touch controls sit above the small status dock, away from the character. */
.touch-controls { position: fixed; inset: 0; z-index: 4; display: none; pointer-events: none; }
.joystick { position: absolute; bottom: calc(var(--safe-bottom) + 106px); left: 20px; display: grid; place-items: center; width: 84px; height: 84px; border: 1px solid #fff6c455; border-radius: 50%; background: #173f3e4d; backdrop-filter: blur(4px); pointer-events: auto; touch-action: none; }
.joystick > div { width: 36px; height: 36px; border: 1px solid #fff6d0b3; border-radius: 50%; background: #e3e7c3a6; box-shadow: 0 2px 12px #123e343d; }
.touch-actions { position: absolute; right: 20px; bottom: calc(var(--safe-bottom) + 106px); display: flex; align-items: flex-end; gap: 8px; pointer-events: auto; }
.touch-actions button { width: 44px; height: 44px; padding: 0; border: 1px solid #fff1bc66; border-radius: 50%; background: #16463ea6; backdrop-filter: blur(4px); color: #f3edcf; font-size: 11px; touch-action: none; }
.touch-actions .touch-main { width: 56px; height: 56px; border-color: #fff5cb; background: #e9d29cbd; color: #254d42; }
.touch-actions button:active { transform: scale(.92); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1080px) {
  .controls-hint { display: none; }
}
@media (pointer: coarse) {
  .touch-controls:not([hidden]) { display: block; }
  .controls-hint { display: none; }
  .intro-layer { touch-action: pan-y; }
  .pickup-hint { bottom: 210px; }
}
@media (max-width: 680px) {
  :root { --edge: 10px; }
  .brand { gap: 6px; padding: 6px 8px; border-radius: 9px; }
  .brand-orbit { width: 20px; height: 20px; font-size: 16px; }
  .brand h1 { font-size: 14px; letter-spacing: .5px; }
  .brand p { display: none; }
  .run-clock { gap: 6px; min-height: 33px; padding: 5px 9px; border-radius: 9px; }
  .run-clock > span { font-size: 18px; letter-spacing: 0; }
  .run-clock small { font-size: 9px; }
  .run-clock i { margin: 0 2px; }
  .icon-button { width: 29px; height: 29px; font-size: 19px; }
  .top-actions { gap: 5px; }
  .bottom-hud { width: calc(100% - 20px); max-width: 420px; padding: 7px 10px 8px; gap: 4px; border-radius: 10px; }
  .orb-stats { gap: 7px; }
  .orb-mark { font-size: 16px; }
  .stats-row { gap: 15px; }
  .stats-row b { font-size: 11px; }
  .stats-row small { font-size: 9px; }
  .stats-row .size-stat b { font-size: 10px; }
  .weapon-grid { gap: 5px; }
  .weapon { flex: 0 1 auto; gap: 4px; max-width: calc(25% - 4px); padding: 2px 6px; }
  .weapon-name { display: none; }
  .weapon-icon { width: 17px; font-size: 19px; line-height: 19px; }
  .weapon small { font-size: 10px; }
  .empty-loadout { font-size: 9px; }
  .vitals { grid-template-columns: 1fr 1.25fr; gap: 14px; padding-top: 5px; }
  .health-card strong, .health-card #hp-value { font-size: 10px; }
  .xp-card strong { font-size: 11px; }
  .xp-card #xp-value { font-size: 9px; }
  .announcements { top: 53px; width: min(280px, 76vw); }
  .toast { padding: 6px 11px; border-radius: 8px; }
  .toast strong { font-size: 11px; }
  .toast small { font-size: 9px; }
  .pickup-hint { bottom: 112px; padding: 6px 11px; gap: 6px; }
  .pickup-hint strong { font-size: 11px; }
  .pickup-hint > span { font-size: 19px; }
  .intro-layer { align-items: center; padding: 60px 27px 80px; }
  .intro-content { width: 100%; max-width: 100%; padding-bottom: 18px; }
  .intro-shade { background: linear-gradient(90deg, #103b2eec, #103a2ca6 64%, #17392d68); }
  .intro-eyebrow { font-size: 9px; letter-spacing: 1px; }
  .intro-content h2 { margin: 21px 0 17px; font-size: 45px; line-height: 1.33; letter-spacing: 2px; }
  .intro-copy { font-size: 11px; line-height: 2; }
  .intro-chips { gap: 6px; margin-top: 17px; }
  .intro-chips span { padding: 5px 9px; font-size: 9px; }
  .intro-content > .primary-button { width: 230px; margin-top: 25px; }
  .intro-caption { bottom: 22px; left: 27px; max-width: 62%; font-size: 9px; line-height: 1.7; letter-spacing: 0; }
  .intro-version { right: 20px; bottom: 24px; font-size: 9px; letter-spacing: 1px; }
  .intro-version span { font-size: 7px; letter-spacing: .5px; }
  .load-status { font-size: 9px; }
  .modal-layer { padding: 13px; }
  .modal-card { padding: 25px; border-radius: 16px; }
  .modal-card h2 { font-size: 23px; }
  .choice-panel { max-width: 430px; padding: 21px 16px 16px; border-radius: 17px; }
  .choice-panel h2 { margin: 7px 0; font-size: 23px; letter-spacing: 1px; }
  .choice-panel > p { margin-bottom: 14px; font-size: 11px; }
  .choice-list { grid-template-columns: 1fr; gap: 8px; }
  .choice-card { display: grid; grid-template-columns: 28px 1fr; gap: 0 10px; min-height: 98px; padding: 13px 15px; border-radius: 11px; }
  .choice-num { position: absolute; top: 10px; right: 12px; font-size: 9px; }
  .choice-glyph { grid-column: 1; grid-row: 1 / 4; align-self: center; margin: 0; font-size: 25px; }
  .choice-card h3 { grid-column: 2; grid-row: 1; margin: 0 65px 5px 0; font-size: 16px; letter-spacing: .5px; }
  .choice-card p { grid-column: 2; grid-row: 2; font-size: 11px; line-height: 1.55; }
  .choice-card small { grid-column: 2; grid-row: 3; margin-top: 4px; font-size: 10px; }
  .choice-action { display: none; }
  .choice-footer { margin-top: 12px; font-size: 9px; }
  .help-card { max-height: 90dvh; padding: 25px; overflow: auto; }
  .help-card h2 { font-size: 23px; }
  .help-columns { grid-template-columns: 1fr; gap: 0; margin-top: 10px; }
  .help-columns h3 { margin-top: 11px; font-size: 13px; }
  .help-columns p { margin-bottom: 10px; font-size: 11px; }
  .help-shortcuts { gap: 9px; font-size: 9px; }
  .joystick { bottom: calc(var(--safe-bottom) + 101px); left: 14px; width: 78px; height: 78px; }
  .joystick > div { width: 33px; height: 33px; }
  .touch-actions { right: 14px; bottom: calc(var(--safe-bottom) + 101px); gap: 6px; }
  .touch-actions button { width: 40px; height: 40px; font-size: 10px; }
  .touch-actions .touch-main { width: 52px; height: 52px; }
}
@media (max-width: 680px) and (pointer: coarse) {
  .pickup-hint { bottom: 204px; }
}
@media (max-width: 370px) {
  .brand-orbit { display: none; }
  .run-clock { gap: 5px; padding-left: 7px; padding-right: 7px; }
  .top-actions #sound { display: none; }
  .stats-row { gap: 10px; }
  .orb-stats { gap: 5px; }
  .weapon { padding-left: 4px; padding-right: 4px; }
  .choice-card h3 { margin-right: 58px; }
}
@media (max-height: 610px) {
  .intro-content h2 { margin: 15px 0; font-size: 39px; }
  .intro-copy { font-size: 11px; }
  .intro-chips { margin-top: 13px; }
  .intro-content > .primary-button { margin-top: 17px; }
  .intro-content { padding-bottom: 0; }
  .intro-caption, .intro-version { bottom: 15px; }
  .choice-panel { padding-top: 17px; }
  .choice-card { min-height: 94px; }
  .choice-panel > p { margin-bottom: 11px; }
}
@media (max-height: 500px) and (min-width: 681px) {
  .intro-chips, .intro-caption { display: none; }
  .intro-content h2 { font-size: 34px; }
  .intro-content > .primary-button { margin-top: 12px; }
  .choice-card { min-height: 178px; padding: 13px 16px; }
  .choice-glyph { margin: 8px 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
