/* =====================================================================
   Compact layout + readable type (loaded last).
   The stage gets most of the screen; the lower panel is one bar
   (money, tabs, icons), a short equipment strip and the bag.
   Fonts: Cinzel for titles (carved-stone caps), Alegreya Sans for
   everything else (clear at small sizes, still old-world in feel).
   ===================================================================== */
@font-face { font-family: "Cinzel"; font-weight: 700; src: url("node_modules/@fontsource/cinzel/files/cinzel-latin-700-normal.woff2") format("woff2"); font-display: block; }
@font-face { font-family: "Alegreya Sans"; font-weight: 500; src: url("node_modules/@fontsource/alegreya-sans/files/alegreya-sans-latin-500-normal.woff2") format("woff2"); font-display: block; }
@font-face { font-family: "Alegreya Sans"; font-weight: 700; src: url("node_modules/@fontsource/alegreya-sans/files/alegreya-sans-latin-700-normal.woff2") format("woff2"); font-display: block; }
@font-face { font-family: "Alegreya Sans"; font-weight: 800; src: url("node_modules/@fontsource/alegreya-sans/files/alegreya-sans-latin-800-normal.woff2") format("woff2"); font-display: block; }

:root {
  --title: "Cinzel", Georgia, serif;
  --px: "Alegreya Sans", system-ui, sans-serif;
  --body: "Alegreya Sans", system-ui, sans-serif;
  --toon: "Alegreya Sans", system-ui, sans-serif;
}
body { -webkit-font-smoothing: antialiased; font-family: var(--px); font-weight: 500; }
button { font-family: var(--px); }

/* ---------------- proportions: big stage, slim panel */
#stage { flex: 1 1 auto; min-height: 0; }
#panel { flex: 0 0 auto; gap: 6px; padding: 7px 8px calc(8px + env(safe-area-inset-bottom)); }

/* one bar: money | tabs | icons */
#topRow { flex: 0 0 34px; gap: 5px; align-items: stretch; }
.chip { min-width: 0; padding: 0 7px; gap: 5px; font-family: var(--px); font-size: 15px; font-weight: 800; }
.chip .coin, .chip .corei { width: 9px; height: 9px; }
#tabs { flex: 1 1 auto; display: flex; gap: 4px; min-width: 0; }
#tabs button { flex: 1 1 0; min-width: 0; padding: 0 4px; font-family: var(--title); font-size: 13px; font-weight: 700; letter-spacing: .5px; }
#tabs button i { font-family: var(--px); font-size: 12px; font-weight: 800; padding: 0 5px; margin-left: 2px; }
#topRow .icon { flex: 0 0 34px; }
#topRow .icon img { width: 20px; height: 20px; }

/* equipment strip */
#doll .slot small { display: none; }
#doll .slot .ghostIcon { max-width: 22px; }
.dollStats { display: flex; flex-direction: column; justify-content: center; gap: 0; font-family: var(--px); font-size: 13px; font-weight: 700; line-height: 1.25; color: #b9ab90; }
.dollStats b { font-family: var(--title); font-size: 14px; color: var(--gold); margin: 0 0 2px; }
#tabGear { gap: 6px; }

/* bag header */
.bayHead { font-family: var(--title); font-size: 12px; min-height: 24px; }
.bayHead i { font-family: var(--px); font-size: 13px; font-weight: 700; }
.bayHead #autoSell { font-family: var(--px); font-size: 12px; font-weight: 700; padding: 3px 7px; }
.bayHead #sellZone { font-family: var(--title); font-size: 12px; height: 24px; display: flex; align-items: center; }

/* overlay text */
#floorBox small { font-family: var(--title); font-size: 11px; }
#floorBox b { font-family: var(--title); font-size: 22px; }
#status { font-family: var(--px); font-size: 14px; font-weight: 700; }
#toast { font-family: var(--px); font-size: 15px; font-weight: 700; }
.floater { font-family: var(--px); font-weight: 800; font-size: 17px; text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000, 0 2px 2px #000; }
.floater.big { font-family: var(--title); font-size: 18px; }
.floater.coin { font-size: 14px; }

/* the rest of the pages: body text in the readable face */
.stxt b, .plus { font-family: var(--px); font-weight: 800; }
.stxt b { font-size: 15px; }
.stxt em, .stxt span, .ibase, .cmp, .crafts small, .crafts i, .back, .rankList li, .opt label, .opt button, .node span, #nodeInfo p, #nodeInfo button, #prestige button, #prestige p, #itemBody ul, #skillHead small, #skillHead b.has { font-family: var(--px); font-weight: 700; }
.stxt em, .stxt span { font-size: 13px; }
#itemBody ul { font-size: 15px; }
#skillHead, .iname, #itemBody h5, .acts button, .crafts b, .sheet h3, .screen header h2, .branch, #nodeInfo .t { font-family: var(--title); }
@media (min-width: 980px) {
  #stats, #log li { font-family: var(--px); font-size: 15px; font-weight: 500; }
  .side h2 { font-family: var(--title); }
}
#tabs button { white-space: nowrap; }
#tabSkills { flex: 0 0 auto; height: var(--gearH, 270px); overflow-y: auto; }
#skillHead { white-space: nowrap; font-size: 12px; gap: 6px; }
#skillHead small { white-space: normal; font-size: 12px; line-height: 1.15; }
