/* ==========================================================================
   Petoria · 森林绘本主题 (Storybook theme)
   Loaded last. Pure presentation: no layout logic, no JS hooks.
   Parchment panels with gold hairlines, bevelled game buttons,
   glossy meters and a dark forest-glass HUD.
   ========================================================================== */
:root {
  --sb-ink: #233a2c;
  --sb-ink-soft: #4b5f4f;
  --sb-muted: #7a8470;
  --sb-forest: #2e5b40;
  --sb-forest-hi: #4a8158;
  --sb-forest-lo: #1f4230;
  --sb-moss: #7fa463;
  --sb-paper: #fbf6e7;
  --sb-paper-2: #f4ecd6;
  --sb-paper-3: #ece2c6;
  --sb-line: #ddcfa9;
  --sb-line-soft: #e9dfc4;
  --sb-gold: #c3953a;
  --sb-gold-hi: #f0d488;
  --sb-ember: #d0613a;
  --sb-ember-hi: #f29a5a;
  --sb-glass: rgba(20, 44, 34, .78);
  --sb-glass-line: rgba(240, 212, 136, .32);
  --sb-serif: 'Songti SC', 'STSong', 'Noto Serif SC', 'Source Han Serif SC', 'Noto Serif CJK SC', serif;
  --sb-shadow: 0 22px 48px -18px rgba(26, 44, 28, .55), 0 6px 14px -6px rgba(26, 44, 28, .25);
  --sb-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .36 0 0 0 0 .2 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Side drawer / panels ---------- */
html body #mobilePanelDrawer {
  background:
    var(--sb-grain),
    radial-gradient(120% 60% at 50% 0%, #fffaf0 0%, rgba(255, 250, 240, 0) 60%),
    linear-gradient(180deg, var(--sb-paper) 0%, var(--sb-paper-2) 100%) !important;
  border: 1px solid #cdbb8b !important;
  border-radius: 20px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), var(--sb-shadow) !important;
  color: var(--sb-ink);
}
html body .companion-panel-head {
  position: relative;
  min-height: 50px;
  align-items: center !important;
  padding: 12px 52px 12px 16px !important;
}
html body .companion-panel-head::after {
  content: '';
  position: absolute; left: 14px; right: 14px; bottom: 0; height: 9px;
  background:
    radial-gradient(circle, var(--sb-gold) 0 2.2px, transparent 2.6px) center/9px 9px no-repeat,
    linear-gradient(90deg, transparent, rgba(195, 149, 58, .55) 18%, rgba(195, 149, 58, .55) 44%, transparent 47%, transparent 53%, rgba(195, 149, 58, .55) 56%, rgba(195, 149, 58, .55) 82%, transparent) center/100% 1px no-repeat;
  pointer-events: none;
}
html body .companion-panel-head h2 {
  font: 900 18px/1.2 var(--sb-serif) !important;
  letter-spacing: .14em;
  color: var(--sb-forest-lo) !important;
  text-shadow: 0 1px 0 #fff;
}
html body #mobilePanelCloseBtn,
html body .mobile-panel-close {
  top: 11px !important;
  width: 30px; height: 30px; border-radius: 50% !important;
  background: linear-gradient(180deg, #fffdf6, var(--sb-paper-3)) !important;
  border: 1px solid var(--sb-line) !important;
  box-shadow: 0 2px 0 #d8c99f, 0 3px 6px -2px rgba(40, 50, 30, .3) !important;
  color: var(--sb-ink-soft) !important;
  transition: transform .15s, box-shadow .15s;
}
html body #mobilePanelCloseBtn:hover { transform: rotate(90deg); }

/* Section headers inside panels */
html body .companion-details > summary,
html body .more-actions-title,
html body .command-head h4,
html body .inv-label,
html body .section-label {
  font-family: var(--sb-serif) !important;
  font-weight: 900 !important;
  color: var(--sb-forest) !important;
  letter-spacing: .08em;
}
html body .companion-details {
  border-top: 1px solid var(--sb-line-soft) !important;
}
html body .companion-details > summary {
  font-size: 13px !important;
  padding: 10px 2px !important;
}


/* ---------- Buttons: bevelled, pressable ---------- */
html body :is(.care-btn, .command-btn, .ghost, .danger-btn, .target-action-mode, .companion-play-actions button, .log-detail-head button, .pet-manage-btn) {
  background: linear-gradient(180deg, #fffdf5 0%, var(--sb-paper-2) 100%) !important;
  border: 1px solid var(--sb-line) !important;
  border-radius: 9px !important;
  color: var(--sb-ink) !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 0 #d6c597, 0 3px 8px -4px rgba(48, 56, 30, .35), inset 0 1px 0 #fff !important;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
html body :is(.care-btn, .command-btn, .ghost, .danger-btn, .target-action-mode, .companion-play-actions button, .pet-manage-btn):hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 3px 0 #d6c597, 0 6px 12px -5px rgba(48, 56, 30, .4), inset 0 1px 0 #fff !important;
}
html body :is(.care-btn, .command-btn, .ghost, .danger-btn, .target-action-mode, .primary, .companion-play-actions button):active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 0 0 #d6c597, inset 0 2px 4px rgba(60, 50, 20, .18) !important;
}
html body :is(.care-btn, .command-btn, .ghost, .target-action-mode) .ui-icon { color: var(--sb-forest); }

html body .primary,
html body .shelf-slots input:checked + .slot-key,
html body .combat-command .target-action-mode.immediate,
html body .command-btn.active,
html body .command-btn[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--sb-forest-hi) 0%, var(--sb-forest) 55%, var(--sb-forest-lo) 100%) !important;
  border: 1px solid #1b3a29 !important;
  color: #fffbe9 !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .25);
  box-shadow: 0 2px 0 #163222, 0 6px 14px -6px rgba(20, 50, 30, .6), inset 0 1px 0 rgba(255, 255, 255, .28) !important;
  font-weight: 800 !important;
}
html body .primary:hover:not(:disabled) { filter: brightness(1.08); }
html body .command-btn.active .ui-icon,
html body .command-btn[aria-pressed="true"] .ui-icon { color: var(--sb-gold-hi); }

