/* ==========================================================================
   STATE WARS — css/stage2.css
   The parts only Stage 2 shows: the state event card, the city's food HUD, and
   the season report after a battle.

   Nothing here is loaded conditionally — it is a few hundred bytes — but every
   selector is on markup that stays hidden in Stage 1, so none of it can leak
   into the first chapter.
   ========================================================================== */

/* ---------- the event card ------------------------------------------------ */

.screen--event { display: grid; place-items: center; padding: var(--gutter); }

.evt { width: min(38rem, 100%); text-align: left; }

.evt__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: .9rem;
}

/* The state's own outline, so the player is looking at a place and not just
   reading its name. */
.evt__shape {
  flex: 0 0 auto;
  width: clamp(3.4rem, 9vw, 4.6rem);
  height: clamp(3.4rem, 9vw, 4.6rem);
  display: grid;
  place-items: center;
}

.evt__shape svg { width: 100%; height: 100%; }
.evt__shape path { fill: #1e3355; stroke: var(--c-ice-soft); stroke-width: 1.4; }

.evt__heading { min-width: 0; }

.evt__state {
  margin: 0;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .24em;
  color: var(--c-ice);
}

.evt__title {
  margin: .1rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3.6vw, 1.8rem);
  letter-spacing: .1em;
  color: var(--c-text);
}

.evt__rel {
  margin: .25rem 0 0;
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .18em;
}

