/* KAiSA Studios site — styled after the Aetherfall in-game UI (brand B):
   smooth silver panels, polished gold rims with a dark-purple keyline, dark recessed item wells,
   mint / lilac / gold buttons, pill tabs. */
:root {
  /* page (outside panels) */
  --bg: #1b1a29;
  --bg-2: #232234;
  --ink: #f4f2fa;
  --ink-2: #c9c4da;
  --ink-3: #9590ab;

  /* silver panel */
  --sv-hi: #f0f4f8;
  --sv: #dfe4ea;
  --sv-lo: #c8cfd8;
  --sv-ink: #2a2140;
  --sv-ink-2: #4c4462;
  --sv-ink-3: #756d88;
  --sv-line: #b9c1cc;

  /* well, rims, accents */
  --well: #221a35;
  --well-2: #2c2242;
  --key: #1e142e;
  --gold: #f2c640;
  --gold-hi: #ffe38a;
  --gold-d: #b0841e;
  --mint: #83f8d8;
  --mint-d: #3fc9a6;
  --lilac: #c0a0cc;
  --lilac-d: #8d68af;
  --slate: #8e98a3;
  --red: #ff5c5c;

  --radius: 16px;
  --rim: 0 0 0 2px var(--gold), 0 0 0 4px var(--key), 0 6px 18px rgba(0, 0, 0, .35), 0 0 14px rgba(242, 198, 64, .18);
  --head: "Barlow Semi Condensed", "Bahnschrift", system-ui, sans-serif;
  --body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 80% -8%, rgba(192, 160, 204, .18), transparent 60%),
    radial-gradient(900px 480px at -8% 12%, rgba(131, 248, 216, .10), transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
  font: 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.1; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 700; }
p { margin: 0 0 1em; color: var(--ink-2); }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.section { padding: 64px 0; }
.eyebrow {
  font: 700 .8rem/1 var(--head); letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 12px; display: inline-block;
}
.muted { color: var(--ink-3); }

/* ---------- silver panel (rim_window) ---------- */
.panel {
  background: linear-gradient(160deg, var(--sv-hi), var(--sv-lo));
  color: var(--sv-ink);
  border-radius: var(--radius);
  box-shadow: var(--rim);
  padding: 24px;
}
.panel p, .panel li { color: var(--sv-ink-2); }
.panel a:not(.btn) { color: var(--lilac-d); font-weight: 700; }
.panel .muted { color: var(--sv-ink-3); }
.panel .eyebrow { color: var(--gold-d); }

/* dark recessed well (the image area of rim_card) */
.well {
  background: radial-gradient(120% 90% at 50% 30%, var(--well-2), var(--well));
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px var(--key), inset 0 6px 16px rgba(0, 0, 0, .45);
  overflow: hidden; position: relative;
}
.well > img { width: 100%; height: 100%; object-fit: contain; padding: 6%; }
.well > svg { width: 100%; height: 100%; display: block; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: var(--head-bg);
  box-shadow: 0 2px 0 var(--gold), 0 4px 0 var(--key), 0 8px 20px rgba(0, 0, 0, .35);
}
.site-head .wrap { display: flex; align-items: center; gap: 24px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 36px; width: auto; }
.nav { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.nav a {
  color: var(--ink-2); font: 700 .95rem var(--head); letter-spacing: .05em; text-transform: uppercase;
  padding: 7px 14px; border-radius: 999px;
}
.nav a:hover { color: var(--ink); background: rgba(255, 255, 255, .06); text-decoration: none; }
.nav a.on { color: #12251f; background: var(--mint); box-shadow: 0 0 0 2px var(--gold), 0 0 0 3.5px var(--key); }
.nav-toggle { display: none; margin-left: auto; font: 700 .95rem var(--head); text-transform: uppercase; letter-spacing: .05em; }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--menu-bg); box-shadow: 0 2px 0 var(--gold), 0 4px 0 var(--key); padding: 12px 16px 16px; gap: 8px; }
  .nav.open { display: flex; }
  .nav a { text-align: center; }
}

/* ---------- buttons (btn_mint / btn_lilac / btn_gold / btn_silver) ---------- */
.btn, .nav-toggle {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 1rem var(--head); letter-spacing: .06em; text-transform: uppercase;
  padding: 12px 24px; border-radius: 14px; border: 0; cursor: pointer;
  box-shadow: 0 0 0 2px var(--gold), 0 0 0 4px var(--key), inset 0 -4px 0 rgba(0, 0, 0, .16), 0 6px 14px rgba(0, 0, 0, .3);
  transition: transform .08s, filter .08s;
}
.btn::before, .nav-toggle::before {
  content: ""; position: absolute; left: 10px; right: 10px; top: 4px; height: 4px; border-radius: 4px;
  background: rgba(255, 255, 255, .55); pointer-events: none;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); filter: brightness(.95); }