/* Combat "立即" is the one ember-coloured call to action. */
html body .combat-command .target-action-mode.immediate {
  background: linear-gradient(180deg, var(--sb-ember-hi) 0%, var(--sb-ember) 60%, #a8442a 100%) !important;
  border-color: #8f3a22 !important;
  box-shadow: 0 2px 0 #7d311c, 0 6px 14px -6px rgba(160, 60, 30, .7), inset 0 1px 0 rgba(255, 255, 255, .35) !important;
}

/* Segmented tabs (log scope, social tabs, auth tabs) */
html body :is(.log-scope, .social-tabs, .auth-tabs, .tabs) {
  background: rgba(214, 199, 160, .35) !important;
  border: 1px solid var(--sb-line-soft) !important;
  border-radius: 11px !important;
  padding: 3px !important;
  box-shadow: inset 0 1px 3px rgba(80, 60, 20, .12);
}
html body #mobilePanelDrawer .log-scope button[aria-pressed="true"],
html body .social-tabs .active,
html body .social-tab.active,
html body .tabs .tab.active {
  background: linear-gradient(180deg, var(--sb-forest-hi), var(--sb-forest)) !important;
  color: #fffbe9 !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 6px -2px rgba(20, 50, 30, .55), inset 0 1px 0 rgba(255, 255, 255, .25) !important;
}

/* ---------- Companion card ---------- */
html body .pet-portrait {
  background:
    radial-gradient(60% 55% at 50% 58%, rgba(255, 244, 205, .95), rgba(255, 244, 205, 0) 70%),
    radial-gradient(90% 70% at 50% 100%, rgba(127, 164, 99, .32), rgba(127, 164, 99, 0) 70%) !important;
  border: 1px solid var(--sb-line-soft) !important;
  border-radius: 18px !important;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .55), inset 0 -10px 18px -10px rgba(80, 110, 60, .35);
}
html body #petName,
html body .pet-name-line {
  font-family: var(--sb-serif) !important;
  font-weight: 900 !important;
  color: var(--sb-forest-lo) !important;
  letter-spacing: .06em;
}
html body .companion-money {
  padding: 1px 8px 1px 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff3cf, #f3dc9c);
  border: 1px solid #dfbd69;
  color: #7b5410 !important;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 1px 0 #fffbe9;
}
html body .rarity {
  border-radius: 999px !important;
  padding: 1px 8px !important;
  background: rgba(255, 255, 255, .6) !important;
  box-shadow: inset 0 0 0 1px currentColor;
}

/* Pet roster chips */
html body .pet-chip {
  background: linear-gradient(180deg, #fffdf6, var(--sb-paper-2)) !important;
  border: 1px solid var(--sb-line) !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 0 #dccc9f, inset 0 1px 0 #fff;
  transition: transform .15s, box-shadow .15s;
}
html body .pet-chip:hover { transform: translateY(-1px); }
html body .pet-chip.active {
  background: linear-gradient(180deg, #fffbe8, #f6e7bd) !important;
  border-color: var(--sb-gold) !important;
  box-shadow: 0 0 0 2px rgba(240, 212, 136, .55), 0 2px 0 #c9a656, 0 6px 14px -6px rgba(160, 120, 40, .55) !important;
}

/* Meters: thicker, inset track, glossy fill. Existing per-stat colours are kept. */
html body .companion-meter > span,
html body .companion-meter > small { color: var(--sb-ink-soft) !important; font-variant-numeric: tabular-nums; }
html body .companion-meter > span { font-weight: 700; }
html body .companion-track {
  height: 7px !important;
  border-radius: 999px !important;
  background: #e6dcc0 !important;
  box-shadow: inset 0 1px 2px rgba(70, 55, 20, .28), 0 1px 0 rgba(255, 255, 255, .7);
  overflow: hidden;
}
html body .companion-track i {
  height: 100% !important;
  border-radius: 999px !important;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, .1) 45%, rgba(0, 0, 0, .08) 100%) !important;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .12);
  transition: width .5s cubic-bezier(.3, .8, .3, 1);
}