.evt__rel[data-rel="friendly"] { color: #7de3a0; }
.evt__rel[data-rel="hostile"]  { color: var(--c-ember); }

.evt__text {
  margin: 0 0 .5rem;
  font-family: var(--font-ui);
  font-size: clamp(.92rem, 2.2vw, 1.02rem);
  line-height: 1.55;
  color: var(--c-text);
}

/* The fact underneath the offer. Quieter than the offer itself — it is
   context, not instruction. */
.evt__foot {
  margin: 0 0 1rem;
  padding-left: .7rem;
  border-left: 2px solid rgba(127, 216, 255, .3);
  font-family: var(--font-ui);
  font-size: .84rem;
  line-height: 1.45;
  color: var(--c-dim);
}

/* ---------- the choices --------------------------------------------------- */

.evt__choices { display: grid; gap: .5rem; }

.evt__choice {
  display: grid;
  gap: .15rem;
  padding: .7rem .9rem;
  text-align: left;
  background: linear-gradient(180deg, rgba(15, 30, 53, .9), rgba(7, 13, 26, .9));
  border: 1px solid var(--c-line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out);
}

.evt__choice:hover:not(:disabled) {
  border-color: var(--c-ice-soft);
  transform: translateX(3px);
}

.evt__choice:disabled { opacity: .45; cursor: not-allowed; }

.evt__choice-label {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: .12em;
  color: var(--c-gold);
}

/* WHAT IT COSTS, ON THE BUTTON. A choice whose price is hidden is a guess. */
.evt__choice-note {
  font-family: var(--font-ui);
  font-size: .8rem;
  color: var(--c-dim);
}

.evt__choice-blocked {
  font-family: var(--font-mono);
  font-size: .64rem;
  letter-spacing: .12em;
  color: var(--c-ember);
}

/* ---------- what happened -------------------------------------------------- */

.evt__result { display: grid; gap: .8rem; }

.evt__outcome {
  margin: 0;
  font-family: var(--font-ui);
  font-size: clamp(.92rem, 2.2vw, 1rem);
  line-height: 1.55;
  color: var(--c-text);
}

.evt__ledger {
  display: grid;
  gap: .3rem;
  padding: .7rem .9rem;
  background: rgba(4, 7, 14, .55);
  border: 1px solid var(--c-line);
  border-radius: 8px;
}

.evt__led {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .06em;
  color: var(--c-dim);
}

.evt__led b.is-up   { color: #7de3a0; }
.evt__led b.is-down { color: var(--c-ember); }
.evt__led b[data-rel="friendly"] { color: #7de3a0; }
.evt__led b[data-rel="hostile"]  { color: var(--c-ember); }
.evt__led b[data-rel="neutral"]  { color: var(--c-dim); }

/* ---------- the city's food HUD -------------------------------------------- */

.cstat--s2[hidden] { display: none; }

#city-net[data-flow="up"]   { color: #7de3a0; }
#city-net[data-flow="down"] { color: var(--c-ember); }
#city-net[data-flow="flat"] { color: var(--c-dim); }

#city-citizens[data-flow="flat"] { color: var(--c-gold); }

.city__shortage {
  grid-column: 1 / -1;
  margin: .6rem 0 0;
  padding: .5rem .8rem;
  background: rgba(255, 106, 77, .1);
  border: 1px solid rgba(255, 106, 77, .34);
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: .82rem;
  line-height: 1.4;
  color: #ffb9a8;
}

.city__shortage b { color: var(--c-ember); letter-spacing: .1em; }
.city__shortage[hidden] { display: none; }

/* ---------- the season report --------------------------------------------- */

.conq__season {
  margin: 1rem 0 .4rem;
  padding: .8rem 1rem;
  background: rgba(4, 7, 14, .5);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  text-align: left;
}

.conq__season[hidden] { display: none; }

.conq__season-title {
  margin: 0 0 .5rem;
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .24em;
  color: var(--c-ice);
}

.conq__season-rows { display: grid; gap: .35rem; }

.conq__season-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .2rem .8rem;
  font-family: var(--font-ui);
  font-size: .84rem;
  color: var(--c-dim);
}

.conq__season-num {
  font-family: var(--font-mono);
  color: var(--c-text);
  letter-spacing: .04em;
}

/* The reason, under the number — this is where the fact does its teaching. */
.conq__season-why {
  grid-column: 1 / -1;
  font-size: .74rem;
  line-height: 1.35;
  color: var(--c-muted);
}

.conq__season-warn {
  margin: .7rem 0 0;
  padding: .5rem .7rem;
  background: rgba(255, 106, 77, .1);
  border: 1px solid rgba(255, 106, 77, .3);
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: .8rem;
  line-height: 1.4;
  color: #ffb9a8;
}

.conq__season-warn[hidden] { display: none; }

/* ==========================================================================
   THE STATE GUIDE
   A reference room, not a test paper: a list you scan down the side and one
   state open beside it. Sections with nothing in them are never drawn, so a
   state with no notable mining shows no mining heading.
   ========================================================================== */

.screen--guide { padding: clamp(.8rem, 2vh, 1.4rem) var(--gutter); }

.guide {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: .6rem;
}

.guide__top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.guide__title {
  margin: .1rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  letter-spacing: .12em;
  color: var(--c-text);
}

.guide__meta { display: flex; align-items: center; gap: .9rem; }

.guide__count {
  display: grid;
  gap: .25rem;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .16em;
  color: var(--c-dim);
}

.guide__track {
  display: block;
  width: clamp(7rem, 16vw, 11rem);
  height: 4px;
  border-radius: 3px;
  background: rgba(29, 50, 82, .8);
  overflow: hidden;
}

.guide__track i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--c-ice-soft), var(--c-gold));
  transition: width var(--t-mid) var(--ease-out);
}

.guide__lead {
  margin: 0;
  font-family: var(--font-ui);
  font-size: .86rem;
  color: var(--c-dim);
}

.guide__body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(12rem, 17rem) 1fr;
  gap: .8rem;
}

/* ---------- the list ------------------------------------------------------ */

.guide__side { display: flex; flex-direction: column; gap: .5rem; min-height: 0; }

.guide__search {
  padding: .55rem .7rem;
  background: rgba(4, 7, 14, .72);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  color: var(--c-text);
  font-family: var(--font-ui);
  font-size: .85rem;
}

.guide__search:focus {
  outline: none;
  border-color: var(--c-ice-soft);
  box-shadow: 0 0 0 3px rgba(127, 216, 255, .12);
}

.guide__list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 2px;
  align-content: start;
  padding-right: 4px;
}

.guide__list::-webkit-scrollbar { width: 8px; }
.guide__list::-webkit-scrollbar-thumb {
  background: rgba(29, 50, 82, .9); border-radius: 4px;
}

.grow {
  display: grid;
  grid-template-columns: 2.2rem 1fr auto;
  align-items: center;
  gap: .5rem;
  padding: .42rem .55rem;
  background: rgba(11, 21, 38, .7);
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast) var(--ease-out);
}

