/* 单词打宝 — 冷峻写实风（深炭铁石底、暗铜内嵌细框、高对比羊皮暖白文字） */
:root {
  --bg: #141210;
  --panel: #1c1916;
  --panel-deep: #110f0d;
  --ink: #e8e0d0;
  --dim: #9c9282;
  --gold: #d4a853;
  --common: #b8b2a6;
  --rare: #6ba368;
  --epic: #5b8fc9;
  --legend: #e09f3e;
  --blood: #8f322a;
  --stone: #4a4238;
  --stone-hi: #6e5d49;
  /* 全站基准字号：移动端防 iOS 自动缩放且保持高可读性 */
  --fs: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html.ja-boot body { visibility: hidden; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Sans", "Yu Gothic", "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: contain;
  display: flex;
  justify-content: center;
}

#app {
  width: min(560px, 100vw);
  padding: 16px 14px 48px;
  padding-top: max(16px, env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.screen { display: flex; flex-direction: column; align-items: center; gap: 14px; }
#screen-battle { height: calc(100dvh - 48px - max(16px, env(safe-area-inset-top))); overflow: hidden; }
.hidden { display: none !important; }
.ghost { visibility: hidden; }

/* iOS 27 状态栏纯色检测带：与整页底色严格同色 */
.status-band {
  position: fixed; top: 0; left: 0; right: 0;
  height: 11px;
  background: var(--bg);
  z-index: 60;
  pointer-events: none;
}

/* ---------- 顶栏 ---------- */
.top { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.page-head {
  position: sticky; top: 0; z-index: 2;
  width: 100%; justify-content: space-between; align-items: center;
  background: var(--bg);
  border-bottom: 1px solid var(--stone);
  margin: -16px -14px 0; padding: 16px 14px 10px;
}
.page-head .btn { flex: none; width: auto; }
.game-title { font-size: var(--fs); font-weight: 700; letter-spacing: 4px; color: var(--gold); text-shadow: 0 1px 2px #000; }
.tagline { color: var(--dim); letter-spacing: 1.5px; font-size: var(--fs); text-align: center; line-height: 1.5; }

/* ---------- 驻地与疆域主屏 ---------- */
.screen-town {
  position: fixed; inset: 0; z-index: 1;
  width: min(560px, 100vw); height: 100dvh;
  margin: 0 auto; padding-top: env(safe-area-inset-top);
  gap: 0; background: var(--bg); overflow: hidden;
}
.town-view { position: relative; flex: 1; width: 100%; min-height: 0; overflow: hidden; }
#town-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

.town-toast {
  position: absolute; left: 50%; bottom: calc(82px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: 90%; padding: 7px 14px; font-size: var(--fs); line-height: 1.5;
  background: rgba(17, 15, 13, 0.94); border: 1px solid var(--gold); color: var(--gold);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65); z-index: 4; white-space: nowrap;
}
.deck-status {
  position: absolute; left: 12px; right: 12px; bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 3; padding: 5px 10px; background: rgba(16, 14, 12, 0.85); border: 1px solid var(--stone);
  font-size: var(--fs); color: var(--dim); text-align: center; min-height: 0;
}
.deck-status:empty { display: none; }

/* 右上三个写实石刻入口图标（行囊 / 建设 / 设置）与疆域切换钮 */
.town-icons { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; z-index: 5; }
.town-icon {
  width: 38px; height: 38px; padding: 0; cursor: pointer;
  border: 1px solid var(--stone-hi); background-color: rgba(20, 18, 16, 0.92);
  background-image: url(/assets/items.png); background-size: 256px 128px; background-repeat: no-repeat;
  box-shadow: inset 0 1px 0 rgba(255, 235, 200, 0.08), 0 2px 6px rgba(0, 0, 0, 0.55);
}
.town-icon:hover { border-color: var(--gold); }
.town-icon:active { transform: translateY(1px); }
.icon-bag { background-position: -158px -94px; }      /* icon.bag（items 29 行囊） */
.icon-build { background-position: -190px -94px; }    /* icon.build（items 30 建设） */
.icon-settings { background-position: -222px -94px; } /* icon.settings（items 31 设置） */

.view-toggle {
  position: absolute; top: 52px; right: 8px; z-index: 5;
  font: inherit; font-size: 14px; font-weight: 600; letter-spacing: 2px;
  padding: 5px 12px; cursor: pointer;
  color: var(--gold); background: rgba(20, 18, 16, 0.92);
  border: 1px solid var(--stone-hi);
  box-shadow: inset 0 1px 0 rgba(255, 235, 200, 0.08), 0 2px 6px rgba(0, 0, 0, 0.55);
}
.view-toggle.active {
  color: var(--ink);
  background: rgba(58, 44, 26, 0.94);
  border-color: var(--gold);
}
.view-toggle:active { transform: translateY(1px); }

/* 底部出击条 */
.town-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(14, 12, 10, 0.88) 45%);
}
.btn-attack {
  width: 100%; height: 48px; padding: 0 18px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
#attack-count { color: var(--gold); letter-spacing: 1px; font-weight: 600; }
.btn-attack:disabled #attack-count { color: var(--dim); }

/* ---------- 设置 ---------- */
.settings { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; justify-content: center; font-size: var(--fs); color: var(--dim); }
.settings label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.lang-row { display: inline-flex; align-items: center; gap: 6px; flex-basis: 100%; justify-content: center; white-space: nowrap; }
.lang-row .btn { min-width: 68px; }
.settings-panel { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 18px; align-items: stretch; }
.settings-block { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--stone); padding-top: 14px; }
.settings-heading { font-size: var(--fs); font-weight: 600; letter-spacing: 1.5px; color: var(--gold); }
.settings-panel > .btn { align-self: center; min-width: 180px; }
.settings-block a { color: var(--gold); }

/* ---------- 按钮 ---------- */
.btn {
  font: inherit; font-size: var(--fs); letter-spacing: 1.5px;
  color: var(--ink); background: #2b2621;
  border: 1px solid var(--stone-hi);
  padding: 11px 24px; cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 238, 205, 0.1), 0 2px 5px rgba(0, 0, 0, 0.45);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.42; cursor: default; }
.btn-primary {
  background: linear-gradient(180deg, #96362d 0%, #73251e 100%);
  border-color: #b85246;
}
.btn-kill {
  background: linear-gradient(180deg, #2d593b 0%, #20422b 100%);
  border-color: #4b7d5a;
}
.btn-spare {
  background: linear-gradient(180deg, #3c3731 0%, #2b2722 100%);
  border-color: #5c544a;
}
.btn-sub { display: block; font-size: 13px; letter-spacing: 3px; opacity: 0.82; margin-top: 2px; }
.btn-mini { font-size: var(--fs); padding: 6px 12px; letter-spacing: 1px; }
.hint { font-size: var(--fs); color: var(--dim); text-align: center; line-height: 1.6; }

/* ---------- 战斗 HUD（恒单行） ---------- */
.hud {
  width: 100%;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px 10px;
  font-size: var(--fs);
  letter-spacing: 0.5px;
  color: var(--dim);
}
.hud > span { white-space: nowrap; flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hud-space { flex: 1; }
#hud-combo.hot { color: var(--gold); }
.icon-pause { vertical-align: -3px; margin-left: 2px; }
.hud-tool {
  font: inherit; font-size: var(--fs); letter-spacing: 0.5px;
  color: var(--ink); background: rgba(28, 25, 22, 0.8);
  border: 1px solid var(--stone-hi); padding: 3px 8px; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
}
.hud-tool:active { transform: translateY(1px); }
.hud-tool:disabled { opacity: 0.35; cursor: default; }
.hud-tool.armed { color: #fff; background: var(--blood); border-color: #b85246; }
.hud-tool.on { color: var(--gold); border-color: var(--gold); }
@media (pointer: coarse) {
  .hud-tool { font-size: var(--fs); padding: 7px 11px; }
}
@media (max-width: 430px), (pointer: coarse) and (max-width: 620px) {
  .hud { font-size: 12px; letter-spacing: 0; gap: 3px; }
  .hud > span { letter-spacing: 0; }
  .hud-tool { font-size: 12px; letter-spacing: 0; padding: 6px 5px; }
}

/* ---------- 战斗荒野古墓画框与写实敌军立绘 ---------- */
.cave {
  position: relative; width: 100%; flex: 1; min-height: 290px;
  border: 1px solid var(--stone-hi);
  background:
    radial-gradient(ellipse at 50% 62%, rgba(66, 51, 36, 0.42), transparent 68%),
    linear-gradient(180deg, #0d0f12 0%, #171614 64%, #231e18 100%);
  box-shadow: inset 0 0 32px rgba(0, 0, 0, 0.75);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden; padding: 18px 14px;
}

.msprite {
  position: relative;
  width: 112px; height: 112px;
  background-image: url(/assets/world.png);
  background-size: 896px 448px;
  background-repeat: no-repeat;
  animation: bob 2.4s ease-in-out infinite;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.7));
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

.msprite.hurt { animation: hurt 0.26s ease-out 1; filter: brightness(1.85) contrast(1.15); }
@keyframes hurt { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
.msprite.dead { animation: die 0.38s ease-in forwards; }
@keyframes die { to { transform: translateY(22px) scale(0.86); opacity: 0; } }
.msprite.flee { animation: flee 0.42s ease-in forwards; }
@keyframes flee { to { transform: translateX(180px); opacity: 0; } }

.monster { display: flex; flex-direction: column; align-items: center; position: relative; max-width: 100%; }
.monster-word {
  margin-top: 12px; font-size: 20px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--ink); text-shadow: 0 2px 4px #000; text-align: center; max-width: 100%; word-break: break-all;
}
.monster-word.long { font-size: var(--fs); line-height: 1.5; letter-spacing: 0; }
.hp {
  width: 164px; height: 8px; margin-top: 10px;
  background: #0c0b0a; border: 1px solid var(--stone-hi);
}
.hp i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #7a241d, #b84237); transition: width 0.24s ease-out; }
.dmg-num {
  position: absolute; top: -4px; right: 4px;
  font-size: 18px; font-weight: 700; color: var(--gold);
  text-shadow: 0 2px 4px #000; animation: floatup 0.7s ease-out forwards; pointer-events: none;
}
@keyframes floatup { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-28px); opacity: 0; } }

/* 揭示面板：纯深炭净底，保证阅读零干扰高对比 */
.reveal {
  position: absolute; inset: 0; background: var(--panel-deep);
  padding: 20px 18px; display: flex; flex-direction: column; gap: 16px;
  justify-content: safe center; overflow-y: auto;
}
.reveal-front { font-size: 20px; font-weight: 600; color: var(--ink); letter-spacing: 1px; }
.reveal-front rt { font-size: 11px; font-weight: 400; letter-spacing: 0; color: var(--gold); }
.reveal-back { font-size: var(--fs); line-height: 1.72; color: var(--ink); }
.reveal-meta { font-size: 14px; color: var(--dim); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.card-body { display: flex; flex-direction: column; gap: 16px; }
.card-senses { display: flex; flex-direction: column; gap: 16px; }
.sense { display: flex; flex-direction: column; gap: 3px; }
.sense-ja { font-size: var(--fs); line-height: 1.7; color: #cfc6b6; }
.sense-zh { font-size: var(--fs); line-height: 1.7; color: var(--ink); }
.sense-ex { margin-top: 12px; padding-left: 12px; border-left: 2px solid var(--stone-hi); display: flex; flex-direction: column; gap: 2px; }
.sense .sense-ex ~ .sense-ex { margin-top: 8px; }
.ex-ja { font-size: var(--fs); line-height: 1.68; color: #d6cdbd; }
.ex-zh { font-size: 15px; line-height: 1.65; color: var(--dim); }
.card-tail { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; border-top: 1px solid rgba(74, 66, 56, 0.45); }
.card-syn { font-size: 15px; color: var(--dim); }
.card-pos-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-pos { font-size: 14px; color: var(--dim); letter-spacing: 1px; }
.reveal-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-conj { display: flex; flex-direction: column; gap: 4px; padding-left: 12px; border-left: 2px solid var(--stone-hi); }
.conj-row { display: flex; gap: 12px; font-size: var(--fs); line-height: 1.6; }
.conj-form { flex: 0 0 4.5em; color: var(--dim); }
.conj-value { color: var(--ink); }
.conj-pop {
  position: absolute; inset: 0; z-index: 3;
  background: rgba(17, 15, 13, 0.98);
  border-top: 1px solid var(--stone-hi);
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto;
}
.conj-pop h3 { font-size: var(--fs); letter-spacing: 2px; color: var(--gold); }
.qa-zh { font-size: var(--fs); line-height: 1.72; color: var(--ink); }
.qa-ja { font-size: var(--fs); line-height: 1.72; color: #cfc6b6; }
.qa-note { font-size: 15px; line-height: 1.68; color: var(--dim); white-space: pre-wrap; padding-left: 12px; border-left: 2px solid var(--stone-hi); }
.accent-bar { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; }
.accent-bar i { width: 5px; background: var(--gold); }

/* 掉落弹字与战利品小图标 */
.loot-pop {
  position: absolute; right: 12px; top: 12px; left: 12px;
  padding: 8px 12px; font-size: 15px; letter-spacing: 0.5px;
  background: rgba(16, 14, 12, 0.95); border: 1px solid var(--rare);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
  animation: pop 0.28s ease-out; text-align: center;
}
@keyframes pop { 0% { transform: translateY(-6px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
.loot-pop.common { border-color: var(--common); color: var(--common); }
.loot-pop.rare { border-color: var(--rare); color: var(--rare); }
.loot-pop.epic { border-color: var(--epic); color: var(--epic); }
.loot-pop.legend { border-color: var(--legend); color: var(--legend); }

.li {
  display: inline-block; width: 24px; height: 24px;
  background-image: url(/assets/items.png);
  background-size: 192px 96px;
  background-repeat: no-repeat;
  vertical-align: -6px;
  margin-right: 6px;
}

.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
#screen-battle .actions { margin-top: auto; width: 100%; }
.judge-group { display: flex; gap: 12px; width: 100%; }
.judge-group .btn { flex: 1; }

/* ---------- 传奇式 30 格石槽行囊 ---------- */
.page-title { font-size: var(--fs); font-weight: 700; letter-spacing: 3px; color: var(--gold); }
.bag-bar {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  font-size: 15px; padding: 2px 2px 0;
}
.bag-gold { color: var(--gold); font-weight: 600; letter-spacing: 0.5px; }
.bag-count { color: var(--dim); }

.bag-detail {
  width: 100%; min-height: 78px;
  background: var(--panel); border: 1px solid var(--stone-hi);
  box-shadow: inset 0 1px 0 rgba(255, 235, 200, 0.06);
  padding: 12px 14px; display: flex; align-items: center; gap: 14px;
}
.bag-detail-empty { width: 100%; text-align: center; color: var(--dim); font-size: 15px; line-height: 1.5; }
.bag-detail-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.bag-detail-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bag-detail-name { font-size: var(--fs); font-weight: 700; letter-spacing: 0.5px; color: var(--ink); }
.bag-detail-name.common { color: var(--common); }
.bag-detail-name.rare { color: var(--rare); }
.bag-detail-name.epic { color: var(--epic); }
.bag-detail-name.legend { color: var(--legend); }
.bag-detail-meta { font-size: 13px; color: var(--dim); }
.bag-detail-desc { font-size: 14px; color: #bfb6a6; line-height: 1.5; }

.item-icon {
  display: block; flex: none;
  width: 44px; height: 44px;
  background-image: url(/assets/items.png);
  background-size: 352px 176px;
  background-repeat: no-repeat;
}

.bag-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  background: var(--panel-deep);
  border: 1px solid var(--stone);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.8);
}

.bag-slot {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  padding: 0;
  background: #161412;
  border: 1px solid #332d26;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.78);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.bag-slot.empty { cursor: default; opacity: 0.55; }
.bag-slot.empty .slot-bg { opacity: 0.55; }
.bag-slot.filled.common { border-color: rgba(184, 178, 166, 0.42); }
.bag-slot.filled.rare { border-color: rgba(107, 163, 104, 0.58); box-shadow: inset 0 0 8px rgba(107, 163, 104, 0.14); }
.bag-slot.filled.epic { border-color: rgba(91, 143, 201, 0.65); box-shadow: inset 0 0 10px rgba(91, 143, 201, 0.18); }
.bag-slot.filled.legend { border-color: rgba(224, 159, 62, 0.78); box-shadow: inset 0 0 12px rgba(224, 159, 62, 0.24); }
.bag-slot.selected {
  outline: 1px solid var(--gold);
  border-color: var(--gold) !important;
  background: #231e18;
}
.slot-qty {
  position: absolute; right: 3px; bottom: 2px;
  font-size: 11px; font-weight: 700; line-height: 1;
  color: var(--ink);
  background: rgba(12, 10, 8, 0.82);
  padding: 1px 3px;
  text-shadow: 0 1px 2px #000;
}

/* ---------- 军镇建设 ---------- */
.build-list { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.build-card {
  border: 1px solid var(--stone); background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 235, 200, 0.05);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 6px;
}
.build-card.built { border-color: var(--gold); }
.build-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.build-name { font-size: var(--fs); font-weight: 700; letter-spacing: 1px; color: var(--ink); }
.build-lv { font-size: 15px; color: var(--gold); letter-spacing: 2px; }
.build-effect { font-size: 15px; color: var(--dim); line-height: 1.5; }
.build-cost { font-size: 15px; color: var(--dim); display: flex; gap: 12px; flex-wrap: wrap; }
.build-cost .lack { color: #c9594c; }
.build-need { font-size: 14px; color: #c9594c; letter-spacing: 0.5px; }
.build-card .btn { align-self: flex-start; }

/* ---------- 新手卡组 ---------- */
.starter {
  position: absolute; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 4; max-height: 56%; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  background: rgba(18, 16, 14, 0.97); border: 1px solid var(--stone-hi);
}
.starter-title { font-size: var(--fs); letter-spacing: 3px; text-align: center; color: var(--gold); }
.starter-list { display: flex; flex-direction: column; gap: 10px; }
.starter-card {
  border: 1px solid var(--stone); background: var(--panel);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
}
.starter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.starter-name { font-size: var(--fs); font-weight: 600; letter-spacing: 0.5px; }
.starter-count { font-size: 14px; color: var(--dim); white-space: nowrap; }
.starter-desc { font-size: 15px; color: var(--dim); line-height: 1.6; }
.starter-card .btn { align-self: flex-start; }

/* ---------- API 密钥与手动加卡 ---------- */
.api-keys { margin: 8px auto 0; width: 100%; max-width: 420px; font-size: var(--fs); color: var(--dim); }
.api-keys summary { cursor: pointer; text-align: center; }
.api-keys-body { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.api-keys-new { display: flex; gap: 6px; }
.api-keys-new input {
  flex: 1; min-width: 0;
  background: var(--panel-deep); border: 1px solid var(--stone-hi); color: var(--ink);
  padding: 8px 10px; font-size: var(--fs); outline: none;
}
.api-keys-new input:focus { border-color: var(--gold); }
.api-keys-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.api-keys-list li { display: flex; align-items: center; gap: 8px; }
.api-keys-list li span:first-child { flex: 1; color: var(--ink); }
.key-date { font-size: 14px; }
.key-reveal { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--stone-hi); background: var(--panel-deep); }
.key-once { font-size: 15px; margin: 0; }
.key-reveal code { word-break: break-all; font-size: 14px; color: var(--gold); }
.key-reveal-actions { display: flex; gap: 6px; }

.manual-add { display: flex; flex-direction: column; gap: 8px; }
.manual-kind { display: flex; gap: 6px; justify-content: center; }
.manual-kind .btn { min-width: 96px; }
.manual-kind .btn:disabled { color: var(--gold); border-color: var(--gold); opacity: 0.9; cursor: default; }
.manual-fields { display: flex; flex-direction: column; gap: 6px; }
.manual-fields input,
.manual-fields select {
  background: var(--panel-deep); border: 1px solid var(--stone-hi); color: var(--ink);
  padding: 8px 10px; font-size: var(--fs); outline: none; width: 100%; border-radius: 0;
}
.manual-fields input:focus,
.manual-fields select:focus { border-color: var(--gold); }

/* ---------- 登录 ---------- */
.auth-box {
  display: flex; flex-direction: column; gap: 12px;
  width: min(340px, 88vw); margin-top: 6vh;
  border: 1px solid var(--stone-hi); background: var(--panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  padding: 22px 20px;
}
.auth-title { font-size: var(--fs); font-weight: 600; letter-spacing: 2px; color: var(--gold); }
.auth-box input {
  background: var(--panel-deep); border: 1px solid var(--stone-hi); color: var(--ink);
  padding: 10px 12px; font-size: var(--fs); outline: none;
}
.auth-box input:focus { border-color: var(--gold); }
.auth-error { color: #c9594c; font-size: 15px; min-height: 1em; }

@media (max-width: 480px) {
  .game-title { font-size: var(--fs); }
  .btn { width: 100%; }
  .manual-kind .btn { width: auto; }
}

@media (pointer: coarse) {
  .kbd-only { display: none; }
  .btn-mini { padding: 9px 14px; }
  .settings input[type="checkbox"] { width: 18px; height: 18px; }
}

@media (pointer: fine) {
  .touch-only { display: none; }
}
