/* ============================================================
   Chipler Colony - item styles
   A shorter stage (so the controls fit under it on a phone),
   the resource bar, the control cards and the end card.
   ============================================================ */

.cc-stage {
  height: clamp(280px, 44svh, 540px);
}

/* ---- resource bar on the stage ---- */
.cc-hud {
  z-index: 3;
  max-width: 34rem;
  margin-inline: auto;
  gap: .3rem;
  font-size: .62rem;
  letter-spacing: .04em;
}
.cc-hud > div {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .2rem .25rem;
  text-align: center;
}
.cc-hud > div > span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
}
.cc-hud output {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}
.cc-hud .is-hungry output { color: var(--amber); }

/* ---- hint and toast at the bottom of the stage ---- */
.cc-hint,
.cc-toast {
  position: absolute;
  left: .6rem;
  right: .6rem;
  margin: 0;
  pointer-events: none;
  text-align: center;
  font-size: .85rem;
}
.cc-hint {
  bottom: 2.6rem;
  width: fit-content;
  max-width: calc(100% - 1.2rem);
  margin-inline: auto;
  padding: .2rem .7rem;
  border-radius: 999px;
  background: rgba(7, 7, 12, .75);
  color: var(--text-dim);
}
.cc-hint[hidden] { display: none; }
.cc-toast {
  bottom: .6rem;
  min-height: 1.6rem;
}
.cc-toast:empty { visibility: hidden; }
.cc-toast:not(:empty) {
  justify-self: center;
  width: fit-content;
  max-width: calc(100% - 1.2rem);
  margin-inline: auto;
  padding: .25rem .7rem;
  border-radius: 999px;
  background: rgba(7, 7, 12, .8);
  border: 1px solid var(--line-bright);
  color: var(--text);
}
.cc-toast.is-good { border-color: var(--green); }
.cc-toast.is-bad  { border-color: var(--amber); }

/* ---- the control cards under the stage ---- */
.cc-deck {
  display: grid;
  gap: .7rem;
  padding-block: .8rem 0;
}
.cc-copy {
  width: 100%;
  min-height: 56px;
  font-size: 1.05rem;
  display: flex;
  justify-content: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.cc-cost { opacity: .8; font-weight: 500; }

.cc-card {
  min-width: 0;
  padding: .75rem .85rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.cc-card h2 {
  font-size: 1rem;
  margin: 0 0 .35rem;
}
.cc-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
}
.cc-card-head h2 { margin: 0; }
.cc-dim {
  margin: .25rem 0 .6rem;
  color: var(--text-dim);
  font-size: .9rem;
}

.cc-builds {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem;
}
.cc-build {
  min-width: 0;
  min-height: 56px;
  padding: .35rem .3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .1rem;
  line-height: 1.15;
  text-align: center;
}
.cc-build strong { font-size: .95rem; }
.cc-build span { font-size: .72rem; color: var(--text-dim); font-weight: 500; }
.cc-builds[hidden] { display: none; }

.cc-request {
  margin: 0 0 .6rem;
  font-size: 1rem;
}
.cc-request strong { color: var(--amber); }
.cc-req-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}

.cc-goals {
  list-style: none;
  margin: 0 0 .3rem;
  padding: 0;
  display: grid;
  gap: .3rem;
}
.cc-goals li {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  font-size: .92rem;
  color: var(--text-dim);
}
.cc-goals li::before {
  content: "";
  flex: none;
  width: .8rem;
  height: .8rem;
  margin-top: .25rem;
  border-radius: 3px;
  border: 2px solid var(--line-field);
}
.cc-goals li span:first-of-type { flex: 1; }
.cc-goals li.is-met { color: var(--text); }
.cc-goals li.is-met::before { background: var(--green); border-color: var(--green); }
.cc-goals output { font-variant-numeric: tabular-nums; }

.cc-roster {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.cc-roster li {
  padding: .2rem .55rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: .8rem;
  color: var(--text-dim);
}
.cc-roster li b { color: var(--text); font-weight: 600; }

/* Wider screens: two columns of cards. */
@media (min-width: 760px) {
  .cc-stage { height: clamp(280px, 52svh, 560px); }
  .cc-deck { grid-template-columns: 1fr 1fr; }
  .cc-copy { grid-column: 1 / -1; }
}

/* ---- end card over the stage ---- */
.cc-screen {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1rem;
  overflow-y: auto;
  text-align: center;
  background: rgba(7, 7, 12, .92);
  touch-action: manipulation;
}
.cc-screen h2 {
  margin: 0;
  font-size: clamp(1.5rem, 7vw, 2.2rem);
}
.cc-kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
}
.cc-stats {
  display: flex;
  gap: .4rem;
  margin: 0;
}
.cc-stats > div {
  min-width: 4.6rem;
  padding: .35rem .5rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.cc-stats dt {
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.cc-stats dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}
.cc-end-line,
.cc-end-link {
  margin: 0;
  font-size: .92rem;
}
.cc-end-line { color: var(--text-dim); }
.cc-end-link a { color: var(--cyan); }
.cc-big {
  min-width: 11rem;
  min-height: 52px;
}