.grow:hover { background: rgba(29, 50, 82, .7); }
.grow[data-on="true"] { border-color: var(--c-ice-soft); background: rgba(29, 50, 82, .9); }

.grow__abbr {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  color: var(--c-ice);
}

.grow__name {
  font-family: var(--font-ui);
  font-size: .84rem;
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grow__mark {
  font-family: var(--font-mono);
  font-size: .55rem;
  letter-spacing: .14em;
  color: var(--c-muted);
}

.grow__mark[data-done="true"] { color: #7de3a0; }

.guide__empty {
  padding: .8rem;
  font-family: var(--font-ui);
  font-size: .84rem;
  color: var(--c-muted);
}

/* ---------- one state's page ----------------------------------------------- */

.guide__detail { min-width: 0; overflow-y: auto; }

.gcard {
  padding: clamp(.9rem, 2.4vw, 1.4rem);
  background: linear-gradient(180deg, rgba(15, 30, 53, .8), rgba(7, 13, 26, .9));
  border: 1px solid var(--c-line);
  border-radius: 12px;
}

.gcard__head { display: flex; gap: 1rem; align-items: center; margin-bottom: .7rem; }

.gcard__shape {
  flex: 0 0 auto;
  width: clamp(4rem, 11vw, 6rem);
  height: clamp(4rem, 11vw, 6rem);
  display: grid;
  place-items: center;
}

.gcard__shape svg { width: 100%; height: 100%; }
.gcard__shape path { fill: #1e3355; stroke: var(--c-ice-soft); stroke-width: 1.4; }

.gcard__region {
  margin: 0;
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .22em;
  color: var(--c-ice);
}

.gcard__name {
  margin: .1rem 0 .15rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  letter-spacing: .06em;
  color: var(--c-text);
}

.gcard__capital {
  margin: 0;
  font-family: var(--font-ui);
  font-size: .86rem;
  color: var(--c-dim);
}

.gcard__capital b { color: var(--c-gold); }

.gcard__tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }

.gtag {
  padding: .12rem .45rem;
  border: 1px solid var(--c-line);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: .55rem;
  letter-spacing: .14em;
  color: var(--c-muted);
}

.gtag--held { border-color: rgba(127, 216, 255, .5); color: var(--c-ice); }
.gtag--done[data-done="false"] { display: none; }
.gtag--done[data-done="true"] { border-color: rgba(125, 227, 160, .5); color: #7de3a0; }
.gtag[data-rel="friendly"] { border-color: rgba(125, 227, 160, .5); color: #7de3a0; }
.gtag[data-rel="hostile"]  { border-color: rgba(255, 106, 77, .5); color: var(--c-ember); }

.gcard__blurb {
  margin: 0 0 .9rem;
  padding-left: .7rem;
  border-left: 2px solid rgba(127, 216, 255, .3);
  font-family: var(--font-ui);
  font-size: .9rem;
  line-height: 1.5;
  color: var(--c-dim);
}

/* THE ONE THING, LARGE. The resource is the biggest item on the page because
   it is the only part the events will ever ask about. */
.gmain {
  margin: .2rem 0 0;
  padding: clamp(.9rem, 2.6vw, 1.3rem);
  background: rgba(4, 7, 14, .55);
  border: 1px solid var(--c-line);
  border-left-width: 4px;
  border-radius: 8px;
}

.gmain[data-kind="food"]     { border-left-color: #6ec27f; }
.gmain[data-kind="material"] { border-left-color: var(--c-gold); }

.gmain__label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: .58rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--c-muted);
}

.gmain__value {
  margin: .1rem 0 .4rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5.5vw, 2.8rem);
  line-height: 1;
  letter-spacing: .04em;
  color: var(--c-text);
}

.gmain[data-kind="food"] .gmain__value     { color: #9fe3ae; }
.gmain[data-kind="material"] .gmain__value { color: var(--c-gold); }

.gmain__why {
  margin: 0;
  font-family: var(--font-ui);
  font-size: clamp(.88rem, 2.2vw, .98rem);
  line-height: 1.5;
  color: var(--c-dim);
}

.gmain__pile {
  margin: .55rem 0 0;
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-muted);
}

.gcard__borders {
  margin: .9rem 0 0;
  font-family: var(--font-ui);
  font-size: .78rem;
  color: var(--c-muted);
}

.gcard__borders b { color: var(--c-dim); font-weight: 400; }

.chip--guide { border-color: rgba(255, 194, 92, .45); }
.chip--guide[hidden] { display: none; }

@media (max-width: 780px) {
  .guide__body { grid-template-columns: 1fr; }
  .guide__list { max-height: 30vh; }
}

/* ==========================================================================
   RESOURCE ICONS
   One glyph per resource family, drawn as inline SVG and coloured through
   currentColor — so the same markup works at 16px in a list row and at 40 on
   a card, with no second asset and no image request.
   ========================================================================== */

.ricon { width: 100%; height: 100%; display: block; }

/* the little one in the guide list */
.grow { grid-template-columns: 1.4rem 2.2rem 1fr auto; }

.grow__icon {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--c-ice-soft);
  opacity: .85;
}

.grow[data-on="true"] .grow__icon { color: var(--c-ice); opacity: 1; }

/* the big one on the state page */
.gmain__value { display: flex; align-items: center; gap: .55rem; }

.gmain__icon {
  flex: 0 0 auto;
  width: clamp(1.9rem, 5vw, 2.6rem);
  height: clamp(1.9rem, 5vw, 2.6rem);
}

/* the one beside an event title, showing what the city is short of */
.evt__icon {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  vertical-align: -.3rem;
  margin-left: .1rem;
}

.evt__icon[hidden] { display: none; }
.evt__icon[data-kind="food"]     { color: #9fe3ae; }
.evt__icon[data-kind="material"] { color: var(--c-gold); }

/* A building the town has not grown into yet. Shown rather than hidden, so the
   menu doubles as a plan for what growing is actually for. */
.bcard[data-locked="true"] { opacity: .5; cursor: not-allowed; }

.bcard__locked {
  font-family: var(--font-mono);
  font-size: .58rem;
  letter-spacing: .1em;
  color: var(--c-ice);
}


/* ==========================================================================
   THE TWO RESOURCES
   A screw and a coin, so a number is never ambiguous at a glance. The screw is
   drawn rather than fetched, like everything else in this game.
   ========================================================================== */

.screw {
  display: inline-block;
  width: .82em;
  height: .82em;
  margin-right: .3em;
  vertical-align: -.06em;
  border-radius: 50%;
  background:
    /* the slot */
    linear-gradient(90deg, transparent 42%, rgba(20,26,36,.9) 42%, rgba(20,26,36,.9) 58%, transparent 58%),
    radial-gradient(circle at 34% 30%, #dfe7f2, #9aa7ba 62%, #6d7889);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.35);
}

/* The screw column carries its own sum: a net figure with no production and
   upkeep beside it is a number a player cannot act on. */
.cstat--wide { min-width: 9.5rem; }

.cstat__sub {
  display: flex;
  gap: .5rem;
  align-items: baseline;
  margin-top: .1rem;
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .06em;
  color: var(--c-muted);
}

.cstat__sub .is-up   { color: #7de3a0; }
.cstat__sub .is-down { color: var(--c-ember); }
.cstat__sub b        { font-weight: 700; }

/* ---------- the garrison ---------------------------------------------------
   What the screws are actually for. Sits under the build menu so assembling a
   bot and putting up a building read as the same kind of decision. */

.garrison { margin-top: .9rem; }

.garrison__title {
  margin: 0 0 .1rem;
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: .22em;
  color: var(--c-ice);
}

.garrison__sum {
  margin: 0 0 .5rem;
  font-family: var(--font-ui);
  font-size: .74rem;
  color: var(--c-muted);
}

.garrison__list { display: grid; gap: .3rem; }

.gbot {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: .45rem;
  padding: .35rem .5rem;
  background: rgba(11, 21, 38, .7);
  border: 1px solid var(--c-line);
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: .78rem;
  color: var(--c-text);
}

.gbot__up {
  font-family: var(--font-mono);
  font-size: .6rem;
  color: var(--c-muted);
}

.gbot__n {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--c-gold);
  min-width: 1.4rem;
  text-align: right;
}

.gbot__none {
  padding: .5rem;
  font-family: var(--font-ui);
  font-size: .76rem;
  color: var(--c-muted);
}

.gbuy {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: .4rem;
  width: 100%;
  padding: .38rem .5rem;
  margin-top: .3rem;
  background: linear-gradient(180deg, rgba(15,30,53,.85), rgba(7,13,26,.9));
  border: 1px solid var(--c-line);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-ui);
  font-size: .78rem;
  color: var(--c-text);
}

.gbuy:hover:not(:disabled) { border-color: var(--c-ice-soft); }
.gbuy:disabled { opacity: .45; cursor: not-allowed; }
.gbuy__cost { font-family: var(--font-mono); font-size: .7rem; color: var(--c-gold); }
.gbuy__why  { grid-column: 1 / -1; font-family: var(--font-mono); font-size: .58rem; color: var(--c-ember); }


/* ==========================================================================
   THE STAGE 2 OPENING
   Full bleed, dark, and out of the way of its own picture: the card sits low
   so the map and then the city have the top two thirds to themselves.
   ========================================================================== */

/* DO NOT set position here. `.screen` is already `position: absolute; inset: 0`,
   which is what gives this screen its size AND makes it the containing block
   for everything below. Overriding it to `relative` dropped the insets, the
   section collapsed, and the canvas inherited a zero-height box — a blank
   intro over the menu background. Only the padding and clipping change. */
.screen--intro2 {
  padding: 0;
  overflow: hidden;
  display: block;
}

.intro2__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.intro2__card {
  position: absolute;
  left: 50%;
  bottom: clamp(3.5rem, 12vh, 7rem);
  transform: translateX(-50%);
  width: min(34rem, 88vw);
  text-align: center;
  pointer-events: none;
}

/* Every beat fades and lifts in. Restarted by re-adding the class. */
.intro2__card.is-in { animation: intro2In 620ms var(--ease-out) both; }

@keyframes intro2In {
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.reduce-motion .intro2__card.is-in { animation-duration: 1ms; }

.intro2__icon {
  display: block;
  width: clamp(2rem, 6vw, 2.8rem);
  height: clamp(2rem, 6vw, 2.8rem);
  margin: 0 auto .5rem;
  color: var(--c-gold);
}

.intro2__icon[hidden] { display: none; }

.intro2__kicker {
  margin: 0 0 .3rem;
  font-family: var(--font-mono);
  font-size: clamp(.68rem, 1.8vw, .82rem);
  letter-spacing: .34em;
  color: var(--c-ice);
}

.intro2__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 6vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: .1em;
  color: var(--c-text);
  text-shadow: 0 0 calc(34px * var(--fx)) rgba(127, 216, 255, .35);
}

.intro2__lines { margin-top: .6rem; }

.intro2__lines p {
  margin: .15rem 0;
  font-family: var(--font-ui);
  font-size: clamp(.9rem, 2.4vw, 1.05rem);
  line-height: 1.5;
  color: var(--c-dim);
}

/* the worked example */
.intro2__market {
  margin-top: .9rem;
  padding: .7rem .9rem;
  background: rgba(4, 7, 14, .66);
  border: 1px solid var(--c-line);
  border-radius: 10px;
}

.intro2__market[hidden] { display: none; }

.intro2__market-q {
  margin: 0 0 .5rem;
  font-family: var(--font-ui);
  font-size: .88rem;
  line-height: 1.45;
  color: var(--c-text);
}

.intro2__market-row {
  display: flex;
  justify-content: center;
  gap: .4rem;
  flex-wrap: wrap;
}

.intro2__market-row span {
  padding: .3rem .7rem;
  border: 1px solid var(--c-line);
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: .82rem;
  letter-spacing: .12em;
  color: var(--c-gold);
}

.intro2__begin { pointer-events: auto; margin-top: 1rem; }
.intro2__begin[hidden] { display: none; }

.intro2__dots {
  position: absolute;
  left: 50%;
  bottom: clamp(1.2rem, 4vh, 2rem);
  transform: translateX(-50%);
  display: flex;
  gap: .4rem;
}

.intro2__dots i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(127, 216, 255, .25);
  transition: background var(--t-fast) var(--ease-out);
}

.intro2__dots i[data-on="true"] { background: var(--c-gold); }

.intro2__skip {
  position: absolute;
  top: clamp(1rem, 3vh, 1.6rem);
  right: clamp(1rem, 3vw, 1.8rem);
}

/* ==========================================================================
   THE HUMAN PRISON
   The one building panel that reports an economy of its own. Warm amber
   throughout rather than the city's blue: these are people, not machines, and
   the colour is the fastest way to say so.
   ========================================================================== */

.pris {
  margin: .5rem 0 .2rem;
  padding: .7rem .8rem;
  border: 1px solid rgba(255, 194, 92, .28);
  border-radius: 7px;
  background: rgba(255, 194, 92, .05);
}

.pris.is-starving {
  border-color: rgba(255, 106, 90, .55);
  background: rgba(255, 106, 90, .08);
}

.pris__why {
  font-size: .72rem;
  line-height: 1.5;
  color: var(--c-muted);
  margin-bottom: .5rem;
}

.pris__rows { display: grid; gap: .18rem; }

.pris__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem;
  font-family: var(--font-mono);
  font-size: .58rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-muted);
}

