:root {
  --bg: #07110d;
  --panel: rgba(12, 25, 20, .86);
  --line: rgba(227, 199, 140, .16);
  --gold: #edc97f;
  --gold-bright: #ffe3a3;
  --text: #f1ecdc;
  --muted: #94a89b;
  --muted-2: #6d8277;
  --green: #65dbaa;
  --amber: #edc97f;
  --red: #ff8b79;
  --font-ui: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Songti SC", "STSong", "Noto Serif SC", "Times New Roman", serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-ui);
  background:
    radial-gradient(900px 700px at 20% -15%, rgba(37, 92, 70, .34), transparent 62%),
    radial-gradient(700px 600px at 95% 100%, rgba(93, 70, 28, .18), transparent 66%),
    linear-gradient(160deg, #08130f 0%, #06100c 50%, #050c09 100%);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.3'/%3E%3C/svg%3E");
  opacity: .055; mix-blend-mode: overlay;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
button:disabled { cursor: not-allowed; }
img { display: block; max-width: 100%; }
b, strong { font-weight: 700; }
em { font-style: normal; }

.app {
  position: relative; z-index: 1;
  width: 100%; max-width: 540px;
  height: 100dvh;
  margin: 0 auto;
  padding: calc(9px + env(safe-area-inset-top)) 10px calc(9px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px;
}

/* ── overlay header ─────────────────────────────────── */
.app-header {
  position: absolute; z-index: 30;
  top: calc(9px + env(safe-area-inset-top)); left: 10px; right: 10px;
  height: 50px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 6px;
  padding: 3px 1px 7px;
  background: linear-gradient(180deg, rgba(5, 13, 9, .94), rgba(5, 13, 9, .56) 68%, transparent);
  pointer-events: none;
}
.app-header > * { pointer-events: auto; }
.help-pill {
  flex: none; height: 40px; padding: 0 11px 0 8px;
  display: flex; align-items: center; gap: 5px;
  border-radius: 10px; border: 1px solid rgba(232, 202, 136, .24);
  background: rgba(8, 19, 14, .66); backdrop-filter: blur(7px);
  color: #d8d4bd; font-size: 10px; font-weight: 600; letter-spacing: .04em;
  transition: .16s ease;
}
.help-pill:hover { border-color: rgba(232, 202, 136, .5); color: var(--gold-bright); }
.help-q {
  width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(232, 202, 136, .4); color: var(--gold);
  font-family: var(--font-display); font-size: 10px; line-height: 1;
}

/* 中间：倒计时 / 阶段 */
.phase-center {
  --ph: var(--green);
  position: relative; justify-self: center;
  width: 100%; max-width: 190px; height: 40px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 9px;
  border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--ph) 38%, transparent);
  background: linear-gradient(180deg, rgba(16, 34, 25, .9), rgba(7, 18, 13, .84));
  backdrop-filter: blur(8px);
  box-shadow: 0 7px 18px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255,255,255,.04);
  overflow: hidden;
}
.phase-center.recruit { --ph: var(--green); }
.phase-center.locked {
  --ph: var(--red);
  animation: countdownAlert .9s ease-in-out infinite;
}
.phase-center.battle { --ph: var(--red); }
.phase-center.offline { --ph: #73877b; }
.phase-num { display: flex; align-items: baseline; gap: 1px; flex: none; color: var(--ph); min-width: 34px; }
.phase-num b {
  font-family: var(--font-display); font-size: 25px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums; text-shadow: 0 0 14px color-mix(in srgb, var(--ph) 32%, transparent);
}
.phase-num span { font-size: 7px; color: color-mix(in srgb, var(--ph) 65%, #8a9b8e); }
.phase-copy { min-width: 0; flex: 1; }
.phase-copy b {
  display: block; color: var(--ph); font-size: 11px; line-height: 1; font-weight: 700;
  letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.phase-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255,255,255,.05); }
.phase-progress i { display: block; height: 100%; width: 0; background: var(--ph); box-shadow: 0 0 7px color-mix(in srgb, var(--ph) 55%, transparent); transition: width .15s linear; }

/* 右侧：金币 */
.assets-pill {
  flex: none; height: 40px; padding: 4px 11px;
  display: flex; align-items: center;
  border-radius: 12px; border: 1px solid rgba(233, 197, 118, .26);
  background: rgba(15, 26, 18, .68); backdrop-filter: blur(7px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.asset-copy { min-width: 0; }
.asset-line { display: flex; align-items: center; gap: 4px; }
.asset-coin {
  width: 14px; height: 14px; flex: none; border-radius: 50%;
  display: grid; place-items: center; color: #4b3512;
  font-size: 6px; font-style: normal; font-family: var(--font-display); font-weight: 800;
  background: radial-gradient(circle at 34% 27%, #fff3b8, #e9c266 42%, #b1802e 72%, #795116);
  border: 1px solid #f7dd9b;
}
.asset-line b {
  color: #ffe7b0; font-size: 14px; line-height: 1; font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: .01em; white-space: nowrap;
}

/* ── long portrait game stage ────────────────────────── */
.game-stage {
  position: relative;
  flex: 0 0 52%; min-height: 0;
  border-radius: 19px; overflow: hidden;
  border: 1px solid rgba(229, 200, 137, .15);
  background:
    radial-gradient(360px 260px at 50% 20%, rgba(44, 99, 72, .22), transparent 70%),
    linear-gradient(175deg, #0b1c14, #07130e 58%, #06100b);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .44), inset 0 1px 0 rgba(255,255,255,.03);
}
.game-stage::after {
  content: ""; position: absolute; inset: 6px; border-radius: 14px; pointer-events: none; z-index: 1;
  border: 1px solid rgba(233, 205, 145, .07);
}
.map-wrap {
  position: absolute; inset: 0; z-index: 0;
  display: flex; align-items: center; justify-content: center;
}
.canvas-shell {
  position: relative; height: 100%; width: 100%;
  aspect-ratio: auto;
  border-radius: 15px; overflow: hidden; isolation: isolate;
  border: 1px solid rgba(229, 200, 137, .17);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .4), inset 0 0 36px rgba(0,0,0,.18);
  background: #10231a;
}
.canvas-shell::after {
  content: ""; position: absolute; inset: 4px; border-radius: 11px; pointer-events: none;
  border: 1px solid rgba(233, 205, 145, .08); z-index: 2;
}
#world { display: block; width: 100%; height: 100%; }
.map-hud { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.screen-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.screen-flash.flash-gold { animation: flashGold .7s ease-out; }
@keyframes flashGold {
  0% { opacity: .9; background: radial-gradient(circle at 50% 55%, rgba(255,231,166,.5), rgba(255,196,92,.08) 42%, transparent 70%); }
  100% { opacity: 0; }
}

/* connection veil */
.connection-veil {
  position: absolute; inset: 0; z-index: 8; display: grid; place-items: center;
  background: rgba(4, 12, 8, .58); backdrop-filter: blur(4px);
  pointer-events: auto;
  transition: opacity .35s ease, visibility .35s ease;
}
.connection-veil.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.connection-card { text-align: center; padding: 14px 18px; border-radius: 11px; border: 1px solid rgba(233,202,133,.18); background: rgba(7,18,13,.7); }
.connection-card b { display: block; margin-top: 8px; color: #ddd8c4; font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.connection-card small { display: block; margin-top: 5px; color: var(--muted-2); font-size: 8px; letter-spacing: .02em; }
.conn-spinner {
  width: 21px; height: 21px; display: inline-block; border-radius: 50%;
  border: 1.5px solid rgba(233,202,133,.18); border-top-color: var(--gold);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── history ────────────────────────────────────────── */
.history-panel {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  padding: 10px 10px 6px;
  border-radius: 17px; border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(24, 44, 34, .52), rgba(7, 18, 13, .56)),
    var(--panel);
  box-shadow: 0 14px 34px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.03);
  position: relative; overflow: hidden;
}
.history-panel::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 210, 148, .25), transparent);
}
.history-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 7px; flex: none; margin-bottom: 5px; }
.eyebrow { color: var(--muted-2); font-size: 6.5px; letter-spacing: .22em; line-height: 1; }
.history-title h2 { margin: 0; font-family: var(--font-display); font-size: 18px; letter-spacing: .1em; font-weight: 600; line-height: 1; }
.history-stats { display: flex; gap: 3px; }
.history-stats span {
  padding: 4px 5px; border-radius: 5px; border: 1px solid rgba(255,255,255,.06);
  background: rgba(5, 14, 10, .28); color: var(--muted-2); font-size: 6.5px; white-space: nowrap;
}
.history-list {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none; margin-top: 2px;
}
.history-list::-webkit-scrollbar { display: none; }
.history-empty {
  height: 100%; min-height: 120px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--muted-2); text-align: center;
}
.history-empty b { color: #bfc6b4; font-size: 10.5px; font-weight: 600; letter-spacing: .05em; }
.history-empty span { font-size: 8px; letter-spacing: .03em; }
.empty-mark {
  width: 28px; height: 28px; border-radius: 50%; border: 1px dashed rgba(233,202,133,.28);
  display: grid; place-items: center; margin-bottom: 2px;
}
.empty-mark i { width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid rgba(233,202,133,.5); }

.log-row {
  display: flex; align-items: center; gap: 6px;
  min-height: 49px; padding: 5px 2px;
  border-bottom: 1px solid rgba(255,255,255,.045);
}
.log-row:last-child { border-bottom: 0; }
.log-no {
  width: 20px; flex: none; text-align: center; color: var(--muted-2);
  font-size: 7.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.log-portrait {
  width: 32px; height: 32px; flex: none; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.07);
  background: radial-gradient(circle at 50% 40%, rgba(78, 135, 101, .25), rgba(7,18,13,.3) 70%);
  overflow: hidden;
}
.log-portrait img { width: 100%; height: 100%; object-fit: contain; transform: translateY(2px); }
.log-main { flex: 1; min-width: 0; }
.log-name { display: flex; align-items: center; gap: 4px; min-width: 0; }
.log-name b { font-size: 10.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-meta { margin-top: 3px; color: var(--muted-2); font-size: 8px; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-result {
  width: 48px; flex: none; display: flex; align-items: center; gap: 4px;
  color: var(--muted); font-size: 8px; font-weight: 600; white-space: nowrap;
}
.log-dot { width: 4px; height: 4px; border-radius: 50%; background: #d0b16f; flex: none; }
.log-result.killed { color: #9be6bd; }
.log-result.killed .log-dot { background: #62dbaa; box-shadow: 0 0 6px rgba(98,219,170,.6); }
.log-result.passed { color: #e2aa80; }
.log-result.passed .log-dot { background: #e2a06c; }
.log-result.absent { color: var(--muted-2); }
.log-result.absent .log-dot { background: #65766b; }
.log-result.settling { color: #ffe1a2; }
.log-result.settling .log-dot { background: #ffd06f; box-shadow: 0 0 7px rgba(255,205,110,.7); animation: dotPulse 1.1s infinite; }
@keyframes dotPulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.log-reward {
  width: 61px; flex: none; text-align: right; color: #e3cd97;
  font-size: 8.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.log-reward.big { color: #ffe19a; text-shadow: 0 0 12px rgba(255,200,90,.2); }
.log-reward.muted { color: var(--muted-2); font-weight: 400; }
.log-row.is-current { background: linear-gradient(90deg, rgba(247, 198, 102, .05), transparent 70%); }

/* ── toast ──────────────────────────────────────────── */
.toast-layer {
  position: absolute; left: 50%; top: 62px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  z-index: 40; pointer-events: none; width: max-content; max-width: 88%;
}
.toast {
  padding: 7px 13px; border-radius: 9px;
  background: rgba(8, 19, 14, .94); border: 1px solid rgba(229, 196, 124, .26);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  color: #ece3cb; font-size: 10px; letter-spacing: .02em; text-align: center;
  animation: toastIn .25s cubic-bezier(.2,.8,.2,1) both;
}
.toast.good { border-color: rgba(100, 220, 170, .35); color: #c9f3de; }
.toast.bad { border-color: rgba(239, 130, 118, .4); color: #ffd2cb; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }

/* ── loading ────────────────────────────────────────── */
.loading {
  position: fixed; inset: 0; z-index: 300;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: radial-gradient(circle at 50% 45%, #13291f, #07100c 70%);
  transition: opacity .5s ease, visibility .5s ease;
}
.loading.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-mark { width: 52px; height: 52px; position: relative; transform: rotate(45deg); border: 1px solid rgba(237, 201, 127, .5); }
.loading-mark::before, .loading-mark::after { content: ""; position: absolute; background: var(--gold); opacity: .7; }
.loading-mark::before { left: 50%; top: 7px; bottom: 7px; width: 1px; }
.loading-mark::after { top: 50%; left: 7px; right: 7px; height: 1px; }
.loading-mark span { position: absolute; inset: 18px; border: 1px solid var(--gold-bright); animation: spin 2.2s linear infinite; box-shadow: 0 0 12px rgba(255,217,143,.4); }
.loading-title { font-family: var(--font-display); font-size: 24px; letter-spacing: .28em; padding-left: .28em; color: #f4e7c7; }
.loading-sub { color: var(--muted); font-size: 9px; letter-spacing: .12em; }
.loading-bar { width: 180px; height: 2px; background: rgba(255,255,255,.08); overflow: hidden; }
.loading-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #a9823d, #ffe4a4); transition: width .15s ease; box-shadow: 0 0 9px rgba(255,215,140,.5); }

/* ── modals ─────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 16px;
  background: rgba(3, 9, 6, .66);
  backdrop-filter: blur(5px);
  animation: fadeIn .2s ease both;
}
.modal-backdrop.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-close {
  position: absolute; right: 11px; top: 10px; width: 29px; height: 29px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.1); color: var(--muted);
  font-size: 18px; line-height: 1; display: grid; place-items: center;
  transition: .16s ease; z-index: 3;
}
.modal-close:hover { color: var(--text); border-color: rgba(233, 202, 133, .4); }

.recruit-card {
  width: min(430px, 94vw); max-height: 92dvh; overflow: auto;
  position: relative; padding: 17px 17px 14px;
  border-radius: 19px;
  border: 1px solid color-mix(in srgb, var(--gate) 35%, transparent);
  background:
    radial-gradient(360px 220px at 85% -15%, color-mix(in srgb, var(--gate) 16%, transparent), transparent 68%),
    linear-gradient(165deg, #11251b, #081510 68%);
  box-shadow: 0 30px 80px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.05);
  animation: cardIn .35s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.recruit-head { display: flex; align-items: flex-start; gap: 10px; padding-right: 22px; }
.gate-token {
  width: 48px; height: 52px; flex: none; display: flex; flex-direction: column;
  align-items: center; justify-content: center; border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--gate) 48%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--gate) 14%, transparent), rgba(5, 15, 10, .4));
  color: var(--gate);
}
.gate-token b { font-family: var(--font-display); font-size: 21px; line-height: 1; letter-spacing: .03em; }
.gate-token span { margin-top: 4px; font-size: 7px; color: var(--muted-2); letter-spacing: .14em; }
.recruit-titles { flex: 1; min-width: 0; padding-top: 1px; }
.recruit-titles h2 { margin: 4px 0 0; font-family: var(--font-display); font-size: 24px; letter-spacing: .08em; line-height: 1; font-weight: 600; }
.recruit-titles p { margin: 5px 0 0; color: var(--muted); font-size: 9px; letter-spacing: .04em; }
.recruit-portrait {
  width: 62px; height: 62px; flex: none; border-radius: 50%; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--gate) 30%, transparent);
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--gate) 20%, transparent), rgba(6,16,11,.5) 70%);
}
.recruit-portrait img { width: 100%; height: 100%; object-fit: contain; object-position: 50% 68%; transform: scale(1.06) translateY(4px); }

.recruit-mult {
  display: flex; align-items: center; gap: 7px;
  margin-top: 12px; padding: 8px 10px; border-radius: 9px;
  background: linear-gradient(100deg, rgba(68, 52, 22, .25), rgba(6, 16, 11, .26));
  border: 1px solid rgba(228, 193, 120, .15);
  color: var(--muted-2); font-size: 8px; letter-spacing: .04em;
}
.recruit-mult b { color: var(--gold-bright); font-family: var(--font-display); font-size: 19px; line-height: 1; }
.recruit-mult .rm-weak { margin-left: auto; color: var(--muted-2); }
.recruit-mult em { color: #d9c08c; }

.recruit-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.recruit-stats div {
  padding: 8px 10px; border-radius: 8px; background: rgba(5, 15, 10, .3);
  border: 1px solid rgba(255,255,255,.055);
}
.recruit-stats span { display: block; color: var(--muted-2); font-size: 8px; letter-spacing: .03em; }
.recruit-stats b { display: block; margin-top: 4px; color: #e6ddc8; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.recruit-stats b.gold { color: var(--gold-bright); font-family: var(--font-display); font-size: 20px; line-height: 1; }

.amount-box {
  margin-top: 10px; padding: 10px; border-radius: 10px;
  background: rgba(5, 15, 10, .28); border: 1px solid rgba(255,255,255,.055);
}
.amount-head { display: flex; justify-content: space-between; gap: 8px; color: var(--muted-2); font-size: 8px; letter-spacing: .03em; }
.stepper-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.step-btn {
  width: 35px; height: 35px; flex: none; border-radius: 9px;
  border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03);
  color: #ded8c5; font-size: 19px; line-height: 1; display: grid; place-items: center;
  transition: .15s ease;
}
.step-btn:hover { border-color: color-mix(in srgb, var(--gate) 45%, transparent); color: var(--gate); }
.step-btn:disabled { opacity: .3; }
.step-value {
  min-width: 78px; height: 35px; border-radius: 8px; display: flex; align-items: baseline; justify-content: center; gap: 3px;
  border: 1px solid color-mix(in srgb, var(--gate) 25%, transparent);
  background: color-mix(in srgb, var(--gate) 7%, transparent);
  padding: 0 6px;
}
.step-value input {
  width: 56px; height: 30px; border: 0; outline: 0; background: transparent;
  color: var(--gate); font-family: var(--font-display); font-size: 20px; font-weight: 700;
  text-align: right; font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.step-value input::-webkit-outer-spin-button, .step-value input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step-value span { color: var(--muted-2); font-size: 8px; }
.quick-amounts { display: flex; gap: 4px; margin-top: 7px; }
.quick-amounts button {
  flex: 1; height: 28px; border-radius: 7px;
  border: 1px solid rgba(255,255,255,.08); color: var(--muted);
  font-size: 9px; font-weight: 600; background: rgba(255,255,255,.025);
  transition: .15s ease;
}
.quick-amounts button:hover { color: var(--text); border-color: rgba(233,202,133,.3); }
.quick-amounts button:disabled { opacity: .35; }
.cost-row { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; color: var(--muted-2); font-size: 9px; }
.cost-row b { display: flex; align-items: center; gap: 4px; color: #f0d9a1; font-size: 13px; font-variant-numeric: tabular-nums; }
.tiny-coin {
  width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(180deg, #f5db96, #bd8f3b); border: 1px solid #ebd08b;
  color: #4c3612; font-size: 6px; font-style: normal;
}
.recruit-confirm {
  width: 100%; height: 43px; margin-top: 10px; border-radius: 10px;
  color: #18251c; font-size: 12px; font-weight: 700; letter-spacing: .03em;
  background: linear-gradient(180deg, #f1d797, #c99c4b);
  box-shadow: 0 8px 20px rgba(186, 141, 59, .2), inset 0 1px 0 rgba(255,255,255,.42);
  transition: .16s ease;
}
.recruit-confirm:active { transform: translateY(1px); }
.recruit-confirm:disabled { opacity: .38; filter: grayscale(.5); cursor: not-allowed; }
.recruit-foot { margin-top: 8px; text-align: center; color: var(--muted-2); font-size: 8px; letter-spacing: .03em; }

/* help */
.help-card {
  width: min(440px, 94vw); max-height: 92dvh; overflow: auto; position: relative;
  padding: 21px 18px 16px; border-radius: 19px;
  border: 1px solid rgba(233, 202, 133, .28);
  background:
    radial-gradient(400px 250px at 10% -10%, rgba(70, 133, 101, .2), transparent 70%),
    linear-gradient(160deg, #10231a, #07130e 62%);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: cardIn .3s cubic-bezier(.2,.8,.2,1) both;
}
.help-card h2 { margin: 5px 0 13px; font-family: var(--font-display); font-size: 27px; letter-spacing: .12em; font-weight: 600; color: #f2e5c4; }
.help-rules { display: flex; flex-direction: column; gap: 6px; }
.rule {
  display: flex; gap: 8px; padding: 8px 9px; border-radius: 8px;
  background: rgba(5, 15, 10, .25); border: 1px solid rgba(255,255,255,.05);
}
.rule > span { color: #a88954; font-family: var(--font-display); font-size: 10px; line-height: 1.4; }
.rule b { display: block; color: #e8e2d0; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; }
.rule p { margin: 3px 0 0; color: #99a99c; font-size: 9px; line-height: 1.6; letter-spacing: .01em; }
.help-formula {
  margin-top: 10px; padding: 10px; border-radius: 9px;
  border: 1px solid rgba(231, 199, 128, .15);
  background: rgba(79, 58, 23, .16);
}
.help-formula span { display: block; color: #b5a072; font-size: 7px; letter-spacing: .16em; }
.help-formula b { display: block; margin-top: 5px; font-family: var(--font-display); color: #eddaa8; font-size: 14px; letter-spacing: .02em; font-weight: 600; }
.help-formula small { display: block; margin-top: 5px; color: #8f9d91; font-size: 8.5px; line-height: 1.5; }
.help-table { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; margin-top: 10px; }
.help-table .ht {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 1px;
  border-radius: 5px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.055);
  font-size: 7px; color: var(--muted-2);
}
.help-table .ht b { font-family: var(--font-display); font-size: 11px; color: #e6d0a2; }
.help-table .ht em { color: #c9a158; font-style: normal; font-size: 7px; }
.help-note { margin: 10px 0 0; color: var(--muted-2); font-size: 8px; line-height: 1.5; text-align: center; }

/* desktop framing */
@media (min-width: 620px) {
  body { display: grid; place-items: center; }
  .app {
    max-width: 440px;
    height: min(920px, calc(100dvh - 26px)); padding: 9px 10px 9px;
    border-radius: 24px; border: 1px solid rgba(233, 202, 133, .16);
    background:
      radial-gradient(500px 420px at 50% -15%, rgba(42, 98, 74, .22), transparent 64%),
      linear-gradient(170deg, rgba(10, 24, 18, .92), rgba(6, 14, 10, .97));
    box-shadow: 0 35px 100px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.035);
  }
}
@media (max-width: 370px) {
  .app { padding-left: 7px; padding-right: 7px; }
  .help-pill { padding-right: 8px; font-size: 9.5px; }
  .assets-pill { padding-right: 6px; }
    .asset-line b { font-size: 13px; }
  .history-stats span { padding: 3px 4px; font-size: 6px; }
  .phase-center { gap: 5px; padding: 0 6px; }
  .phase-num b { font-size: 22px; }
  .phase-copy b { font-size: 9.5px; }
}
@media (max-height: 620px) {
  body { overflow-y: auto; }
  .app { height: auto; min-height: 100dvh; }
  .game-stage { flex: none; height: 390px; }
  .history-panel { flex: 0 0 300px; min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ── login / register ───────────────────────────────── */
.auth-screen {
  position: fixed; inset: 0; z-index: 280;
  display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(620px 520px at 50% 20%, rgba(45, 106, 79, .28), transparent 70%),
    radial-gradient(500px 500px at 90% 95%, rgba(109, 83, 33, .16), transparent 72%),
    linear-gradient(160deg, #08130f, #050c09 70%);
  animation: fadeIn .25s ease both;
}
.auth-screen.hidden { display: none; }
.auth-orb {
  position: absolute; width: 420px; height: 420px; border-radius: 50%;
  top: -220px; left: 50%; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(83, 170, 126, .14), transparent 68%);
  pointer-events: none;
}
.auth-card {
  position: relative; width: min(370px, 94vw); max-height: 92dvh; overflow: auto; padding: 22px 20px 17px;
  border-radius: 19px; border: 1px solid rgba(233, 202, 133, .3);
  background:
    radial-gradient(340px 230px at 50% -15%, rgba(70, 140, 102, .24), transparent 70%),
    linear-gradient(165deg, #11261c, #081510 72%);
  box-shadow: 0 30px 90px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.05);
  text-align: center;
  animation: cardIn .4s cubic-bezier(.2,.8,.2,1) both;
}
.auth-mark { width: 38px; height: 38px; margin: 0 auto 10px; transform: rotate(45deg); border: 1px solid rgba(236, 203, 132, .5); position: relative; background: rgba(30, 55, 42, .4); }
.auth-mark::before, .auth-mark::after { content: ""; position: absolute; background: rgba(239, 209, 145, .8); }
.auth-mark::before { left: 50%; top: 8px; bottom: 8px; width: 1px; }
.auth-mark::after { top: 50%; left: 8px; right: 8px; height: 1px; }
.auth-mark span { position: absolute; inset: 12px; border: 1px solid rgba(239, 209, 145, .7); }
.auth-card h1 {
  margin: 8px 0 0; font-family: var(--font-display); font-size: 32px; letter-spacing: .18em; padding-left: .18em;
  background: linear-gradient(180deg, #fff6da, #e2c27a 60%, #a17b3a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 600;
}
.auth-lead { margin: 8px 0 16px; color: #aebcae; font-size: 10px; line-height: 1.8; letter-spacing: .03em; }
.auth-lead small { color: var(--muted-2); font-size: 8.5px; }
.auth-tabs { display: flex; padding: 3px; gap: 3px; border-radius: 9px; background: rgba(4, 13, 9, .42); border: 1px solid rgba(255,255,255,.06); }
.auth-tabs button {
  flex: 1; height: 32px; border-radius: 7px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .06em;
  transition: .16s ease;
}
.auth-tabs button.active { color: #18251c; background: linear-gradient(180deg, #f0d594, #c79a49); box-shadow: 0 4px 12px rgba(182, 138, 58, .18); }
.auth-form { margin-top: 12px; text-align: left; }
.auth-field { display: block; margin-bottom: 9px; }
.auth-field span { display: block; margin-bottom: 4px; color: var(--muted-2); font-size: 8px; letter-spacing: .08em; }
.auth-field input {
  width: 100%; height: 39px; padding: 0 11px; border-radius: 8px; outline: 0;
  border: 1px solid rgba(255,255,255,.1); background: rgba(4, 13, 9, .42);
  color: #ece5d1; font-size: 12px; letter-spacing: .02em;
  transition: .16s ease;
}
.auth-field input:focus { border-color: rgba(236, 202, 130, .48); box-shadow: 0 0 0 2px rgba(236, 202, 130, .07); }
.auth-field input::placeholder { color: #5c7064; font-size: 10px; }
.auth-error { min-height: 16px; color: #ef958a; font-size: 9px; line-height: 1.4; padding: 0 2px; }
.auth-submit {
  width: 100%; height: 41px; border-radius: 9px; color: #18251c; font-size: 11.5px; font-weight: 700;
  letter-spacing: .06em; background: linear-gradient(180deg, #f2d99b, #c99b49);
  box-shadow: 0 8px 20px rgba(184, 140, 60, .18), inset 0 1px 0 rgba(255,255,255,.4);
  transition: .16s ease;
}
.auth-submit:hover { filter: brightness(1.05); }
.auth-submit:disabled { opacity: .45; filter: grayscale(.4); }
.auth-switch { margin-top: 11px; color: var(--muted-2); font-size: 9px; }
.auth-switch button { color: var(--gold); font-size: 9px; text-decoration: underline; text-underline-offset: 3px; margin-left: 2px; }
.auth-note { margin-top: 13px; padding-top: 9px; border-top: 1px solid rgba(255,255,255,.06); color: #5f7266; font-size: 7px; letter-spacing: .08em; }

.help-account {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 9px; padding: 8px 9px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.055); background: rgba(5,15,10,.24);
  color: var(--muted-2); font-size: 8px;
}
.help-account b { color: #d8c69b; font-weight: 600; }
.help-account button { color: #e0a095; font-size: 8px; text-decoration: underline; text-underline-offset: 3px; }


/* ── bottom tab bar / profile ───────────────────────── */
.tab-bar {
  flex: 0 0 56px; z-index: 25;
  display: flex; align-items: stretch; gap: 5px;
  padding: 5px 12px;
  border-radius: 16px; border: 1px solid rgba(233, 202, 133, .16);
  background:
    linear-gradient(180deg, rgba(17, 33, 24, .92), rgba(6, 16, 11, .96));
  box-shadow: 0 -10px 28px rgba(0, 0, 0, .26), inset 0 1px 0 rgba(255, 255, 255, .035);
}
.tab-item {
  position: relative; flex: 1; min-width: 0; border-radius: 11px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted-2); font-size: 8px; font-weight: 600; letter-spacing: .08em;
  transition: .18s ease;
}
.tab-item svg { width: 21px; height: 21px; opacity: .66; transition: .18s ease; }
.tab-item span { line-height: 1; }
.tab-item.active {
  color: #f2d69a;
  background: linear-gradient(180deg, rgba(235, 204, 137, .11), rgba(235, 204, 137, .025));
  box-shadow: inset 0 0 0 1px rgba(235, 204, 137, .1);
}
.tab-item.active svg { opacity: 1; filter: drop-shadow(0 0 6px rgba(238, 205, 132, .38)); }
.tab-item.active::after {
  content: ""; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 15px; height: 2px; border-radius: 2px; background: var(--gold); box-shadow: 0 0 8px rgba(238, 205, 132, .6);
}

.profile-view {
  display: none; flex: 1; min-height: 0; overflow-y: auto;
  flex-direction: column; gap: 10px; padding: 6px 4px 2px;
  scrollbar-width: thin;
}
.app.view-mine .app-header,
.app.view-mine .game-stage,
.app.view-mine .history-panel { display: none; }
.app.view-mine .profile-view { display: flex; }
.profile-head { padding: 8px 6px 2px; }
.profile-head h2 {
  margin: 5px 0 0; font-family: var(--font-display); font-size: 28px;
  line-height: 1; font-weight: 600; letter-spacing: .14em;
  background: linear-gradient(180deg, #fff4d8, #dfbf78 62%, #a57f3e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.profile-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px;
  border-radius: 17px; border: 1px solid rgba(232, 202, 136, .2);
  background:
    radial-gradient(260px 130px at 15% 0%, rgba(74, 141, 104, .25), transparent 70%),
    linear-gradient(160deg, rgba(23, 45, 33, .9), rgba(8, 19, 13, .92));
  box-shadow: 0 14px 30px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.04);
}
.profile-avatar {
  position: relative; width: 60px; height: 60px; flex: none; border-radius: 50%;
  border: 1px solid #e7c67e; overflow: hidden;
  background: radial-gradient(circle at 36% 28%, #dff8ff, #5ca9c6 45%, #214e5f 78%);
  box-shadow: 0 0 0 3px rgba(230, 190, 100, .08);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; transform: scale(1.25) translateY(2px); }
.profile-avatar i {
  position: absolute; right: 2px; bottom: 2px; width: 9px; height: 9px; border-radius: 50%;
  background: #62dbaa; border: 2px solid #0a1711; box-shadow: 0 0 7px rgba(98,219,170,.65);
}
.profile-id { min-width: 0; flex: 1; }
.profile-id h3 { margin: 0; color: #efe4c3; font-size: 17px; font-weight: 600; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-id span { display: block; margin-top: 5px; color: var(--muted-2); font-size: 8px; letter-spacing: .08em; }
.profile-logout { flex: none; height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(239,130,118,.24); color: #e4a097; font-size: 8.5px; }
.profile-assets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.profile-asset {
  min-width: 0; padding: 10px 11px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.07); background: rgba(7, 19, 13, .5);
}
.profile-asset.main { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
.profile-asset span { display: block; color: var(--muted-2); font-size: 8px; letter-spacing: .08em; }
.profile-asset b { display: flex; align-items: center; gap: 5px; margin-top: 5px; color: #f7e3b3; font-size: 15px; font-variant-numeric: tabular-nums; font-weight: 600; }
.profile-asset.main b { margin-top: 0; font-size: 22px; }
.profile-asset.main b em { font-style: normal; }
.profile-actions { display: flex; gap: 8px; }
.profile-action {
  flex: 1; height: 39px; border-radius: 9px; border: 1px solid rgba(255,255,255,.1);
  color: #bec9ba; font-size: 10px; font-weight: 600; letter-spacing: .06em;
  background: rgba(8, 20, 14, .45);
}
.profile-action.primary { color: #1a251c; border-color: rgba(240,213,148,.6); background: linear-gradient(180deg, #f0d594, #c79a49); }
.profile-note { margin: 2px 4px 0; color: #5f7266; font-size: 8px; line-height: 1.7; }

#gold.gold-gain { display: inline-block; animation: goldGain .7s cubic-bezier(.2,.8,.2,1); }
@keyframes countdownAlert {
  0%, 100% {
    border-color: rgba(239, 107, 97, .38);
    box-shadow: 0 7px 18px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255,255,255,.04);
    background: linear-gradient(180deg, rgba(36, 22, 21, .9), rgba(14, 15, 12, .86));
  }
  50% {
    border-color: rgba(255, 116, 100, .9);
    box-shadow: 0 0 0 1px rgba(255, 112, 96, .24), 0 0 25px rgba(235, 82, 68, .32), inset 0 0 18px rgba(200, 58, 48, .1);
    background: linear-gradient(180deg, rgba(68, 30, 26, .95), rgba(24, 16, 14, .92));
  }
}
@keyframes goldGain {
  0% { transform: scale(1); color: #ffe7b0; }
  30% { transform: scale(1.22); color: #fff6d6; text-shadow: 0 0 10px rgba(255, 221, 144, .8); }
  100% { transform: scale(1); color: #ffe7b0; }
}

/* ── battle result dialog ────────────────────────────── */
.result-backdrop {
  position: fixed; inset: 0; z-index: 240;
  display: grid; place-items: center; padding: 14px;
  background: rgba(3, 9, 6, .78);
  backdrop-filter: blur(7px);
  animation: fadeIn .2s ease both;
}
.result-backdrop.hidden { display: none; }
.result-card {
  --res: #edc97f;
  position: relative; width: min(360px, 94vw); max-height: 94dvh; overflow-y: auto;
  padding: 14px 14px 15px; text-align: center;
  border-radius: 20px; border: 1px solid color-mix(in srgb, var(--res) 38%, transparent);
  background:
    radial-gradient(330px 280px at 50% 0%, rgba(81, 147, 109, .22), transparent 70%),
    linear-gradient(165deg, #11271c, #07140f 74%);
  box-shadow: 0 30px 90px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.05);
  animation: cardIn .35s cubic-bezier(.2,.8,.2,1) both;
}
.result-card[data-result="fail"] {
  --res: #a7b9ef;
  background:
    radial-gradient(330px 280px at 50% 0%, rgba(75, 91, 146, .24), transparent 70%),
    linear-gradient(165deg, #151b2b, #090d16 74%);
}
.result-card h2 {
  margin: 5px 0 0; font-family: var(--font-display); font-size: 25px;
  letter-spacing: .16em; padding-left: .16em; font-weight: 600;
  color: var(--res);
}
.result-card[data-result="fail"] h2 { color: #c5d2f4; }
.result-art {
  position: relative; width: 100%; margin-top: 8px;
  border-radius: 14px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 36%, rgba(255,255,255,.08), transparent 62%);
}
.result-art img { display: block; width: 100%; height: auto; }
.result-ribbon {
  position: absolute; left: 8%; right: 8%; bottom: 4.2%; height: 10.5%;
  display: flex; align-items: center; justify-content: center; gap: 3px;
  color: #39280f; pointer-events: none;
}
.result-ribbon b { font-family: var(--font-display); font-size: 18px; font-weight: 700; line-height: 1; letter-spacing: .02em; }
.result-ribbon span { font-size: 8px; font-weight: 700; letter-spacing: .04em; margin-top: 5px; }
.result-card[data-result="fail"] .result-ribbon { color: #1b2542; }
.result-detail {
  margin: 9px 0 11px; color: #bdc9b8; font-size: 9px; letter-spacing: .04em;
}
.result-card[data-result="fail"] .result-detail { color: #aab8d8; }
.result-confirm {
  width: 100%; height: 41px; border-radius: 10px;
  color: #18251c; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  background: linear-gradient(180deg, #f1d897, #c99b49);
  box-shadow: 0 8px 20px rgba(184, 140, 60, .18), inset 0 1px 0 rgba(255,255,255,.4);
}
.result-card[data-result="fail"] .result-confirm {
  color: #172035;
  background: linear-gradient(180deg, #d9e4ff, #9cafdf);
  box-shadow: 0 8px 20px rgba(92, 113, 174, .2);
}
.result-card .modal-close { color: var(--res); }

/* ── recharge ───────────────────────────────────────── */
.assets-pill { cursor: pointer; transition: border-color .16s ease, transform .16s ease; }
.assets-pill:hover, .assets-pill:focus-visible { border-color: rgba(233, 197, 118, .62); outline: 0; transform: translateY(-1px); }
.recharge-card {
  position: relative; width: min(360px, 94vw); padding: 17px 16px 15px;
  border-radius: 19px; border: 1px solid rgba(233, 202, 133, .28);
  background:
    radial-gradient(320px 210px at 50% -10%, rgba(76, 142, 106, .24), transparent 70%),
    linear-gradient(165deg, #11261c, #071510 74%);
  box-shadow: 0 28px 90px rgba(0,0,0,.66), inset 0 1px 0 rgba(255,255,255,.05);
  text-align: center;
  animation: cardIn .35s cubic-bezier(.2,.8,.2,1) both;
}
.recharge-card h2 { margin: 5px 0 12px; font-family: var(--font-display); font-size: 26px; letter-spacing: .15em; padding-left: .15em; color: #f1db9d; font-weight: 600; }
.recharge-balance {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(233, 202, 133, .14);
  background: rgba(5, 15, 10, .42);
}
.recharge-balance span { color: var(--muted-2); font-size: 9px; letter-spacing: .08em; }
.recharge-balance b { display: flex; align-items: center; gap: 5px; color: #ffe6a9; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.recharge-balance em { font-style: normal; }
.recharge-options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 11px; }
.recharge-option {
  position: relative; min-height: 48px; display: flex; align-items: center; justify-content: center;
  border-radius: 9px; border: 1px solid rgba(255,255,255,.09);
  background: rgba(5, 16, 11, .38); cursor: pointer; transition: .16s ease;
}
.recharge-option:hover { border-color: rgba(233, 202, 133, .35); }
.recharge-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.recharge-option span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.recharge-option b { color: #e9dcb9; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.recharge-option small { color: var(--muted-2); font-size: 7px; letter-spacing: .08em; }
.recharge-option:has(input[type="radio"]:checked) {
  border-color: rgba(240, 207, 135, .72);
  background: linear-gradient(180deg, rgba(224, 184, 101, .16), rgba(224, 184, 101, .04));
  box-shadow: inset 0 0 0 1px rgba(240, 207, 135, .12);
}
.recharge-option:has(input[type="radio"]:checked) b { color: #ffe8ac; }
.recharge-option.other { grid-column: 1 / -1; justify-content: space-between; padding: 6px 8px 6px 14px; gap: 8px; }
.recharge-option.other span { align-items: flex-start; gap: 1px; }
.recharge-option.other input[type="number"] {
  width: 100px; height: 31px; padding: 0 8px; border-radius: 7px; border: 1px solid rgba(255,255,255,.11);
  background: rgba(4, 13, 9, .5); color: #f4e6c1; font-size: 11px; outline: 0;
}
.recharge-option.other input[type="number"]:focus { border-color: rgba(240, 207, 135, .5); }
.recharge-error { min-height: 16px; padding: 3px 2px 0; color: #ef958a; font-size: 8.5px; text-align: left; }
.recharge-confirm {
  width: 100%; height: 41px; border-radius: 10px; color: #18251c;
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
  background: linear-gradient(180deg, #f2d99b, #c99b49);
  box-shadow: 0 8px 20px rgba(184, 140, 60, .18), inset 0 1px 0 rgba(255,255,255,.4);
}
.recharge-confirm:disabled { opacity: .45; filter: grayscale(.3); }
.recharge-note { margin: 9px 0 0; color: #5f7266; font-size: 7.5px; line-height: 1.6; }
@media (max-width: 370px) {
  .recharge-options { gap: 5px; }
  .recharge-option { min-height: 43px; }
}

/* ── sound toggle ───────────────────────────────────── */
.help-account > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.help-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.help-actions button { white-space: nowrap; }
.profile-actions .profile-action { min-width: 0; }

/* ── settings ───────────────────────────────────────── */
.settings-btn {
  position: absolute; left: 0; top: calc(100% + 5px);
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  color: #c9c9ad; border: 1px solid rgba(232, 202, 136, .24);
  background: rgba(8, 19, 14, .72); backdrop-filter: blur(7px);
  box-shadow: 0 6px 16px rgba(0,0,0,.24);
  transition: .18s ease;
}
.settings-btn svg { width: 19px; height: 19px; }
.settings-btn:hover { color: var(--gold-bright); border-color: rgba(232,202,136,.52); transform: rotate(25deg); }
.settings-card {
  position: relative; width: min(360px, 94vw); padding: 19px 16px 15px;
  border-radius: 19px; border: 1px solid rgba(233, 202, 133, .27);
  background:
    radial-gradient(300px 210px at 50% -10%, rgba(76, 142, 106, .22), transparent 70%),
    linear-gradient(165deg, #11261c, #071510 74%);
  box-shadow: 0 28px 90px rgba(0,0,0,.66), inset 0 1px 0 rgba(255,255,255,.05);
  animation: cardIn .35s cubic-bezier(.2,.8,.2,1) both;
}
.settings-card h2 { margin: 5px 0 14px; font-family: var(--font-display); font-size: 26px; letter-spacing: .15em; color: #f1db9d; font-weight: 600; text-align: center; }
.setting-list { display: flex; flex-direction: column; gap: 7px; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.07); background: rgba(5,16,11,.38);
  transition: .16s ease;
}
.setting-row:hover { border-color: rgba(233,202,133,.3); }
.setting-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.setting-copy b { color: #e8ddc0; font-size: 11px; font-weight: 600; letter-spacing: .03em; }
.setting-copy small { color: var(--muted-2); font-size: 7.5px; letter-spacing: .04em; }
.setting-row input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; width: 38px; height: 21px; flex: none; border-radius: 12px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.1); transition: .2s ease; }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 15px; height: 15px; border-radius: 50%; background: #9aa79c; transition: .2s ease; }
.setting-row input:checked + .switch { background: rgba(224, 184, 101, .72); border-color: rgba(255,225,155,.66); box-shadow: 0 0 12px rgba(224,184,101,.22); }
.setting-row input:checked + .switch::after { left: 19px; background: #fff1c8; }
.setting-row:has(input:focus-visible) { outline: 1px solid rgba(240,207,135,.5); outline-offset: 2px; }
.settings-note { margin: 12px 2px 0; color: #607267; font-size: 7.5px; text-align: center; }
.app.view-mine .settings-btn { display: none; }
