/* ============================================================
   Realms of Elynia — pelin ulkoasu (V1).
   Kanoniset tokenit tulevat tokens.css:stä (--sand, --parchment,
   --night, --bronze, --gold, ...). Ei ulkoisia fontteja/CDN:iä:
   'Cinzel' putoaa Georgiaan kunnes self-host myohemmassa vaiheessa.
   ============================================================ */

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--sand);
  color: var(--ink);
  font: 16px/1.45 var(--font-body);
  min-height: 100vh;
}

img { max-width: 100%; }

a { color: var(--bronze); }
a:hover { color: var(--bronze-deep); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.icon-sm { width: 18px; height: 18px; }
.icon-xs { width: 13px; height: 13px; }

/* ---------------------------------------------------------- boot */

#app.loading {
  display: grid;
  place-items: center;
  min-height: 100vh;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------- header */

.hdr {
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow);
}

/* rivi 1 — night command band */
.hdr-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: var(--night);
  border-bottom: 2px solid var(--bronze);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: .26em;
  color: var(--gold);
  margin-right: auto;
  white-space: nowrap;
}

.player-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 3px 14px 3px 5px;
  border: 1px solid var(--bronze);
  border-radius: 999px;
  background: rgba(201, 162, 75, .10);
}

.player-chip .pname {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .06em;
  color: var(--night-text);
}

.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--bronze);
  border-radius: var(--radius);
  cursor: pointer;
}
.iconbtn:hover { background: rgba(201, 162, 75, .14); }
/* Musiikki mykistetty: himmennetty ikoni + diagonaalinen viiva (yliviivaus). */
.iconbtn.muted { opacity: .45; position: relative; }
.iconbtn.muted::after {
  content: ""; position: absolute; left: 4px; right: 4px; top: 50%;
  height: 2px; background: var(--gold); transform: rotate(-45deg); border-radius: 2px;
}

/* rivi 2 — parchment stat strip */
.hdr-strip {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 9px 16px;
  background: var(--parchment);
  border-bottom: 1px solid var(--line);
}

.stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  font-variant: small-caps;
  letter-spacing: .03em;
  white-space: nowrap;
}

.stat .sub, .sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------- bars & pips */

.bar {
  position: relative;
  height: 18px;
  flex: 1 1 140px;
  min-width: 140px;
  max-width: 240px;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.bar .fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  transition: width .4s;
}

.bar .lbl {
  position: relative;
  display: block;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: .03em;
}

.bar.hp .fill { background: var(--crimson); }
/* HP-label on vaaleaa tekstiä keskitettynä koko palkin päälle. Kun HP laskee,
   crimson-täyttö kutistuu vasemmalle ja keskikohta paljastaa vaalean radan
   (--parchment-deep) → vaalea teksti jäisi lukukelvottomaksi. Tumma ääriviiva
   (text-shadow) pitää labelin luettavana sekä täytöllä ETTÄ paljaalla radalla. */
.bar.hp .lbl {
  color: var(--parchment);
  text-shadow: 0 0 2px rgba(20, 14, 8, .95), 0 1px 2px rgba(20, 14, 8, .85);
}
.bar.xp .fill { background: var(--gold); }
.bar.xp .lbl { color: var(--ink); }
.bar.pe .fill { background: var(--gl-blue, #2E5A7A); }
.bar.pe .lbl { color: var(--parchment); text-shadow: 0 0 2px rgba(20, 14, 8, .95), 0 1px 2px rgba(20, 14, 8, .85); }

.pips { display: inline-flex; gap: 3px; }

.pip {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
}
.pip.on { background: var(--laurel); border-color: var(--laurel); }

.pips-lg .pip { width: 11px; height: 11px; }

.countdown {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}

.mini-bar {
  position: relative;
  display: inline-block;
  width: 64px;
  height: 10px;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  vertical-align: middle;
}
.mini-bar .fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--gl-blue, #2E5A7A);
}
.mini-bar-wide { width: 110px; }

/* ---------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .08em;
  color: #F7F2E4;
  background: linear-gradient(180deg, #A47E3C, #7E5F29);
  border: 1px solid #5F4720;
  border-radius: var(--radius);
  cursor: pointer;
}
.btn:hover { background: linear-gradient(180deg, #B08A44, var(--bronze)); }
.btn:disabled {
  color: var(--ink-soft);
  background: var(--parchment-deep);
  border-color: var(--line);
  cursor: not-allowed;
}

.btn-block { width: 100%; }

.btn-ghost {
  color: var(--ink);
  background: var(--parchment);
  border: 1px solid var(--bronze);
}
.btn-ghost:hover { background: var(--parchment-deep); }

.plusbtn {
  width: 44px;
  height: 44px;
  flex: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  color: #F7F2E4;
  background: linear-gradient(180deg, #A47E3C, #7E5F29);
  border: 1px solid #5F4720;
  border-radius: var(--radius);
  cursor: pointer;
}
.plusbtn:hover { background: linear-gradient(180deg, #B08A44, var(--bronze)); }
.plusbtn:disabled {
  color: var(--ink-soft);
  background: var(--parchment-deep);
  border-color: var(--line);
  cursor: not-allowed;
}

/* ---------------------------------------------------------- view shell */

.view {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px;
}

.panel {
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.panel h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 3px double var(--line);
}

.error-panel { max-width: 460px; margin: 40px auto; text-align: center; }
.error-panel p { color: var(--crimson); margin: 0 0 14px; }

/* skeletonit */
.skel-stack { display: grid; gap: var(--gap); max-width: 720px; margin: 0 auto; }
.skel {
  background: var(--parchment-deep);
  border-radius: var(--radius);
  animation: skel-pulse 1.2s ease-in-out infinite alternate;
}
@keyframes skel-pulse {
  from { opacity: .55; }
  to { opacity: .95; }
}

/* ---------------------------------------------------------- toasts */

#toasts {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}

.toast {
  padding: 10px 14px;
  background: var(--parchment);
  border: 1px solid var(--line);
  border-left: 4px solid var(--bronze);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 14px;
}
.toast.success { border-left-color: var(--laurel); }
.toast.error { border-left-color: var(--crimson); }

/* ---------------------------------------------------------- auth landing (hero) */

/* body.auth-page (route() togglaa view.public-lipusta): header piiloon ja
   shell täysleveäksi, jotta .auth-hero täyttää koko viewportin. */
body.auth-page .hdr { display: none; }
body.auth-page .shell { max-width: none; margin: 0; }
body.auth-page .view { max-width: none; padding: 0; }

/* Hero-kuori: täysleveä taustakuva (login.jpg) + gradient-fallback + scrim.
   Sama additiivinen kuvakaava kuin scene-taustoissa (onerror poistaa imgn). */
.auth-hero {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background: linear-gradient(160deg, #241C12 0%, #3A2E1D 45%, #6E521F 130%);
}
.auth-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.auth-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(20, 14, 8, .84) 0%, rgba(20, 14, 8, .48) 38%, rgba(20, 14, 8, .12) 62%, rgba(20, 14, 8, .40) 100%),
    linear-gradient(180deg, rgba(20, 14, 8, .30) 0%, rgba(20, 14, 8, 0) 30%, rgba(20, 14, 8, .55) 100%);
}
.auth-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 48px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 44px;
}

/* Pitch-sarake: wordmark, tagline, myyntipointit, CTA, medaljongit, top-3. */
.auth-pitch {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  color: var(--night-text);
}
.auth-kicker {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--gold);
}
.auth-wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 54px;
  line-height: 1.04;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--parchment);
  text-shadow: 0 2px 22px rgba(0, 0, 0, .65);
}
.auth-wordmark-sm { font-size: 34px; }
.auth-tagline {
  margin: 0;
  font-size: 17px;
  color: #D9CBA8;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .6);
}
.auth-features {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.auth-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15.5px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}
.auth-cta {
  min-height: 52px;
  padding: 14px 28px;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(201, 162, 75, .35), 0 2px 8px rgba(0, 0, 0, .5);
}
.auth-medallions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.auth-med {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bronze);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .55);
}
.auth-legends {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #C9BCA0;
}
.auth-legends b { color: var(--gold); }
.auth-legend-sep { opacity: .6; }