.pris__row b {
  font-family: var(--font-display);
  font-size: .9rem;
  letter-spacing: .03em;
  color: var(--c-text);
}

.pris__row[data-tone="good"] b { color: #7fe0a8; }
.pris__row[data-tone="bad"] b { color: #ff9a8a; }
.pris__row[data-tone="full"] b { color: var(--c-gold); }

.pris__warn {
  margin-top: .5rem;
  font-size: .72rem;
  line-height: 1.45;
  color: #ff9a8a;
}

.pris__buy { width: 100%; margin-top: .6rem; }

/* ---------- the Global Market --------------------------------------------- */

.market {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: clamp(.8rem, 3vh, 2rem);
  background: rgba(4, 8, 16, .82);
}

.market__card {
  position: relative;
  width: min(30rem, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: clamp(1rem, 3vw, 1.6rem);
  border: 1px solid rgba(255, 194, 92, .45);
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(28, 24, 14, .98), rgba(10, 12, 18, .99));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}

.market__card[data-result="good"] { border-color: rgba(127, 224, 168, .6); }
.market__card[data-result="poor"] { border-color: rgba(255, 106, 90, .55); }

.market__close {
  position: absolute;
  top: .3rem;
  right: .5rem;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--c-muted);
  background: none;
  border: 0;
}

.market__close:hover { color: #fff; }

.market__kicker {
  font-family: var(--font-mono);
  font-size: .56rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--c-gold);
}

.market__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: condensed;
  font-size: clamp(1.2rem, 3.4vw, 1.7rem);
  line-height: 1.05;
  letter-spacing: .06em;
  color: #fff;
  margin: .15rem 0 .5rem;
}