.btn-mint { background: linear-gradient(#9dffe4, var(--mint) 60%, #6be6c4); color: #12251f; }
.btn-lilac { background: linear-gradient(#d9bfe2, var(--lilac) 60%, #a988b8); color: #2a1838; }
.btn-gold { background: linear-gradient(#ffe48a, var(--gold) 60%, #dcae2c); color: #2a1d05; }
.btn-ghost, .nav-toggle { background: linear-gradient(#f4f7fa, #c9d0d9 70%, #aeb6c1); color: var(--sv-ink); }
.nav-toggle { display: none; padding: 9px 18px; }
@media (max-width: 760px) { .nav-toggle { display: inline-flex; } }
.btn img { width: 22px; height: 22px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 16px; }

/* ---------- layout helpers ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.feature { display: flex; flex-direction: column; gap: 10px; }
.feature .ico { width: 60px; height: 60px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25)); }
.feature h3 { margin: 0; }
.feature p { margin: 0; }

/* placeholder photo frame (scene placeholders that still have no render) */
.ph { position: relative; overflow: hidden; aspect-ratio: 16 / 9; }
.ph svg { width: 100%; height: 100%; display: block; }
.ph-tag {
  position: absolute; left: 10px; bottom: 10px;
  font: 700 .7rem var(--head); letter-spacing: .14em; text-transform: uppercase;
  color: #c9c4da; background: rgba(18, 12, 30, .75); padding: 4px 8px; border-radius: 6px;
}

/* render showcase: a dark well with one or more machine renders */
.showcase { position: relative; aspect-ratio: 16 / 10; }
.showcase img { position: absolute; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .45)); }
.showcase .s-main { inset: 6% 18% 8% 18%; width: 64%; height: 86%; z-index: 2; }
.showcase .s-left { left: 0; bottom: 4%; width: 40%; height: 60%; z-index: 1; }
.showcase .s-right { right: 0; bottom: 4%; width: 40%; height: 60%; z-index: 1; }
.showcase .cap {
  position: absolute; left: 12px; bottom: 10px; z-index: 3;
  font: 700 .72rem var(--head); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
}

/* ---------- hero ---------- */
.hero { position: relative; padding: 80px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: 1fr 1.05fr; gap: 48px; align-items: center; }
.hero p.lead { font-size: 1.15rem; max-width: 34em; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } .hero { padding-top: 40px; } }

.studio-hero { text-align: center; padding: 56px 0 32px; }
.studio-hero img.logo { width: min(640px, 100%); margin: 0 auto 20px; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .45)); }
.studio-hero p { max-width: 38em; margin-inline: auto; font-size: 1.1rem; }
.studio-hero .btn-row { justify-content: center; margin-top: 24px; }

/* game card on the studio page */
.game-card { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center; }
.game-card .body { padding: 8px 8px 8px 0; display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 760px) { .game-card { grid-template-columns: 1fr; } .game-card .body { padding: 0; } }
.pill {
  display: inline-block; font: 700 .72rem var(--head); letter-spacing: .12em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px; box-shadow: 0 0 0 1.5px var(--gold), 0 0 0 3px var(--key);
}
.pill-mint { background: var(--mint); color: #12251f; }
.pill-lilac { background: var(--lilac); color: #2a1838; }
.pill-gold { background: var(--gold); color: #2a1d05; }
.pill-slate { background: var(--slate); color: #fff; }

/* steps */
.steps { counter-reset: s; display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.step { counter-increment: s; position: relative; padding-top: 64px; }
.step::before {
  content: counter(s); position: absolute; top: 18px; left: 22px;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font: 700 1.2rem var(--head); color: #12251f; background: var(--mint);
  box-shadow: 0 0 0 2px var(--gold), 0 0 0 3.5px var(--key);
}

/* ---------- footer ---------- */
.site-foot { padding: 36px 0; margin-top: 48px; color: var(--ink-3); font-size: .9rem; background: var(--foot-bg); box-shadow: 0 -2px 0 var(--gold), 0 -4px 0 var(--key); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
.site-foot img { height: 30px; width: auto; }
.site-foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-foot a { color: var(--ink-2); }

.draft-banner {
  background: repeating-linear-gradient(45deg, var(--banner-a) 0 12px, var(--banner-b) 12px 24px);
  color: var(--gold); text-align: center; font: 700 .8rem var(--head); letter-spacing: .14em;
  text-transform: uppercase; padding: 6px 12px;
}

/* ---------- wiki ---------- */
.wiki-head { padding: 40px 0 8px; }
.wiki-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; align-items: start; }
.wiki-layout > * { min-width: 0; }
@media (max-width: 900px) { .wiki-layout { grid-template-columns: 1fr; } }
.side { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 900px) { .side { position: static; } }
.side h4 { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--sv-ink-3); margin-bottom: 10px; }

/* tabs (tab_on / tab_off) */
.chips { display: flex; flex-wrap: wrap; gap: 10px 8px; padding: 3px; }
.chip {
  font: 700 .85rem var(--head); letter-spacing: .03em; padding: 6px 12px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--slate); color: #fff;
  box-shadow: 0 0 0 1.5px var(--gold), 0 0 0 3px var(--key);
}
.chip:hover { filter: brightness(1.08); }
.chip.on { background: var(--mint); color: #12251f; }
.chip .n { opacity: .7; margin-left: 4px; font-weight: 600; }
.chip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; box-shadow: 0 0 0 1px var(--key); vertical-align: 1px; }

.field {
  width: 100%; border: 0; color: var(--sv-ink); border-radius: 999px; padding: 11px 18px; font: inherit; font-weight: 600;
  background: linear-gradient(#f4f7fa, #d4dae2);
  box-shadow: 0 0 0 2px var(--gold), 0 0 0 4px var(--key), inset 0 2px 4px rgba(0, 0, 0, .12);
}
.field::placeholder { color: var(--sv-ink-3); }
.field:focus { outline: none; box-shadow: 0 0 0 2px var(--mint), 0 0 0 4px var(--key), 0 0 12px rgba(131, 248, 216, .5); }
select.field { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--sv-ink-2) 50%), linear-gradient(135deg, var(--sv-ink-2) 50%, transparent 50%), linear-gradient(#f4f7fa, #d4dae2); background-position: calc(100% - 22px) 52%, calc(100% - 17px) 52%, 0 0; background-size: 5px 5px, 5px 5px, 100% 100%; background-repeat: no-repeat; }

.toolbar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; padding: 4px; }
.toolbar .field { flex: 1 1 260px; }
.toolbar select.field { flex: 0 0 240px; }
.count { color: var(--ink-3); font-size: .9rem; }

/* item card (rim_card): dark well on top, silver label below, gold rim */
.items { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); padding: 4px; }
.item {
  display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; color: var(--sv-ink);
  background: linear-gradient(170deg, var(--sv-hi), var(--sv-lo));
  box-shadow: var(--rim); padding: 7px; gap: 0;
  transition: transform .1s, box-shadow .1s;
}
.item:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 0 0 2px var(--gold-hi), 0 0 0 4px var(--key), 0 10px 22px rgba(0, 0, 0, .4), 0 0 18px rgba(242, 198, 64, .35); }
.item .thumb { aspect-ratio: 1; }
.item .tier-bar { height: 4px; border-radius: 2px; margin: 6px 2px 0; background: var(--rc, transparent); }
.item .meta { padding: 8px 6px 4px; display: flex; flex-direction: column; gap: 3px; }
.item .name { font: 700 1rem/1.15 var(--head); color: var(--sv-ink); }
.item .sub { font: 700 .7rem var(--head); color: var(--sv-ink-3); text-transform: uppercase; letter-spacing: .1em; }
.price { display: inline-flex; align-items: center; gap: 5px; font: 700 1rem var(--head); color: #8a6512; }
.price img { width: 18px; height: 18px; }
.price.na { font-weight: 700; }

.pager { display: flex; gap: 10px; justify-content: center; margin: 32px 0 8px; flex-wrap: wrap; padding: 4px; }
.pager button {
  min-width: 42px; padding: 8px 12px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--slate); color: #fff; font: 700 .9rem var(--head);
  box-shadow: 0 0 0 1.5px var(--gold), 0 0 0 3px var(--key);
}
.pager button.on { background: var(--lilac); color: #2a1838; }
.pager button:disabled { opacity: .45; cursor: default; }

.empty { padding: 60px 20px; text-align: center; color: var(--ink-3); }

/* item detail */
.item-page { display: grid; grid-template-columns: 1fr 1.1fr; gap: 36px; align-items: start; margin: 8px 0 32px; }
@media (max-width: 860px) { .item-page { grid-template-columns: 1fr; } }
.item-page .big { aspect-ratio: 1; }
.item-page .big-frame { padding: 10px; }
.stats { width: 100%; border-collapse: collapse; margin: 16px 0 20px; }
.stats th, .stats td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--sv-line); }
.stats tr:last-child th, .stats tr:last-child td { border-bottom: 0; }
.stats th { color: var(--sv-ink-3); font: 700 .82rem var(--head); letter-spacing: .08em; text-transform: uppercase; width: 44%; }
.stats td { font-weight: 800; color: var(--sv-ink); }
.crumbs { font-size: .9rem; color: var(--ink-3); margin: 28px 0 18px; }
.crumbs a { color: var(--ink-2); }
.neighbours { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 22px; padding: 4px; }
.note {
  border-left: 4px solid var(--gold); background: rgba(242, 198, 64, .12); padding: 12px 16px; border-radius: 0 10px 10px 0;
  color: var(--sv-ink-2); font-size: .92rem; margin: 16px 0 0;
}

/* guide */
.toc { display: flex; flex-direction: column; gap: 4px; }
.toc a { color: var(--sv-ink-2); padding: 7px 12px; border-radius: 999px; font-weight: 700; }
.toc a:hover { background: rgba(0, 0, 0, .06); text-decoration: none; color: var(--sv-ink); }
.prose h2 { margin-top: 1.4em; scroll-margin-top: 92px; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; color: var(--ink-2); }
.prose .panel li { color: var(--sv-ink-2); }
.tier-table { width: 100%; border-collapse: collapse; }
.tier-table th, .tier-table td { padding: 10px 12px; border-bottom: 1px solid var(--sv-line); text-align: left; }
.tier-table tr:last-child td { border-bottom: 0; }
.tier-table th { font: 700 .82rem var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--sv-ink-3); }
.tier { font: 700 .95rem var(--head); padding: 2px 10px; border-radius: 999px; color: #1e142e; box-shadow: 0 0 0 1px var(--key); display: inline-block; margin: 2px 0; }
.render-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 14px 0 20px; }
.render-row a { display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); font: 700 .85rem var(--head); text-align: center; }
.render-row .well { aspect-ratio: 1; }

/* small screens: two cards per row, filter tabs scroll sideways */
@media (max-width: 900px) {
  .items { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
  .side .chips { flex-wrap: nowrap; overflow-x: auto; padding: 4px 4px 8px; scrollbar-width: thin; }
  .side .chip { flex: 0 0 auto; }
  .toolbar select.field { flex: 1 1 100%; }
}
@media (max-width: 760px) {
  .cta-row { grid-template-columns: 1fr !important; text-align: center; justify-items: center; }
  .render-row { gap: 8px; }
}
.prose > .note, .wiki-head .note { color: var(--ink-2); }
a.panel:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--gold-hi), 0 0 0 4px var(--key), 0 10px 22px rgba(0, 0, 0, .4), 0 0 18px rgba(242, 198, 64, .35); }
a.panel h3 { color: var(--sv-ink); }