/* Lasimainen night-lomakepaneeli (sama kieli kuin pelin map-panelit). */
.auth-panel-dark {
  flex: none;
  width: 360px;
  padding: 26px 26px 22px;
  background: rgba(22, 15, 8, .80);
  border: 1px solid rgba(201, 162, 75, .38);
  border-radius: 12px;
  box-shadow: 0 12px 44px rgba(0, 0, 0, .55);
  backdrop-filter: blur(3px);
  color: var(--night-text);
}
.auth-panel-dark.auth-panel-wide { width: min(660px, 100%); }
.auth-panel-dark h2 {
  margin: 0 0 18px;
  padding-bottom: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid var(--night-line);
}
.auth-panel-dark .field label { color: var(--night-text); }
.auth-panel-dark .field .optional { color: #B8A98C; }
.auth-panel-dark .field input {
  background: rgba(58, 46, 29, .65);
  border-color: var(--night-line);
  color: var(--night-text);
}
.auth-panel-dark .field input:focus { outline: none; border-color: var(--gold); }
.auth-panel-dark .field input.invalid { border-color: #F08A7A; }
.auth-panel-dark .hint { color: #B8A98C; }
.auth-panel-dark .ferr { color: #F08A7A; }

.auth-alt {
  margin: 16px 0 0;
  font-size: 14px;
  color: #C9BCA0;
}
.auth-alt a { color: var(--gold); }

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 4px;
}

.field .optional {
  font-weight: 400;
  color: var(--ink-soft);
}

.field input {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  font: 16px var(--font-body);
  color: var(--ink);
  background: #FBF7EC;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.field input.invalid { border-color: var(--crimson); }

.hint {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.ferr {
  margin: 5px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--crimson);
}

/* Rekisteröinnin valitsimet night-paneelissa. */
.pickset {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

.pickset legend {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 0;
  margin-bottom: 8px;
  color: var(--gold);
}

/* muotokuvamedaljongit (g-fallback-teksti alla, taide .portrait-img päällä) */
.portraits {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.medallion {
  width: 100%;
  max-width: 72px;
  aspect-ratio: 1;
  min-height: 44px;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--night-soft), var(--night) 78%);
  border: 2px solid var(--bronze);
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: box-shadow .14s ease, border-color .14s ease;
}
.medallion:hover { border-color: var(--gold); }
.medallion[aria-pressed="true"] {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold), 0 0 16px rgba(201, 162, 75, .5);
}

/* tyylikortit */
.stylecards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stylecard {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 44px;
  padding: 12px;
  font: inherit;
  color: var(--night-text);
  text-align: left;
  background: rgba(58, 46, 29, .5);
  border: 2px solid var(--night-line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.stylecard:hover { border-color: var(--bronze); }
.stylecard[aria-pressed="true"] {
  border-color: var(--gold);
  background: rgba(201, 162, 75, .13);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.scname {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .06em;
  color: var(--gold);
}

.scblurb {
  font-size: 12.5px;
  color: #C9BCA0;
}

/* ---------------------------------------------------------- immersive cards (shared) */

/* Yleiskäyttöinen kortti-/pino-järjestelmä KAIKILLE immersiivisille näkymille
   (Overview, ja tästä eteenpäin loput ~12). Pino (.imm-stack) on flex-column
   .imm-scenen reunassa: ensimmäinen kortti saa luontaisen kokonsa,
   .imm-card-fill täyttää lopun ja vierittää sisäisesti jos sisältö ei mahdu —
   TÄMÄ estää korttien menemisen päällekkäin kun sisällön pituus vaihtelee
   (esim. Overviewin Attributes freePoints > 0 -tilassa). Yksi näkymä voi
   käyttää 1-4 pinoa (imm-stack-tl/tr/bl/br) riippuen tarpeesta. */
.imm-stack {
  position: absolute;
  z-index: 3;
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.imm-stack-left { left: 16px; top: 16px; bottom: 16px; }
.imm-stack-right { right: 16px; top: 16px; bottom: 16px; }
.imm-stack-tl { left: 16px; top: 16px; }
.imm-stack-tr { right: 16px; top: 16px; }
.imm-stack-bl { left: 16px; bottom: 16px; }
.imm-stack-center { top: 16px; bottom: 16px; left: 50%; transform: translateX(-50%); }
/* Leveämmät kortit sisällölle joka ei mahdu 300px-sarakkeeseen (taulukot,
   suodattimet, isot ruudukot) — käytä .imm-stackin width-oletuksen sijaan. */
.imm-stack-wide { width: 460px; }
.imm-stack-xwide { width: 640px; }
/* Kaksi vierekkäistä pinoa: .imm-scene on kapeampi kuin koko viewport (kaksi
   190px-sivupalkkia syövät tilaa, jää usein alle 1000px), joten kiinteät
   leveydet (esim. xwide+wide) menevät helposti päällekkäin kapeammilla
   työpöytäleveyksillä. Nämä varianit jakavat tilan aina turvallisesti
   puoliksi + 16px väli — käytä TÄTÄ kahden pinon layouteissa .imm-stack-
   left/right+wide/xwide-yhdistelmän sijaan. */
.imm-stack-half-left { left: 16px; right: calc(50% + 8px); width: auto; }
.imm-stack-half-right { left: calc(50% + 8px); right: 16px; width: auto; }
.imm-stack-br { right: 16px; bottom: 16px; }
/* Lähes koko scenen leveyden täyttävä yksittäinen pino — ruudukko-/taulukkosivuille
   (Professions, Work, Leaderboard, Premium, Shop) jotka tarvitsevat enemmän tilaa kuin
   xwide (640px) antaa. Käytä yksinään, EI yhdistettynä -center/-xwide:hen. */
.imm-stack-full { left: 16px; right: 16px; top: 16px; bottom: 16px; width: auto; }

.imm-card {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px;
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 10px;
  color: var(--night-text);
  box-shadow: 0 8px 24px rgba(20, 14, 8, .55);
}
/* Täyttää pinon jäljellä olevan tilan ja vierittää sisäisesti. */
.imm-card-fill { flex: 1 1 auto; }
.imm-card-center { text-align: center; }
.imm-card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 3px double var(--night-line);
}

/* Uudelleenkäytetyt elementit (.char-name, .sname, .rb-row, jne.) oletti aiemmin
   valoisaa .panel-kontekstia (tumma teksti vaalealla). Night-panelilla ne
   tarvitsevat vaalean tekstin — sama periaate kuin .scene-card .yield-tag.
   Tämä lista kasvaa sitä mukaa kun uusia näkymiä muunnetaan immersiivisiksi. */
.imm-card .style-label,
.imm-card .dlabel,
.imm-card .res-note,
.imm-card .sblurb,
.imm-card .cap-note,
.imm-card .trained-note,
.imm-card .rb-gains,
.imm-card .rb-time,
.imm-card .rb-empty,
.imm-card .hint-line { color: var(--night-text); opacity: .75; }
.imm-card .rb-row { color: var(--night-text); border-bottom-color: var(--night-line); }
.imm-card .rb-row:hover { background: var(--night-soft); color: var(--night-text); }
.imm-card .statrow, .imm-card .trainrow { border-bottom-color: var(--night-line); }
.imm-card .trained-tag { color: var(--night-text); opacity: .75; }
.imm-card .hint-line a, .imm-card .rb-empty a { color: var(--gold); }
.imm-card .hint-line a:hover, .imm-card .rb-empty a:hover { color: #fff; }
/* leaderboard.js */
.imm-card .lb-tab { color: var(--night-text); background: var(--night-soft); border-color: var(--night-line); }
.imm-card .lb-banner { background: var(--night-soft); border-color: var(--bronze); }
.imm-card .lb-table th, .imm-card .lb-table td { border-bottom-color: var(--night-line); }
.imm-card .lb-table th, .imm-card .lb-rank, .imm-card .lb-page, .imm-card .lb-empty { color: var(--night-text); opacity: .75; }
.imm-card .lb-name a { color: var(--night-text); }
.imm-card .lb-row.mine { background: var(--night-soft); }
/* quests.js */
.imm-card .quest-card { background: var(--night-soft); border-color: var(--night-line); }
.imm-card .q-chip { background: var(--night); border: 1px solid var(--night-line); }
.imm-card .q-chip.q-gold { color: var(--gold); }
.imm-card .q-chip.q-xp { color: var(--night-text); }
.imm-card .q-bar { background: var(--night); border-color: var(--night-line); }
.imm-card .q-progress-lbl, .imm-card .q-reroll-ask, .imm-card .q-reroll-no, .imm-card .dr-locked { color: var(--night-text); opacity: .75; }
.imm-card .dr-note { color: var(--night-text); }
/* arena.js */
.imm-card .opprow, .imm-card .hist-row { border-bottom-color: var(--night-line); }
.imm-card .opp-name, .imm-card .hist-row { color: var(--night-text); }
.imm-card .opp-name:hover { color: var(--gold); }
.imm-card .hist-row:hover { background: var(--night-soft); color: var(--night-text); }
.imm-card .opp-meta, .imm-card .delta-prev .d-sep, .imm-card .al-note { color: var(--night-text); opacity: .75; }
/* .d-win/.hd-pos ja .d-loss/.hd-neg olettivat vaaleaa taustaa (var(--laurel)/
   var(--crimson) ovat liian tummia night-kortilla) — samat vaaleat sävyt kuin
   .nt-win/.nt-loss (ar-record), jotka on jo suunniteltu night-kontekstiin. */
.imm-card .d-win, .imm-card .hd-pos { color: #A6C178; }
.imm-card .d-loss, .imm-card .hd-neg { color: #E07A6A; }
/* work.js */
.imm-card .wa-sub, .imm-card .wa-note { color: var(--night-text); opacity: .75; }
.imm-card .wa-bar { background: var(--night-soft); border-color: var(--night-line); }
/* professions.js overview */
.imm-card .pe-count { color: var(--gold); }
.imm-card .pe-track { background: var(--night-soft); border-color: var(--night-line); }
.imm-card .pe-note { color: var(--night-text); opacity: .75; }
/* Yleiset: .countdown/.sub esiintyvät melkein joka näkymässä (palkit,
   AP/PE-chipit) ja olettivat ink-soft-tekstiä — koskee kaikkia jo muunnettuja
   näkymiä retroaktiivisesti (Overview/Training/Work/Arena), ei vain uusia. */
.imm-card .countdown, .imm-card .sub { color: var(--night-text); opacity: .75; }
/* expeditions.js (zone detail) */
.imm-card .mobrow { border-bottom-color: var(--night-line); }
.imm-card .styletag, .imm-card .mob-lvl { color: var(--night-text); opacity: .75; }
.imm-card .backlink { color: var(--gold); }
/* shop.js */
.imm-card .tabbtn { color: var(--night-text); background: var(--night-soft); border-color: var(--night-line); }
.imm-card .tabbtn:hover { background: var(--night); }
/* market.js */
.imm-card .mk-dash, .imm-card .mk-taxnote, .imm-card .mk-mine-sub, .imm-card .mk-lock-note, .imm-card .mk-lock-prog { color: var(--night-text); opacity: .75; }
.imm-card .mk-lock-bar { background: var(--night-soft); }
.imm-card.mk-locked h2 { color: var(--gold); }
/* trades.js */
.imm-card .tr-who, .imm-card .tr-confirm-ask { color: var(--night-text); }
.imm-card .tr-back { color: var(--gold); }
/* character.js */
.imm-card .spell-chip { color: var(--night-text); background: var(--night-soft); border-color: var(--night-line); }
.imm-card .spell-chip:hover { background: var(--night); }
.imm-card .pouch-cell { background: var(--night-soft); border-color: var(--night-line); }
.imm-card .pouch-qty { color: var(--gold); }
.imm-card .pouch-kind, .imm-card .inv-count, .imm-card .mat-note { color: var(--night-text); opacity: .75; }
.imm-card .matrow { border-bottom-color: var(--night-line); }
.imm-card .gbonus { color: #A6C178; }
.imm-card .buff-name { color: var(--night-text); }
.imm-card .buff-time { color: var(--night-text); opacity: .75; }
.imm-card .buff-eff { color: #A6C178; }
.imm-card .buff-elixir .buff-eff { color: #C6D8EE; }
.imm-card .tr-taxnote, .imm-card .tr-lock-note, .imm-card .tr-lock-prog { color: var(--night-text); opacity: .75; }
.imm-card .tr-lock-bar { background: var(--night-soft); }
.imm-card.tr-locked h2 { color: var(--gold); }
/* Yleinen: .price-short olettaa vaaleaa taustaa (var(--crimson) on liian tumma
   night-kortilla) — koskee mitä tahansa näkymää joka käyttää priceTag()-tyylistä
   hintaa suoraan .imm-card:n lapsena (ensimmäinen tapaus: forge.js:n Spolia-osto). */
.imm-card .price-short { color: #E07A6A; }
/* forge.js */
.imm-card .forge-lead { color: var(--night-text); opacity: .75; }
/* professions.js detail (gather + workshop) */
.imm-card .pd-blurb, .imm-card .pd-skill-xp, .imm-card .node-req, .imm-card .rc-arrow, .imm-card .pe-cost, .imm-card .ws-tier-h { color: var(--night-text); opacity: .75; }
.imm-card .node-name, .imm-card .recipe-name { color: var(--night-text); }
.imm-card .pd-skill-lbl, .imm-card .bonus-chance, .imm-card .recipe-out { color: var(--gold); }
.imm-card .node-lock { color: #E07A6A; }
.imm-card .yield-tag, .imm-card .rc-input { background: var(--night-soft); border-color: var(--night-line); color: var(--night-text); }
.imm-card .rc-input b { color: #A6C178; }
.imm-card .rc-input.short b { color: #E07A6A; }
.imm-card .ws-tier-h { border-top-color: var(--night-line); }
/* report.js */
.imm-card .round { border-bottom-color: var(--night-line); }
.imm-card .round-h, .imm-card .rh-name, .imm-card .rh-num { color: var(--night-text); opacity: .75; }
.imm-card .rbar { background: var(--night-soft); border-color: var(--night-line); }
.imm-card .dmg { color: #E07A6A; }

.ov-br-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--night-line);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.ov-br-foot .hint-line { margin: 0; font-size: 12.5px; }

/* ---------------------------------------------------------- overview (#/overview) */

.char-medallion {
  width: 96px;
  height: 96px;
  margin: 6px auto 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #F3EAD3, var(--parchment-deep) 72%);
  border: 3px solid var(--bronze);
  color: var(--bronze-deep);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  display: grid;
  place-items: center;
}

.char-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: .08em;
  margin: 0 0 10px;
}

.char-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.lvl-badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .08em;
  color: var(--gold);
  background: var(--night);
  border: 1px solid var(--bronze);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}

.style-label {
  font-variant: small-caps;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--ink-soft);
}

.gold-line {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  margin-bottom: 16px;
}

/* palkkirivit */
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.bar-row .bar { max-width: none; }

.res-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 36px;
  margin-bottom: 10px;
}
.res-row:last-child { margin-bottom: 0; }

.res-name {
  font-variant: small-caps;
  font-weight: 700;
  letter-spacing: .03em;
  min-width: 150px;
}

.res-note {
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* statipaneeli */
.fp-chip {
  display: inline-block;
  margin: 0 0 12px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: .03em;
  background: rgba(201, 162, 75, .22);
  border: 1px solid var(--gold);
  border-radius: 999px;
}

.statlist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.statrow {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.statrow:last-child { border-bottom: 0; }

.sname {
  flex: 1;
  font-variant: small-caps;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .04em;
}

.sval {
  width: 44px;
  text-align: right;
  font-weight: 700;
  font-size: 17px;
}

.cap-note {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------- mobile */

@media (max-width: 899px) {
  .hdr-top { padding: 8px 12px; gap: 10px; }
  .wordmark { font-size: 15px; letter-spacing: .20em; }
  .player-chip { padding: 2px 10px 2px 4px; }
  .player-chip .pname { font-size: 12.5px; }

  /* tiivistetty, sivusuunnassa vieritettava stat strip */
  .hdr-strip {
    overflow-x: auto;
    gap: 16px;
    padding: 8px 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .hdr-strip .bar { flex: none; width: 150px; min-width: 150px; }

  .ov { grid-template-columns: 1fr; }
  .stylecards { grid-template-columns: 1fr; }
  .portraits { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Auth-hero mobiilissa: pino (pitch -> paneeli), keskitetty pitch. */
  .auth-hero-inner {
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 26px;
    padding: 32px 16px 44px;
  }
  .auth-pitch { max-width: none; align-items: center; text-align: center; }
  .auth-features { align-items: flex-start; text-align: left; }
  .auth-wordmark { font-size: 34px; }
  .auth-medallions { justify-content: center; }
  .auth-legends { justify-content: center; }
  .auth-panel-dark { width: 100%; padding: 20px 16px; }
  #toasts { left: 12px; right: 12px; max-width: none; }
}

/* ============================================================
   V2 — navigaatio, retket, taisteluraportti, treeni.
   Pysytaan kanonisissa tokeneissa; night-paneelit rarity.html-
   referenssin mukaan. Ei emojia, 44px-kohteet, mobiili 1 palsta.
   ============================================================ */

/* ---------------------------------------------------------- shell + nav */

.shell {
  display: flex;
  align-items: flex-start;
  max-width: 1210px;
  margin: 0 auto;
}
.shell > .view { flex: 1 1 auto; min-width: 0; }

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 190px;
  flex: none;
  margin: 16px 0 16px 16px;
}
.nav:empty { display: none; }

/* Toinen (oikea) sivupalkki — Economy-ryhmä. Perii .navin desktop-tyylin
   (parchment-napit, 190px pylväs), peilattu marginaali; ei mobiilisisältöä
   (ks. renderNav) — piilotetaan kokonaan alle 899px, alapalkki on edelleen
   yksin vasemman .nav-elementin (#nav) vastuulla. */
.nav-right { margin: 16px 16px 16px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 13px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .07em;
  color: var(--ink);
  text-decoration: none;
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.nav-item:hover { background: var(--parchment-deep); color: var(--ink); }
.nav-item.active {
  background: var(--night);
  border-color: var(--bronze);
  color: var(--gold);
}

/* ---------------------------------------------------------- portraits (forward-compat) */

/* Fallback-teksti alla, taidekuva absoluuttisesti päällä. Kuva on
   piilossa/tyhjä kunnes /assets/portraits/<id>.jpg on olemassa. */
.char-medallion, .medallion, .vs-medallion { position: relative; overflow: hidden; }

.portrait-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
}

/* ---------------------------------------------------------- stat blurbs */

.scol {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.scol .sname { flex: none; }

.sblurb {
  font-size: 12px;
  font-variant: normal;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-soft);
  line-height: 1.35;
}

/* ---------------------------------------------------------- pills */

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.res-win { background: var(--laurel); color: #F2EFE8; }
.res-loss { background: var(--crimson); color: #F2EFE8; }

.tier-easy { background: var(--parchment-deep); color: var(--ink-soft); border: 1px solid var(--line); }
.tier-normal { background: var(--bronze); color: #F7F2E4; }
.tier-hard { background: var(--crimson); color: #F2EFE8; }
.tier-boss { background: var(--night); color: var(--gold); border: 1px solid var(--bronze); }

.diff-easy { background: var(--laurel); color: #F2EFE8; }
.diff-fair { background: var(--bronze); color: #F7F2E4; }
.diff-dangerous { background: var(--crimson); color: #F2EFE8; }
.diff-deadly { background: var(--gl-red-deep, #571313); color: #F2EFE8; }

/* ---------------------------------------------------------- recent battles */

.rb-list { list-style: none; margin: 0; padding: 0; }

.rb-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 48px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.rb-list li:last-child .rb-row { border-bottom: 0; }
.rb-row:hover { background: var(--parchment-deep); color: var(--ink); }

.rb-opp {
  flex: 1;
  min-width: 120px;
  font-weight: 700;
  font-variant: small-caps;
  letter-spacing: .03em;
}
.rb-gains { font-size: 13px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.rb-time { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.rb-empty { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

/* ---------------------------------------------------------- expeditions */

.exp { display: grid; gap: var(--gap); }

.ap-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.ap-big {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .04em;
  white-space: nowrap;
}
.ap-big b { font-size: 30px; line-height: 1; }

.zone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

.zone-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 44px;
  padding: 16px;
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: var(--radius);
  box-shadow: none;
  color: var(--night-text);
  text-decoration: none;
}
a.zone-card:hover { border-color: var(--gold); background: var(--night-soft); color: var(--night-text); }
.zone-card.locked { opacity: .62; }

.zc-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .06em;
}
.zc-flavor { font-size: 13px; color: var(--night-text); opacity: .75; }
.zc-flavor-detail { margin: 0 0 12px; }
.zc-meta {
  font-size: 12.5px;
  font-weight: 700;
  font-variant: small-caps;
  letter-spacing: .03em;
  color: var(--gold);
}
.zone-card.locked .zc-meta { color: #E07A6A; }

.backlink {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
}

.moblist { list-style: none; margin: 0; padding: 0; }

.mobrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.mobrow:last-child { border-bottom: 0; padding-bottom: 4px; }

.mob-ic {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 50%;
}

.mob-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mob-name {
  font-weight: 700;
  font-variant: small-caps;
  font-size: 16px;
  letter-spacing: .03em;
}

.mob-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.styletag, .mob-lvl {
  font-size: 12px;
  font-weight: 700;
  font-variant: small-caps;
  letter-spacing: .04em;
  color: var(--ink-soft);
  white-space: nowrap;
}

.mob-fight {
  flex: none;
  min-width: 132px;
  padding: 10px 14px;
  font-size: 12.5px;
}

/* ---------------------------------------------------------- battle report */

.report-vs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 10px;
  padding: 18px 16px;
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  color: var(--night-text);
}

.vs-plate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  min-width: 0;
}

.vs-medallion {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #F3EAD3, var(--parchment-deep) 72%);
  border: 2px solid var(--bronze);
  color: var(--bronze-deep);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  display: grid;
  place-items: center;
}
.vs-medallion.vs-mob { background: var(--night-soft); border-color: var(--night-line); }

.vs-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .06em;
  overflow-wrap: anywhere;
}

.vs-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  font-variant: small-caps;
  letter-spacing: .05em;
  color: #8A7A5F;
}

.adv-tag {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.vs-sep {
  align-self: center;
  padding: 0 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .1em;
  color: var(--gold);
}

.nbar {
  position: relative;
  width: 100%;
  max-width: 220px;
  height: 12px;
  background: var(--night-soft);
  border: 1px solid var(--night-line);
  border-radius: 4px;
  overflow: hidden;
}
.nbar .fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--crimson);
  transition: width .9s ease;
}

.vs-hp { font-size: 12.5px; font-weight: 700; }

.verdict {
  padding: 14px 8px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: .3em;
  text-indent: .3em; /* kompensoi viimeisen letter-spacingin */
  color: #F2EFE8;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.verdict.victory { background: var(--laurel); }
.verdict.defeat { background: var(--crimson); }

.reward-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-weight: 700;
  font-size: 13.5px;
  background: var(--parchment);
  border: 1px solid var(--bronze);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.chip-gold {
  background: rgba(201, 162, 75, .25);
  border-color: var(--gold);
  font-family: var(--font-display);
  letter-spacing: .08em;
}

.loss-note { margin: 0; text-align: center; color: var(--night-text); opacity: .75; }

.round { padding: 10px 0; border-bottom: 1px solid var(--line); }
.round:last-child { border-bottom: 0; }

.round-h {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.ev { margin: 0 0 4px; font-size: 14.5px; }
.dmg { color: var(--crimson); }

.round-hp {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 7px;
}

.rh-side {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 200px;
  min-width: 0;
}

.rh-name {
  max-width: 110px;
  font-size: 11.5px;
  font-weight: 700;
  font-variant: small-caps;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rbar {
  position: relative;
  flex: 1;
  min-width: 60px;
  height: 8px;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.rbar .fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--crimson);
}

.rh-num {
  min-width: 26px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
  text-align: right;
}

.more-rounds[hidden] { display: none; }
.show-rounds-wrap { text-align: center; padding-top: 10px; }

.report-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
a.btn { text-decoration: none; }
a.btn:hover { color: #F7F2E4; }
a.btn-ghost:hover { color: var(--ink); }

.report-meta {
  margin: 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--night-text);
  opacity: .75;
}

/* ---------------------------------------------------------- training */

.train-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}
.train-top .gold-line { margin: 0; }
.train-top .fp-chip { margin: 0; }

.trainlist { list-style: none; margin: 0; padding: 0; }

.trainrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.trainrow:last-child { border-bottom: 0; }

.tcost {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 74px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.train-btn { min-width: 92px; }

.sval.flash {
  animation: laurel-flash 1s ease-out;
  border-radius: 4px;
}
@keyframes laurel-flash {
  from { background: rgba(74, 93, 51, .5); }
  to { background: transparent; }
}

/* ---------------------------------------------------------- V2 mobile */

@media (max-width: 899px) {
  .shell { display: block; }

  .nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    flex-direction: row;
    width: auto;
    margin: 0;
    gap: 4px;
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom, 0px));
    background: var(--night);
    border-top: 2px solid var(--bronze);
  }

  /* Oikea sivupalkki (Economy) on desktop-vain ilmiö — piilotetaan kokonaan;
     alapalkki (yllä, #nav) hoitaa mobiilinavigaation yksin kuten ennenkin. */
  .nav.nav-right { display: none; }

  .nav-item {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 52px;
    padding: 5px 4px;
    font-size: 10.5px;
    letter-spacing: .05em;
    color: var(--night-text);
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  .nav-item:hover { background: var(--night-soft); color: var(--night-text); }
  .nav-item.active { background: var(--night-soft); color: var(--gold); border: 0; }

  body.has-nav .view { padding-bottom: 84px; }

  .zone-grid { grid-template-columns: 1fr; }
  .mobrow { flex-wrap: wrap; }
  .mob-fight { flex: 1 1 100%; min-width: 0; }
  .report-vs { grid-template-columns: 1fr; }
  .vs-sep { padding: 2px 0; }
  .trainrow { flex-wrap: wrap; }
  .train-btn { flex: 1 1 100%; }
}

/* ============================================================
   V3 — esineet: hahmosivu (paper-doll, item sheet), kauppa,
   dropit raportissa. Rarity VAIN nimivarilla (tokens.css-luokat),
   listat night-paneeleilla, ei kehyksia. CSS-kolmiot nuolina.
   ============================================================ */

/* ---------------------------------------------------------- character page */

/* paper-doll: night-ruudukko, keskella medaljonki */
.doll {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 10px;
}

.doll-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 74px;
  padding: 8px 6px;
  text-align: center;
  border-radius: var(--radius);
  font: inherit;
}

.doll-cell.empty {
  border: 1px dashed var(--night-line);
  color: #8A7A5F;
}

.doll-cell.filled {
  background: var(--night-soft);
  border: 1px solid var(--night-line);
  cursor: pointer;
  padding: 8px 6px;
}
.doll-cell.filled:hover { border-color: var(--bronze); }

.doll-slotname {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8A7A5F;
}

.doll-iname {
  font-weight: 700;
  font-size: 12.5px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.doll-portrait { border: 0; }

/* johdetut arvot */
.derived-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.derived-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.derived-item b { font-size: 17px; }

.dlabel {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.derived-lines {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-bottom: 14px;
}

/* gear-bonus sulut + trained-kontekstit */
.gbonus {
  font-size: 13px;
  font-weight: 700;
  color: var(--laurel);
  white-space: nowrap;
}

.trained-note {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-soft);
  white-space: nowrap;
}

.trained-tag {
  font-size: 10.5px;
  font-weight: 700;
  font-variant: small-caps;
  letter-spacing: .05em;
  color: var(--ink-soft);
}

.statrow .sval { width: auto; min-width: 44px; }

.equip-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  margin-bottom: 14px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: .03em;
  color: var(--ink);
  text-decoration: none;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.equip-chip:hover { border-color: var(--bronze); color: var(--ink); }

/* loitsuchipit (radio) */
.spell-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spell-chip {
  min-height: 44px;
  padding: 9px 18px;
  font: inherit;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: .03em;
  color: var(--ink);
  background: var(--parchment);
  border: 2px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.spell-chip:hover { background: var(--parchment-deep); }
.spell-chip.active {
  color: var(--gold);
  background: var(--night);
  border-color: var(--bronze);
}

/* inventaario: night-solut, nimi rarity-varilla */
.inv-count {
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--ink-soft);
}

.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  padding: 10px;
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 10px;
}

.inv-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-height: 56px;
  padding: 9px 10px;
  text-align: left;
  font: inherit;
  background: var(--night-soft);
  border: 1px solid var(--night-line);
  border-radius: var(--radius);
  cursor: pointer;
}
.inv-cell:hover { border-color: var(--bronze); }

.inv-name {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.inv-meta {
  font-size: 11px;
  font-variant: small-caps;
  letter-spacing: .04em;
  color: #8A7A5F;
}

/* materiaalit */
.matlist { list-style: none; margin: 0; padding: 0; }

.matrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.matrow:last-child { border-bottom: 0; }

.mat-qty {
  min-width: 44px;
  text-align: right;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.mat-note {
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.mat-btn { min-width: 84px; padding: 8px 14px; font-size: 12.5px; }

.mat-acts {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

/* ---------------------------------------------------------- character sheet */

.character-sheet-view .imm-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.char-row {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
}

.char-row:first-of-type { padding-top: 20px; }
.char-row-condition { margin-bottom: 16px; }

.char-hero-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.char-inventory-row {
  margin-bottom: 16px;
}

.char-extra-row {
  padding-bottom: 20px;
}

.char-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* ------------------------------------------------------- equipment doll */

.char-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.char-panel-head h2 { margin: 0; }

.char-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px 16px;
  margin-top: 4px;
}

.char-currency-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.char-currency-stack .gold-line,
.char-currency-stack .honor-line,
.char-currency-stack .aurei-line {
  margin: 0;
  justify-content: flex-end;
  font-size: 13px;
  white-space: nowrap;
}

.aurei-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.char-equipment .doll {
  grid-template-columns: 1fr 1.5fr 1fr;
  grid-template-areas:
    ".      helmet    ."
    "amulet portrait  ring"
    "weapon portrait  offhand"
    "gloves armor     boots";
  gap: 8px;
  padding: 14px;
}

.doll-slot-helmet  { grid-area: helmet; }
.doll-slot-amulet  { grid-area: amulet; }
.doll-slot-ring    { grid-area: ring; }
.doll-slot-weapon  { grid-area: weapon; }
.doll-slot-offhand { grid-area: offhand; }
.doll-slot-gloves  { grid-area: gloves; }
.doll-slot-armor   { grid-area: armor; }
.doll-slot-boots   { grid-area: boots; }

.doll-cell {
  min-height: 64px;
  padding: 6px 4px;
  font-size: 10px;
}

.doll-iname {
  font-size: 11px;
}

.doll-portrait {
  grid-area: portrait;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.doll-medallion {
  width: 190px;
  height: 190px;
  font-size: 34px;
  border-radius: var(--radius);
}

.doll-medallion .portrait-img {
  border-radius: var(--radius);
}

/* ------------------------------------------------------- condition strip */

.condition-strip-card {
  padding: 14px 20px;
}

.condition-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.cond-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 220px;
  min-width: 200px;
}

.cond-item .bar {
  flex: 1;
  max-width: none;
}

.cond-item-pips {
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
}

/* ------------------------------------------------------- attributes combat block */

.derived-lines-compact {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.attr-cap-note {
  margin: 0;
  white-space: nowrap;
}

.attr-derived-row {
  justify-content: space-between;
  align-items: center;
}

.derived-lines-group {
  display: flex;
  gap: 22px;
}

.attr-fp-chip {
  margin: 0;
}

/* ------------------------------------------------------- inventory bag grid */

.inv-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.inv-panel-head h2 { margin: 0; }

.char-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.char-identity h2 {
  margin: 0;
}

.char-name-inline {
  margin: 0;
  font-size: 21px;
  color: var(--parchment);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

.bag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 10px;
}

.bag-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  aspect-ratio: 1;
  padding: 8px 6px;
  text-align: center;
  font: inherit;
  color: inherit;
  background: var(--night-soft);
  border: 1px solid var(--night-line);
  border-top: 3px solid currentColor;
  border-radius: var(--radius);
  cursor: pointer;
  overflow: hidden;
}
.bag-cell:hover { border-color: var(--bronze); border-top-color: currentColor; }

.bag-cell-name {
  font-weight: 700;
  font-size: 11px;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bag-cell-meta {
  font-size: 9.5px;
  color: #8A7A5F;
}

.bag-cell-empty {
  border-top-color: var(--night-line);
  border-style: dashed;
  cursor: default;
  background: transparent;
}

.bag-cell-static {
  cursor: default;
}
.bag-cell-static:hover { border-color: var(--night-line); }

.bag-cell-qty {
  font-weight: 700;
  font-size: 12px;
  color: var(--gold);
}

.bag-cell-supply {
  aspect-ratio: auto;
  min-height: 128px;
  justify-content: flex-start;
  padding-top: 10px;
  gap: 3px;
}

.bag-cell-sub {
  font-size: 9.5px;
  line-height: 1.25;
  color: var(--ink-soft);
}

.bag-cell-btn {
  margin-top: auto;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 4px 6px;
  font-size: 11px;
}

/* Esinetaide (aseet, /assets/items/<templateId>.jpg): pieni laatta jonka oma
   harmaa studiotausta toimii kilpimäisenä pohjana night-soluissa. Rarity EI
   koskaan näy taiteessa — nimiväri + glow kantaa sen (talon sääntö). Puuttuva
   taide (armor/offhand) = ei img-tagia lainkaan, layout ennallaan. */
.bag-art {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  object-fit: cover;
  border: 1px solid var(--night-line);
}
.doll-art {
  width: 40px;
  height: 40px;
  border-radius: 7px;
  object-fit: cover;
  border: 1px solid var(--night-line);
}
.is-art {
  float: left;
  width: 56px;
  height: 56px;
  margin: 0 12px 4px 0;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--night-line);
}
.offer-art {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--night-line);
  margin-bottom: 2px;
}

/* Spells-paneeli (character-sheet): koko 5-loitsun katalogi edistymisruudukkona.
   Sama 3-kerroksinen night-korttivisuaali kuin .bag-gridissä, mutta leveämmät
   ruudut nimelle + efektiselitteelle. Aktiivinen = kultakorostus, locked = himmeä. */
.spell-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 10px;
}
.spell-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 96px;
  padding: 12px 12px 10px;
  text-align: left;
  font: inherit;
  color: var(--night-text);
  background: var(--night-soft);
  border: 1px solid var(--night-line);
  border-top: 3px solid var(--bronze);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.spell-cell:hover { border-color: var(--bronze); }
.spell-cell:focus-visible { outline: none; border-color: var(--gold); }
.spell-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .04em;
  color: var(--gold);
}
.spell-blurb {
  flex: 1;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--night-text);
}
.spell-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8A7A5F;
}
.spell-cell.active {
  border-color: var(--gold);
  border-top-color: var(--gold);
  background: rgba(201, 162, 75, .14);
  box-shadow: 0 0 0 1px var(--gold), 0 2px 10px rgba(201, 162, 75, .25);
}
.spell-cell.active .spell-tag { color: var(--gold); }
.spell-cell.locked {
  cursor: default;
  opacity: .5;
  border-top-color: var(--night-line);
  border-style: dashed;
}
.spell-cell.locked:hover { border-color: var(--night-line); }

.tab-card .tabbar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--night-line);
}

.tabbtn {
  flex: 1;
  min-height: 44px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .03em;
  text-decoration: none;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.tabbtn:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.2);
}

.tabbtn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  background: transparent;
}

.profs-grid-mini {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 8px;
  row-gap: 11px;
}

.prof-card-mini {
  display: flex;
  flex-direction: row;
  gap: 8px;
  padding: 8px;
  text-decoration: none;
  background: var(--night-soft);
  border: 1px solid var(--night-line);
  border-radius: var(--radius);
  cursor: pointer;
  align-items: center;
}

.prof-card-mini:hover {
  border-color: var(--bronze);
  background: rgba(140, 107, 47, 0.15);
}

.prof-mini-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 2px;
}

.prof-mini-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.prof-mini-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.prof-mini-name {
  font-weight: 700;
  font-size: 11px;
  line-height: 1.2;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prof-mini-skill {
  display: flex;
  align-items: center;
  gap: 4px;
}

.prof-skill-lbl {
  font-weight: 700;
  font-size: 12px;
  color: var(--ink);
  min-width: 20px;
}

.skill-track-mini {
  flex: 1;
  height: 3px;
  background: var(--night);
  border-radius: 2px;
  overflow: hidden;
}

.skill-track-mini .fill {
  display: block;
  height: 100%;
  background: var(--bronze);
  border-radius: 2px;
}

.statlist-compact {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.statrow-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.statrow-compact:last-child {
  border-bottom: none;
}

.statrow-compact .sname {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}

.statrow-compact .sval {
  font-weight: 700;
  font-size: 13px;
  text-align: right;
}

.statrow-compact .gbonus {
  font-size: 11px;
  margin-left: 4px;
}

/* Responsive: tablet 900-1199px */
@media(max-width: 1199px) {
  .char-row {
    padding: 0 16px;
  }

  .char-hero-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .char-col-professions {
    grid-column: 1 / -1;
  }

  .profs-grid-mini {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Responsive: mobile <900px */
@media(max-width: 899px) {
  .char-row {
    padding: 0 12px;
  }

  .char-row:first-of-type { padding-top: 12px; }
  .char-row-condition { margin-bottom: 12px; }
  .char-hero-row {
    grid-template-columns: 1fr;
    margin-bottom: 12px;
  }
  .char-inventory-row { margin-bottom: 12px; }
  .char-extra-row { padding-bottom: 12px; }

  .char-column {
    gap: 12px;
  }

  .condition-strip {
    gap: 12px;
  }

  .cond-item {
    flex: 1 1 100%;
    min-width: 0;
  }

  .profs-grid-mini {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .char-equipment .doll {
    gap: 4px;
    padding: 8px;
  }

  .doll-cell {
    min-height: 50px;
    padding: 4px 3px;
    font-size: 9px;
  }

  .doll-medallion {
    width: 96px;
    height: 96px;
    font-size: 22px;
  }

  .bag-grid {
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  }
}

/* ---------------------------------------------------------- item sheet */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(36, 28, 18, .55);
}

.item-sheet {
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--parchment);
  border: 1px solid var(--bronze);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(43, 33, 24, .45);
}

.is-head {
  position: relative;
  padding: 14px 56px 12px 16px;
  background: var(--night);
  color: var(--night-text);
}

.is-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .04em;
  overflow-wrap: anywhere;
}

.is-meta {
  margin-top: 4px;
  font-size: 12px;
  font-variant: small-caps;
  letter-spacing: .05em;
  color: #8A7A5F;
}

.is-close {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--night-text);
  font-size: 22px;
  line-height: 1;
}

.is-body { padding: 12px 16px; }

.is-cmpnote {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.is-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.is-line:last-child { border-bottom: 0; }

.is-label { font-variant: small-caps; font-weight: 700; letter-spacing: .03em; }
.is-val { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.is-sub { font-size: 12.5px; color: var(--ink-soft); }
.is-sub .is-label, .is-sub .is-val { font-weight: 700; }

.req-unmet { color: var(--crimson); }

.is-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--parchment-deep);
}

.sell-ask { font-size: 13.5px; font-weight: 700; margin-right: auto; }
.sell-ask b { font-weight: 700; }

/* vertailunuolet: CSS-kolmiot, ei emojia */
.cmp {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 4px;
}
.cmp-up {
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 8px solid var(--laurel);
}
.cmp-down {
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid var(--crimson);
}

/* ---------------------------------------------------------- shop */
/* shop.jpg: kauppias + aserekki/juomahylly vasemmalla, kilvet/nuolet oikealla.
   Dokataan paneeli oikealle (sama kuvio kuin premium/forge) — kauppiaan kasvot
   + wares jäävät näkyviin vasemmalle. Vain työpöytä; mobiili = imm-scene-cards-reflow. */
@media (min-width: 900px) {
  .shop-panel { width: min(620px, 46vw); }
  .shop-scene .imm-card {
    background: rgba(22, 15, 8, .90);
    border-color: rgba(201, 162, 75, .38);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .6);
  }
  .shop-scene::before {
    content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: linear-gradient(90deg, rgba(20, 14, 8, 0) 40%, rgba(20, 14, 8, .30) 62%, rgba(20, 14, 8, .55) 100%);
  }
}

.shop-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.shop-head .gold-line { margin: 0; }

.tabbar {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}

.tabbtn {
  min-height: 44px;
  min-width: 92px;
  padding: 9px 20px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--ink);
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.tabbtn:hover { background: var(--parchment-deep); }
.tabbtn.active {
  color: var(--gold);
  background: var(--night);
  border-color: var(--bronze);
}

.shop-rot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 13.5px;
  font-weight: 700;
}

.charm-note {
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: #A6C178;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.offer-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 10px;
  color: var(--night-text);
}

.offer-name {
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.offer-meta {
  font-size: 11.5px;
  font-variant: small-caps;
  letter-spacing: .04em;
  color: #8A7A5F;
}

.offer-stats {
  font-size: 12.5px;
  color: var(--night-text);
  min-height: 2.4em;
}

.offer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
}
/* Potions/Ammo/Scrolls/Sell-laatat: hinta+nappirypäs pinottuna pystyyn (ei
   vierekkäin) — kapeassa ruudukkolaatassa ne eivät mahtuisi siististi riviin. */
.offer-foot-col { flex-direction: column; align-items: stretch; gap: 8px; }
.offer-foot-col .mat-acts { justify-content: flex-end; }

.offer-buy { min-width: 84px; padding: 8px 16px; font-size: 12.5px; }

.price {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  font-size: 14.5px;
  white-space: nowrap;
}
.price-short { color: var(--crimson); opacity: .75; }
.offer-card .price-short { color: #E07A6A; }

/* ---------------------------------------------------------- warnings & drops */

.warn-banner {
  padding: 12px 16px;
  font-weight: 700;
  font-size: 14px;
  color: #F2EFE8;
  background: var(--crimson);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.drop-cards {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.drop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 18px;
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 10px;
  text-align: center;
}

.drop-name {
  font-weight: 700;
  font-size: 14.5px;
  overflow-wrap: anywhere;
}

.drop-meta {
  font-size: 11.5px;
  font-variant: small-caps;
  letter-spacing: .05em;
  color: #8A7A5F;
}

.drop-sold {
  font-size: 11.5px;
  color: #C7B896;
}

/* ---------------------------------------------------------- V3 mobile */

@media (max-width: 899px) {
  /* item sheet muuttuu bottom sheetiksi */
  .sheet-backdrop {
    place-items: end stretch;
    padding: 0;
  }
  .item-sheet {
    max-width: none;
    max-height: 82vh;
    border-radius: 12px 12px 0 0;
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .matrow { flex-wrap: wrap; }
  .mat-acts { flex: 1 1 100%; justify-content: flex-end; }

  .shop-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .tabbar { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .tabbtn { flex: 1; }

  /* 5 valilehtea alapalkissa — tiivistetaan hieman */
  .nav-item { font-size: 9.5px; letter-spacing: .03em; padding: 5px 2px; }
}

/* ============================================================
   V4 — areena (PvP): Honor-plate, vastustajarivit, delta-chipit,
   historia hyokkays/puolustus-glyyfeilla, julkinen profiili.
   Ei emojia — glyyfit ovat ikoneita/inline-SVG:ta. 44px-kohteet.
   ============================================================ */

/* ---------------------------------------------------------- arena plate */

.arena-plate {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 26px;
  padding: 16px 20px;
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  color: var(--night-text);
}

.ar-honor {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.ar-honor-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  color: var(--gold);
}

.ar-honor-lbl {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #8A7A5F;
}

.ar-record {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .06em;
  white-space: nowrap;
}
.ar-rec-sep { color: #8A7A5F; padding: 0 3px; }

/* voitto/tappio night-pinnalla — laurel/crimson vaalennettuina */
.nt-win { color: #A6C178; }
.nt-loss { color: #E07A6A; }

.ar-pts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}
.arena-plate .sub { color: #C7B896; }
.arena-plate .countdown { color: #C7B896; }

/* ---------------------------------------------------------- locked */

.arena-locked {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.al-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.al-note { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

.arena-locked .bar { width: 100%; max-width: 340px; flex: none; }

/* ---------------------------------------------------------- opponents */

.opplist { list-style: none; margin: 0; padding: 0; }

.opprow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.opprow:last-child { border-bottom: 0; }

.opp-medallion {
  position: relative;
  overflow: hidden;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #F3EAD3, var(--parchment-deep) 72%);
  border: 2px solid var(--bronze);
  color: var(--bronze-deep);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
  text-decoration: none;
}
.opp-medallion:hover { border-color: var(--gold); }

.opp-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.opp-name {
  font-weight: 700;
  font-variant: small-caps;
  font-size: 16px;
  letter-spacing: .03em;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.opp-name:hover { color: var(--bronze-deep); text-decoration: underline; }

.opp-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  font-variant: small-caps;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

.styletag-ic { display: inline-flex; align-items: center; gap: 4px; }

.delta-prev {
  flex: none;
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
}
.delta-prev .d-sep { color: var(--ink-soft); padding: 0 3px; font-weight: 400; }
.d-win { color: var(--laurel); }
.d-loss { color: var(--crimson); }

.opp-attack {
  flex: none;
  min-width: 122px;
  padding: 9px 14px;
  font-size: 12.5px;
}

.ar-refresh { padding-top: 12px; text-align: center; }

/* ---------------------------------------------------------- history */

.hist-list { list-style: none; margin: 0; padding: 0; }

.hist-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 48px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.hist-list li:last-child .hist-row { border-bottom: 0; }
.hist-row:hover { background: var(--parchment-deep); color: var(--ink); }

.hist-glyph, .rb-glyph {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 50%;
}
.hist-glyph .icon, .rb-glyph .icon { width: 18px; height: 18px; }
.rb-glyph { width: 28px; height: 28px; }
.rb-glyph .icon { width: 15px; height: 15px; }

.hist-opp {
  flex: 1;
  min-width: 110px;
  font-weight: 700;
  font-variant: small-caps;
  letter-spacing: .03em;
}

.hist-delta { font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.hd-pos { color: var(--laurel); }
.hd-neg { color: var(--crimson); }

/* ---------------------------------------------------------- pvp report */

.chip-honor-pos { border-color: var(--laurel); color: var(--laurel); }
.chip-honor-neg { border-color: var(--crimson); color: var(--crimson); }

/* ---------------------------------------------------------- overview honor */

.honor-line {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  margin: -8px 0 16px;
}

/* ---------------------------------------------------------- public profile */

.profile-honor {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin-bottom: 16px;
}
.profile-honor .derived-item { align-items: center; }
.profile-honor b { font-size: 17px; }

.challenge-wrap {
  display: grid;
  justify-items: center;
  gap: 8px;
}
.challenge-ask { font-size: 13.5px; font-weight: 700; }
.challenge-acts { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.pe-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 10px;
}

.pe-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 56px;
  padding: 9px 10px;
  background: var(--night-soft);
  border: 1px solid var(--night-line);
  border-radius: var(--radius);
}
.pe-cell.empty {
  background: transparent;
  border-style: dashed;
}

.pe-slot {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8A7A5F;
}

.pe-name {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.pe-meta {
  font-size: 11px;
  font-variant: small-caps;
  letter-spacing: .04em;
  color: #8A7A5F;
}

.pe-empty { color: #8A7A5F; font-size: 12.5px; }

/* ---------------------------------------------------------- V4 mobile */

@media (max-width: 899px) {
  .arena-plate { gap: 12px 18px; }
  .ar-pts { margin-left: 0; flex: 1 1 100%; }

  .opprow { flex-wrap: wrap; }
  .opp-attack { flex: 1 1 100%; min-width: 0; }
}

/* ============================================================
   V1.5 — chat dock. Aina mountattuna reitittimen ulkopuolella;
   desktop = oikean laidan night-paneeli, mobiili = koko leveyden
   bottom sheet alanavin päällä. Ei emojia, esc() kaikelle tekstille.
   ============================================================ */

/* headerin toggle + unread-badge */
.chat-toggle { position: relative; }

.chat-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--crimson);
  border: 1px solid var(--night);
  color: #F2EFE8;
  font: 700 11px/16px var(--gl-font-num, 'Segoe UI', system-ui, sans-serif);
  text-align: center;
}

/* dock-runko (desktop: kiinteä paneeli viewportin oikeassa laidassa) */
.chat-dock {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 40; /* alanavin (30) yllä, toastien (50) alla */
  display: none;
  flex-direction: column;
  width: 300px;
  height: min(540px, calc(100vh - 120px));
  background: var(--night);
  border: 1px solid var(--bronze);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--night-text);
  overflow: hidden;
}
.chat-dock.open {
  display: flex;
  animation: chat-in .16s ease-out;
}

@keyframes chat-in {
  from { transform: translateY(10px); opacity: .6; }
  to { transform: translateY(0); opacity: 1; }
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 8px 10px;
  border-bottom: 1px solid var(--night-line);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--gold);
}

.chat-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  background: #8A7A5F;
}
.chat-dot.online { background: var(--rarity-uncommon); }
.chat-dot.connecting { background: var(--gold); }
.chat-dot.offline { background: var(--crimson); }

.chat-presence {
  margin-left: auto;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 11.5px;
  letter-spacing: 0;
  text-transform: none;
  color: #8A7A5F;
  white-space: nowrap;
}

.chat-close {
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  font: 700 16px/1 var(--font-body);
  color: var(--night-text);
  background: transparent;
  border: 1px solid var(--night-line);
  border-radius: var(--radius);
  cursor: pointer;
}
.chat-close:hover { background: var(--night-soft); }

/* viestilista */
.chat-msgs {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  scrollbar-width: thin;
}

.chat-msg {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.chat-from {
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
}
.chat-from:hover { color: var(--gold); text-decoration: underline; }

.chat-lvl {
  color: #8A7A5F;
  font-size: 11px;
  white-space: nowrap;
}

.chat-text { color: var(--night-text); }

.chat-sys {
  color: #8A7A5F;
  font-style: italic;
  font-size: 12.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* syöttörivi */
.chat-inputrow {
  flex: none;
  padding: 8px;
  border-top: 1px solid var(--night-line);
}

.chat-input {
  width: 100%;
  min-height: 40px;
  padding: 6px 10px;
  font: 14px var(--font-body);
  color: var(--night-text);
  background: var(--night-soft);
  border: 1px solid var(--night-line);
  border-radius: var(--radius);
}
.chat-input::placeholder { color: #8A7A5F; }
.chat-input:disabled { opacity: .55; cursor: not-allowed; }

/* mobiili: koko leveyden bottom sheet alanavin päällä */
@media (max-width: 899px) {
  .chat-dock {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: min(70vh, 480px);
    border: 0;
    border-top: 2px solid var(--bronze);
    border-radius: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

/* ==========================================================
   V5 — Work, Daily quests, Leaderboard, nav badges, daily strip
   ========================================================== */

/* ---------------------------------------------------------- shared bits */

.link-btn {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 6px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--bronze);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
}
.link-btn:hover { color: var(--bronze-deep); }

/* ---------------------------------------------------------- work: job cards */

.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.job-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 10px;
  color: var(--night-text);
}
.job-card.locked { opacity: .6; }

.job-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.job-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--gold); }
.job-min { font-size: 11.5px; color: #8A7A5F; }
.job-lock { font-size: 11.5px; font-weight: 700; color: var(--crimson); }

.seg {
  display: inline-flex;
  border: 1px solid var(--night-line);
  border-radius: var(--radius);
  overflow: hidden;
  align-self: flex-start;
}
.seg-btn {
  min-height: 40px;
  min-width: 48px;
  padding: 8px 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--night-text);
  background: var(--night-soft);
  border: 0;
  border-right: 1px solid var(--night-line);
  cursor: pointer;
}
.seg-btn:last-child { border-right: 0; }
.seg-btn.on { color: var(--night); background: var(--gold); }
.seg-btn:disabled { opacity: .5; cursor: not-allowed; }

.job-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}
.job-pay {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
}
.job-pay b { color: var(--gold); }
.job-start { min-width: 96px; padding: 8px 16px; font-size: 12.5px; }

/* ---------------------------------------------------------- work: in progress */

.work-active { display: flex; flex-direction: column; gap: 14px; }

.wa-head { display: flex; align-items: center; gap: 12px; }
.wa-head .icon { width: 32px; height: 32px; }
.wa-title h2 { margin: 0; }
.wa-sub { font-size: 12.5px; color: var(--ink-soft); }

.wa-bar {
  position: relative;
  height: 18px;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.wa-bar .fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--gold);
  transition: width 1s linear;
}

.wa-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.wa-pay {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  font-size: 15px;
  color: var(--bronze-deep);
}

.wa-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.wa-note { font-size: 12.5px; color: var(--ink-soft); }

/* ---------------------------------------------------------- quests */

.quests-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.quests-head h2 { margin: 0; }
.q-reset { font-size: 13px; }

/* ---- Work & Quests yhdistetty näkymä (jaettu backdrop quest.jpg) ----
   quest.jpg kuvaa job boardin (vasen) + scroll-pyhäkön (oikea). Keskitetty
   läpikuultava paneeli jättää molemmat teemaelementit reunoille näkyviin.
   Vain työpöytä; mobiili käyttää jaettua .imm-scene-cards-reflowia (<900px). */
@media (min-width: 900px) {
  .wq-scene .wq-panel { width: min(760px, 64vw); }
  .wq-scene .imm-card {
    background: rgba(22, 15, 8, .90);
    border-color: rgba(201, 162, 75, .34);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .6);
  }
  /* Sub-tab-kortti kompaktiksi; kaksi tabia täyttävät leveyden tasan. */
  .wq-scene .wq-tab-card { padding: 10px 12px; }
  .wq-scene .wq-tab-card .tabbar { margin: 0; width: 100%; }
  .wq-scene .wq-tab-card .tabbtn { flex: 1; }
  /* Luettavuus-scrim molempiin reunoihin (kuvan yli, panelin alle). */
  .wq-scene::before {
    content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: linear-gradient(90deg, rgba(20, 14, 8, .45) 0%, rgba(20, 14, 8, 0) 24%, rgba(20, 14, 8, 0) 76%, rgba(20, 14, 8, .45) 100%);
  }
}

.quest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.quest-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.quest-card.ready { border-color: var(--gold); }
.quest-card.claimed { opacity: .72; }

.q-top { display: flex; flex-direction: column; gap: 6px; }
.q-desc { font-weight: 700; font-size: 14.5px; line-height: 1.3; }

.q-rewards { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.q-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--parchment-deep);
}
.q-chip.q-gold { color: var(--bronze-deep); }
.q-chip.q-xp { color: var(--ink); }

.q-bar {
  position: relative;
  height: 16px;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.q-bar .fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--laurel);
  transition: width .4s;
}
.quest-card.ready .q-bar .fill { background: var(--gold); }
.q-bar .lbl {
  position: relative;
  display: block;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 16px;
  color: var(--ink);
}

.q-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  min-height: 40px;
}
.q-claim { min-width: 96px; padding: 8px 18px; font-size: 12.5px; }
.q-progress-lbl { font-size: 12.5px; color: var(--ink-soft); }
.q-done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
  color: var(--laurel);
}

.q-reroll-wrap { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.q-reroll-ask { font-size: 12px; color: var(--ink-soft); }
.q-reroll-no { color: var(--ink-soft); }

/* laurel-pulse valmiin tehtävän Claim-napissa */
.quest-card.ready .q-claim { animation: q-pulse 1.8s ease-in-out infinite; }
@keyframes q-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(164, 126, 60, 0); }
  50% { box-shadow: 0 0 0 4px rgba(164, 126, 60, .35); }
}

/* daily reward */
.reward-panel { display: flex; flex-direction: column; gap: 10px; }
.reward-panel.reward-ready { border-color: var(--gold); }
.dr-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--ink);
}
.dr-locked { color: var(--ink-soft); }
.dr-claim { align-self: flex-start; }

.reward-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 10px;
  color: var(--night-text);
}

/* ---------------------------------------------------------- leaderboard */

.lb-tabs { display: inline-flex; gap: 4px; margin-bottom: 12px; }
.lb-tab {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--ink);
  text-decoration: none;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.lb-tab.on { color: var(--gold); background: var(--night); border-color: var(--bronze); }

.lb-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 13.5px;
  background: var(--parchment-deep);
  border: 1px solid var(--bronze);
  border-radius: var(--radius);
}
.lb-banner b { color: var(--bronze-deep); }

.lb-scroll { overflow-x: auto; }

/* ---- Hall of Champions -tausta (scenes/leaderboard.jpg): symmetrinen marmorihalli,
   mestarien rintakuvat molemmilla reunoilla. Keskitetty läpikuultava paneeli jättää
   rintakuvat kehystämään rankingia. Vain työpöytä; mobiili = imm-scene-cards-reflow. */
@media (min-width: 900px) {
  .leaderboard-scene .leaderboard-panel { width: min(840px, 66vw); }
  .leaderboard-scene .imm-card {
    background: rgba(22, 15, 8, .90);
    border-color: rgba(201, 162, 75, .34);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .6);
  }
  .leaderboard-scene::before {
    content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: linear-gradient(90deg, rgba(20, 14, 8, .45) 0%, rgba(20, 14, 8, 0) 22%, rgba(20, 14, 8, 0) 78%, rgba(20, 14, 8, .45) 100%);
  }
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.lb-table th, .lb-table td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.lb-table th {
  font-family: var(--font-display);
  font-size: 11.5px;
  letter-spacing: .05em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.lb-table .lb-num { text-align: right; }
.lb-rank { color: var(--ink-soft); font-weight: 700; }
.lb-name a { color: var(--ink); font-weight: 700; text-decoration: none; }
.lb-name a:hover { color: var(--gold); text-decoration: underline; }
.lb-row.mine { background: var(--parchment-deep); }
.lb-row.mine .lb-name a { color: var(--gold); }
.lb-empty { text-align: center; color: var(--ink-soft); padding: 20px; }

.lb-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}
.lb-page { font-size: 13px; color: var(--ink-soft); }
.lb-pager .btn-ghost { min-width: 84px; padding: 8px 16px; font-size: 12.5px; }
.lb-pager .is-disabled {
  opacity: .45;
  pointer-events: none;
  cursor: default;
}

/* ---------------------------------------------------------- nav badge + more */

.nav-item { position: relative; }
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: #F7F2E4;
  background: var(--crimson);
  border-radius: 999px;
}
/* desktop: badge sivupalkin rivin oikeaan reunaan */
.nav-full .nav-badge { margin-left: auto; }

/* desktop-sivupalkki näyttää nav-full-kohteet; mobiili- ja More-napit piiloon */
.nav-mobile, .nav-more { display: none; }

.more-sheet { position: fixed; inset: 0; z-index: 60; }
.ms-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 15, 8, .5);
}
.ms-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 80vh;
  overflow-y: auto;
  padding: 10px 12px calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--night);
  border-top: 2px solid var(--bronze);
  border-radius: 16px 16px 0 0;
  animation: ms-rise .18s ease-out;
}
.ms-grip {
  width: 40px;
  height: 4px;
  margin: 2px auto 10px;
  border-radius: 2px;
  background: var(--night-line);
}
.ms-list { display: flex; flex-direction: column; gap: 4px; }
.ms-item {
  flex-direction: row;
  justify-content: flex-start;
  gap: 12px;
  min-height: 52px;
  color: var(--night-text);
  background: transparent;
  border: 0;
  box-shadow: none;
  text-align: left;
}
.ms-item .icon { width: 22px; height: 22px; }
.ms-item.active { color: var(--gold); background: var(--night-soft); }
.ms-item .nav-badge { margin-left: auto; }
.ms-logout { width: 100%; cursor: pointer; }
@keyframes ms-rise { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ---------------------------------------------------------- overview: daily strip + job status */

.daily-strip, .job-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: center;
  padding: 6px 12px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.daily-strip:hover, .job-status:hover { border-color: var(--bronze); }
.daily-strip.has-todo { border-color: var(--bronze); }
.ds-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  color: #F7F2E4;
  background: var(--crimson);
  border-radius: 999px;
}
.ds-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--parchment);
}
.job-status .countdown { font-weight: 700; color: var(--bronze-deep); }
.job-status .js-lbl { overflow-wrap: anywhere; }

/* ---------------------------------------------------------- professions (V6) */

/* PE-paneeli (overview + detail) */
.pe-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.pe-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.pe-count { margin-left: auto; font-weight: 700; font-size: 15px; color: var(--bronze-deep); }
.pe-track {
  position: relative;
  height: 16px;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.pe-track .fill {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  background: linear-gradient(180deg, var(--gold), var(--bronze));
  transition: width .3s ease;
}
.pe-note { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-soft); }

/* Ammattikortit */
.prof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.prof-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 10px;
  color: var(--night-text);
  text-decoration: none;
}
.prof-card:hover { border-color: var(--bronze); background: #2A2115; }
.prof-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.prof-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--gold);
}
.prof-kind {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.kind-gathering { color: #CDE3B6; background: rgba(74, 93, 51, .35); border: 1px solid var(--laurel); }
.kind-processing { color: #E4D2A6; background: rgba(140, 107, 47, .30); border: 1px solid var(--bronze); }
.kind-crafting { color: #C6D8EE; background: rgba(78, 144, 226, .22); border: 1px solid #3E6FA0; }

.prof-skill { display: flex; flex-direction: column; gap: 5px; }
.prof-skill-lbl { font-size: 12.5px; font-weight: 700; color: var(--night-text); }
.prof-skill-max { color: #8A7A5F; font-weight: 400; }
.skill-track {
  position: relative;
  display: block;
  height: 8px;
  background: var(--night-soft);
  border: 1px solid var(--night-line);
  border-radius: 4px;
  overflow: hidden;
}
.skill-track .fill {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  background: var(--gold);
}
.prof-blurb { margin: 0; font-size: 12.5px; line-height: 1.4; color: #B8A98C; }

/* Detail-pää */
.prof-detail-head { display: flex; flex-direction: column; gap: 10px; }
.pd-blurb { margin: 0; font-size: 14px; color: var(--ink-soft); }
.pd-skill { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pd-skill .skill-track {
  flex: 1;
  min-width: 140px;
  height: 10px;
  background: var(--parchment-deep);
  border-color: var(--line);
}
.pd-skill-lbl { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--bronze-deep); white-space: nowrap; }
.pd-skill-xp { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }

/* Node- ja recipe-rivit */
.node-list { display: flex; flex-direction: column; }
.node-row, .recipe-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.node-row:last-child, .recipe-row:last-child { border-bottom: 0; }
.node-row.locked, .recipe-row.locked { opacity: .55; }

.node-info, .recipe-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.node-head, .recipe-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.node-name, .recipe-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}
.node-req { font-size: 11.5px; color: var(--ink-soft); }
.node-lock { font-size: 11.5px; font-weight: 700; color: var(--crimson); }

.yield-line { display: flex; flex-wrap: wrap; gap: 6px; }
.yield-tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
  color: var(--ink);
  white-space: nowrap;
}
.bonus-tag { border-style: dashed; color: var(--ink-soft); }
.bonus-chance { color: var(--bronze-deep); font-weight: 700; }

.recipe-io { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.rc-inputs { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.rc-input {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.rc-input b { color: var(--laurel); font-weight: 700; }
.rc-input.short b { color: var(--crimson); }
.rc-arrow { color: var(--ink-soft); font-weight: 700; }
.recipe-out {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--bronze-deep);
  white-space: nowrap;
}

.node-act { display: flex; align-items: center; gap: 10px; flex: none; }
.pe-cost {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}
.node-btn { min-width: 96px; padding: 8px 16px; font-size: 12.5px; }

/* ---------------------------------------------------------- profession scenes (V-scenes) */

/* Pinni-kerros scene-taustakuvan päällä (gather-ammatit + Expeditions). Itse
   scene-laatikko tulee jaetusta .imm-scene imm-scene-cards -kaavasta; tässä vain
   pinnien absoluuttinen ankkurikerros kuvan yllä. */
.scene-pins { position: absolute; inset: 0; z-index: 3; }

/* Node-pinni: teardrop-bronssimarkkeri, kultarengas, tier-numero. */
.node-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 34px;
  min-height: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 50% 0;
  rotate: -45deg;
  background: radial-gradient(circle at 40% 35%, var(--gold), var(--bronze-deep));
  border: 2px solid var(--gold);
  box-shadow: 0 2px 6px rgba(20, 14, 8, .6), 0 0 0 1px rgba(20, 14, 8, .35);
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease;
}
/* 44px kosketuskohde ilman että itse markkeri kasvaa. */
.node-pin::before {
  content: "";
  position: absolute;
  inset: -6px;
  rotate: 45deg;
  border-radius: 50%;
}
.pin-tier {
  rotate: 45deg;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  color: var(--night);
  text-shadow: 0 1px 0 rgba(249, 242, 228, .35);
}
.node-pin:hover, .node-pin:focus-visible {
  transform: translate(-50%, -50%) scale(1.14);
  box-shadow: 0 3px 10px rgba(20, 14, 8, .7), 0 0 12px var(--gold);
  outline: none;
}
.node-pin:focus-visible { border-color: #F2E4B8; }
/* Lukittu node: himmennetty, katkoviivarengas, lukkoglyfi. */
.node-pin.shrouded {
  background: radial-gradient(circle at 40% 35%, #6A5A44, #2C2418);
  border-style: dashed;
  border-color: #8A7A5F;
  opacity: .72;
}
.node-pin.shrouded .pin-tier { display: none; }
.pin-lock {
  rotate: 45deg;
  width: 15px;
  height: 15px;
  fill: #D9CBA8;
}

/* Kelluva scene-kortti (desktop hover/focus): night-paneeli pinnin lähellä. */
.scene-card {
  position: absolute;
  z-index: 10;
  width: 230px;
  padding: 12px 14px;
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 10px;
  color: var(--night-text);
  box-shadow: 0 8px 24px rgba(20, 14, 8, .55);
}
.sc-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--gold);
  margin-bottom: 4px;
}
.sc-req { display: block; font-size: 11.5px; color: var(--night-text); margin-bottom: 8px; }
.sc-req.locked { color: var(--rarity-mythic); font-weight: 700; }
.sc-yields { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
/* Tummalla paneelilla yield-tagit kääntyvät vaaleiksi (peritty .yield-tag on
   parchment-taustainen; skopoidaan scene-korttiin/-sheetiin). */
.scene-card .yield-tag, .scene-sheet .yield-tag {
  background: var(--night-soft);
  border-color: var(--night-line);
  color: var(--night-text);
}
.scene-card .bonus-tag, .scene-sheet .bonus-tag { color: #C9BCA0; }
.scene-card .bonus-chance, .scene-sheet .bonus-chance { color: var(--gold); }
.sc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.scene-card .pe-cost, .scene-sheet .pe-cost { color: #C9BCA0; }
.sc-gather { min-width: 92px; padding: 7px 14px; font-size: 12.5px; }
/* Mobiili/näppäimistö-sheet käyttää jaettua .sheet-backdropia; sisältö night-panelilla. */
.scene-sheet {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 18px 16px 16px;
  background: var(--night);
  border: 1px solid var(--bronze);
  border-radius: 10px;
  color: var(--night-text);
  box-shadow: 0 8px 28px rgba(20, 14, 8, .6);
}
.scene-sheet .sc-name { font-size: 18px; }
.scene-sheet-close {
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--night-text);
  font-size: 22px;
  line-height: 1;
}
.scene-sheet .sc-foot { margin-top: 4px; }

/* Sekundaarinen node-lista (gather-scenen alla): visuaalisesti kevyempi. */
.scene-list h2 { opacity: .95; }

/* Workshop-paneeli: tier-otsikot + reseptirivit teemoitetussa laatikossa. */
.ws-panel { display: flex; flex-direction: column; gap: 4px; }
.ws-tier { padding: 4px 0; }
.ws-tier-h {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 6px 0 2px;
  border-top: 1px solid var(--line);
}
.ws-tier:first-child .ws-tier-h { border-top: 0; }

/* Materials pouch (character-näkymä) */
.pouch-group { margin-bottom: 14px; }
.pouch-group:last-child { margin-bottom: 0; }
.pouch-kind {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.pouch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.pouch-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.pouch-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pouch-qty { font-weight: 700; font-size: 13px; color: var(--bronze-deep); white-space: nowrap; }

/* Buffs strip (character-paneeli) */
.buffs-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.buff-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: var(--parchment-deep);
}
.buff-food { border-color: var(--laurel); background: rgba(74, 93, 51, .16); }
.buff-elixir { border-color: #3E6FA0; background: rgba(78, 144, 226, .14); }
.buff-name { font-weight: 700; color: var(--ink); }
.buff-eff { color: var(--laurel); font-weight: 700; }
.buff-elixir .buff-eff { color: #2E5A7A; }
.buff-time { color: var(--ink-soft); font-weight: 700; }

/* Buff-pisteet (overview PE-chip) */
.pe-chip .buff-dots { display: inline-flex; gap: 4px; margin-left: 6px; }
.buff-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.buff-dot-food { background: var(--laurel); }
.buff-dot-elixir { background: #4E90E2; }

/* ---------------------------------------------------------- immersive scenes (shared) */

/* Yhteinen kehys/vignette-kaava kaikille täysleveille scene-näkymille (World Map,
   Environs, Overview, ja tulevat). Jokainen näkymä lisää OMAN luokkansa (.world-scene
   jne.) samaan elementtiin pinni-/kortti-CSS:n ankkuriksi — .imm-scene hoitaa vain
   kehyksen niin ettei sitä tarvitse toistaa joka näkymässä erikseen. */
.imm-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  max-height: 560px;
  border: 1px solid var(--bronze);
  border-radius: 10px;
  overflow: hidden;
  background-color: var(--night);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 60px rgba(36, 28, 18, .5), var(--shadow);
}
.imm-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--parchment);
  opacity: .07;
  mix-blend-mode: multiply;
  z-index: 2;
}
.imm-scene .backdrop-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* ---------------------------------------------------------- world map (#/map) */

/* Rakennuspinni: pelkkä linkki (ei action-nappia) — klikkaus navigoi suoraan
   hash-reittiin. Talomallinen (pyöristetty neliö) erottuu ammattikartaston
   teardrop-node-pinnistä. Nimilappu tulee esiin hover/focus/touch-fokuksella. */
.building-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  min-width: 26px;
  min-height: 26px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: radial-gradient(circle at 40% 35%, var(--gold), var(--bronze-deep));
  border: 2px solid var(--gold);
  box-shadow: 0 2px 6px rgba(20, 14, 8, .6), 0 0 0 1px rgba(20, 14, 8, .35);
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease;
  text-decoration: none;
}
/* 44px kosketuskohde ilman että itse merkki kasvaa. */
.building-pin::before {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 10px;
}
.building-pin:hover, .building-pin:focus-visible {
  transform: translate(-50%, -50%) scale(1.14);
  box-shadow: 0 3px 10px rgba(20, 14, 8, .7), 0 0 12px var(--gold);
  outline: none;
}
.building-pin:focus-visible { border-color: #F2E4B8; }
.pin-label {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--night);
  border: 1px solid var(--night-line);
  color: var(--night-text);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
  z-index: 4;
}
.building-pin:hover .pin-label, .building-pin:focus-visible .pin-label { opacity: 1; }

/* ---------------------------------------------------------- environs (#/environs) */

/* Esteettömyys-/tekstikäyttäjä-fallback: pieni kulma-overlay scenen päällä
   (ei enää iso otsikkopaneeli) — kartta alkaa suoraan headerista. */
.env-list-link {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(36, 28, 18, .75);
  border: 1px solid var(--night-line);
  color: var(--night-text);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.env-list-link:hover { color: var(--gold); }

/* Kehys/vignette-kaava tulee jaetusta .imm-scenestä (ks. yllä) — .environs-scene
   kantaa vain zone-tason erikoistuksia (ei mitään tässä toistaiseksi). */

/* Perus-pinni: 44px kosketuskohde, sama kaava kuin .building-pin/.node-pin. */
.env-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  cursor: pointer;
  text-decoration: none;
  transition: transform .14s ease, box-shadow .14s ease;
}
.env-pin::before {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 10px;
}
.env-pin:hover, .env-pin:focus-visible {
  transform: translate(-50%, -50%) scale(1.14);
  outline: none;
}
.env-pin .pin-label {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--night);
  border: 1px solid var(--night-line);
  color: var(--night-text);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
  z-index: 4;
}
.env-pin:hover .pin-label, .env-pin:focus-visible .pin-label { opacity: 1; }

/* Keräyspaikka: teardrop kuten ammattikartaston node-pin, laurel-sävy erottaa
   sen retkizoneista. */
.env-pin-gather {
  min-width: 30px;
  min-height: 30px;
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  rotate: -45deg;
  background: radial-gradient(circle at 40% 35%, #7C9A57, var(--laurel));
  border: 2px solid #9CB876;
  box-shadow: 0 2px 6px rgba(20, 14, 8, .6), 0 0 0 1px rgba(20, 14, 8, .35);
}
.env-pin-gather .pin-label { rotate: 45deg; }
.env-pin-gather:hover, .env-pin-gather:focus-visible {
  box-shadow: 0 3px 10px rgba(20, 14, 8, .7), 0 0 12px #9CB876;
}

/* Retkizone: kilpimuotoinen virstanpylväs, numeroitu järjestyksessä. */
.env-pin-zone {
  min-width: 34px;
  min-height: 34px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: radial-gradient(circle at 40% 35%, var(--gold), var(--bronze-deep));
  border: 2px solid var(--gold);
  box-shadow: 0 2px 6px rgba(20, 14, 8, .6), 0 0 0 1px rgba(20, 14, 8, .35);
}
.env-pin-zone:hover, .env-pin-zone:focus-visible {
  box-shadow: 0 3px 10px rgba(20, 14, 8, .7), 0 0 12px var(--gold);
}
.pin-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  color: var(--night);
  text-shadow: 0 1px 0 rgba(249, 242, 228, .35);
}
/* Lukittu zone: EI linkki (div), ei hover/focus-tilaa, tumma+katkoviiva kuten
   .zone-card.locked. */
.env-pin-zone.locked {
  cursor: default;
  background: radial-gradient(circle at 40% 35%, #6A5A44, #2C2418);
  border-style: dashed;
  border-color: #8A7A5F;
  opacity: .72;
}
.env-pin-zone.locked .pin-num { display: none; }
.env-pin-zone.locked:hover, .env-pin-zone.locked:focus-visible { transform: translate(-50%, -50%); box-shadow: 0 2px 6px rgba(20, 14, 8, .6), 0 0 0 1px rgba(20, 14, 8, .35); }
.env-pin-zone.locked .pin-lock {
  rotate: 0deg;
  width: 16px;
  height: 16px;
  fill: #D9CBA8;
}
.env-pin-zone.locked .pin-label { white-space: normal; width: max-content; max-width: 160px; text-align: center; }

/* ---------------------------------------------------------- full-page maps */

/* body.map-fullpage asetetaan route()issa view.fullBleed-lipusta (World Map,
   Environs). Kartta täyttää koko näkymän reunasta reunaan kahden sivupalkin
   välissä sen sijaan että se olisi keskitetty 1000px-paneeliin. min-height:0
   jokaisessa lenkissä estää flexboxin oletus-min-height:autosta syntyvän
   kutistumislukon (lapsen luontainen sisältökorkeus estäisi muuten mahtumisen
   viewportiin). */
/* Header+shell elävät #app-wrapperin sisällä (ei suoraan bodyn lapsina) —
   flex-ketju pitää käynnistää #appista, ei bodysta, jotta se saa oikean
   korkeuden jaettavaksi (100vh) header+shellin kesken. */
body.map-fullpage #app { display: flex; flex-direction: column; min-height: 100vh; }
/* .shellin oma align-items:flex-start (yllä) estäisi .viewiä venymästä koko
   korkeuteen — stretch tarvitaan jotta flex:1-ketju kantautuu .world-scenelle.
   margin:0 auto (.shellin perussääntö) pitää nollata eksplisiittisesti: auto-
   marginaali poikittaisakselilla ohittaa align-items:stretchin flexbox-
   spekin mukaan ja keskittäisi shellin sisältöleveyteensä leveytenä
   venymisen sijaan. */
body.map-fullpage .shell { max-width: none; margin: 0; flex: 1 1 auto; min-height: 0; align-items: stretch; }
body.map-fullpage .view { max-width: none; padding: 0; margin: 0; display: flex; flex-direction: column; min-height: 0; }
body.map-fullpage .imm-view { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
body.map-fullpage .imm-scene {
  flex: 1 1 auto;
  aspect-ratio: auto;
  max-height: none;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

@media (max-width: 899px) {
  /* Alapalkin väistötila säilyy full-page-tilassakin. */
  body.map-fullpage.has-nav .view { padding-bottom: 84px; }
}

/* ---------------------------------------------------------- mobile nav (V5) */

@media (max-width: 899px) {
  /* mobiilissa sivupalkin täysi lista piiloon; näytä primary + More */
  .nav-full { display: none; }
  .nav-mobile, .nav-more { display: flex; }

  .job-grid { grid-template-columns: 1fr; }
  .quest-grid { grid-template-columns: 1fr; }
  .lb-tabs { width: 100%; }
  .lb-tab { flex: 1; justify-content: center; }
  .prof-grid { grid-template-columns: 1fr; }
  .node-row, .recipe-row { flex-wrap: wrap; }
  .node-act { width: 100%; justify-content: space-between; }

  /* Scene-pinnit mobiilissa: isommat kosketuskohteet; hover-kortti ei ole
     käytössä (sheet kantaa kortin). Scene-laatikon koko tulee .imm-scenestä. */
  .node-pin { min-width: 38px; min-height: 38px; width: 38px; height: 38px; }
  .pin-tier { font-size: 15px; }

  /* Karttamerkit mobiilissa: hieman isommat kosketuskohteet, matalampi kuva. */
  .imm-scene { aspect-ratio: 4 / 3; max-height: 340px; }
  .building-pin { min-width: 30px; min-height: 30px; width: 30px; height: 30px; }
  .env-pin-gather { min-width: 34px; min-height: 34px; width: 34px; height: 34px; }
  .env-pin-zone { min-width: 38px; min-height: 38px; width: 38px; height: 38px; }

  /* Kortti-pohjaiset immersiiviset näkymät (kaikki paitsi %-pin-scenet kuten
     World Map/Environs, joilla on oma yllä oleva käsittely): nurkka-/pino-
     kortit menisivät päällekkäin kapealla näytöllä — kuva kutistuu matalaksi
     kaistaleeksi ylös (normaali dokumenttivirtaus, ei enää overflow:hidden-
     rajattu), kortit pinoutuvat sen alle täysleveinä night-paneeleina.
     Jaettu .imm-scene-cards-merkkiluokka kaikille korttipohjaisille scene-
     elementeille — uusi näkymä saa tämän ILMAN uutta mobiili-CSS:ää. */
  .imm-scene-cards {
    aspect-ratio: auto;
    max-height: none;
    height: auto;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
  .imm-scene-cards::after { display: none; }
  .imm-scene-cards .backdrop-img {
    position: relative;
    inset: auto;
    width: 100%;
    height: 160px;
    border-radius: 9px 9px 0 0;
  }
  .imm-stack {
    position: static;
    width: 100%;
    gap: 0;
  }
  .imm-card {
    flex: none;
    width: 100%;
    max-height: none;
    overflow-y: visible;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }
  .imm-card + .imm-card { border-top: 0; }
}

/* ---------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  .skel { animation: none; }
  .bar .fill { transition: none; }
  .nbar .fill { transition: none; }
  .sval.flash { animation: none; }
  .chat-dock.open { animation: none; }
  .wa-bar .fill { transition: none; }
  .q-bar .fill { transition: none; }
  .quest-card.ready .q-claim { animation: none; }
  .ms-panel { animation: none; }
  .pe-track .fill { transition: none; }
  .node-pin { transition: none; }
  .node-pin:hover, .node-pin:focus-visible { transform: translate(-50%, -50%); box-shadow: 0 2px 6px rgba(20, 14, 8, .6), 0 0 0 1px rgba(20, 14, 8, .35); }
  .building-pin { transition: none; }
  .building-pin:hover, .building-pin:focus-visible { transform: translate(-50%, -50%); box-shadow: 0 2px 6px rgba(20, 14, 8, .6), 0 0 0 1px rgba(20, 14, 8, .35); }
  .env-pin { transition: none; }
  .env-pin:hover, .env-pin:focus-visible { transform: translate(-50%, -50%); }
  .env-pin-gather:hover, .env-pin-gather:focus-visible,
  .env-pin-zone:hover, .env-pin-zone:focus-visible { box-shadow: 0 2px 6px rgba(20, 14, 8, .6), 0 0 0 1px rgba(20, 14, 8, .35); }
}

/* ============================================================
   V7 — The Forge (#/forge): casino-jalostus. Kanoniset tokenit,
   44px-kohteet, mobiili 1 palsta, ei emojia, prefers-reduced-motion.
   ============================================================ */

.forge-glyph { width: 26px; height: 26px; color: var(--bronze); }

.forge-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.forge-panel-head h2 { margin: 0; }
.forge-panel-head-acts { display: flex; align-items: center; gap: 14px; }

.forge-odds-link { min-height: 40px; padding: 8px 16px; font-size: 12.5px; }

.forge-lead {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------- forge workshop (3 columns) */
/* Yhden ruudun jalostuspaja forge.jpg-taustan päällä: VASEN inventaario, KESKELLÄ
   item-slot (alasin) toimintoineen, OIKEA supplies + Sealed Spolia. Forge on
   fullBleed (map-fullpage) → .imm-scene täyttää viewportin, joten workshop
   täyttää sen korkeuden ja sarakkeet vierittyvät sisäisesti. Mobiili (<900px):
   jaettu .imm-scene-cards-reflow pinoaa sarakkeet (kuvakaistale + kortit). */
.forge-workshop {
  position: relative;
  z-index: 3;
  height: 100%;
  min-height: 0;
  display: flex;
  gap: 16px;
  padding: 16px;
  align-items: stretch;
}
.forge-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  min-width: 0;
}
.forge-col-inv { flex: 0 0 clamp(240px, 22%, 300px); overflow-y: auto; }
.forge-col-slot { flex: 1 1 auto; overflow-y: auto; }
.forge-col-shop { flex: 0 0 clamp(300px, 27%, 360px); overflow-y: auto; }

@media (min-width: 900px) {
  /* Läpikuultavat night-kortit forge-taustan päällä (kuin premium/market-dock). */
  .forge-scene .imm-card {
    background: rgba(22, 15, 8, .90);
    border-color: rgba(201, 162, 75, .38);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .6);
  }
}

/* Vasemman inventaarion solulista (1 palsta). */
.forge-inv { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.forge-inv-grid { grid-template-columns: 1fr; margin-top: 8px; }
.forge-cell[aria-pressed="true"] {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), inset 0 0 16px rgba(201, 162, 75, .18);
}

/* Keskimmäinen item-slot (alasin). */
.forge-slot-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 220px;
  padding: 24px;
  text-align: center;
  border: 2px dashed var(--night-line);
  border-radius: 10px;
  margin-top: 8px;
}
.forge-slot-glyph .forge-glyph { width: 44px; height: 44px; color: var(--bronze); opacity: .7; }
.forge-slot-item {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 8px 0 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--night-line);
}
.forge-slot-art {
  width: 64px; height: 64px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--night-line);
}
.forge-slot-id { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.forge-slot-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .02em;
}
.forge-slot-meta { font-size: 12.5px; color: #B7A886; }

/* Toimintorivit: otsikko + vaadittu matsi + lopputulos + nappi. */
.forge-ops { display: flex; flex-direction: column; gap: 10px; }
.forge-op {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--night-soft);
  border: 1px solid var(--night-line);
  border-left: 3px solid var(--bronze);
  border-radius: var(--radius);
}
.forge-op.is-disabled { opacity: .6; border-left-color: var(--night-line); }
.forge-op-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.forge-op-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .05em;
  color: var(--gold);
}
.forge-op-req { font-size: 12px; color: var(--night-text); }
.forge-op-own { color: #B7A886; }
.forge-op-own.short { color: #E07A6A; }
.forge-op-out { font-size: 12.5px; color: var(--night-text); }
.forge-op-na { color: #8A7A5F; font-style: italic; }
.forge-op-btn { flex: none; min-width: 96px; min-height: 40px; padding: 8px 16px; font-size: 12.5px; }

/* Junon statti-valitsin ensimmäistä lumoa varten (korvaa enchant-rivin sisällön). */
.forge-juno { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.forge-juno-ask { font-size: 12.5px; color: var(--night-text); }
.forge-juno-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.forge-juno-stat, .forge-juno-cancel { min-height: 36px; padding: 6px 12px; font-size: 12px; }

/* Kolme saraketta vaatii tilaa (2 sivupalkkia syövät ~380px). Alle ~1280px
   viewportissa slot-sarake kutistuisi olemattomiin → pinotaan sarakkeet. */
@media (max-width: 1280px) {
  .forge-workshop { flex-direction: column; gap: 14px; }
  .forge-col { flex: none; width: 100%; min-height: 0; }
  .forge-inv { overflow: visible; }
  .forge-slot-name { font-size: 16px; }
}
/* 900–1280px: scene on täyskorkea (map-fullpage) → workshop vierittää sisäisesti. */
@media (max-width: 1280px) and (min-width: 900px) {
  .forge-workshop { height: 100%; overflow-y: auto; padding: 16px; }
  .forge-col { overflow: visible; }
}
/* ≤899px: scene reflowaa banneriksi (.imm-scene-cards) → normaali dokumenttivirtaus. */
@media (max-width: 899px) {
  .forge-workshop { height: auto; overflow: visible; padding: 0; gap: 0; }
  .forge-col { overflow: visible; }
}

/* ---------------------------------------------------------- consumable cards */

.forge-cons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.forge-cons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 10px;
  color: var(--night-text);
}

.fc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.fc-name { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.fc-qty { font-size: 12.5px; color: #C7B896; white-space: nowrap; }

.fc-blurb { font-size: 12px; color: #B7A886; min-height: 2.2em; }

.fc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 4px;
}
.fc-buy { min-width: 76px; min-height: 40px; padding: 8px 14px; font-size: 12.5px; }
.forge-cons .price-short { color: #E07A6A; }

/* ---------------------------------------------------------- sealed spolia */

.spolia-buy {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 6px;
}

.spolia-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.spolia-flabel {
  font-size: 11.5px;
  font-variant: small-caps;
  letter-spacing: .05em;
  font-weight: 700;
  color: var(--ink-soft);
}

.forge-select {
  min-height: 44px;
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.spolia-act {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.spolia-buy-btn { min-height: 44px; }

.linklike {
  border: 0;
  background: none;
  padding: 0;
  color: var(--bronze);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.linklike:hover { color: var(--bronze-deep); }

/* ---------------------------------------------------------- wax-seal caches */

.wax-tray {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.wax-cache {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  min-height: 44px;
  background: var(--night);
  border: 1px solid var(--bronze);
  border-radius: 10px;
  color: var(--night-text);
  cursor: pointer;
  text-align: center;
  transition: transform .12s ease, box-shadow .12s ease;
}
.wax-cache:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(20, 14, 8, .4); }
.wax-cache:disabled { opacity: .55; cursor: default; }

.wax-seal {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--gold);
  background: radial-gradient(circle at 50% 40%, #5A2320, #3A1512);
  border: 1px solid var(--crimson);
}
.wax-seal .forge-glyph { width: 22px; height: 22px; }

.wax-slot {
  font-weight: 700;
  font-size: 13px;
  font-variant: small-caps;
  letter-spacing: .04em;
}
.wax-ilvl { font-size: 11px; color: #B7A886; }
.wax-hint { font-size: 11px; color: var(--gold); font-variant: small-caps; letter-spacing: .05em; }

.wax-cache.cracking .wax-seal { animation: wax-crack .35s ease forwards; }
@keyframes wax-crack {
  0% { transform: scale(1) rotate(0); }
  40% { transform: scale(1.15) rotate(-6deg); }
  100% { transform: scale(.4) rotate(8deg); opacity: 0; }
}

/* ---------------------------------------------------------- reveal stage */

.reveal-backdrop { z-index: 60; }

.reveal-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 420px;
  padding: 8px;
}

.reveal-flash {
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, currentColor 0%, transparent 62%);
  animation: reveal-flash .7s ease-out forwards;
}
.reveal-flash.rarity-common { color: var(--rarity-common); }
.reveal-flash.rarity-uncommon { color: var(--rarity-uncommon); }
.reveal-flash.rarity-rare { color: var(--rarity-rare); }
.reveal-flash.rarity-epic { color: var(--rarity-epic); }
.reveal-flash.rarity-legendary { color: var(--rarity-legendary); }
.reveal-flash.rarity-mythic { color: var(--rarity-mythic); }
@keyframes reveal-flash {
  0% { opacity: 0; transform: scale(.3); }
  35% { opacity: .85; }
  100% { opacity: 0; transform: scale(1.4); }
}

.reveal-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 22px 18px 18px;
  background: var(--night);
  border: 1px solid var(--bronze);
  border-radius: 12px;
  color: var(--night-text);
  text-align: center;
  box-shadow: 0 8px 28px rgba(20, 14, 8, .55);
  animation: reveal-pop .35s ease-out both;
  animation-delay: .18s;
}
@keyframes reveal-pop {
  0% { opacity: 0; transform: scale(.9); }
  100% { opacity: 1; transform: scale(1); }
}

.reveal-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: .04em;
  overflow-wrap: anywhere;
}
.reveal-meta {
  font-size: 12px;
  font-variant: small-caps;
  letter-spacing: .05em;
  color: #8A7A5F;
}
.reveal-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  font-size: 13px;
}
.reveal-ok { margin-top: 6px; min-height: 44px; min-width: 120px; }

/* Vähennetty liike: ei välähdystä eikä pop-animaatiota — välitön paljastus. */
.reveal-backdrop.reduce .reveal-flash { display: none; }
.reveal-backdrop.reduce .reveal-card { animation: none; }

/* ---------------------------------------------------------- odds modal */

.forge-modal-backdrop { z-index: 55; }

.forge-modal {
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--parchment);
  border: 1px solid var(--bronze);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(43, 33, 24, .45);
}

.fm-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--night);
  color: var(--night-text);
}
.fm-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .05em;
}
.fm-close { color: var(--night-text); font-size: 22px; line-height: 1; }

.fm-body { padding: 12px 16px 16px; }
.fm-h3 {
  margin: 14px 0 6px;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink);
}
.fm-h3:first-child { margin-top: 2px; }
.fm-note { margin: 8px 0 0; font-size: 12px; color: var(--ink-soft); }

.odds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.odds-table td {
  padding: 7px 4px;
  border-bottom: 1px solid var(--line);
}
.odds-table tr:last-child td { border-bottom: 0; }
.odds-pct { text-align: right; font-weight: 700; white-space: nowrap; }
.odds-arrow { margin: 0 4px; color: var(--ink-soft); }

/* ---------------------------------------------------------- enchant badge */

.ench-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  font-size: .82em;
  font-weight: 700;
  color: var(--night);
  background: var(--gold);
  border-radius: 999px;
  vertical-align: middle;
}

/* ---------------------------------------------------------- item-sheet forge block */

.forge-block {
  margin-top: 12px;
  padding: 12px;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.fb-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .05em;
  color: var(--ink);
}
.fb-glyph { width: 18px; height: 18px; color: var(--bronze); }

.fb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.fb-row:last-of-type { border-bottom: 0; }

.fb-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fb-label { font-weight: 700; font-size: 13.5px; font-variant: small-caps; letter-spacing: .03em; }
.fb-sub { font-size: 12px; color: var(--ink-soft); overflow-wrap: anywhere; }
.fb-arrow { color: var(--ink-soft); }

.fb-btn { min-width: 84px; min-height: 40px; padding: 8px 14px; font-size: 12.5px; }

.fb-note { margin: 8px 0 0; font-size: 11.5px; color: var(--ink-soft); }
.fb-note a { color: var(--bronze); }

/* Inline-varmistus + Juno-stativalinta forge-rivillä */
.fb-confirm { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.fb-ask { font-size: 12.5px; font-weight: 700; }
.fb-confirm-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
}
.fb-stat { min-height: 40px; padding: 8px 10px; font-size: 12px; }

/* Onnistumis-flash lakanan uudelleenavauksessa */
.item-sheet.forge-flash { animation: forge-flash .6s ease-out; }
@keyframes forge-flash {
  0% { box-shadow: 0 0 0 0 rgba(201, 162, 75, .0), 0 8px 28px rgba(43, 33, 24, .45); }
  30% { box-shadow: 0 0 0 3px rgba(201, 162, 75, .75), 0 8px 28px rgba(43, 33, 24, .45); }
  100% { box-shadow: 0 0 0 0 rgba(201, 162, 75, .0), 0 8px 28px rgba(43, 33, 24, .45); }
}

/* ---------------------------------------------------------- forge mobile */

@media (max-width: 899px) {
  .spolia-act { margin-left: 0; width: 100%; }
  .spolia-buy-btn { flex: 1; }
  .spolia-field { flex: 1; min-width: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  .wax-cache { transition: none; }
  .wax-cache:hover { transform: none; }
  .wax-cache.cracking .wax-seal { animation: none; opacity: 0; }
  .reveal-flash { display: none; }
  .reveal-card { animation: none; }
  .item-sheet.forge-flash { animation: none; }
}

/* ============================================================
   V8 — MARKETPLACE (#/market): night-listauskortit (rarity-väri +
   glow tokens.css:stä), suodatinpalkki, sivutus, My listings,
   hintainput-popover (gear-lakana + materiaalilakana), locked-paneeli.
   Kanoniset tokenit, 44px-kohteet, mobiili, ei emojia.
   ============================================================ */

.mk-head { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.mk-head .gold-line { margin: 0; }
.mk-tabbar { margin-left: auto; }

/* trades.js:n mtTabsHtml-kortti: sama .tabbar.mk-tabbar kuin market.js:ssä,
   mutta ilman gold-line-sisarta joka muualla tekee vanhemmasta flex-kontin.
   margin-left:auto ei työnnä mitään oikealle jollei vanhempi ole flex —
   ilman tätä riviä napit valuivat kortin vasempaan reunaan Marketin oikealle
   asemoitujen nappien sijaan. */
.mt-tab-card { display: flex; }

/* --- suodatinpalkki --- */
.mk-filters {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}
.mk-kind {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.mk-kindbtn {
  min-height: 38px;
  min-width: 88px;
  padding: 8px 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .06em;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.mk-kindbtn.active {
  color: var(--gold);
  background: var(--night);
}
.mk-fields, .mk-sort { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.mk-fields[hidden] { display: none; }
.mk-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  font-variant: small-caps;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink-soft);
}
.mk-field select, .mk-field input {
  min-height: 44px;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.mk-field select { min-width: 132px; }
.mk-lvlpair { display: inline-flex; align-items: center; gap: 6px; }
.mk-lvlpair input { width: 68px; }
.mk-dash { color: var(--ink-soft); }
.mk-apply { min-width: 96px; }

/* --- browse-ruudukko + kortit --- */
.mk-taxnote {
  margin: 0 0 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}
.mk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.mk-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 10px;
  color: var(--night-text);
}
.mk-card.mk-own { border-color: var(--bronze); }
.mk-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.mk-name {
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.mk-matname { color: var(--night-text); }
.mk-own-badge {
  flex: none;
  padding: 2px 8px;
  font-size: 10.5px;
  font-variant: small-caps;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--gold);
  border: 1px solid var(--bronze);
  border-radius: 999px;
  white-space: nowrap;
}
.mk-meta {
  font-size: 11.5px;
  font-variant: small-caps;
  letter-spacing: .04em;
  color: #8A7A5F;
}
.mk-stats {
  font-size: 12.5px;
  color: var(--night-text);
  min-height: 1.4em;
}
.mk-matunit { color: #C7B896; }
.mk-seller {
  font-size: 11.5px;
  color: #C7B896;
}
.mk-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
}
.mk-card .price-short { color: #E07A6A; }
.mk-btn { min-width: 84px; padding: 8px 16px; font-size: 12.5px; }

/* --- sivutus --- */
.mk-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}
.mk-page-btn { min-width: 84px; padding: 8px 16px; font-size: 12.5px; }
.mk-page-lbl {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--ink-soft);
}

/* --- My listings --- */
.mk-count {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--bronze-deep);
  letter-spacing: 0;
  text-transform: none;
}
.mk-mine-list { display: grid; gap: 8px; }
.mk-mine-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.mk-mine-item { display: flex; flex-direction: column; gap: 2px; margin-right: auto; min-width: 0; }
.mk-mine-item .mk-name { font-size: 14px; }
.mk-mine-sub {
  font-size: 11.5px;
  font-variant: small-caps;
  letter-spacing: .04em;
  color: var(--ink-soft);
}
.mk-mine-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 74px;
  justify-content: flex-end;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.mk-sold-row { opacity: .92; }
.mk-net { display: inline-flex; align-items: center; gap: 8px; }
.mk-net-lbl {
  font-size: 11px;
  font-variant: small-caps;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

/* --- locked-paneeli --- */
.mk-locked { text-align: center; padding: 32px 20px; }
.mk-lock-glyph { color: var(--bronze); display: flex; justify-content: center; margin-bottom: 6px; }
.mk-lock-glyph .mk-glyph { width: 44px; height: 44px; }
.mk-locked h2 {
  border: 0;
  padding: 0;
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: .06em;
  text-transform: none;
  color: var(--ink);
}
.mk-lock-note {
  max-width: 460px;
  margin: 0 auto 16px;
  font-size: 14px;
  color: var(--ink-soft);
}
.mk-lock-bar {
  max-width: 320px;
  height: 12px;
  margin: 0 auto 6px;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.mk-lock-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--bronze), var(--gold));
  border-radius: 999px;
  transition: width .4s ease;
}
.mk-lock-prog {
  margin: 0;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* --- listaus-popover (gear-lakana + materiaalilakana) --- */
.mk-list-pop {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: var(--parchment);
  border: 1px solid var(--bronze);
  border-radius: var(--radius);
}
.mk-list-title { font-size: 13.5px; font-weight: 700; }
.mk-list-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  font-variant: small-caps;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink-soft);
}
.mk-list-field input {
  min-height: 44px;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.mk-list-preview { display: grid; gap: 4px; }
.mk-list-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
}
.mk-list-line span:first-child {
  font-variant: small-caps;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--ink-soft);
}
.mk-list-fee { font-weight: 700; color: var(--crimson); }
.mk-list-recv { font-weight: 700; color: var(--laurel); }
.mk-list-fee.price-short { color: var(--crimson); }
.mk-list-hint {
  margin: 0;
  font-size: 12px;
  color: var(--ink-soft);
}
.mk-list-acts {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.mk-matsell .mk-list-field { margin-bottom: 10px; }

/* --- pouchin Sell on market -nappi --- */
.pouch-cell-sellable {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 4px;
}
.pouch-cell-sellable .pouch-name,
.pouch-cell-sellable .pouch-qty { align-self: flex-start; }
.pouch-sell {
  min-height: 32px;
  margin-top: 4px;
  padding: 5px 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--ink);
  background: var(--parchment);
  border: 1px solid var(--bronze);
  border-radius: 6px;
  cursor: pointer;
}
.pouch-sell:hover { background: var(--parchment-deep); }

/* --- market mobiili --- */
@media (max-width: 899px) {
  .mk-tabbar { margin-left: 0; width: 100%; }
  .mk-tabbar .tabbtn { flex: 1; }
  .mk-filters { align-items: stretch; }
  .mk-kind { width: 100%; }
  .mk-kindbtn { flex: 1; }
  .mk-fields, .mk-sort { width: 100%; }
  .mk-field, .mk-field select { width: 100%; }
  .mk-apply { width: 100%; }
  .mk-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .mk-mine-row { flex-wrap: wrap; }
  .mk-mine-time { min-width: 0; }
}

/* ============================================================
   V9 — Suorat kaupat (#/trades, #/trades/:id) + kaupankäyntikomposeri
   + chatin kuiskaukset ja kauppakutsukortit.
   Kanoniset tokenit, 44px-kohteet, mobiili 1 palsta, ei emojia,
   prefers-reduced-motion.
   ============================================================ */

.tr-headpanel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.tr-headpanel h2 { margin: 0; }
.tr-new { margin-left: auto; min-width: 130px; }

.tr-count {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--bronze-deep);
  letter-spacing: 0;
  text-transform: none;
}

/* --- tarjouskorttilista --- */
.tr-list { display: grid; gap: 10px; }
.tr-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.tr-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.tr-who { font-size: 14px; color: var(--ink); }
.tr-who b { color: var(--bronze-deep); }

.tr-status {
  padding: 2px 9px;
  font-size: 10.5px;
  font-variant: small-caps;
  font-weight: 700;
  letter-spacing: .05em;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.tr-status-pending { color: var(--bronze-deep); border-color: var(--bronze); }
.tr-status-accepted { color: var(--laurel); border-color: var(--laurel); }
.tr-status-declined, .tr-status-cancelled { color: var(--crimson); border-color: var(--crimson); }
.tr-status-expired { color: var(--ink-soft); }

.tr-expiry {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* --- give/want-palstat --- */
.tr-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tr-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 8px;
  color: var(--night-text);
}
.tr-side-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--gold);
}
.tr-side-empty {
  margin: 0;
  font-size: 12.5px;
  font-style: italic;
  color: #8A7A5F;
}
.tr-item { display: flex; flex-direction: column; gap: 1px; }
.tr-item-name { font-weight: 700; font-size: 13.5px; overflow-wrap: anywhere; }
.tr-item-meta {
  font-size: 11px;
  font-variant: small-caps;
  letter-spacing: .04em;
  color: #8A7A5F;
}
.tr-mat {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.tr-mat-name { font-size: 13px; color: var(--night-text); overflow-wrap: anywhere; }
.tr-mat-qty { font-weight: 700; font-size: 12.5px; color: #C7B896; }
.tr-goldrow { display: inline-flex; align-items: center; gap: 6px; }
.tr-coin { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--gold); }
.tr-goldlbl { font-size: 11.5px; color: #C7B896; }

.tr-item-gone { opacity: .5; }
.tr-gone-tag {
  font-size: 10.5px;
  font-variant: small-caps;
  letter-spacing: .04em;
  color: var(--rarity-mythic);
}

.tr-card-acts, .tr-detail-acts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.tr-card-acts .btn, .tr-detail-acts .btn { min-width: 96px; padding: 8px 16px; font-size: 12.5px; }
.tr-share { text-decoration: none; }

/* --- accept-inline-varmistus --- */
.tr-confirm {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}
.tr-confirm-ask { flex: 1 1 220px; font-size: 13px; font-weight: 700; color: var(--ink); }
.tr-confirm-acts { display: inline-flex; gap: 8px; }

/* --- history --- */
.tr-hist { display: grid; gap: 6px; }
.tr-hist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13.5px;
}
.tr-hist-who { margin-right: auto; }
.tr-hist-who b { color: var(--bronze-deep); }
.tr-hist-link {
  color: var(--bronze);
  font-weight: 700;
  font-size: 12.5px;
  text-decoration: none;
}
.tr-hist-link:hover { color: var(--bronze-deep); text-decoration: underline; }

/* --- detail --- */
.tr-detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.tr-back { color: var(--bronze); font-weight: 700; text-decoration: none; }
.tr-back:hover { color: var(--bronze-deep); text-decoration: underline; }
.tr-detail-who { margin: 0 0 12px; font-size: 15px; }
.tr-detail-who b { color: var(--bronze-deep); }
.tr-taxnote, .tr-detail .tr-taxnote {
  margin: 12px 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

/* --- locked --- */
.tr-locked { text-align: center; padding: 32px 20px; }
.tr-lock-wrap { color: var(--bronze); display: flex; justify-content: center; margin-bottom: 6px; }
.tr-lock-glyph { width: 44px; height: 44px; }
.tr-locked h2 {
  border: 0;
  padding: 0;
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: .06em;
  text-transform: none;
  color: var(--ink);
}
.tr-lock-note {
  max-width: 460px;
  margin: 0 auto 16px;
  font-size: 14px;
  color: var(--ink-soft);
}
.tr-lock-bar {
  max-width: 320px;
  height: 12px;
  margin: 0 auto 6px;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.tr-lock-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--bronze), var(--gold));
  border-radius: 999px;
  transition: width .4s ease;
}
.tr-lock-prog { margin: 0; font-weight: 700; font-size: 12.5px; color: var(--ink-soft); }