.market__lead {
  font-size: .82rem;
  line-height: 1.55;
  color: var(--c-dim);
  margin-bottom: .8rem;
}

.market__lead b { color: var(--c-text); }

.market__picks { display: grid; gap: .4rem; }

.market__pick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .12rem;
  padding: .6rem .8rem;
  border: 1px solid rgba(127, 216, 255, .28);
  border-radius: 6px;
  background: rgba(10, 18, 30, .7);
  text-align: left;
  transition: border-color var(--t-fast) var(--ease-out),
              background var(--t-fast) var(--ease-out);
}

/* THE HINT LINE. Deliberately the brightest thing on the button: while hints
   are on this IS the lesson, and a player who reads nothing else on the card
   should still come away having seen "Iowa - Corn". */
.market__pick .market__known {
  font-family: var(--font-display);
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: none;
  color: #ffd27a;
}

/* The receipt. One more free sighting of the pairing, after the choice is
   already made and there is nothing left to get wrong. */
.market__stamp {
  display: flex;
  align-items: baseline;
  gap: .55rem;
  flex-wrap: wrap;
  margin: .1rem 0 .7rem;
  padding: .5rem .7rem;
  border-radius: 6px;
  border: 1px solid rgba(159, 240, 208, .32);
  background: rgba(16, 34, 30, .55);
}

