:root {
  color-scheme: light;
  --ink: #1d2b24;
  --muted: #69766b;
  --paper: #eee4c8;
  --paper-light: #f8f0da;
  --paper-deep: #d9cba6;
  --forest: #102f29;
  --forest-deep: #081d1a;
  --jade: #39725e;
  --jade-light: #89aa8f;
  --gold: #c9a45d;
  --gold-light: #ecd49b;
  --cinnabar: #9b4234;
  --cinnabar-dark: #672a24;
  --line: rgba(57, 70, 52, .2);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 15% 10%, rgba(64, 120, 96, .29), transparent 34%),
    radial-gradient(ellipse at 92% 72%, rgba(164, 111, 51, .15), transparent 30%),
    linear-gradient(155deg, #132d28 0%, #081815 48%, #10231e 100%);
  font-family: var(--sans);
  isolation: isolate;
}
body::before {
  position: fixed;
  z-index: -2;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    repeating-radial-gradient(ellipse at 80% 18%, transparent 0 22px, rgba(224, 205, 157, .035) 23px 24px, transparent 25px 42px),
    linear-gradient(115deg, transparent 0 46%, rgba(231, 210, 159, .025) 46.2% 46.8%, transparent 47% 100%);
}
body::after {
  position: fixed;
  z-index: -1;
  right: 0;
  bottom: 0;
  left: 0;
  height: 34vh;
  min-height: 250px;
  content: "";
  opacity: .34;
  background:
    linear-gradient(142deg, transparent 0 16%, #06100e 16.3% 31%, transparent 31.3%) 0 100% / 48% 80% no-repeat,
    linear-gradient(38deg, transparent 0 34%, #06100e 34.3% 56%, transparent 56.3%) 100% 100% / 68% 100% no-repeat,
    linear-gradient(to top, #050e0c 0 17%, transparent 17.5%);
  pointer-events: none;
}
button { font: inherit; }
button:focus-visible { outline: 3px solid #f0bd61; outline-offset: 3px; }
[hidden] { display: none !important; }

.page { max-width: 1080px; padding: 36px 24px 60px; margin: 0 auto; }
.page-header { position: relative; margin: 0 0 27px; color: #f6f0dc; }
.page-header::after {
  display: block;
  width: min(380px, 70vw);
  height: 1px;
  margin-top: 17px;
  content: "";
  background: linear-gradient(to right, var(--gold), rgba(201, 164, 93, .08), transparent);
}
.eyebrow { display: flex; align-items: center; gap: 10px; color: #b7cbbb; font-family: var(--serif); font-size: 11px; font-weight: 700; letter-spacing: .24em; }
.eyebrow-dot { width: 8px; height: 8px; border: 1px solid #e5c987; background: #9e3f31; box-shadow: 0 0 0 4px rgba(225, 196, 130, .09); transform: rotate(45deg); }
.page-header h1 { margin: 9px 0 2px; font-family: var(--serif); font-weight: 800; font-size: clamp(39px, 6vw, 62px); line-height: 1.1; letter-spacing: .12em; text-shadow: 0 3px 18px rgba(0, 0, 0, .26); }
.page-header h1 span { color: #e1bd70; }
.page-header p { margin: 9px 0 0; color: #b7c8bb; font-family: var(--serif); font-size: 14px; letter-spacing: .12em; }

.layout { display: grid; grid-template-columns: minmax(0, 480px) minmax(260px, 1fr); align-items: start; gap: 35px; }
.game-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(226, 197, 133, .82);
  border-radius: 5px 20px 5px 20px;
  background:
    linear-gradient(90deg, rgba(95, 70, 30, .035) 1px, transparent 1px) 0 0 / 21px 100%,
    linear-gradient(0deg, rgba(95, 70, 30, .025) 1px, transparent 1px) 0 0 / 100% 21px,
    var(--paper-light);
  box-shadow: 0 28px 70px rgba(0, 8, 6, .48), inset 0 0 0 4px rgba(106, 77, 35, .11), inset 0 0 38px rgba(101, 73, 28, .08);
  isolation: isolate;
}
.game-shell::before {
  position: absolute;
  z-index: 7;
  inset: 6px;
  border: 1px solid rgba(115, 84, 38, .22);
  border-radius: 1px 14px 1px 14px;
  content: "";
  pointer-events: none;
}
.shell-corner { position: absolute; z-index: 8; top: 8px; width: 22px; height: 22px; pointer-events: none; }
.shell-corner::before, .shell-corner::after { position: absolute; content: ""; background: #d4b46e; }
.shell-corner::before { width: 18px; height: 1px; top: 0; }
.shell-corner::after { width: 1px; height: 18px; top: 0; }
.corner-nw { left: 8px; }
.corner-nw::before, .corner-nw::after { left: 0; }
.corner-ne { right: 8px; transform: scaleX(-1); }
.corner-ne::before, .corner-ne::after { left: 0; }

.game-heading {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 18px 14px;
  color: #f7efd7;
  background:
    radial-gradient(circle at 84% 15%, rgba(215, 188, 120, .12) 0 1px, transparent 2px) 0 0 / 14px 14px,
    linear-gradient(112deg, #0d2924, #17473b 62%, #102e28);
  border-bottom: 2px solid #b99450;
  box-shadow: inset 0 -1px 0 rgba(247, 222, 160, .26);
}
.game-heading::after { position: absolute; right: 18px; bottom: -4px; left: 18px; height: 1px; content: ""; background: linear-gradient(90deg, transparent, rgba(218, 181, 104, .58), transparent); }
.game-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 39px;
  height: 39px;
  border: 1px solid #e0bb72;
  border-radius: 2px;
  color: #f5dfac;
  background: linear-gradient(145deg, #a34838, #772d29);
  font-family: var(--serif);
  font-size: 22px;
  box-shadow: inset 0 0 0 3px rgba(91, 24, 23, .28), 0 2px 8px rgba(0, 0, 0, .2);
  transform: rotate(-2deg);
}
.game-overline { color: #a9c2ae; font-size: 9px; letter-spacing: .2em; font-weight: 750; }
.game-name { margin-top: 2px; color: #fff2d0; font-family: var(--serif); font-size: 16px; font-weight: 800; letter-spacing: .12em; }
.realm-pill {
  margin-left: auto;
  padding: 6px 11px 5px;
  border: 1px solid #c5a45f;
  border-radius: 2px 10px 2px 10px;
  color: #f1dcaa;
  background: rgba(8, 28, 24, .68);
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  white-space: nowrap;
  box-shadow: inset 0 0 0 2px rgba(229, 204, 148, .07);
}
.sound-btn { flex: none; display: grid; place-items: center; width: 33px; height: 33px; border: 1px solid #8daf95; border-radius: 50%; color: #eff0d9; background: #254f42; font-size: 16px; font-weight: 900; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(239, 218, 165, .1); }
.sound-btn:hover { border-color: #d8bc79; background: #326552; }
.sound-btn[aria-pressed="false"] { color: #a99f89; border-color: #6d756a; background: #283732; }

.hud { display: grid; grid-template-columns: repeat(3, 1fr); margin: 13px 14px 12px; overflow: hidden; border: 1px solid #9a916d; border-radius: 2px 9px 2px 9px; background: linear-gradient(180deg, #d9e3cf, #cbd8c4); box-shadow: inset 0 0 0 3px rgba(251, 246, 218, .42), 0 3px 8px rgba(55, 54, 36, .08); }
.hud-cell { position: relative; min-width: 0; padding: 9px 5px 8px; text-align: center; border-right: 1px solid rgba(57, 83, 62, .2); }
.hud-cell:last-child { border-right: 0; }
.hud-cell > span { display: block; margin-bottom: 2px; color: #637662; font-family: var(--serif); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.hud-cell strong { color: #163f34; font-family: var(--serif); font-size: 22px; line-height: 1.05; font-variant-numeric: tabular-nums; text-shadow: 0 1px rgba(255, 255, 255, .5); }
.hud-cell small { margin-left: 1px; font-family: var(--sans); font-size: 10px; font-weight: 700; }

.arena-wrap { position: relative; margin: 0 7px; border: 2px solid #a78b50; background: #122b25; box-shadow: 0 0 0 1px #294b3d, 0 0 0 4px rgba(70, 57, 31, .16), inset 0 0 28px rgba(0, 0, 0, .32); }
#arena { display: block; width: 100%; height: auto; aspect-ratio: 960 / 440; touch-action: manipulation; }
.arena-status { position: absolute; left: 10px; right: 10px; bottom: 9px; width: fit-content; max-width: calc(100% - 20px); padding: 7px 11px 7px 13px; border: 1px solid rgba(232, 204, 139, .45); border-left: 3px solid #bd5845; border-radius: 1px 8px 1px 8px; color: #f8eed1; background: rgba(7, 26, 22, .84); font-family: var(--serif); font-size: 11px; line-height: 1.4; letter-spacing: .03em; box-shadow: 0 4px 15px rgba(0, 0, 0, .22); backdrop-filter: blur(8px); }
.action-prompt { display: flex; align-items: center; gap: 9px; padding: 10px 17px; background: #e8ddc3; color: #685a3f; font-size: 11px; font-weight: 650; line-height: 1.45; }
.prompt-sigil { color: #a17c41; font-size: 17px; }
.encounter-strip { position: relative; display: flex; flex-direction: column; gap: 3px; margin: 9px 10px 0; padding: 9px 13px 9px 16px; border: 1px solid #b5aa82; border-left: 4px solid #557a63; border-radius: 1px 8px 1px 8px; color: #304c3d; background: linear-gradient(100deg, #e1dfc6, #edf0da); box-shadow: inset 0 0 14px rgba(79, 91, 54, .05); }
.encounter-strip::after { position: absolute; right: 11px; top: 50%; width: 22px; height: 22px; border: 1px solid currentColor; content: "阵"; color: rgba(68, 91, 68, .22); font-family: var(--serif); font-size: 14px; line-height: 21px; text-align: center; transform: translateY(-50%) rotate(8deg); }
.encounter-strip strong { padding-right: 28px; font-family: var(--serif); font-size: 12px; line-height: 1.35; letter-spacing: .04em; }
.encounter-strip span { padding-right: 28px; color: #647465; font-size: 10px; line-height: 1.45; }
.encounter-strip[data-kind="fast"] { border-color: #78a7a2; border-left-color: #368b87; color: #245f5d; background: linear-gradient(100deg, #d5e9e2, #edf1d8); }
.encounter-strip[data-kind="brute"] { border-color: #c19b60; border-left-color: #9c663a; color: #6f4b29; background: linear-gradient(100deg, #ecdfbd, #f2e9d3); }
.encounter-strip[data-kind="boss"] { border-color: #9b493d; border-left-color: #e1ad59; color: #f0cf85; background: linear-gradient(110deg, #4d1f1c, #793329 58%, #40201d); box-shadow: inset 0 0 20px rgba(33, 3, 3, .28), 0 3px 12px rgba(83, 27, 22, .18); }
.encounter-strip[data-kind="boss"] span { color: #e8cbb1; }
.encounter-strip[data-kind="boss"]::after { content: "劫"; color: rgba(247, 204, 121, .48); }

.tutorial-banner { position: relative; margin: 12px 18px 0; padding: 11px 13px 11px 43px; overflow: hidden; border: 1px solid #ba843d; border-radius: 2px 9px 2px 9px; background: linear-gradient(105deg, #f5e5b9, #fff2d1); box-shadow: inset 0 0 0 3px rgba(255, 250, 221, .5), 0 4px 12px rgba(105, 72, 30, .1); }
.tutorial-banner::before { position: absolute; top: 0; bottom: 0; left: 0; display: grid; place-items: center; width: 32px; content: "引"; color: #f0c879; background: #994235; font-family: var(--serif); font-size: 18px; }
.tutorial-count { color: #98611f; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.tutorial-row { display: flex; align-items: center; gap: 10px; margin-top: 3px; }
.tutorial-row strong { flex: 1; color: #65471e; font-family: var(--serif); font-size: 12px; line-height: 1.4; }
.tutorial-skip { flex: none; border: 0; background: transparent; color: #8f704d; font-size: 10px; text-decoration: underline; cursor: pointer; }
.mine-btn.guided, .inventory .slot.guided { position: relative; z-index: 1; outline: 3px solid #e4a13b; outline-offset: 2px; box-shadow: 0 0 0 6px rgba(235, 167, 58, .24); animation: guide-pulse 1.35s ease-in-out infinite; }
@keyframes guide-pulse { 50% { box-shadow: 0 0 0 11px rgba(235, 167, 58, .07); } }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 8px; margin: 16px 18px 9px; }
.section-heading > div:first-child { position: relative; flex: 1; min-width: 0; }
.section-heading > div:first-child::after { position: absolute; right: 9px; bottom: 6px; left: 110px; height: 1px; content: ""; background: linear-gradient(to right, rgba(126, 105, 60, .36), transparent); }
.section-label { display: block; color: #967d50; font-family: var(--serif); font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.section-heading h2 { margin: 2px 0 0; color: #23382d; font-family: var(--serif); font-size: 16px; line-height: 1.2; letter-spacing: .1em; }
.charges { flex: none; padding-bottom: 1px; color: #6b755f; font-family: var(--serif); font-size: 11px; }
.charges strong { margin-left: 4px; color: #26624f; font-size: 17px; font-variant-numeric: tabular-nums; }
.charges span { color: #929a89; }
.mine-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 0 18px; }
.mine-btn { position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 66px; padding: 9px 8px; overflow: hidden; border: 1px solid; border-radius: 2px 11px 2px 11px; text-align: left; cursor: pointer; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .27), 0 3px 7px rgba(49, 47, 29, .09); transition: transform .15s ease, box-shadow .15s ease, filter .15s ease; }
.mine-btn::before { position: absolute; top: 4px; right: 4px; bottom: 4px; left: 4px; border: 1px solid currentColor; border-radius: 1px 7px 1px 7px; content: ""; opacity: .13; pointer-events: none; }
.mine-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .31), 0 7px 14px rgba(22, 44, 28, .15); }
.mine-btn:active:not(:disabled) { transform: translateY(0); }
.mine-btn:disabled { cursor: not-allowed; filter: saturate(.55); opacity: .52; }
.iron-mine { border-color: #b78c4e; color: #684829; background: linear-gradient(135deg, #f1deb4, #d8bd89); }
.frost-mine { border-color: #6faaa2; color: #265f59; background: linear-gradient(135deg, #d8ede7, #afd3ca); }
.mine-icon { display: grid; place-items: center; flex: none; width: 35px; height: 35px; border: 1px solid currentColor; border-radius: 50%; background: rgba(255, 255, 255, .34); font-size: 21px; line-height: 1; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .17); }
.mine-copy { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.mine-copy strong { font-family: var(--serif); white-space: nowrap; font-size: 13px; letter-spacing: .03em; }
.mine-copy small { white-space: nowrap; font-size: 9px; opacity: .87; }
.mine-arrow { display: grid; place-items: center; flex: none; width: 23px; height: 23px; margin-left: auto; border: 1px solid currentColor; border-radius: 2px; font-family: var(--serif); font-size: 11px; opacity: .62; transform: rotate(3deg); }
.gear-heading { margin-top: 18px; }
.section-note { color: #7c887a; font-size: 10px; }
.inventory { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; min-height: 78px; margin: 0 12px; padding: 8px 6px; border: 1px solid rgba(85, 98, 70, .25); border-radius: 50% / 18%; background: radial-gradient(ellipse at center, transparent 0 37%, rgba(63, 110, 84, .09) 38% 39%, transparent 40% 54%, rgba(63, 110, 84, .07) 55% 56%, transparent 57%), rgba(204, 211, 183, .26); box-shadow: inset 0 0 16px rgba(54, 83, 62, .08); }
.inventory .slot, .inventory > button { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; min-width: 0; min-height: 60px; padding: 3px; border: 1px solid #9da993; border-radius: 2px 9px 2px 9px; color: #526557; background: linear-gradient(145deg, #e9ebd9, #dbe2d3); cursor: pointer; text-align: center; touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .36); transition: transform .13s ease, border-color .13s ease, background .13s ease; }
.inventory .slot.empty { border-style: dashed; background: rgba(229, 233, 214, .65); }
.inventory .slot:hover { transform: translateY(-2px); }
.inventory .slot.selected { outline: 2px solid #c98635; outline-offset: 1px; color: #6b471f; background: #f7e4b9; transform: translateY(-3px); }
.inventory .slot.iron { border-color: #b99154; color: #6e4d29; background: linear-gradient(145deg, #f5e7c6, #dfc592); }
.inventory .slot.frost { border-color: #72aaa3; color: #28635e; background: linear-gradient(145deg, #dff0e9, #bcd9d1); }
.inventory .slot .icon, .inventory .slot .item-icon { font-size: 21px; line-height: 1; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .55)); }
.inventory .slot .name, .inventory .slot .item-name { display: block; max-width: 100%; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); font-size: 9px; font-weight: 800; }
.inventory .slot .rank, .inventory .slot .level { position: absolute; top: 2px; right: 3px; font-size: 8px; font-weight: 850; }
.slot-empty-mark { color: rgba(63, 88, 69, .38); font-family: var(--serif); font-size: 19px; }
.inventory .slot:disabled { cursor: default; }
.inventory .slot.dragging { opacity: .32; }
.inventory .slot.merge-target { outline: 2px solid #4c9b72; outline-offset: 2px; }
.inventory .slot.drop-ready { outline: 3px solid #27a765; outline-offset: 2px; box-shadow: 0 0 0 6px rgba(42, 182, 110, .23); transform: translateY(-3px) scale(1.06); }
.inventory .slot.drop-invalid { outline: 2px solid #bf655d; outline-offset: 2px; }
.drag-ghost { position: fixed; z-index: 50; display: grid; place-items: center; width: 82px; height: 64px; padding: 5px; border: 2px solid #d7a653; border-radius: 2px 10px 2px 10px; color: #684522; background: #f7e3b6; box-shadow: 0 12px 28px rgba(19, 36, 25, .3); font-family: var(--serif); font-size: 12px; font-weight: 850; white-space: nowrap; pointer-events: none; transform: translate(-50%, -110%); }
.drag-ghost.frost { border-color: #75b5b0; color: #275e5d; background: #d9eee8; }

.game-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 18px 17px; padding-top: 12px; border-top: 1px solid rgba(117, 98, 59, .25); }
.essence { display: flex; align-items: baseline; gap: 8px; color: #707966; font-family: var(--serif); font-size: 11px; }
.essence::before { display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid #76917a; border-radius: 50%; content: "气"; color: #55745f; font-size: 9px; }
.essence strong { color: #1f5945; font-size: 19px; font-variant-numeric: tabular-nums; }
.cultivate-btn { padding: 8px 12px; border: 1px solid #95713b; border-radius: 2px 8px 2px 8px; color: #f6e5ba; background: linear-gradient(#326b53, #23513f); font-family: var(--serif); font-size: 11px; font-weight: 800; letter-spacing: .06em; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(236, 218, 170, .12), 0 2px 0 #173c2f; }
.cultivate-btn:hover:not(:disabled) { background: linear-gradient(#3d7d61, #296048); }
.cultivate-btn:disabled { opacity: .48; cursor: not-allowed; }
.cultivate-btn span { margin-left: 4px; }
.toast { position: absolute; z-index: 11; bottom: 18px; left: 50%; max-width: 90%; padding: 8px 14px; border: 1px solid #c09b57; border-radius: 2px 9px 2px 9px; color: #fff1c9; background: rgba(18, 55, 43, .97); font-family: var(--serif); font-size: 12px; text-align: center; white-space: nowrap; opacity: 0; transform: translate(-50%, 6px); transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
.toast:not(:empty), .toast.show, .toast.visible { opacity: 1; transform: translate(-50%, 0); }

.overlay { position: absolute; z-index: 9; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(3, 20, 17, .78); backdrop-filter: blur(5px); }
.overlay.hidden { display: none; }
.overlay-card { position: relative; width: 100%; max-width: 340px; padding: 29px 25px 24px; overflow: hidden; border: 1px solid #c4a05a; border-radius: 3px 17px 3px 17px; color: #25382c; background: linear-gradient(96deg, rgba(110, 76, 30, .035) 1px, transparent 1px) 0 0 / 18px 100%, linear-gradient(#f5e8c6, #ead8aa); box-shadow: inset 0 0 0 5px rgba(255, 247, 217, .45), inset 0 0 30px rgba(110, 73, 24, .09), 0 18px 45px rgba(0, 9, 6, .46); text-align: center; }
.overlay-card::before { position: absolute; inset: 9px; border: 1px solid rgba(130, 94, 40, .28); border-radius: 1px 10px 1px 10px; content: ""; pointer-events: none; }
.overlay-card::after { position: absolute; top: -60px; left: 50%; width: 180px; height: 180px; border: 1px solid rgba(79, 111, 78, .1); border-radius: 50%; content: ""; box-shadow: 0 0 0 17px rgba(79, 111, 78, .045), 0 0 0 35px rgba(79, 111, 78, .025); pointer-events: none; transform: translateX(-50%); }
.overlay-card > * { position: relative; z-index: 1; }
.overlay-kicker { color: #8d6c37; font-family: var(--serif); font-size: 10px; font-weight: 850; letter-spacing: .22em; }
.overlay-emblem { display: grid; place-items: center; width: 61px; height: 61px; margin: 18px auto 11px; border: 1px solid #e0bd72; border-radius: 2px; color: #f4d99c; background: linear-gradient(145deg, #aa4b3a, #762b27); font-family: var(--serif); font-size: 29px; font-weight: 800; box-shadow: inset 0 0 0 4px rgba(92, 26, 24, .28), 0 0 0 5px rgba(121, 85, 39, .11); transform: rotate(-3deg); }
.overlay-card h2 { margin: 8px 0 8px; color: #173e32; font-family: var(--serif); font-size: 31px; letter-spacing: .12em; }
.overlay-card p { margin: 0 auto 19px; max-width: 26em; color: #5f6657; font-size: 13px; line-height: 1.75; }
.result-summary { margin: -6px 0 10px; color: #315b45; font-size: 12px; font-weight: 800; }
.overlay-card .result-tip { padding: 10px 12px; border: 1px solid rgba(143, 105, 47, .24); border-radius: 2px 7px 2px 7px; color: #684f2d; background: rgba(219, 201, 158, .48); text-align: left; font-size: 12px; line-height: 1.55; }
.primary-btn { display: flex; justify-content: center; align-items: center; gap: 11px; width: 100%; min-height: 45px; border: 1px solid #d3ac61; border-radius: 2px 9px 2px 9px; color: #fff0c7; background: linear-gradient(180deg, #a84d3b, #803329); font-family: var(--serif); font-size: 14px; font-weight: 850; letter-spacing: .13em; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255, 224, 161, .12), 0 4px 0 #5e251f; }
.primary-btn:hover { background: linear-gradient(180deg, #b95b45, #913b2e); }
.primary-btn:active { transform: translateY(3px); box-shadow: inset 0 0 0 2px rgba(255, 224, 161, .12), 0 1px 0 #5e251f; }
.secondary-btn { width: 100%; min-height: 40px; margin-top: 10px; border: 1px solid #81947b; border-radius: 2px 8px 2px 8px; color: #264d39; background: rgba(214, 226, 199, .75); font-family: var(--serif); font-size: 12px; font-weight: 800; cursor: pointer; }
.secondary-btn:hover { background: #d0dfc4; }
.overlay-foot { margin-top: 17px; color: #97866a; font-family: var(--serif); font-size: 10px; letter-spacing: .04em; }
.replay-guide-btn { margin-top: 13px; padding: 8px 12px; border: 1px solid rgba(207, 173, 106, .6); border-radius: 2px 7px 2px 7px; color: #e8d6b0; background: transparent; font-size: 11px; font-weight: 750; cursor: pointer; }
.replay-guide-btn:hover:not(:disabled) { background: rgba(232, 204, 150, .12); }
.replay-guide-btn:disabled { opacity: .5; cursor: not-allowed; }
.overlay-card .replay-guide-btn { color: #645e4d; border-color: #aa9c74; margin-top: 12px; }

.design-notes { position: relative; padding: 19px 3px 16px 25px; color: #edeee3; }
.design-notes::before { position: absolute; top: 21px; bottom: 18px; left: 0; width: 1px; content: ""; background: linear-gradient(to bottom, #c9a45d, rgba(201, 164, 93, .08)); }
.design-notes::after { position: absolute; top: 14px; left: -4px; width: 9px; height: 9px; border: 1px solid #d9b86f; content: ""; transform: rotate(45deg); }
.note-label { width: fit-content; padding: 6px 10px; border: 1px solid rgba(224, 189, 115, .6); border-radius: 1px 8px 1px 8px; color: #ead099; background: rgba(9, 34, 28, .38); font-family: var(--serif); font-size: 10px; font-weight: 800; letter-spacing: .19em; }
.design-notes h2 { margin: 22px 0 13px; color: #f4edda; font-family: var(--serif); font-size: clamp(29px, 3vw, 38px); line-height: 1.23; letter-spacing: .08em; }
.design-notes > p { margin: 0; max-width: 400px; color: #bdd0c1; font-size: 13px; line-height: 1.85; }
.note-divider { height: 1px; margin: 22px 0; background: linear-gradient(to right, rgba(234, 207, 151, .48), transparent); }
.note-row { display: flex; align-items: start; gap: 14px; margin: 0 0 20px; }
.note-index { display: grid; place-items: center; flex: none; width: 29px; height: 29px; border: 1px solid rgba(208, 173, 118, .48); border-radius: 50%; color: #d8b675; font-family: var(--serif); font-size: 12px; line-height: 1; }
.note-row strong { color: #f3eddd; font-family: var(--serif); font-size: 14px; letter-spacing: .04em; }
.note-row p { margin: 5px 0 0; color: #aabfb0; font-size: 12px; line-height: 1.7; }
.boot-loader {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  background: rgba(6, 22, 19, .92);
  color: #f3ead0;
}
.boot-loader[hidden] { display: none !important; }
.boot-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid #e0bb72;
  color: #f5dfac;
  background: linear-gradient(145deg, #a34838, #772d29);
  font-family: var(--serif);
  font-size: 28px;
}
.boot-loader strong { font-family: var(--serif); font-size: 18px; letter-spacing: .18em; }
.boot-loader span { color: #b7c8bb; font-size: 12px; letter-spacing: .08em; }

@media (max-width: 780px) {
  .page { max-width: 540px; padding: 22px 12px 40px; }
  .page-header { margin-bottom: 19px; padding: 0 4px; }
  .page-header h1 { font-size: 40px; }
  .layout { grid-template-columns: 1fr; gap: 21px; }
  .design-notes { padding: 8px 10px 14px 28px; }
  .design-notes h2 { font-size: 27px; }
}

@media (max-width: 560px) {
  body { background: #0b211c; }
  body::after { display: none; }
  .page { max-width: none; min-height: 100dvh; padding: 0; }
  .page-header, .design-notes, .action-prompt { display: none; }
  .layout { display: block; }
  .game-shell { min-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .game-shell::before { inset: 4px; border-color: rgba(112, 85, 43, .16); }
  .shell-corner { display: none; }
  .game-heading { padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 9px; }
  .game-mark { width: 35px; height: 35px; font-size: 20px; }
  .hud { margin: 8px 10px 8px; }
  .arena-wrap { margin-inline: 4px; }
  .arena-status { bottom: 7px; font-size: 10px; }
  .encounter-strip { margin: 7px 8px 0; padding-block: 7px; }
  .tutorial-banner { margin: 8px 12px 0; }
  .section-heading { margin-top: 11px; margin-bottom: 6px; }
  .gear-heading { margin-top: 12px; }
  .mine-btn { min-height: 59px; }
  .inventory { min-height: 70px; }
  .inventory .slot, .inventory > button { min-height: 56px; }
  .game-footer { margin-top: 9px; margin-bottom: 9px; padding-top: 8px; padding-bottom: env(safe-area-inset-bottom, 0px); }
}

@media (max-width: 560px) and (max-height: 700px) {
  .hud { margin-top: 6px; margin-bottom: 6px; }
  .hud-cell { padding-block: 6px; }
  .hud-cell strong { font-size: 18px; }
  #arena { max-height: 26dvh; width: auto; max-width: 100%; margin-inline: auto; }
  .encounter-strip { margin-top: 5px; }
  .section-heading { margin-top: 8px; margin-bottom: 4px; }
  .mine-btn { min-height: 52px; }
  .inventory { min-height: 62px; }
  .inventory .slot, .inventory > button { min-height: 48px; }
  .game-footer { margin-top: 6px; margin-bottom: 6px; }
}

@media (max-width: 380px) {
  .game-heading { padding-inline: 10px; gap: 7px; }
  .game-overline { letter-spacing: .12em; }
  .realm-pill { padding-inline: 7px; }
  .hud { margin-inline: 7px; }
  .mine-grid { padding-inline: 10px; gap: 6px; }
  .mine-btn { gap: 5px; min-height: 58px; padding: 6px; }
  .mine-icon { width: 29px; height: 29px; font-size: 18px; }
  .mine-copy strong { font-size: 12px; }
  .mine-copy small { font-size: 8px; }
  .mine-arrow { display: none; }
  .section-heading { margin-inline: 10px; }
  .section-heading > div:first-child::after { left: 96px; }
  .inventory { margin-inline: 7px; gap: 4px; padding-inline: 4px; }
  .game-footer { margin-inline: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