/* --- kaupankäyntikomposeri (jaettu item-sheet-lakana) --- */
.tc-sheet { max-width: 620px; }
.tc-head .is-name { display: inline-flex; align-items: center; gap: 8px; }
.tc-glyph { width: 20px; height: 20px; color: var(--gold); }
.tc-body { display: flex; flex-direction: column; gap: 14px; }

.tc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  font-variant: small-caps;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink-soft);
}
.tc-field input, .tc-field select {
  min-height: 44px;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 15px;
  font-variant: normal;
  letter-spacing: 0;
  color: var(--ink);
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.tc-gold input { max-width: 180px; }

.tc-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.tc-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.tc-coltitle {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--bronze-deep);
}
.tc-sublabel {
  font-size: 11px;
  font-variant: small-caps;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink-soft);
}
.tc-empty { margin: 0; font-size: 12.5px; font-style: italic; color: var(--ink-soft); }

.tc-picklist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.tc-pick {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 9px;
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.tc-pick-on { border-color: var(--bronze); background: #F0E6CB; }
.tc-pick input { margin-top: 3px; flex: none; width: 16px; height: 16px; }
.tc-pick-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tc-pick-name { font-weight: 700; font-size: 13.5px; overflow-wrap: anywhere; }
.on-light .tc-pick-name.rarity-common { color: var(--rarity-common-on-light); }
.tc-pick-meta {
  font-size: 11px;
  font-variant: small-caps;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

.tc-matlist { display: flex; flex-direction: column; gap: 6px; }
.tc-matrow {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tc-mat-name { flex: 1 1 auto; font-size: 13px; overflow-wrap: anywhere; }
.tc-mat-have { font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.tc-matrow input {
  width: 74px;
  min-height: 40px;
  padding: 6px 8px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tc-wantmat-add, .tc-wantgear-add {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tc-wantmat-add select { flex: 1 1 120px; min-height: 40px; }
.tc-wantmat-add input, .tc-wantgear-add input {
  width: 78px;
  min-height: 40px;
  padding: 6px 8px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.tc-addbtn { min-height: 40px; min-width: 60px; padding: 6px 14px; font-size: 12px; }
.tc-wantmat-lines, .tc-wantgear-lines { display: flex; flex-direction: column; gap: 4px; }
.tc-added {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 10px;
  font-size: 13px;
  background: var(--parchment);
  border: 1px solid var(--bronze);
  border-radius: var(--radius);
}
.tc-remove {
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  font: 700 15px/1 var(--font-body);
  color: var(--crimson);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.tc-remove:hover { background: var(--parchment-deep); }
.tc-hint { margin: 4px 0 0; font-size: 11.5px; color: var(--ink-soft); }

.tc-summary { display: grid; gap: 3px; }
.tc-sum-line { margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.tc-sum-warn { margin: 2px 0 0; font-size: 12.5px; font-weight: 700; color: var(--crimson); }
.tc-sum-warn.tc-sum-info { color: var(--ink-soft); }

/* --- chat: kuiskaukset + kauppakutsukortti --- */
.chat-whisper {
  line-height: 1.35;
  overflow-wrap: anywhere;
  font-style: italic;
  color: #C7B896;
}
.chat-whisper-out { color: #A99A7A; }
.chat-w-name { color: var(--gold); font-weight: 700; font-style: normal; text-decoration: none; }
.chat-w-name:hover { text-decoration: underline; }
.chat-w-dir { font-variant: small-caps; letter-spacing: .03em; }
.chat-w-text { color: #DCCFAF; }

.chat-ti {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--night-soft);
  border: 1px solid var(--bronze);
  border-radius: var(--radius);
}
.chat-ti-icon { flex: none; color: var(--gold); }
.chat-ti-icon svg { width: 22px; height: 22px; }
.chat-ti-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-ti-title { font-size: 12.5px; color: var(--night-text); overflow-wrap: anywhere; }
.chat-ti-link {
  align-self: flex-start;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
}
.chat-ti-link:hover { text-decoration: underline; }

/* --- trades mobiili --- */
@media (max-width: 899px) {
  .tr-new { margin-left: 0; width: 100%; }
  .tr-cols { grid-template-columns: 1fr; }
  .tr-card-acts .btn, .tr-detail-acts .btn { flex: 1; min-width: 0; }
  .tc-sheet { max-width: 100%; }
  .tc-cols { grid-template-columns: 1fr; }
  .tc-gold input { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tr-lock-fill { transition: none; }
}

/* ============================================================ V10 PREMIUM (#/premium) */
/* Imperial Treasury -taustan (public/assets/scenes/premium.jpg) esiin jättävä
   asettelu: työpöydällä ohjauspaneeli dokataan oikeaan reunaan (imm-stack-right),
   jolloin treasury-sali (kupoli, aarrearkut, keskellä punnitseva rahastonhoitaja)
   näkyy vasemmalla/keskellä. Mobiilissa käytetään jaettua .imm-scene-cards-reflowia
   (kuva-kaistale + täysleveät kortit), joten nämä ovat vain min-width:900px. */
@media (min-width: 900px) {
  .premium-panel { width: min(660px, 46vw); }
  .premium-scene .imm-card {
    background: rgba(22, 15, 8, .90);
    border-color: rgba(201, 162, 75, .38);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .6);
  }
  /* Ei venytetä pakettikorttia koko korkeuteen — jättäisi ison tyhjän paneelin. */
  .premium-scene .aur-shop { flex: 0 1 auto; }
  /* Kapeampi paneeli → paketit 2 sarakkeeseen (auto-fitin sijaan). */
  .premium-scene .aur-pkg-grid { grid-template-columns: 1fr 1fr; }
  /* Luettavuus-scrim panelin taakse oikeaan reunaan (kuvan yli, panelin alle). */
  .premium-scene::before {
    content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: linear-gradient(90deg, rgba(20, 14, 8, 0) 40%, rgba(20, 14, 8, .30) 62%, rgba(20, 14, 8, .55) 100%);
  }
}

/* ============================================================ MAP SIDE PANEL (shared) */
/* Jaettu kelluva, piilotettava oikean reunan paneeli scene-taustakuvan päälle:
   Expeditions (#/expeditions) JA gather-ammatit (#/professions/*). Kun taustakuva
   on itse sisältöä (kartta + pinnit), paneeli on kapea + läpikuultava jotta kuva
   näkyy selvästi läpi; piilotusnappi liu'uttaa sen scenen oikean reunan taakse
   (kahva jää näkyviin), jolloin scene pysyy lähes kokonaan peittämättömänä. */
.map-panel {
  width: 300px;
  transition: transform .22s ease;
}
.map-panel .zone-grid { grid-template-columns: 1fr; }
.map-panel-toggle {
  position: absolute;
  left: -18px;
  top: 16px;
  z-index: 4;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--night);
  border: 1px solid var(--bronze);
  color: var(--gold);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
.map-panel-toggle:hover { background: var(--night-soft); }
@media (prefers-reduced-motion: reduce) {
  .map-panel { transition: none; }
}
@media (min-width: 900px) {
  /* Piilotus vain työpöydällä — mobiilissa .imm-stack reflowaa staattiseksi
     täysleveäksi pinoksi, jossa vaakasiirto työntäisi paneelin ruudun ulos. */
  .map-panel.collapsed { transform: translateX(calc(100% - 40px)); }
  .expeditions-scene .imm-card,
  .prof-gather-scene .imm-card {
    background: rgba(22, 15, 8, .72);
    border-color: rgba(201, 162, 75, .34);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .55);
  }
  .expeditions-scene::before,
  .prof-gather-scene::before {
    content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: linear-gradient(90deg, rgba(20, 14, 8, 0) 55%, rgba(20, 14, 8, .22) 74%, rgba(20, 14, 8, .42) 100%);
  }
}
@media (max-width: 899px) {
  /* Mobiilissa scene reflowaa banneriksi + staattiseksi täysleveäksi pinoksi
     (jaettu .imm-scene-cards-reflow): paneeli täyttää leveyden, eikä
     piilotusnappia tarvita (ei overlay-tilaa jota kätkeä). Tulee LÄHDEKOODISSA
     .map-panelin oletusleveyden JÄLKEEN → voittaa saman spesifisyyden. */
  .map-panel { width: 100%; }
  .map-panel-toggle { display: none; }
}

.stat-aurei { text-decoration: none; color: inherit; cursor: pointer; }
.stat-aurei:hover { color: var(--gold); }
.aur-coin, .aur-balance {
  display: inline-flex; align-items: center; gap: 5px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.aur-balance {
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  color: var(--gold); letter-spacing: .04em;
}
.aur-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
/* view-title/view-sub eivät koskaan saaneet omaa tyyliä (perivät selaimen
   oletus-h1:n) — huomaamatonta täysleveällä sivulla, mutta rajaa nyt korkean
   oletusmarginaalin takia korttia kun se on kompakti .imm-card. */
.view-title { margin: 0 0 4px; font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: .04em; }
.view-sub { margin: 0; font-size: 13.5px; color: var(--ink-soft); }
.imm-card .view-sub { color: var(--night-text); opacity: .8; }

.aur-notice {
  margin: 0 0 12px; padding: 9px 12px; border-radius: var(--radius);
  background: var(--night-soft); border: 1px solid var(--bronze);
  color: var(--night-text); font-size: 13.5px;
}
.aur-notice-bonus { border-color: var(--gold); }
.aur-notice-lock { border-color: var(--rarity-mythic); color: #F2C7C7; }

.aur-pkg-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px;
}
.aur-pkg {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 16px 12px; border: 1px solid var(--bronze); border-radius: var(--radius);
  background: var(--night); box-shadow: var(--shadow, 0 2px 6px rgba(43,33,24,.18));
}
.aur-pkg-amount { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--gold); }
.aur-pkg-amount .icon-sm { width: 20px; height: 20px; }
.aur-pkg-bonus { font-size: 11.5px; color: var(--night-text); opacity: .8; }
.aur-pkg-name { font-size: 12.5px; color: var(--night-text); letter-spacing: .03em; }
.aur-buy { width: 100%; margin-top: 4px; min-height: 44px; font-family: var(--font-display); font-weight: 700; letter-spacing: .04em; }

.aur-cache {
  padding: 14px; border: 1px solid var(--bronze); border-radius: var(--radius);
  background: var(--night); margin-bottom: 16px;
}
.aur-cache-head h3 { margin: 0 0 4px; font-family: var(--font-display); color: var(--gold); letter-spacing: .05em; }
.aur-cache-head p { margin: 0 0 12px; font-size: 13px; color: var(--night-text); }
.aur-cache-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.aur-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--night-text); }
.aur-cache-controls .btn { min-height: 44px; }
.aur-imp-buy { display: inline-flex; align-items: center; gap: 7px; }
.aur-cache-note { margin: 10px 0 0; font-size: 12px; color: var(--night-text); opacity: .85; }
.aur-cache-note a, .aur-compliance-links a { color: var(--gold); }

.aur-sub { margin: 4px 0 10px; font-family: var(--font-display); color: var(--gold); letter-spacing: .05em; font-size: 15px; }
.aur-item-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.aur-item {
  display: flex; flex-direction: column; gap: 6px; padding: 12px;
  border: 1px solid var(--bronze); border-radius: var(--radius); background: var(--night);
}
.aur-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.aur-item-name { font-weight: 700; color: var(--night-text); font-size: 13.5px; }
.aur-item-price { color: var(--gold); }
.aur-item-blurb { margin: 0; font-size: 12px; color: var(--night-text); opacity: .85; flex: 1; }
.aur-spend { min-height: 40px; }

.aur-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.aur-odds-table, .aur-history-table { width: 100%; border-collapse: collapse; }
.aur-odds-table th, .aur-odds-table td, .aur-history-table td {
  padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--bronze);
  font-size: 13px; color: var(--night-text);
}
.aur-odds-table th { font-family: var(--font-display); color: var(--gold); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.aur-odds-table td.rarity-common { color: var(--rarity-common); }
.aur-odds-table td.rarity-uncommon { color: var(--rarity-uncommon); }
.aur-odds-table td.rarity-rare { color: var(--rarity-rare); }
.aur-odds-table td.rarity-epic { color: var(--rarity-epic); }
.aur-odds-table td.rarity-legendary { color: var(--rarity-legendary); }
.aur-odds-table td.rarity-mythic { color: var(--rarity-mythic); font-weight: 700; }
.rarity-mythic { color: var(--rarity-mythic); }
.aur-compliance { margin: 12px 0 4px; font-size: 12px; color: var(--night-text); opacity: .9; line-height: 1.5; }
.aur-compliance-links { margin: 0; font-size: 12px; }
.aur-delta.aur-pos { color: var(--rarity-uncommon); font-variant-numeric: tabular-nums; }
.aur-delta.aur-neg { color: #C98B7A; font-variant-numeric: tabular-nums; }
.aur-history-table td:last-child { text-align: right; }

/* FIX: odds + history olivat vaaleita .panel-paneeleja mutta sisältö käytti
   vaaleaa --night-text -tekstiä + rarity-värejä (jotka on suunniteltu TUMMILLE
   night-paneeleille; common=valkoinen) → näkymätöntä. Tehdään näistä tummat kuten
   muutkin premium-kortit; otsikko vaaleaksi (kullaksi) tummalle taustalle. */
.aur-odds, .aur-history { background: var(--night); border-color: var(--bronze); }
.aur-odds h2, .aur-history h2 { color: var(--gold); border-bottom-color: var(--bronze); }

@media (max-width: 899px) {
  .aur-two-col { grid-template-columns: 1fr; }
  .aur-cache-controls { flex-direction: column; align-items: stretch; }
  .aur-cache-controls .btn { width: 100%; justify-content: center; }
}

/* ============================================================ V11 auth footer + Turnstile */
.auth-legal {
  margin: 18px 0 0; text-align: center; font-size: 12.5px;
  display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap;
}
.auth-legal a { color: #B8A98C; text-decoration: none; }
.auth-legal a:hover { color: var(--gold); text-decoration: underline; }
.cf-turnstile-mount { margin: 4px 0 14px; min-height: 0; display: flex; justify-content: center; }

/* ============================================================ forge dual-currency (gold/aurei) */
.fc-foot-dual { display: flex; gap: 8px; }
.fc-foot-dual .fc-buy {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 40px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.fc-buy .aur-ico { width: 16px; height: 16px; }
.aurword { color: var(--gold); font-weight: 600; }
.coinword { color: var(--bronze-deep, #6E521F); font-weight: 600; }

/* ============================================================ Ascension ritual */
.forge-ascend .ascend-info { margin: 4px 0 12px; font-size: 14px; color: var(--night-text, #EDE4CF); }
.ascend-fervor { color: var(--gold); font-weight: 700; }
.ascend-plus { color: var(--rarity-uncommon); font-weight: 700; }

.ascend-backdrop {
  display: flex; align-items: center; justify-content: center;
  /* forge.jpg näkyy himmeänä rituaalin takana (sama alttari mistä juuri
     klikkasit) — tumma radial-gradient scrim päällä pitää kortin luettavana. */
  background-image:
    radial-gradient(120% 90% at 50% 40%, rgba(20,14,6,.86), rgba(10,7,3,.95)),
    url('/assets/scenes/forge.jpg');
  background-size: cover, cover;
  background-position: center, center 30%;
}
.ascend-stage {
  position: relative; width: min(440px, 92vw); padding: 26px 22px 22px; text-align: center;
  border: 1px solid var(--bronze); border-radius: 10px; overflow: hidden;
  background: linear-gradient(180deg, #2A2114, #1A140C);
  box-shadow: 0 10px 44px rgba(0,0,0,.6);
}
.ascend-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.ascend-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: .03em; }
.ascend-arrow { font-size: 14px; color: var(--night-text); }

.ascend-core { position: relative; width: 150px; height: 150px; margin: 4px auto; display: grid; place-items: center; }
.ascend-glow {
  position: absolute; width: 70px; height: 70px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,162,75,.95), rgba(201,162,75,.18) 60%, transparent 72%);
  filter: blur(2px); opacity: .45;
}
.ascend-ring { position: absolute; width: 118px; height: 118px; border-radius: 50%; border: 2px dashed rgba(201,162,75,.5); opacity: .5; }
.ascend-spark { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); opacity: 0; }

.ascend-bar { height: 8px; border-radius: 5px; margin: 14px auto 2px; width: 82%; background: rgba(0,0,0,.4); border: 1px solid var(--bronze); overflow: hidden; }
.ascend-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--bronze), var(--gold)); box-shadow: 0 0 10px var(--gold); }

.ascend-stage.charging .ascend-fill { animation: ascend-fill 1.8s cubic-bezier(.45,.05,.55,1) forwards; }
.ascend-stage.charging .ascend-glow { animation: ascend-pulse .55s ease-in-out infinite alternate; }
.ascend-stage.charging .ascend-ring { animation: ascend-spin 2.2s linear infinite; }
@keyframes ascend-fill { from { width: 0; } to { width: 100%; } }
@keyframes ascend-pulse { from { opacity: .45; transform: scale(.85); } to { opacity: 1; transform: scale(1.28); } }
@keyframes ascend-spin { to { transform: rotate(360deg); } }

.ascend-stage.reveal-success .ascend-glow { opacity: 1; animation: ascend-burst .7s ease-out forwards; }
.ascend-stage.reveal-success .ascend-ring { border-color: var(--gold); opacity: 1; box-shadow: 0 0 24px var(--gold); }
@keyframes ascend-burst { 0% { transform: scale(.6); opacity: 1; } 60% { transform: scale(2.4); opacity: .9; } 100% { transform: scale(3.3); opacity: 0; } }
.ascend-stage.reveal-success::after { content: ""; position: absolute; inset: 0; pointer-events: none; animation: ascend-flash .6s ease-out forwards; }
@keyframes ascend-flash { 0% { box-shadow: inset 0 0 0 rgba(201,162,75,0); } 25% { box-shadow: inset 0 0 70px rgba(201,162,75,.6); } 100% { box-shadow: inset 0 0 0 rgba(201,162,75,0); } }

.ascend-stage.reveal-fail .ascend-glow { opacity: .15; transform: scale(.6); background: radial-gradient(circle, rgba(150,60,50,.5), transparent 65%); transition: all .5s; }
.ascend-stage.reveal-fail .ascend-ring { border-color: rgba(150,70,60,.5); opacity: .3; }

.ascend-result { min-height: 40px; margin-top: 8px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ascend-msg { margin: 0; font-size: 16px; }
.ascend-msg.success { font-family: var(--font-display); font-weight: 700; letter-spacing: .03em; }
.ascend-msg.fail { color: #D9B7A9; font-size: 14px; }
.ascend-done { min-width: 140px; min-height: 42px; }
.ascend-mute {
  position: absolute; top: 8px; right: 10px; background: transparent; border: 1px solid var(--bronze);
  color: var(--night-text); border-radius: 4px; font-size: 11px; padding: 3px 8px; cursor: pointer;
}
.ascend-mute[aria-pressed="true"] { opacity: .5; }

@media (prefers-reduced-motion: reduce) {
  .ascend-stage.charging .ascend-fill { animation: none; width: 100%; }
  .ascend-stage.charging .ascend-glow, .ascend-stage.charging .ascend-ring,
  .ascend-stage.reveal-success .ascend-glow, .ascend-stage.reveal-success::after { animation: none; }
}

/* ============================================================ profession action loader */
.prof-action-loader {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
  z-index: 50; display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; max-width: min(92vw, 360px);
  background: var(--night); border: 1px solid var(--bronze); border-radius: 999px;
  box-shadow: 0 6px 22px rgba(0,0,0,.42);
  animation: pal-in .18s ease-out;
}
.prof-action-loader.pal-out { animation: pal-fade .2s ease-in forwards; }
@keyframes pal-in { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes pal-fade { to { opacity: 0; } }
.pal-label { flex: 1; min-width: 0; font-size: 13px; color: var(--night-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-bar { flex: none; width: 84px; height: 6px; border-radius: 4px; background: rgba(0,0,0,.4); border: 1px solid var(--bronze); overflow: hidden; }
.pal-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--bronze), var(--gold)); animation-name: pal-fill; animation-timing-function: linear; animation-fill-mode: forwards; }
@keyframes pal-fill { from { width: 0; } to { width: 100%; } }
.pal-mute { flex: none; background: transparent; border: none; color: var(--gold); font-size: 15px; line-height: 1; cursor: pointer; padding: 2px 4px; }
.pal-muted .pal-mute { color: var(--night-text); opacity: .5; text-decoration: line-through; }
@media (prefers-reduced-motion: reduce) {
  .prof-action-loader { animation: none; }
  .pal-fill { animation: none; width: 100%; }
}
@media (max-width: 899px) { .prof-action-loader { bottom: 76px; } }