.market__stamp-kick {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(233, 241, 252, .55);
}

.market__stamp-pair {
  display: inline-flex;
  align-items: baseline;
  gap: .5rem;
}

.market__stamp-pair b {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #ffffff;
}

.market__stamp-pair i {
  font-style: normal;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #9ff0d0;
}

.market__stamp-pair i::before {
  content: '\2192';
  margin-right: .45rem;
  color: rgba(233, 241, 252, .45);
}

/* A plain ration purchase is not a verdict, so it gets no verdict colour. */
.market__card[data-result="plain"] { border-color: rgba(127, 216, 255, .34); }

.market__pick:hover {
  border-color: rgba(255, 194, 92, .7);
  background: rgba(30, 26, 14, .8);
}

.market__pick b {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: .04em;
  color: #fff;
}

.market__pick span {
  font-family: var(--font-mono);
  font-size: .56rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-muted);
}

.market__note {
  margin-top: .7rem;
  font-size: .72rem;
  line-height: 1.45;
  color: var(--c-muted);
}

.market__note[data-bad="true"] { color: #ff9a8a; }
.market__done { width: 100%; margin-top: .8rem; }

/* ==========================================================================
   STATE KNOWLEDGE — Stage 2's intelligence database
   Cards, not table rows: a grid of readouts is something a player scans, and
   a table of scores is something a player is graded by.
   ========================================================================== */

.know-sum {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .6rem;
  margin: .2rem 0 1rem;
}

.know-sum__item {
  display: grid;
  gap: .15rem;
  padding: .7rem .85rem;
  border: 1px solid rgba(127, 216, 255, .2);
  border-radius: 8px;
  background: rgba(10, 18, 30, .55);
}

.know-sum__item b {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: #9ff0d0;
  line-height: 1;
}

.know-sum__item b span {
  font-size: .8rem;
  color: rgba(233, 241, 252, .38);
}

.know-sum__label {
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(233, 241, 252, .5);
}

.know-sort { margin-bottom: .9rem; }

.know-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: .55rem;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: .3rem;
}