/* Equipment & inventory slots read as item frames */
html body :is(.equip-slot, .inv-slot) {
  border: 1px solid var(--sb-line) !important;
  border-radius: 10px !important;
  background: radial-gradient(circle at 50% 35%, #fffdf4, #efe5c9) !important;
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 4px rgba(120, 95, 40, .12), 0 1px 0 rgba(255, 255, 255, .8);
}
html body :is(.equip-slot, .inv-slot).empty {
  background: repeating-linear-gradient(135deg, rgba(214, 199, 160, .18) 0 4px, transparent 4px 8px), #f6efdb !important;
  box-shadow: inset 0 1px 3px rgba(120, 95, 40, .16);
}

/* Skill cards */
html body .ability {
  margin: 6px 0 !important;
  padding: 9px 10px 9px 12px !important;
  border-radius: 10px !important;
  background: linear-gradient(90deg, color-mix(in srgb, var(--skill-color, #8aa77a) 14%, #fffaf0) 0%, #fffaf0 70%) !important;
  border: 1px solid var(--sb-line-soft) !important;
  border-left: 3px solid var(--quality-color, var(--sb-moss)) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8), 0 2px 6px -4px rgba(60, 50, 20, .3);
}
html body .ability-top strong { font-family: var(--sb-serif); font-weight: 900; color: var(--sb-forest-lo); letter-spacing: .04em; }
html body .ability-element {
  padding: 0 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--skill-color, #8aa77a) 22%, #fff);
  color: color-mix(in srgb, var(--skill-color, #6c8a5c) 55%, #1d2b20) !important;
  font-weight: 800;
}
html body .skill-quality { border-radius: 999px !important; padding: 0 6px !important; background: #fff; }
html body .ability-chip {
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .7) !important;
  border: 1px solid var(--sb-line-soft) !important;
}

/* ---------- Log ---------- */
html body #messages .log-group {
  background: rgba(255, 252, 242, .75) !important;
  border: 1px solid var(--sb-line-soft) !important;
  border-radius: 12px !important;
  overflow: hidden;
  margin-bottom: 10px !important;
  box-shadow: 0 2px 6px -4px rgba(60, 50, 20, .3);
}
html body #messages .log-group-head {
  background: linear-gradient(90deg, var(--sb-forest) 0%, var(--sb-forest-hi) 100%) !important;
  color: #fff6d8 !important;
  font-family: var(--sb-serif);
  font-weight: 900;
  letter-spacing: .08em;
}
html body #messages .log-group-head span { color: rgba(255, 246, 216, .8) !important; font-family: system-ui, sans-serif; letter-spacing: 0; }
html body #messages .log-entry { border-bottom: 1px dashed var(--sb-line-soft) !important; }
html body #messages .log-entry:last-child { border-bottom: 0 !important; }
html body #messages .log-entry > summary { padding: 7px 10px !important; transition: background .15s; }
html body #messages .log-entry > summary:hover,
html body #messages .log-entry[open] > summary { background: rgba(240, 212, 136, .18) !important; }
html body #messages .log-time { color: var(--sb-muted) !important; }
html body #messages .log-actor { color: var(--sb-forest) !important; }
html body #messages .log-result[data-tone=damage] {
  color: #fff !important; background: linear-gradient(180deg, #e2654a, #b83e2c);
  padding: 0 7px; border-radius: 999px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}
html body #messages .log-result[data-tone=heal] {
  color: #fff !important; background: linear-gradient(180deg, #5fbf7a, #2f8b51);
  padding: 0 7px; border-radius: 999px;
}
html body #messages .log-result[data-tone=reward] {
  color: #6f4a0a !important; background: linear-gradient(180deg, #fff1c2, #f0d283);
  padding: 0 7px; border-radius: 999px; border: 1px solid #dcb85e;
}
html body #messages .log-details { background: #fbf3dc !important; border-left: 3px solid var(--sb-gold) !important; }