/* ---------- wiki hub ---------- */
.hub-hero { padding: 44px 0 12px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .hub-hero { grid-template-columns: 1fr; gap: 20px; } }
.hub-hero .lead { font-size: 1.12rem; max-width: 32em; }
.hub-search { display: flex; gap: 12px; margin: 22px 0 14px; padding: 4px; flex-wrap: wrap; }
.hub-search .field { flex: 1 1 240px; font-size: 1.05rem; padding: 14px 22px; }
.stat-strip { display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--ink-3); font-size: .92rem; }
.stat-strip b { color: var(--ink); font: 700 1.15rem var(--head); margin-right: 4px; }
.hub-hero .showcase { aspect-ratio: 16 / 11; }

.hub-sec { margin: 44px 0 0; }
.hub-sec > h2 { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.hub-sec > h2 small { font: 600 .95rem var(--body); color: var(--ink-3); }

.start-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); padding: 4px; }
.start { display: grid; grid-template-columns: 64px 1fr; gap: 6px 16px; align-items: center; padding: 20px 22px; }
.start img { width: 64px; height: 64px; grid-row: span 2; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25)); }
.start h3 { margin: 0; align-self: end; }
.start p { margin: 0; font-size: .95rem; align-self: start; }

.topic-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); padding: 4px; }
.topic { padding: 8px; display: flex; flex-direction: column; }
.topic .well { aspect-ratio: 4 / 3; }
.topic .well > img { padding: 4%; }
.topic .t-body { padding: 10px 8px 4px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.topic h3 { margin: 0; font-size: 1.2rem; }
.topic .n { font: 700 .9rem var(--head); color: var(--sv-ink-3); }

.tier-strip { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 4px; }
.tier-card { padding: 8px; text-align: center; }
.tier-card .well { aspect-ratio: 1; box-shadow: inset 0 0 0 2px var(--key), inset 0 -40px 50px -30px var(--tc), inset 0 6px 16px rgba(0, 0, 0, .45); }
.tier-card .tier { margin-top: 10px; background: var(--tc); }
.tier-card .n { display: block; font: 600 .82rem var(--body); color: var(--sv-ink-3); margin-top: 4px; }
.tier-card .pool { display: block; font: 700 .68rem var(--head); letter-spacing: .12em; text-transform: uppercase; color: var(--sv-ink-3); }

.hub-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .hub-cols { grid-template-columns: 1fr; } }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: grid; grid-template-columns: 28px 52px 1fr auto; gap: 12px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--sv-line); }
.rank-list li:last-child { border-bottom: 0; }
.rank-list .r { font: 700 1.1rem var(--head); color: var(--gold-d); text-align: center; }
.rank-list .well { width: 52px; height: 52px; border-radius: 8px; }
.rank-list .well > img { padding: 3px; }
.rank-list .nm { font: 700 1rem/1.2 var(--head); color: var(--sv-ink); }
.rank-list .nm small { display: block; font: 600 .8rem var(--body); color: var(--sv-ink-3); }
.rank-list .v { font: 700 .95rem var(--head); color: #2f8f6f; text-align: right; }

.upd { padding: 12px 0; border-bottom: 1px solid var(--sv-line); }
.upd:last-child { border-bottom: 0; }
.upd time { font: 700 .75rem var(--head); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-d); }
.upd h4 { margin: 2px 0 4px; font-size: 1.08rem; color: var(--sv-ink); }
.upd ul { margin: 0; padding-left: 1.1em; }
.upd li { font-size: .93rem; color: var(--sv-ink-2); }

