/* Companion Pet System – player guide. No external fonts or libraries. */
:root {
  --bg: #fbf3ef;
  --bg-soft: #f6e6df;
  --panel: #ffffff;
  --panel-2: #fff7f3;
  --ink: #3a2c2a;
  --ink-soft: #6d5a56;
  --line: #e8cfc5;
  --accent: #d9694a;        /* orange */
  --accent-ink: #b04a2e;
  --accent-soft: #fbe1d6;
  --pink: #e6869a;
  --pink-soft: #fde8ee;
  --lav: #8d87c4;           /* tab colour of the pet window */
  --lav-soft: #ecebf8;
  --teal: #2f9d9a;
  --teal-soft: #e0f3f2;
  --green: #3c8f4f;
  --gold: #a87b12;
  --shadow: 0 2px 10px rgba(120, 60, 40, .08);
  --radius: 14px;
  --header-h: 60px;
  --track: #e7dcd8;
  --energy: linear-gradient(#6fd0cc, #2aa39e);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #1e1919;
  --bg-soft: #2a2222;
  --panel: #2b2424;
  --panel-2: #332a29;
  --ink: #f3e9e6;
  --ink-soft: #c9b8b3;
  --line: #4a3c3a;
  --accent: #f08d6c;
  --accent-ink: #ffb197;
  --accent-soft: #4a2e26;
  --pink: #f0a0b2;
  --pink-soft: #45282f;
  --lav: #a9a4e0;
  --lav-soft: #34314d;
  --teal: #5cc8c4;
  --teal-soft: #213a3a;
  --green: #7fd08f;
  --gold: #e3bb55;
  --shadow: 0 2px 10px rgba(0, 0, 0, .35);
  --track: #4a3f3d;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1e1919;
    --bg-soft: #2a2222;
    --panel: #2b2424;
    --panel-2: #332a29;
    --ink: #f3e9e6;
    --ink-soft: #c9b8b3;
    --line: #4a3c3a;
    --accent: #f08d6c;
    --accent-ink: #ffb197;
    --accent-soft: #4a2e26;
    --pink: #f0a0b2;
    --pink-soft: #45282f;
    --lav: #a9a4e0;
    --lav-soft: #34314d;
    --teal: #5cc8c4;
    --teal-soft: #213a3a;
    --green: #7fd08f;
    --gold: #e3bb55;
    --shadow: 0 2px 10px rgba(0, 0, 0, .35);
    --track: #4a3f3d;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 "Segoe UI", "Trebuchet MS", Verdana, system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent-ink); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--lav); outline-offset: 2px; border-radius: 4px; }
kbd {
  display: inline-block; padding: 0 .45em; border: 1px solid var(--line); border-bottom-width: 3px;
  border-radius: 6px; background: var(--panel); font: 600 .85em/1.6 Consolas, monospace; white-space: nowrap;
}
.term { font-weight: 700; color: var(--accent-ink); }
.de-term { color: var(--ink-soft); font-size: .9em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--panel); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { top: 8px; }

/* ------------------------------------------------------------ header -- */
.site-header {
  position: sticky; top: 0; z-index: 20; height: var(--header-h);
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: linear-gradient(180deg, #f8d9cc, #efc0ae);
  border-bottom: 2px solid #e2a993;
  color: #6b2f22;
}
:root[data-theme="dark"] .site-header { background: linear-gradient(180deg, #4a2e28, #3a231e); border-color: #5c3a31; color: #ffd9cb; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-header { background: linear-gradient(180deg, #4a2e28, #3a231e); border-color: #5c3a31; color: #ffd9cb; } }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; text-decoration: none; color: inherit; }
.brand img { width: 34px; height: 34px; flex: none; }
.brand-text { font-weight: 800; font-size: 1.15rem; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.btn {
  appearance: none; border: 1px solid #d79a85; background: #fff6f2; color: #6b2f22;
  font: 700 .85rem/1 inherit; font-family: inherit; padding: 8px 10px; border-radius: 10px; cursor: pointer; min-height: 36px;
}
.btn:hover { background: #fff; }
.btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn { background: #2b2424; color: #ffd9cb; border-color: #6b4a40; }
:root[data-theme="dark"] .btn[aria-pressed="true"] { background: var(--accent); color: #2b1510; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn { background: #2b2424; color: #ffd9cb; border-color: #6b4a40; }
  :root:not([data-theme="light"]) .btn[aria-pressed="true"] { background: var(--accent); color: #2b1510; }
}
.lang-switch { display: flex; gap: 0; }
.lang-switch .btn:first-child { border-radius: 10px 0 0 10px; }
.lang-switch .btn:last-child { border-radius: 0 10px 10px 0; border-left: 0; }
.nav-toggle { display: none; }

/* ------------------------------------------------------------ layout -- */
.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 28px; max-width: 1240px; margin: 0 auto; padding: 20px 16px 60px; }
.toc {
  position: sticky; top: calc(var(--header-h) + 16px); align-self: start;
  max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 8px;
}
.toc h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); margin: 4px 10px 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li a {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 9px;
  color: var(--ink); text-decoration: none; font-size: .93rem; line-height: 1.3;
}
.toc li a img { width: 22px; height: 22px; flex: none; }
.toc li a:hover { background: var(--accent-soft); }
.toc li a.active { background: var(--lav-soft); color: var(--ink); font-weight: 700; box-shadow: inset 3px 0 0 var(--lav); }
main { min-width: 0; }

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 12px; }
  .nav-toggle { display: inline-flex; align-items: center; gap: 6px; }
  .toc {
    display: none; position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; z-index: 15;
    max-height: none; border-radius: 0; border: 0; padding: 12px 16px 40px;
  }
  .toc.open { display: block; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .brand-text .long { display: none; }
  .btn { padding: 8px 8px; }
}

/* ----------------------------------------------------------- content -- */
.hero {
  background: linear-gradient(135deg, #fde3d8 0%, #fbd0dc 55%, #e9e6fb 100%);
  border-radius: 20px; padding: 26px 24px; margin-bottom: 26px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; color: #3a2c2a;
}
:root[data-theme="dark"] .hero { background: linear-gradient(135deg, #4a2e28 0%, #4a2836 55%, #2f2c4a 100%); color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { background: linear-gradient(135deg, #4a2e28 0%, #4a2836 55%, #2f2c4a 100%); color: var(--ink); } }
.hero h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.15; }
.hero p { margin: 6px 0; }
.hero .eggs { display: grid; grid-template-columns: repeat(3, 56px); gap: 6px; }
.hero .eggs img { width: 56px; height: 56px; }
@media (max-width: 600px) { .hero { grid-template-columns: 1fr; } .hero .eggs { grid-template-columns: repeat(6, 1fr); } .hero .eggs img { width: 100%; height: auto; max-width: 56px; } }

section.chapter {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 22px;
}
@media (max-width: 480px) { section.chapter { padding: 18px 14px; } .hero { padding: 20px 16px; } }
section.chapter > h2 {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: clamp(1.3rem, 3vw, 1.6rem); line-height: 1.2;
}
section.chapter > h2 img { width: 34px; height: 34px; flex: none; }
h3 { font-size: 1.12rem; margin: 22px 0 8px; color: var(--accent-ink); }
p { margin: 8px 0; }
ul, ol { padding-left: 1.3em; }
li { margin: 4px 0; }

.callout { border-radius: 12px; padding: 12px 14px 12px 46px; margin: 14px 0; position: relative; }
.callout::before { position: absolute; left: 12px; top: 10px; font-size: 1.3rem; line-height: 1; }
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.callout .label { font-weight: 800; display: block; margin-bottom: 2px; }
.example { background: var(--teal-soft); border: 1px solid color-mix(in srgb, var(--teal) 35%, transparent); }
.example::before { content: "\270E"; color: var(--teal); }
.tip { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.tip::before { content: "\2605"; color: var(--accent); }
.note { background: var(--lav-soft); border: 1px solid color-mix(in srgb, var(--lav) 40%, transparent); }
.note::before { content: "i"; font: 800 1rem/1.3rem Georgia, serif; width: 1.3rem; height: 1.3rem; text-align: center; border-radius: 50%; background: var(--lav); color: #fff; }

figure.shot { margin: 16px 0; }
figure.shot a { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #3a3436; line-height: 0; }
figure.shot img { display: block; width: 100%; height: auto; }
figure.shot.small { max-width: 560px; }
figure.shot.tiny { max-width: 420px; }
figcaption { font-size: .88rem; color: var(--ink-soft); margin-top: 6px; }

/* cards of tabs / features */
.grid-cards { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.grid-cards li { margin: 0; display: grid; grid-template-columns: 36px 1fr; gap: 4px 10px; align-items: start; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.grid-cards li img { width: 36px; height: 36px; grid-row: span 2; }
.grid-cards li b { line-height: 1.25; }
.grid-cards li span { font-size: .92rem; color: var(--ink-soft); line-height: 1.4; }
.grid-cards li.tab-name b::after { content: none; }

.icon-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; padding: 0; list-style: none; }
.icon-row li { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 84px; text-align: center; font-size: .82rem; line-height: 1.25; }
.icon-row img { width: 48px; height: 48px; }

/* item list */
.item-list { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.item-list li { margin: 0; display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.item-list img { width: 44px; height: 44px; }

/* status table */
.status-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.status-table th { text-align: left; font-size: .85rem; color: var(--ink-soft); padding: 0 8px; }
.status-table td { background: var(--panel-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px; vertical-align: middle; }
.status-table td:first-child { border-left: 1px solid var(--line); border-radius: 12px 0 0 12px; }
.status-table td:last-child { border-right: 1px solid var(--line); border-radius: 0 12px 12px 0; }
.status-table img { width: 36px; height: 36px; vertical-align: middle; }
.status-table .cell { display: flex; align-items: center; gap: 8px; }
@media (max-width: 640px) {
  .status-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .status-table, .status-table tbody, .status-table tr, .status-table td { display: block; width: 100%; }
  .status-table tr { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
  .status-table td, .status-table td:first-child, .status-table td:last-child { border: 0; border-radius: 0; }
  .status-table td[data-th]::before { content: attr(data-th); display: block; font-size: .75rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .5px; }
}

/* steps */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.steps li { counter-increment: step; margin: 0; position: relative; padding: 10px 12px 10px 52px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; }
.steps li::before {
  content: counter(step); position: absolute; left: 12px; top: 10px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; text-align: center; line-height: 28px;
}
.steps .reward { display: block; font-size: .9rem; color: var(--gold); font-weight: 600; }

/* ------------------------------------------------------------ gauges -- */
.gauges { display: grid; gap: 14px; margin: 14px 0; }
.gauge-demo { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.gauge-head { display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 8px; flex-wrap: wrap; }
.gauge-head img { width: 26px; height: 26px; }
.gauge-head .de-term { font-weight: 400; }
.bar {
  position: relative; height: 22px; border-radius: 11px; overflow: hidden;
  background: var(--track) url(../assets/img/icons/gauge_track.png) center / 100% 100% no-repeat;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18);
}
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background-size: 100% 100%; background-repeat: no-repeat; border-radius: 11px 0 0 11px; }
.bar .fill.energy { background: var(--energy); }
.bar .bar-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font: 800 .82rem/1 Verdana, sans-serif; color: #1f2a3a; text-shadow: 0 0 3px #fff, 0 0 2px #fff;
}
.bar.stat { border-radius: 4px; height: 24px; }
.bar.stat .fill { border-radius: 4px 0 0 4px; }
.bar .reach { position: absolute; top: 0; bottom: 0; background: rgba(255, 255, 255, .55); }
.bar .beyond { position: absolute; top: 0; bottom: 0; right: 0; background: repeating-linear-gradient(135deg, rgba(60, 50, 50, .45) 0 4px, rgba(60, 50, 50, .30) 4px 8px); }
.bar .notch { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed #5a3a30; }
.bar .notch::before, .bar .notch::after { content: ""; position: absolute; left: -6px; border: 5px solid transparent; }
.bar .notch::before { top: -1px; border-top-color: #5a3a30; }
.bar .notch::after { bottom: -1px; border-bottom-color: #5a3a30; }
.bar .perfect { position: absolute; right: 0; top: 0; bottom: 0; width: 3px; background: #c0392b; }
.hearts { display: flex; gap: 4px; align-items: center; margin-bottom: 8px; }
.hearts img { width: 28px; height: 28px; }
.legend { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; font-size: .93rem; }
.legend li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; margin: 0; }
.swatch { width: 34px; height: 16px; border-radius: 4px; border: 1px solid var(--line); position: relative; }
.swatch.fill { background: url(../assets/img/icons/gauge_stat_patk.png) 0 0 / 100% 100%; }
.swatch.reach { background: #efe6e3; }
.swatch.beyond { background: repeating-linear-gradient(135deg, #8f8584 0 4px, #b2a9a8 4px 8px); }
.swatch.notch { background: transparent; border: 0; }
.swatch.notch::before { content: ""; position: absolute; left: 15px; top: 0; bottom: 0; border-left: 2px dashed #5a3a30; }
.swatch.perfect { background: linear-gradient(90deg, #efe6e3 80%, #c0392b 80%); }
.ivs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; padding: 0; list-style: none; }
.ivs li { margin: 0; padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: .88rem; color: #fff; }
.iv-red { background: #c0392b; } .iv-yellow { background: #c99a0e; } .iv-green { background: #3c8f4f; } .iv-gold { background: linear-gradient(90deg, #b8860b, #e5c158); color: #3a2c00 !important; }

/* element cycle */
.cycle { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 0; margin: 12px 0; }
.cycle li { margin: 0; display: flex; align-items: center; gap: 4px; }
.cycle li .el { display: flex; flex-direction: column; align-items: center; width: 74px; font-size: .82rem; text-align: center; }
.cycle li .el img { width: 44px; height: 44px; }
.cycle li:not(:last-child)::after { content: "\279C"; color: var(--accent); font-size: 1.3rem; }
.el-notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; list-style: none; padding: 0; }
.el-notes li { margin: 0; display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font-size: .93rem; }
.el-notes img { width: 40px; height: 40px; }

/* modes */
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; list-style: none; padding: 0; }
.modes li { margin: 0; background: var(--panel-2); border: 1px solid var(--line); border-top: 4px solid var(--lav); border-radius: 12px; padding: 10px 12px; }
.modes li > b { display: block; }
.modes li span { font-size: .93rem; }

/* FAQ */
details.faq { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; }
details.faq summary { cursor: pointer; padding: 12px 14px; font-weight: 700; list-style-position: inside; }
details.faq[open] summary { border-bottom: 1px solid var(--line); }
details.faq > div { padding: 6px 14px 12px; }

/* glossary */
dl.glossary { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 0; margin: 10px 0; }
dl.glossary dt, dl.glossary dd { padding: 9px 10px; border-bottom: 1px solid var(--line); margin: 0; }
dl.glossary dt { font-weight: 800; }
dl.glossary dt .de-term { display: block; font-weight: 400; }
@media (max-width: 560px) { dl.glossary { grid-template-columns: 1fr; } dl.glossary dt { border-bottom: 0; padding-bottom: 0; } }

.site-footer { text-align: center; color: var(--ink-soft); font-size: .88rem; padding: 10px 16px 30px; }
.to-top { position: fixed; right: 14px; bottom: 14px; z-index: 10; width: 44px; height: 44px; border-radius: 50%; display: none; align-items: center; justify-content: center; text-decoration: none; background: var(--accent); color: #fff; font-size: 1.3rem; box-shadow: var(--shadow); }
.to-top.show { display: flex; }
noscript p { background: #fff3cd; color: #5c4400; padding: 12px; border-radius: 10px; }
