/* ==========================================================================
   STATE WARS — study.css
   The learn-the-states screen, and the panel shown when a missed question
   calls off an attack.
   ========================================================================== */

/* ---------- 1. Study screen ------------------------------------------------ */

.screen--study { padding: 0; align-items: stretch; overflow: hidden; }

.study {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 0;
}

.study__top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: clamp(.8rem, 2.4vh, 1.3rem) var(--gutter) clamp(.6rem, 1.8vh, 1rem);
  border-bottom: 1px solid rgba(127, 216, 255, .14);
  background: linear-gradient(180deg, rgba(7, 13, 26, .92), rgba(7, 13, 26, .4));
}

.study__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: condensed;
  font-size: clamp(1.5rem, 4.6vw, 2.6rem);
  line-height: 1;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 calc(28px * var(--fx)) rgba(127, 216, 255, .35);
}

.study__actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.chip--go {
  border-color: rgba(255, 194, 92, .55);
  color: var(--c-gold);
  background: rgba(255, 194, 92, .1);
}

.chip--go:hover {
  background: var(--c-gold);
  color: #241703;
  border-color: var(--c-gold);
}

.chip--test {
  border-color: rgba(123, 240, 184, .5);
  color: #7bf0b8;
  background: rgba(123, 240, 184, .09);
}

.chip--test:hover,
.chip--test.is-on {
  background: #7bf0b8;
  border-color: #7bf0b8;
  color: #04241a;
}

/* 1a. Name check panel */
.ncheck {
  padding-bottom: .9rem;
  margin-bottom: .9rem;
  border-bottom: 1px solid rgba(127, 216, 255, .14);
}

.ncheck__kicker {
  font-family: var(--font-mono);
  font-size: .58rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #7bf0b8;
  margin-bottom: .45rem;
}

.ncheck__prompt {
  font-size: .84rem;
  line-height: 1.55;
  color: var(--c-dim);
  min-height: 3.9em;
  margin-bottom: .7rem;
}

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

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

.ncheck__right b { color: #7bf0b8; }

.ncheck__track {
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(4, 7, 14, .6);
}

.ncheck__track i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #2f9c76, #7bf0b8);
  transition: width var(--t-fast) var(--ease-out);
}

.ncheck__grade {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .4rem;
  margin-top: .8rem;
}

.chip--knew {
  border-color: rgba(123, 240, 184, .55);
  color: #7bf0b8;
  background: rgba(123, 240, 184, .1);
}

.chip--knew:hover { background: #7bf0b8; border-color: #7bf0b8; color: #04241a; }

.chip--missed {
  border-color: rgba(255, 154, 166, .5);
  color: #ff9aa6;
  background: rgba(255, 154, 166, .1);
}

.chip--missed:hover { background: #ff9aa6; border-color: #ff9aa6; color: #2b0810; }

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

/* 1b. Map + detail panel */
.study__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 21rem);
  gap: clamp(.6rem, 2vw, 1.4rem);
  min-height: 0;
  padding: clamp(.5rem, 1.6vh, 1rem) var(--gutter) clamp(.8rem, 2vh, 1.2rem);
}

.study__map { position: relative; min-height: 0; min-width: 0; }

.study__panel {
  min-height: 0;
  overflow-y: auto;
  padding: clamp(.9rem, 2.4vw, 1.2rem);
  border: 1px solid rgba(127, 216, 255, .18);
  border-radius: 5px;
  background: linear-gradient(160deg, rgba(15, 30, 53, .9), rgba(9, 17, 31, .92));
}

.study__empty-title {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: .5rem;
}

.study__empty-note {
  font-size: .86rem;
  line-height: 1.6;
  color: var(--c-dim);
}

.study__shape {
  height: clamp(6rem, 15vh, 9rem);
  margin-bottom: .7rem;
  padding: .4rem;
  border-radius: 4px;
  background: rgba(4, 7, 14, .45);
}

.study__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 3.4vw, 1.7rem);
  line-height: 1;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
}

.study__abbr {
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: .9rem;
}

.study__facts { display: grid; gap: .4rem; margin-bottom: 1rem; }

.study__facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .8rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid rgba(127, 216, 255, .1);
}

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

.study__facts dd {
  font-family: var(--font-display);
  font-size: .98rem;
  letter-spacing: .04em;
  color: var(--c-text);
  text-align: right;
}

.study__sub {
  font-family: var(--font-mono);
  font-size: .58rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: .5rem;
}

.study__borders {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: 1.1rem;
}

.bchip {
  padding: .34rem .6rem;
  border: 1px solid rgba(127, 216, 255, .3);
  border-radius: 3px;
  background: rgba(127, 216, 255, .07);
  font-family: var(--font-display);
  font-size: .84rem;
  letter-spacing: .04em;
  color: var(--c-text);
  transition: all var(--t-fast) var(--ease-out);
}

.bchip:hover {
  border-color: var(--c-gold);
  background: rgba(255, 194, 92, .16);
  color: #fff;
  transform: translateY(-1px);
}

.bchip--none {
  border-style: dashed;
  border-color: rgba(255, 255, 255, .14);
  background: none;
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .1em;
  color: var(--c-muted);
  cursor: default;
}

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

@media (max-width: 820px) {
  .study__body { grid-template-columns: 1fr; grid-template-rows: minmax(9rem, 1fr) auto; }
  .study__panel { max-height: 42vh; }
}

/* ---------- 2. Attack called off ------------------------------------------- */

.denied__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: condensed;
  font-size: clamp(1.7rem, 6vw, 3.2rem);
  line-height: 1;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #ff8a72;
  text-shadow: 0 0 calc(30px * var(--fx)) rgba(255, 106, 77, .55);
}

.screen--denied .conq__shape .stateshape path {
  fill: rgba(255, 138, 114, .14);
  stroke: #ff8a72;
  filter: drop-shadow(0 0 calc(18px * var(--fx)) rgba(255, 106, 77, .6));
}

/* The price of the wrong answer, counting down. Big enough to be the thing you
   read after the headline, because it is the only new rule on this screen. */
.lockbox {
  display: grid;
  justify-items: center;
  gap: .15rem;
  margin-top: clamp(.6rem, 2vh, 1rem);
  padding: clamp(.6rem, 2vh, .9rem) clamp(1rem, 4vw, 2rem);
  border: 1px solid rgba(255, 194, 92, .35);
  border-radius: 5px;
  background: rgba(60, 42, 12, .35);
}

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

.lockbox__time {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 6vw, 2.8rem);
  line-height: 1;
  letter-spacing: .08em;
  color: var(--c-gold);
  font-variant-numeric: tabular-nums;
}

.lockbox__note { font-size: .78rem; color: var(--c-dim); }

.lockbox[data-open="true"] {
  border-color: rgba(127, 224, 168, .45);
  background: rgba(18, 52, 34, .35);
}

.lockbox[data-open="true"] .lockbox__time { color: #7fe0a8; }

.denied__actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  margin-top: clamp(1rem, 3vh, 1.6rem);
}

.denied__actions .btn--huge { width: auto; min-width: 15rem; margin-top: 0; }
.denied__actions .btn--back { margin-top: 0; min-width: 11rem; }

@media (max-width: 560px) {
  .denied__actions { flex-direction: column; }
  .denied__actions .btn--huge, .denied__actions .btn--back { width: 100%; min-width: 0; }
}