/* ---------- item page extras ---------- */
.item-left, .item-right { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.how h3, .item-right h3 { margin-bottom: 6px; }
.how p { margin: 0; }
.notes { margin: 0; padding-left: 1.1em; }
.notes li { margin-bottom: .4em; }
.hint { font: 600 .82rem var(--body); color: var(--sv-ink-3); margin-left: 4px; }
.q { display: inline-block; font: 700 .72rem var(--head); letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; box-shadow: 0 0 0 1px var(--key); }
.q-top { background: var(--gold); color: #2a1d05; }
.q-good { background: var(--mint); color: #12251f; }
.q-mid { background: var(--sv-line); color: var(--sv-ink); }
.q-low { background: #e9b4b4; color: #4a1515; }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 4px; }
.pn { display: flex; flex-direction: column; padding: 10px 14px; border-radius: 12px; background: var(--pn-bg); box-shadow: 0 0 0 1.5px var(--gold), 0 0 0 3px var(--key); color: var(--ink-2); min-width: 0; }
.pn:hover { text-decoration: none; filter: brightness(1.15); }
.pn span { font: 700 .72rem var(--head); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.pn b { font: 700 1rem var(--head); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn.next { text-align: right; }
.pn.off { visibility: hidden; }
h2 .h-sub, h2 small { font: 600 .95rem var(--body); color: var(--ink-3); margin-left: 10px; }
.neighbours.stage { grid-template-columns: repeat(auto-fill, minmax(200px, 240px)); margin-bottom: 36px; }

/* ---------- updates timeline ---------- */
.timeline { position: relative; display: flex; flex-direction: column; gap: 26px; margin: 12px 0 24px; padding-left: 150px; }
.timeline::before { content: ""; position: absolute; left: 128px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: linear-gradient(var(--gold), rgba(242, 198, 64, .15)); }
.tl-entry { position: relative; }
.tl-entry time { position: absolute; left: -150px; top: 20px; width: 112px; text-align: right; font: 700 .85rem var(--head); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.tl-entry::before { content: ""; position: absolute; left: -28px; top: 22px; width: 13px; height: 13px; border-radius: 50%; background: var(--slate); box-shadow: 0 0 0 2px var(--gold), 0 0 0 4px var(--key); }
.tl-entry.latest::before { background: var(--mint); }
.tl-entry .panel { padding: 18px 22px; }
.tl-entry h3 { margin-bottom: 8px; }
.tl-entry ul { margin: 0; padding-left: 1.1em; }
.tl-entry li { margin-bottom: .3em; }
@media (max-width: 700px) {
  .timeline { padding-left: 22px; }
  .timeline::before { left: 4px; }
  .tl-entry time { position: static; display: block; text-align: left; width: auto; margin-bottom: 6px; }
  .tl-entry::before { left: -24px; top: 4px; }
}

/* ---------- mechanics ---------- */
.prose .panel.tbl { padding: 6px 14px; margin: 10px 0 18px; }
.prose .panel.tbl td { color: var(--sv-ink-2); }
.prose .panel.tbl td b { color: var(--sv-ink); }
.formula { font: 700 1.25rem var(--head); text-align: center; padding: 16px; margin: 6px 0 16px; letter-spacing: .02em; }
.suffix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 4px 10px; padding: 8px 0; }
.suffix-grid div { display: flex; justify-content: space-between; gap: 6px; padding: 4px 6px; border-bottom: 1px solid var(--sv-line); font-size: .9rem; }
.suffix-grid b { font-family: var(--head); color: var(--sv-ink); }
.suffix-grid span { color: var(--sv-ink-3); }

/* phone fixes for the item page */
@media (max-width: 860px) {
  .item-page { grid-template-columns: minmax(0, 1fr); }
  .neighbours.stage { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (max-width: 560px) {
  .stats th { width: auto; padding: 8px 6px; font-size: .74rem; }
  .stats td { padding: 8px 6px; }
  .q { margin: 4px 0 0; }
  .stats .hint { display: block; margin: 2px 0 0; }
  .neighbours { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 860px) {
  .item-page { gap: 22px; }
  .item-left { display: contents; }
  .item-left .big-frame { order: 1; }
  .item-right { order: 2; }
  .item-left .how { order: 3; }
  .item-left .prevnext { order: 4; }
}

/* ================= themes =================
   Dark (default): deep night purple with silver titles and gold accents.
   Light: the game's lilac, silver header/footer, gold rims. Toggle in the header (js/common.js);
   the choice is kept in localStorage "kaisa-theme" and applied in each page's <head>. */
:root, [data-theme="dark"] {
  --bg: #12111b;
  --bg-2: #1a1926;
  --ink: #f6f4fb;
  --ink-2: #cbc6dc;
  --ink-3: #9893ae;
  --link: var(--mint);
  --head-bg: linear-gradient(#262439, #18172a);
  --menu-bg: #1c1b2b;
  --foot-bg: linear-gradient(#17161f, #0f0e16);
  --banner-a: #2a2840; --banner-b: #201e33;
  --pn-bg: linear-gradient(#2a2840, #1c1b2b);
  --title: linear-gradient(180deg, #ffffff 0%, #e6eaf0 45%, #aab3bf 100%);
  --page-glow: radial-gradient(1100px 520px at 80% -8%, rgba(192, 160, 204, .16), transparent 60%),
    radial-gradient(900px 480px at -8% 12%, rgba(131, 248, 216, .08), transparent 60%),
    radial-gradient(700px 420px at 50% 110%, rgba(242, 198, 64, .07), transparent 60%);
  --nav-ink: #d6dbe3;
  --strong-ink: var(--gold-hi);
  --toggle-bg: linear-gradient(#f4f7fa, #c9d0d9 70%, #aeb6c1);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #d5c2df;
  --bg-2: #c9b2d5;
  --ink: #241433;
  --ink-2: #44305a;
  --ink-3: #6a5584;
  --link: #5a2f86;
  --head-bg: linear-gradient(#fbfcfd, #dfe4ea 55%, #c3cad4);
  --menu-bg: linear-gradient(#f4f7fa, #d4dae2);
  --foot-bg: linear-gradient(#e9edf1, #c3cad4);
  --banner-a: #3b2952; --banner-b: #33234a;
  --pn-bg: linear-gradient(#f4f7fa, #c9d0d9);
  --title: linear-gradient(180deg, #3a1f57 0%, #2a1838 55%, #5b3a84 100%);
  --page-glow: radial-gradient(1100px 560px at 80% -8%, rgba(255, 255, 255, .55), transparent 60%),
    radial-gradient(900px 520px at -8% 14%, rgba(242, 198, 64, .22), transparent 60%),
    radial-gradient(900px 520px at 100% 70%, rgba(141, 104, 175, .28), transparent 60%);
  --nav-ink: #3a2a52;
  --strong-ink: #241433;
  --toggle-bg: linear-gradient(#ffe48a, var(--gold) 60%, #dcae2c);
  color-scheme: light;
}
body { background-color: var(--bg); background-image: var(--page-glow); transition: background-color .25s, color .25s; }

/* silver page titles (outside panels) */
h1, h2 { background: var(--title); -webkit-background-clip: text; background-clip: text; color: transparent; }
.panel h1, .panel h2, .panel h3 { background: none; color: var(--sv-ink); -webkit-background-clip: border-box; background-clip: border-box; }
h2 small, h2 .h-sub { -webkit-text-fill-color: currentColor; }

/* nav: silver links, gold rule under the bar */
.nav a { color: var(--nav-ink); }
.site-head { box-shadow: 0 2px 0 var(--gold), 0 3px 0 var(--gold-d), 0 5px 0 var(--key), 0 8px 20px rgba(0, 0, 0, .3); }
.site-foot { box-shadow: 0 -2px 0 var(--gold), 0 -3px 0 var(--gold-d), 0 -5px 0 var(--key); }
.stat-strip b { color: var(--strong-ink); }
.eyebrow { background: linear-gradient(90deg, var(--gold-hi), var(--gold) 45%, var(--gold-d)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.panel .eyebrow { background: none; color: var(--gold-d); }
.showcase .cap { color: #9590ab; }

/* gold-and-silver divider under section headings */
.hub-sec > h2, .wiki-head h1 { position: relative; padding-bottom: 10px; }
.hub-sec > h2::after, .wiki-head h1::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 72px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-hi), var(--gold) 50%, #dfe4ea);
}

/* theme toggle (silver coin in dark, gold coin in light) */
.theme-btn {
  width: 38px; height: 38px; flex: none; border: 0; border-radius: 50%; cursor: pointer; padding: 0;
  display: inline-grid; place-items: center; color: var(--sv-ink); background: var(--toggle-bg);
  box-shadow: 0 0 0 2px var(--gold), 0 0 0 4px var(--key), inset 0 -3px 0 rgba(0, 0, 0, .15), 0 4px 10px rgba(0, 0, 0, .25);
  transition: transform .08s, filter .08s;
}
.theme-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.theme-btn svg { width: 20px; height: 20px; }
.theme-btn .i-sun { display: none; }
[data-theme="light"] .theme-btn .i-sun { display: block; }
[data-theme="light"] .theme-btn .i-moon { display: none; }
@media (max-width: 760px) { .theme-btn { margin-left: 4px; } }

/* light-mode touch-ups */
[data-theme="light"] .nav a:hover { background: rgba(42, 24, 56, .08); color: #241433; }
[data-theme="light"] .crumbs a { color: var(--ink-2); font-weight: 700; }
[data-theme="light"] .pn b { color: var(--sv-ink); }
[data-theme="light"] .pn span { color: var(--gold-d); }
[data-theme="light"] .note { background: rgba(242, 198, 64, .28); }
[data-theme="light"] .item:hover, [data-theme="light"] a.panel:hover { box-shadow: 0 0 0 2px var(--gold-hi), 0 0 0 4px var(--key), 0 10px 22px rgba(42, 24, 56, .3), 0 0 18px rgba(242, 198, 64, .5); }
[data-theme="light"] .panel { box-shadow: 0 0 0 2px var(--gold), 0 0 0 4px var(--key), 0 6px 18px rgba(42, 24, 56, .22), 0 0 14px rgba(242, 198, 64, .25); }
[data-theme="light"] .brand img, [data-theme="light"] .site-foot img { filter: drop-shadow(0 0 .6px #2a1838) drop-shadow(0 0 .6px #2a1838) drop-shadow(0 1px 1px rgba(42, 24, 56, .5)); }
[data-theme="light"] .eyebrow:not(.panel .eyebrow) {
  background: linear-gradient(#ffe48a, var(--gold) 60%, #dcae2c); -webkit-background-clip: border-box; background-clip: border-box;
  color: #2a1d05; padding: 5px 10px 4px; border-radius: 999px; box-shadow: 0 0 0 1.5px var(--key);
}

/* two-tone page backgrounds: mint fading into pink-purple (light), deep teal into night purple (dark) */
:root, [data-theme="dark"] {
  --page-tone: linear-gradient(160deg, #0f3036 0%, #15192b 45%, #2a1638 100%);
}
[data-theme="light"] {
  --page-tone: linear-gradient(160deg, #b9f3e3 0%, #cfe3e6 30%, #d9bfe0 65%, #d9a6d3 100%);
}
body {
  background-image:
    radial-gradient(900px 480px at 85% -5%, rgba(255, 255, 255, .10), transparent 60%),
    radial-gradient(800px 460px at 50% 105%, rgba(242, 198, 64, .08), transparent 60%),
    var(--page-tone);
  background-attachment: fixed;
}
[data-theme="light"] body {
  background-image:
    radial-gradient(900px 480px at 85% -5%, rgba(255, 255, 255, .45), transparent 60%),
    radial-gradient(800px 460px at 50% 105%, rgba(242, 198, 64, .16), transparent 60%),
    var(--page-tone);
}

/* in-game screenshots (aetherfall.html) */
.shots { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 20px; }
.shot { margin: 0; padding: 10px; }
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; box-shadow: inset 0 0 0 2px var(--key); }
.shot figcaption { font: 600 .9rem var(--body); color: var(--sv-ink-2); padding: 8px 4px 2px; }
.shot.big { grid-column: 1 / -1; }
.shot.big img { aspect-ratio: 16 / 8; }
@media (max-width: 760px) { .shots { grid-template-columns: minmax(0, 1fr); } .shot.big img { aspect-ratio: 16 / 10; } }

/* ---------- links page (links.html, the link-in-bio hub) ---------- */
.links-page {
  position: relative; width: min(480px, 100% - 32px); margin-inline: auto;
  padding: max(28px, env(safe-area-inset-top)) 0 max(28px, env(safe-area-inset-bottom));
}
.links-page .theme-btn { position: absolute; right: 0; top: max(20px, env(safe-area-inset-top)); }
.links-head { text-align: center; padding: 44px 0 20px; }
.links-head h1 { margin: 0 0 12px; background: none; }
.links-head h1 img { width: min(340px, 86%); height: auto; margin-inline: auto; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .4)); }
[data-theme="light"] .links-head h1 img { filter: drop-shadow(0 0 .6px #2a1838) drop-shadow(0 0 .6px #2a1838) drop-shadow(0 1px 1px rgba(42, 24, 56, .5)); }
.links-head p { margin: 0 auto; max-width: 26em; font-size: 1.02rem; }
.links-head p b { color: var(--strong-ink); }

.links-feature { display: block; aspect-ratio: 16 / 9; border-radius: var(--radius); box-shadow: var(--rim); margin-bottom: 18px; transition: transform .08s, filter .08s; }
.links-feature:hover { filter: brightness(1.06); transform: translateY(-1px); text-decoration: none; }
.links-feature > img { width: 100%; height: 100%; object-fit: cover; padding: 0; }
.links-feature .pill { position: absolute; left: 12px; top: 12px; }
.links-feature-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 16px 12px; color: #e6e1f2;
  font: 600 .95rem var(--body); background: linear-gradient(transparent, rgba(18, 12, 30, .88));
  display: flex; align-items: baseline; gap: 10px;
}
.links-feature-cap b { font: 700 1.5rem var(--head); letter-spacing: .02em; color: #fff; }

.links-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.link-row {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 9px 14px 11px 10px;
  border-radius: 16px; color: var(--sv-ink); background: linear-gradient(#f4f7fa, #c9d0d9 70%, #aeb6c1);
  box-shadow: 0 0 0 2px var(--gold), 0 0 0 4px var(--key), inset 0 -4px 0 rgba(0, 0, 0, .16), 0 6px 14px rgba(0, 0, 0, .3);
  transition: transform .08s, filter .08s;
}
.link-row::before { content: ""; position: absolute; left: 14px; right: 14px; top: 4px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .55); pointer-events: none; }
a.link-row:hover { text-decoration: none; filter: brightness(1.05); transform: translateY(-1px); }
a.link-row:active { transform: translateY(2px); filter: brightness(.95); }
a.link-row:focus-visible, .links-feature:focus-visible { outline: 3px solid var(--mint); outline-offset: 5px; }
.link-mint { background: linear-gradient(#9dffe4, var(--mint) 60%, #6be6c4); color: #12251f; }
.link-lilac { background: linear-gradient(#d9bfe2, var(--lilac) 60%, #a988b8); color: #2a1838; }
.link-gold { background: linear-gradient(#ffe48a, var(--gold) 60%, #dcae2c); color: #2a1d05; }
.l-ico {
  flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--mint);
  background: radial-gradient(120% 90% at 50% 30%, var(--well-2), var(--well)); box-shadow: inset 0 0 0 2px var(--key), inset 0 4px 8px rgba(0, 0, 0, .45);
}
.l-ico svg { width: 24px; height: 24px; }
.link-gold .l-ico { color: var(--gold-hi); }
.link-lilac .l-ico { color: #e3c8ee; }
.l-text { flex: 1; min-width: 0; display: grid; }
.l-text b { font: 700 1.15rem/1.15 var(--head); letter-spacing: .05em; text-transform: uppercase; }
.l-text small { font: 600 .84rem/1.3 var(--body); opacity: .78; }
.link-row .go { flex: none; width: 20px; height: 20px; opacity: .55; }
.link-row.is-soon { filter: saturate(.45); opacity: .72; box-shadow: 0 0 0 2px var(--slate), 0 0 0 4px var(--key), inset 0 -4px 0 rgba(0, 0, 0, .16); }
.l-soon { flex: none; font: 700 .72rem/1 var(--head); letter-spacing: .12em; text-transform: uppercase; padding: 6px 9px 5px; border-radius: 999px; background: var(--key); color: var(--gold-hi); }
.links-foot { text-align: center; color: var(--ink-3); font-size: .8rem; margin-top: 28px; display: grid; gap: 6px; }
.links-foot a { font: 700 .95rem var(--body); }
@media (prefers-reduced-motion: reduce) { .link-row, .links-feature { transition: none; } }

/* home cards: a real picture filling the well, and the merge "a + a = b" graphic */
.card-shot { display: block; aspect-ratio: 16 / 10; }
.card-shot > img { width: 100%; height: 100%; object-fit: cover; padding: 0; display: block; }
.card-shot .cap, .merge-art .cap {
  position: absolute; left: 10px; bottom: 9px; padding: 3px 9px; border-radius: 999px;
  background: rgba(14, 10, 24, .72); color: #e9e4f5; font: 600 .72rem var(--head); letter-spacing: .1em; text-transform: uppercase;
}
a.card-shot > img { transition: transform .25s ease; }
a.card-shot:hover > img { transform: scale(1.03); }
.merge-art { aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; gap: 2%; padding: 0 4%; }
.merge-art > img { width: 22%; height: auto; padding: 0; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .45)); }
.merge-art > img.big { width: 36%; }
.merge-art > b { font: 700 clamp(1.4rem, 4vw, 2.2rem) var(--head); color: var(--gold); }
.shot video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; display: block; background: #0e0a18; }
.shot img, .shot.big img { aspect-ratio: 16 / 9; height: auto; }
.shot video { height: auto; }
.photo-trio { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; aspect-ratio: 3 / 2; }
.photo-trio img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
.photo-trio img:first-child { grid-row: 1 / 3; }