.kcard {
  padding: .6rem .75rem .5rem;
  border: 1px solid rgba(127, 216, 255, .18);
  border-radius: 8px;
  background: rgba(9, 16, 27, .7);
}

/* A state never looked at is dimmed rather than hidden — the gaps in the
   database are the most useful thing on this screen. */
.kcard.is-unmet { opacity: .5; border-style: dashed; }

.kcard__head {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin-bottom: .35rem;
}

.kcard__abbr {
  font-family: var(--font-mono);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .14em;
  padding: .1rem .3rem;
  border-radius: 3px;
  background: rgba(127, 216, 255, .14);
  color: rgba(233, 241, 252, .8);
}

.kcard__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: .95rem;
  letter-spacing: .02em;
  color: #fff;
}

.kcard__line {
  display: grid;
  grid-template-columns: 1.1rem 1fr auto;
  grid-template-areas: 'icon fact stars' 'icon lvl lvl';
  align-items: baseline;
  gap: .1rem .45rem;
  padding: .22rem 0;
}

.kcard__icon { grid-area: icon; font-size: .8rem; }

.kcard__fact {
  grid-area: fact;
  font-size: .86rem;
  color: rgba(233, 241, 252, .92);
}

.kcard__stars { grid-area: stars; white-space: nowrap; }

.kcard__stars i {
  font-style: normal;
  font-size: .6rem;
  color: rgba(233, 241, 252, .16);
}

.kcard__stars i.on { color: #ffd27a; }

.kcard__lvl {
  grid-area: lvl;
  font-size: .55rem;
  font-weight: 800;
  letter-spacing: .15em;
  color: rgba(233, 241, 252, .38);
}

.kcard__line[data-level="mastered"] .kcard__stars i.on,
.kcard__line[data-level="mastered"] .kcard__lvl { color: #9ff0d0; }
.kcard__line[data-level="practicing"] .kcard__lvl { color: #ffd27a; }
.kcard__line[data-level="learning"] .kcard__lvl { color: rgba(255, 170, 120, .8); }

.kcard__unmet {
  margin: .25rem 0 0;
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(233, 241, 252, .38);
}

@media (max-width: 620px) {
  .know-grid { grid-template-columns: 1fr; max-height: 46vh; }
}