/* ---------- Top HUD & bottom dock: forest glass ---------- */
html body :is(#worldInfo > summary, #accountMenu > summary, .map-filter-toggle, .circ-btn, .sync-status, .map-control-bar) {
  background: linear-gradient(180deg, rgba(36, 70, 52, .86), var(--sb-glass)) !important;
  border: 1px solid var(--sb-glass-line) !important;
  box-shadow: 0 6px 16px -6px rgba(10, 25, 18, .55), inset 0 1px 0 rgba(255, 245, 210, .14) !important;
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
  backdrop-filter: blur(8px) saturate(1.2);
  color: #fbf1d0 !important;
}
html body :is(#worldInfo > summary, #accountMenu > summary, .map-filter-toggle, .circ-btn):hover { border-color: rgba(240, 212, 136, .6) !important; }
html body .topbar-brand { text-shadow: 0 1px 2px rgba(10, 25, 18, .65), 0 0 12px rgba(10, 25, 18, .35); }
html body .topbar-brand :is(strong, b, h1, span:not(.brand-mark)) { font-family: var(--sb-serif); letter-spacing: .12em; }
html body .brand-mark {
  background: radial-gradient(circle at 35% 30%, #4f8a5f, #1f4230) !important;
  border: 1px solid var(--sb-gold) !important;
  box-shadow: 0 0 0 2px rgba(240, 212, 136, .25), 0 4px 10px -3px rgba(0, 0, 0, .45) !important;
  color: var(--sb-gold-hi) !important;
}

html body .mobile-map-hud {
  background: linear-gradient(180deg, rgba(38, 74, 55, .9), rgba(18, 40, 30, .9)) !important;
  border: 1px solid var(--sb-glass-line) !important;
  border-radius: 16px !important;
  padding: 4px !important;
  box-shadow: 0 14px 30px -12px rgba(8, 22, 15, .7), inset 0 1px 0 rgba(255, 245, 210, .16) !important;
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
}
html body .mobile-map-menu-btn { border-radius: 12px !important; transition: background .2s, color .2s, transform .15s; }
html body .mobile-map-menu-btn:hover { color: #fff6d8 !important; transform: translateY(-1px); }
html body .mobile-map-menu-btn.active {
  background: linear-gradient(180deg, rgba(240, 212, 136, .28), rgba(240, 212, 136, .1)) !important;
  color: #ffeaa8 !important;
  box-shadow: inset 0 0 0 1px rgba(240, 212, 136, .45), 0 0 14px -2px rgba(240, 212, 136, .45) !important;
}
html body .mobile-map-menu-btn.active .ui-icon { filter: drop-shadow(0 0 4px rgba(255, 220, 140, .7)); }

/* ---------- Map target popover (combat command) ---------- */
html body .map-target-popover > .cmd-menu.target-action-menu {
  background: var(--sb-grain), linear-gradient(180deg, var(--sb-paper), var(--sb-paper-2)) !important;
  border: 1px solid #cdbb8b !important;
  border-radius: 16px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), var(--sb-shadow) !important;
}
html body .map-target-popover::before { background: var(--sb-paper-2) !important; border-color: #cdbb8b !important; }
html body .combat-command .cmd-menu-head,
html body .map-target-popover .combat-command .cmd-menu-head {
  background: linear-gradient(90deg, #3a2a22, #5a3526 60%, #3a2a22) !important;
  color: #ffe7b0 !important;
  border-radius: 15px 15px 0 0 !important;
  padding: 8px 10px 8px 12px !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(240, 180, 110, .35) !important;
  box-shadow: none !important;
  font-family: var(--sb-serif);
  letter-spacing: .14em;
}
html body .combat-command .cmd-menu-head :is(button, .ui-icon) { color: #ffe7b0 !important; }
html body .combat-command .cmd-menu-head button { background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 50% !important; transition: background .15s; }
html body .combat-command .cmd-menu-head button:hover { background: rgba(255, 231, 176, .14) !important; }
html body .combat-target-art {
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #fff6dc, #e6d4a4);
  box-shadow: 0 0 0 2px #fff8e4, 0 0 0 3px #b98c45, 0 4px 10px -4px rgba(80, 40, 10, .5);
}
html body .combat-target-title strong,
html body .combat-target-title b { font-family: var(--sb-serif); font-weight: 900; color: #4a2618; }
html body .combat-target-health {
  height: 7px !important; border-radius: 999px !important;
  background: #e3d4b4 !important; box-shadow: inset 0 1px 2px rgba(80, 40, 10, .3);
}
html body .combat-target-health i {
  background: linear-gradient(180deg, #ff9b7f, #d2452f 60%, #a83524) !important;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4);
}
html body .combat-command .target-action-row { border-bottom: 1px dashed var(--sb-line-soft) !important; }
html body .combat-command .target-action-label { font-family: var(--sb-serif); font-weight: 900; color: var(--sb-ink); letter-spacing: .06em; }

/* ---------- Dialogs, tutorial, toast ---------- */
html body :is(.modal-panel, .tutorial-card) {
  background: var(--sb-grain), linear-gradient(180deg, var(--sb-paper), var(--sb-paper-2)) !important;
  border: 1px solid #cdbb8b !important;
  border-radius: 20px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), var(--sb-shadow) !important;
}
html body :is(.modal-panel, .tutorial-card) :is(h2, h3, strong:first-child) { font-family: var(--sb-serif); color: var(--sb-forest-lo); letter-spacing: .06em; }
html body .toast {
  background: linear-gradient(180deg, rgba(38, 74, 55, .95), rgba(18, 40, 30, .95)) !important;
  border: 1px solid var(--sb-glass-line) !important;
  color: #fff3d0 !important;
  border-radius: 14px !important;
  box-shadow: 0 14px 30px -12px rgba(8, 22, 15, .7) !important;
}

/* Scrollbars inside parchment */
html body #mobilePanelDrawer * { scrollbar-color: rgba(160, 130, 70, .45) transparent; }

@media (prefers-reduced-motion: reduce) {
  html body :is(.care-btn, .command-btn, .ghost, .danger-btn, .target-action-mode, .pet-chip, #mobilePanelCloseBtn, .mobile-map-menu-btn) { transition: none !important; }
}

/* Target menu buttons carry high-specificity rules upstream; match them. */
html body .cmd-menu.target-action-menu .target-action-mode {
  background: linear-gradient(180deg, #fffdf5 0%, var(--sb-paper-2) 100%) !important;
  border: 1px solid var(--sb-line) !important;
  color: var(--sb-ink) !important;
  border-radius: 9px !important;
  box-shadow: 0 2px 0 #d6c597, 0 3px 8px -4px rgba(48, 56, 30, .35), inset 0 1px 0 #fff !important;
  font-weight: 800 !important;
}
html body .cmd-menu.target-action-menu .target-action-mode.immediate {
  background: linear-gradient(180deg, var(--sb-forest-hi) 0%, var(--sb-forest) 55%, var(--sb-forest-lo) 100%) !important;
  border-color: #1b3a29 !important;
  color: #fffbe9 !important;
  box-shadow: 0 2px 0 #163222, 0 6px 14px -6px rgba(20, 50, 30, .6), inset 0 1px 0 rgba(255, 255, 255, .28) !important;
}
html body .cmd-menu.target-action-menu.combat-command .target-action-mode.immediate {
  background: linear-gradient(180deg, var(--sb-ember-hi) 0%, var(--sb-ember) 60%, #a8442a 100%) !important;
  border-color: #8f3a22 !important;
  box-shadow: 0 2px 0 #7d311c, 0 6px 14px -6px rgba(160, 60, 30, .7), inset 0 1px 0 rgba(255, 255, 255, .35) !important;
}
html body .cmd-menu.target-action-menu .target-action-mode.immediate .ui-icon { color: #ffe9a6 !important; }
html body .cmd-menu.target-action-menu .target-action-mode:disabled { opacity: .55; filter: grayscale(.4); box-shadow: none !important; }

/* ---------- Map labels: name plates, HP pips, tooltips ---------- */
html body .world .map-pet-name {
  padding: 1px 7px 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(36, 70, 52, .9), rgba(18, 40, 30, .88));
  border: 1px solid rgba(240, 212, 136, .35);
  box-shadow: 0 2px 6px -2px rgba(10, 25, 18, .6);
  color: #fff4d2 !important;
  font-weight: 800;
  letter-spacing: .04em;
  text-shadow: none !important;
}
html body .world .pet-avatar[aria-pressed="true"] .map-pet-name,
html body .world .pet-avatar.selected .map-pet-name {
  background: linear-gradient(180deg, #f6dc8f, #d9a84a);
  border-color: #fff3c4;
  color: #3b2a0c !important;
}
html body .world-monster .monster-hp,
html body .pet-map-hp {
  height: 4px !important;
  background: rgba(22, 30, 24, .78) !important;
  box-shadow: 0 0 0 1px rgba(255, 245, 215, .55), 0 2px 4px rgba(0, 0, 0, .35) !important;
  border-radius: 999px !important;
}
html body .world-monster .monster-hp > span,
html body .pet-map-hp > span {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 60%) !important;
  border-radius: 999px;
}
html body .world .world-object-tooltip,
html body .world .monster-tooltip,
html body .world .sched-ev-tooltip {
  background: linear-gradient(180deg, rgba(36, 70, 52, .95), rgba(18, 40, 30, .95)) !important;
  border: 1px solid rgba(240, 212, 136, .4) !important;
  border-radius: 8px !important;
  color: #fff4d2 !important;
  box-shadow: 0 8px 18px -8px rgba(8, 22, 15, .8) !important;
  font-weight: 700 !important;
}
html body .world .obj-level-sup {
  background: linear-gradient(180deg, #f6dc8f, #d29d3f) !important;
  color: #3b2a0c !important;
  font-weight: 900;
  border: 1px solid #fff3c4;
}

/* Account menu: one consistent row style for every entry */
html body .account-menu-items {
  background: linear-gradient(180deg, rgba(36, 70, 52, .95), rgba(18, 40, 30, .95)) !important;
  border: 1px solid var(--sb-glass-line) !important;
  border-radius: 14px !important;
  box-shadow: 0 16px 30px -12px rgba(8, 22, 15, .75), inset 0 1px 0 rgba(255, 245, 210, .14) !important;
}
html body #accountMenu .account-menu-items > :is(button, a) {
  background: transparent !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  color: #fbf1d0 !important;
  font-weight: 700 !important;
  border-radius: 9px !important;
  justify-content: flex-start;
}
html body #accountMenu .account-menu-items > :is(button, a):hover {
  background: rgba(240, 212, 136, .14) !important;
  border-color: rgba(240, 212, 136, .3) !important;
}
html body #worldInfo .world-stats-bar {
  border-color: var(--sb-glass-line) !important;
  box-shadow: 0 16px 30px -12px rgba(8, 22, 15, .75), inset 0 1px 0 rgba(255, 245, 210, .14) !important;
}

/* ===== v2: single-layer surfaces (no frame inside a frame) ===== */
html body .map-control-bar .map-controls,
html body .map-control-bar .map-controls > * {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
html body .map-control-bar { border-radius: 14px !important; }
html body .map-control-bar button {
  border-radius: 9px !important;
  color: #fbf1d0 !important;
  transition: background .15s;
}
html body .map-control-bar button:hover:not(:disabled) { background: rgba(240, 212, 136, .16) !important; }
html body .map-control-bar :is(#mapZoomLabel, .map-zoom-label) { min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; color: #fbf1d0 !important; }
html body .sync-status::before { box-shadow: 0 0 0 3px rgba(130, 220, 140, .2), 0 0 8px rgba(130, 220, 140, .8); }

/* World status: plain readouts on the glass sheet, not boxed chips */
html body #worldInfo .world-stats-bar > * {
  background: rgba(255, 245, 210, .07) !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 8px !important;
}

/* Brand: one ring, not two */
html body .brand-mark { box-shadow: 0 4px 10px -3px rgba(0, 0, 0, .45) !important; }

/* Companion portrait: an open stage instead of a boxed frame */
html body .pet-portrait {
  border: 0 !important;
  box-shadow: none !important;
  background:
    radial-gradient(48% 12% at 50% 84%, rgba(60, 80, 40, .22), rgba(60, 80, 40, 0) 100%),
    radial-gradient(60% 55% at 50% 52%, rgba(255, 244, 205, .95), rgba(255, 244, 205, 0) 72%) !important;
}

/* Log rounds: a banner and rows directly on the page, no card around them */
html body #messages .log-group {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: visible;
}
html body #messages .log-group-head { border-radius: 9px !important; box-shadow: 0 3px 8px -5px rgba(20, 50, 30, .6); }
html body #messages .log-entry > summary { border-radius: 8px; }

/* Skill picker chips wrap tightly */
html body .combat-skill-picker .move-options { gap: 6px !important; align-content: flex-start; }
html body .combat-skill-picker .move-token { margin: 0 !important; }

/* Every map popover header: flush forest band, serif title, flat close */
html body .cmd-menu.target-action-menu .cmd-menu-head,
html body #objActionPopup .obj-action-header {
  background: linear-gradient(100deg, #1f4230 0%, #2e5b40 55%, #3b6a4b 100%) !important;
  border-radius: 15px 15px 0 0 !important;
  border-bottom: 1px solid rgba(240, 212, 136, .35) !important;
  padding: 9px 10px 9px 12px !important;
}
html body .cmd-menu.target-action-menu .cmd-menu-head b,
html body #objActionTitle { font-family: var(--sb-serif); font-weight: 900; letter-spacing: .14em !important; color: #fff3cf !important; }
html body .command-seal { border-color: rgba(240, 212, 136, .55) !important; color: var(--sb-gold-hi) !important; background: rgba(255, 245, 210, .06); }
html body .cmd-menu.target-action-menu .cmd-menu-close,
html body #objActionPopup #objActionCloseBtn { background: transparent !important; transition: background .15s; }
html body .cmd-menu.target-action-menu .cmd-menu-close:hover,
html body #objActionPopup #objActionCloseBtn:hover { background: rgba(255, 243, 207, .14) !important; }
html body .target-action-menu .target-detail-card strong,
html body .target-action-menu .target-detail-title { font-family: var(--sb-serif); font-weight: 900; color: var(--sb-forest-lo); letter-spacing: .04em; }
html body .target-action-menu .target-action-row { border-top: 1px dashed var(--sb-line) !important; }
html body .target-action-menu .target-action-row > :first-child { font-family: var(--sb-serif); font-weight: 900; color: var(--sb-ink); }

/* Ornament on every collapsible section title */

html body .more-actions-title { font-family: var(--sb-serif) !important; font-weight: 900 !important; color: var(--sb-forest) !important; }
html body .more-actions-title span { font-family: system-ui, sans-serif; font-weight: 500; color: var(--sb-muted) !important; letter-spacing: 0; }

/* Friendly empty state */
html body .social-empty {
  display: grid; justify-items: center; gap: 8px;
  margin: 26px 8px !important; padding: 22px 16px !important;
  text-align: center; color: var(--sb-muted) !important;
  border: 1px dashed var(--sb-line) !important; border-radius: 14px;
  background: radial-gradient(70% 60% at 50% 0%, rgba(240, 212, 136, .16), transparent 70%);
}
html body .social-empty::before {
  content: '✿';
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  font-size: 20px; color: var(--sb-gold);
  background: radial-gradient(circle at 40% 35%, #fffaf0, #f1e5c3);
  box-shadow: 0 0 0 1px var(--sb-line), 0 4px 10px -5px rgba(120, 90, 30, .5);
}
html body .cmd-menu.target-action-menu.combat-command .cmd-menu-head {
  background: linear-gradient(90deg, #3a2a22, #5a3526 60%, #3a2a22) !important;
  border-bottom-color: rgba(240, 180, 110, .35) !important;
}
/* Collapsible section titles keep their chevron, tinted gold */
html body #mobilePanelDrawer :is(.more-actions, .stat-details, .companion-details) > summary::before { border-color: var(--sb-gold) !important; }

/* ===== v3: grouped profile actions ===== */
html body .pet-profile-panel #petProfileActions {
  display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 7px;
  margin: 0 0 8px !important; padding: 0 !important; border: 0 !important;
}
html body .pet-profile-panel .profile-action-row {
  display: grid !important; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 10px;
  padding: 0 !important; margin: 0 0 7px !important;
}
html body .pet-profile-panel .profile-action-label {
  font: 900 12px/1 var(--sb-serif); letter-spacing: .24em; color: var(--sb-forest);
  white-space: nowrap;
}
html body .pet-profile-panel .profile-action-buttons { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
html body .pet-profile-panel .profile-action-buttons > button {
  flex: 1 1 0; min-width: 0;
  min-height: 30px !important; height: 30px; padding: 0 10px !important;
  font-size: 12.5px !important; line-height: 1 !important; border-radius: 8px !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html body .pet-profile-panel .profile-action-buttons > .danger-btn {
  background: linear-gradient(180deg, #fff6ef, #f6dfd2) !important; color: #9a3b26 !important;
  border-color: #e3b9a6 !important; box-shadow: 0 2px 0 #dcae98, inset 0 1px 0 #fff !important;
}
html body .pet-profile-panel .companion-play-actions small { display: none; }

/* ===== Daily commissions ===== */
html body .daily-commissions:empty { display: none; }
html body .daily-commissions {
  margin: 4px 0 14px; padding: 12px 12px 10px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 252, 240, .9), rgba(246, 236, 210, .75));
  border: 1px solid var(--sb-line);
  box-shadow: 0 2px 8px -6px rgba(60, 50, 20, .4);
}
html body .daily-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
html body .daily-head strong { font: 900 14px/1.2 var(--sb-serif); letter-spacing: .16em; color: var(--sb-forest-lo); }
html body .daily-head small { color: var(--sb-muted); font-size: 11px; }
html body .daily-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
html body :is(.daily-task, .daily-chest) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 10px; background: rgba(255, 255, 255, .55); border-left: 3px solid var(--skill-color, var(--sb-moss)); }
html body .daily-chest { grid-template-columns: 28px minmax(0, 1fr) auto; margin-top: 8px; border-left-color: var(--sb-gold); background: linear-gradient(90deg, rgba(240, 212, 136, .22), rgba(255, 255, 255, .5)); }
html body .daily-chest-icon { width: 26px; height: 22px; border-radius: 4px 4px 3px 3px; background: linear-gradient(180deg, #b77a3a 0 42%, #8e5826 42% 100%); box-shadow: inset 0 0 0 2px #e9c46a, 0 2px 4px -2px rgba(60, 30, 0, .6); position: relative; }
html body .daily-chest-icon::after { content: ''; position: absolute; left: 50%; top: 36%; width: 6px; height: 7px; margin-left: -3px; border-radius: 1px; background: #f6d77a; box-shadow: 0 0 0 1px #8e5826; }
html body .daily-chest.is-ready .daily-chest-icon { animation: chest-bob 1.4s ease-in-out infinite; filter: drop-shadow(0 0 6px rgba(246, 215, 122, .9)); }
@keyframes chest-bob { 50% { transform: translateY(-2px) rotate(-3deg); } }
html body .daily-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 8px; min-width: 0; }
html body .daily-label { font-weight: 700; color: var(--sb-ink); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body .daily-reward { font-size: 11px; font-weight: 800; color: #8a5d12; font-variant-numeric: tabular-nums; }
html body .daily-bar { grid-column: 1 / -1; height: 5px; border-radius: 999px; background: #e6dcc0; box-shadow: inset 0 1px 2px rgba(70, 55, 20, .25); overflow: hidden; }
html body .daily-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(180deg, color-mix(in srgb, var(--skill-color, #7fa463) 70%, #fff), var(--skill-color, #5f8a4c)); transition: width .4s; }
html body .daily-num { font-size: 12px; font-weight: 800; color: var(--sb-muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
html body .daily-state { font-size: 11px; color: var(--sb-muted); }
html body .daily-claim { min-height: 28px !important; padding: 0 12px !important; font-size: 12px !important; }
html body :is(.daily-task, .daily-chest).is-claimed { opacity: .55; }

/* ===== Bestiary ===== */
html body .bestiary-head { display: flex; align-items: baseline; justify-content: space-between; margin: 2px 0 4px; }
html body .bestiary-head strong { font: 900 15px/1.2 var(--sb-serif); letter-spacing: .16em; color: var(--sb-forest-lo); }
html body .bestiary-head small { color: var(--sb-muted); font-weight: 700; }
html body .bestiary-legend { margin: 0 0 10px; font-size: 11px; color: var(--sb-muted); }
html body .bestiary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
html body .bestiary-card {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 9px; border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--skill-color, #c9b98e) 16%, #fffaf0), #fffaf0 65%);
  border: 1px solid var(--sb-line-soft);
  box-shadow: 0 2px 6px -5px rgba(60, 50, 20, .45);
}
html body .bestiary-card.is-boss { border-color: #d9a85a; box-shadow: 0 0 0 1px rgba(217, 168, 90, .35), 0 3px 10px -6px rgba(140, 90, 20, .6); }
html body .bestiary-art {
  width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 60%, rgba(255, 250, 230, .95), color-mix(in srgb, var(--skill-color, #d9ccaa) 30%, #efe5c9));
}
html body .bestiary-art :is(img, .asset-sprite-wrap, .map-art-sprite) { max-width: 52px; max-height: 52px; width: 52px; height: 52px; object-fit: contain; image-rendering: auto; }
html body .bestiary-card.is-unknown { background: rgba(240, 233, 214, .55); }
html body .bestiary-card.is-unknown .bestiary-art { background: #e6dcc3; }
html body .bestiary-card.is-unknown .bestiary-art > * { filter: brightness(0) opacity(.28); }
html body .bestiary-card.is-unknown .bestiary-title strong { color: var(--sb-muted); letter-spacing: .2em; }
html body .bestiary-info { display: grid; gap: 3px; min-width: 0; }
html body .bestiary-title { display: flex; align-items: center; gap: 5px; min-width: 0; }
html body .bestiary-title strong { font: 900 13px/1.25 var(--sb-serif); color: var(--sb-forest-lo); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body :is(.bestiary-element, .bestiary-boss) { flex: none; padding: 0 6px; border-radius: 999px; font-size: 10px; font-weight: 800; line-height: 1.6; }
html body .bestiary-element { background: color-mix(in srgb, var(--skill-color, #8aa77a) 26%, #fff); color: color-mix(in srgb, var(--skill-color, #6c8a5c) 50%, #1d2b20); }
html body .bestiary-boss { background: linear-gradient(180deg, #f6dc8f, #d29d3f); color: #3b2a0c; }
html body .bestiary-meta { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 11px; color: var(--sb-ink-soft); font-variant-numeric: tabular-nums; }
html body .bestiary-rank { padding: 0 6px; border-radius: 999px; font-weight: 800; background: #efe6cc; color: #6d5a2e; }
html body .bestiary-rank[data-rank="familiar"] { background: #dcefd9; color: #2f6b3c; }
html body .bestiary-rank[data-rank="adept"] { background: #dbe6f6; color: #2d548f; }
html body .bestiary-rank[data-rank="master"] { background: linear-gradient(180deg, #f6dc8f, #d29d3f); color: #3b2a0c; }
html body .bestiary-bonus { color: #b0442c; font-weight: 800; }
html body .bestiary-progress { height: 4px; border-radius: 999px; background: #e6dcc0; overflow: hidden; }
html body .bestiary-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--sb-gold), #e8c264); border-radius: 999px; }
html body .bestiary-next { font-size: 10.5px; color: var(--sb-muted); }
html body .bestiary-stats { display: flex; flex-wrap: wrap; gap: 2px 8px; margin: 2px 0 0; font-size: 10.5px; }
html body .bestiary-stats div { display: flex; gap: 3px; }
html body .bestiary-stats dt { color: var(--sb-muted); }
html body .bestiary-stats dd { margin: 0; font-weight: 800; color: var(--sb-ink); font-variant-numeric: tabular-nums; }

/* ===== Log: coloured object names instead of emoji ===== */
html body .log-name { font-weight: 800; }
html body .log-name small { margin-right: 2px; font-size: .82em; font-weight: 700; opacity: .75; }
html body .log-name[data-kind="own"] { color: #1f5f99; }
html body .log-name[data-kind="pet"] { color: #2f6f9e; }
html body .log-name[data-kind="monster"] { color: #b23b2a; }
html body .log-name[data-kind="item"] { color: #946112; }
html body .log-name[data-kind="equipment"] { color: #6a49b8; }
html body .log-name[data-kind="plant"] { color: #3b7f35; }
html body .log-name[data-kind="building"] { color: #8a5a2b; }
html body .log-name[data-kind="place"] { color: #1f7a78; }
html body .log-name[data-kind="skill"] { color: #a2457f; }
html body .obj-tick { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 900; color: #fff; background: transparent; box-shadow: inset 0 0 0 1.5px var(--sb-line); }
html body .obj-done .obj-tick { background: var(--sb-gold); box-shadow: none; }
html body .obj-claimed-state .obj-tick { background: var(--sb-forest-hi); box-shadow: none; }
html body .obj-reward { color: #8a5d12 !important; background: rgba(240, 212, 136, .25) !important; border-radius: 999px; padding: 0 6px; font-weight: 800; }
html body .obj-bar span { background: linear-gradient(90deg, var(--sb-gold), #e8c264) !important; }
html body .pet-profile-panel .profile-action-buttons > button { white-space: nowrap !important; padding: 0 8px !important; }
@media (max-width: 600px) {
  html body .pet-profile-panel .profile-action-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  html body .pet-profile-panel .profile-action-label { font-size: 11px; letter-spacing: .3em; }
}

/* Full-size actions share a baseline in each footer; inline controls have
   their own compact sizing. Material and interaction states come from above. */
html body :is(#authForm .auth-actions, #adminPanel .admin-actions, .game-dialog-actions,
              .tutorial-actions, .item-detail-actions, .modal-actions)
  > button:is(.primary,.ghost,.danger-btn,.care-btn) {
  box-sizing:border-box;
  min-height:32px;
  padding:5px 12px;
  border-radius:9px!important;
  font:700 12px/1.4 system-ui,sans-serif;
  letter-spacing:0;
}
html body #authForm .auth-actions > button:is(.primary,.ghost) {min-height:38px;}
html body .danger-btn {color:#934a3d!important;}
html body :is(.primary,.ghost,.danger-btn,.care-btn,.target-action-mode):focus-visible {
  outline:2px solid #9a7028;
  outline-offset:2px;
}
html body :is(.auth-actions,.modal-actions,.game-dialog-actions,.tutorial-actions,.admin-actions) > button:disabled {
  opacity:.56;
  cursor:default;
}

/* Reusable, named toolbars in the two scrolling companion columns. */
#mobilePanelDrawer #petCareActions.partner-tools:not(.hidden),
#mobilePanelDrawer #commandActions > .partner-tools {
  display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-start; gap:6px;
}
#mobilePanelDrawer .partner-tools > :is(button.care-btn,button.command-btn,#picnicBtn) {
  position:relative; display:inline-grid; place-items:center; flex:0 0 32px;
  box-sizing:border-box; width:32px; min-width:32px; height:32px; min-height:32px;
  margin:0; padding:0; overflow:visible;
}
.partner-tools .ui-icon {width:17px; height:17px;}
.partner-tools .tool-label {
  display:none; position:absolute; z-index:4; bottom:calc(100% + 3px); left:0;
  padding:3px 6px; border-radius:5px; color:#fff9e8; background:#294738;
  font:600 11px/1.4 system-ui,sans-serif; white-space:nowrap; pointer-events:none;
}
.partner-tools button:is(:hover,:focus-visible) .tool-label {display:block;}
#mobilePanelDrawer .partner-tools button.active {outline:2px solid #a6792b; outline-offset:-2px;}
.partner-management-actions {display:flex; flex-wrap:wrap; gap:6px; padding:8px 0;}
.partner-management-actions > button {min-height:28px; padding:3px 9px; font:600 12px/1.3 system-ui,sans-serif;}
.capture-attacker {font-size:12px; color:#435744; margin:6px 0;}
@media (hover:none) {
  #mobilePanelDrawer .partner-tools > :is(button.care-btn,button.command-btn,#picnicBtn) {
    height:40px; min-width:38px; flex-basis:38px; gap:1px; align-content:center;
  }
  .partner-tools .tool-label {display:block; position:static; background:none; color:inherit; padding:0; font-size:10px;}
}
.bloodline-skills {margin:4px 0 0; padding-top:6px; border-top:1px solid var(--sb-line); color:#78591f; font:600 11px/1.6 system-ui,sans-serif;}
