*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--panel);
  color: var(--ink);
  font: 15px/1.55 var(--font-body);
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3, .tcDisplay, .tcCta, .tcBrand, .tcCount b {
  font-family: var(--font-display);
  letter-spacing: .03em;
}
a { color: inherit; }
.tcWrap { max-width: 78rem; margin: 0 auto; padding: 1rem 1.1rem 4rem; }
.tcCrumb { font-size: .82rem; color: var(--ink-dim); margin: .2rem 0 .9rem; }
.tcCrumb a { text-decoration: none; border-bottom: 1px solid var(--edge); }
.tcCrumb a:hover { color: var(--gold-ink); }
.tcPlate {
  background: var(--raise);
  border: 1px solid var(--edge);
  border-radius: 3px;
  padding: .85rem 1.1rem;
  margin: 0 0 .5rem;
  position: relative;
}
.tcPlate h1 { margin: 0; font-size: clamp(1.5rem, 3.4vw, 2.15rem); line-height: 1.1; }
.tcPlate .tcLede { margin: .35rem 0 0; color: var(--ink-dim); font-size: .93rem; max-width: 54ch; }
.tcGem { display: flex; align-items: center; gap: .5rem; margin: .9rem 0 1.2rem; }
.tcGem::before, .tcGem::after { content: ""; height: 1px; background: var(--edge); flex: 1; opacity: .7; }
.tcGem i { width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); }
.tcPanel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 1rem 1.15rem 1.5rem;
}
.tcPanel > h2 {
  margin: .2rem 0 .9rem;
  font-size: 1.32rem;
  line-height: 1.15;
  letter-spacing: .04em;
  color: var(--ink);
  font-weight: 700;
}
.tcCols { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.6rem; align-items: start; }
@media (max-width: 60rem) { .tcCols { grid-template-columns: minmax(0, 1fr); } }
.tcCounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.6rem, 1fr)); gap: .7rem; margin: .2rem 0 1.4rem; }
.tcCount {
  background: var(--raise); border: 1px solid var(--edge); border-radius: 3px;
  padding: .8rem .45rem; text-align: center; min-width: 0;
}
.tcCount b { display: block; font-size: clamp(1.05rem, 2.6vw, 1.55rem); line-height: 1.1; font-weight: 700; }
.tcCount span { display: block; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); margin-top: .15rem; }
.tcCount.isCap b { color: var(--gold-ink); }
.tcField { display: flex; align-items: center; gap: .5rem; margin-bottom: .55rem; flex-wrap: wrap; }
.tcField > label { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); min-width: 4.6rem; }
select, input[type="number"], input[type="search"], input[type="text"] {
  font: inherit; color: var(--ink); background: var(--raise);
  border: 1px solid var(--edge); border-radius: 3px; padding: .32rem .5rem; min-width: 0;
}
select:focus, input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
input[type="range"] { accent-color: var(--gold); flex: 1; min-width: 6rem; }
.tcBtn {
  font: inherit; font-family: var(--font-display); font-size: .85rem;
  background: var(--raise); color: var(--ink);
  border: 1px solid var(--edge); border-radius: 3px; padding: .3rem .7rem; cursor: pointer;
}
.tcBtn:hover { border-color: var(--gold); }
.tcBtn.isPrimary { background: linear-gradient(var(--gold-hi), var(--gold)); color: var(--ink-on-gold); border-color: var(--edge); }
.tcSeg { display: flex; flex-wrap: wrap; gap: .3rem; margin: .25rem 0 .1rem; }
.tcSeg__opt {
  font: inherit; font-size: .72rem; line-height: 1.25;
  background: var(--raise); color: var(--ink-dim);
  border: 1px solid var(--edge); border-radius: 3px; padding: .22rem .5rem; cursor: pointer;
  text-align: left;
}
.tcSeg__opt:hover:not(.isOn) { border-color: var(--gold); color: var(--ink); }
.tcSeg__opt.isOn { background: var(--gold); color: var(--ink-on-gold); border-color: var(--edge); cursor: default; }
.tcDoll {
  display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.5fr) minmax(0, .85fr);
  gap: .55rem; align-items: start;
}
.tcSlots { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; align-content: start; }
.tcStage {
  position: relative; aspect-ratio: 3 / 4; min-height: 15rem;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 3px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.tcStage canvas { display: block; width: 100%; height: 100%; }
.tcStageOver {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: .5rem;
  align-items: center; justify-content: center; text-align: center; padding: 1rem;
}
.tcStageOver.isHidden { display: none; }
.tcStageNote { margin: 0; font-size: .68rem; line-height: 1.4; color: var(--ink-dim); max-width: 17rem; }
.tcStageNote.isError { color: var(--ink); }
@media (max-width: 44rem) {
  .tcDoll { grid-template-columns: minmax(0, 1fr); }
  .tcStage { order: -1; aspect-ratio: auto; min-height: 0; height: 15rem; }
  .tcSlots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.tcSlot {
  position: relative;
  background: var(--raise); border: 1px solid var(--edge); border-radius: 3px;
  padding: .45rem .5rem; text-align: left; cursor: pointer; font: inherit; color: inherit;
  min-height: 3.5rem; display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: .5rem; align-items: center; min-width: 0;
}
.tcIco {
  width: 40px; height: 40px; flex: none; border: 1px solid var(--edge); border-radius: 2px;
  background: var(--panel); display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.tcIco img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tcIco.isBare::after {
  content: ""; width: 12px; height: 12px; transform: rotate(45deg);
  border: 1px solid var(--edge); opacity: .5;
}
.tcSlot .tcTxt { min-width: 0; }
.tcSlot::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--gold); opacity: 0;
}
.tcSlot:hover, .tcSlot.isOn {
  border-color: var(--edge); border-width: 2px;
  padding: calc(.45rem - 1px) calc(.5rem - 1px);
}
.tcSlot:hover::before, .tcSlot.isOn::before { opacity: 1; }
.tcSlot:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.tcSlot em { font-style: normal; font-size: .6rem; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-dim); }
.tcSlot b { font-weight: 600; font-size: .86rem; overflow-wrap: anywhere; }
.tcSlot.isEmpty b { color: var(--ink-dim); font-weight: 400; font-style: italic; opacity: .75; }
.tcSlot.isEmpty .tcTxt { display: flex; align-items: center; min-height: 2.2rem; }
.tcChip {
  display: inline-block; font-size: .66rem; letter-spacing: .06em;
  border: 1px solid var(--edge); border-radius: 999px; padding: .04rem .42rem;
  color: var(--ink-dim); background: var(--panel); white-space: nowrap;
}
.tcChip.isGold { color: var(--gold-ink); border-color: var(--gold); }
.tcFlag { display: inline-block; font-size: .64rem; letter-spacing: .05em; color: var(--ink-dim);
  border: 1px dashed var(--edge); border-radius: 3px; padding: .02rem .34rem; margin-left: .3rem; white-space: nowrap; }
.tcDeclare {
  border: 1px solid var(--edge); border-left: 3px solid var(--gold);
  background: var(--raise); border-radius: 3px;
  padding: .5rem .7rem; font-size: .82rem; color: var(--ink-dim); margin: 0 0 .9rem;
}
.tcDeclare b { color: var(--ink); }
.tcStats { width: 100%; border-collapse: collapse; font-size: .87rem; }
.tcStats th { text-align: left; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-dim); font-weight: 600; padding: .5rem .4rem .25rem; }
.tcStats td { padding: .28rem .45rem; border-top: 1px solid var(--edge-soft); }
.tcStats td.tcNum { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tcStats tr.isZero td { color: var(--ink-dim); opacity: .55; }
.tcBudget { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--ink-dim); margin: .1rem 0 .6rem; }
.tcBudget .tcBar { flex: 1; height: 7px; background: var(--panel); border: 1px solid var(--edge); border-radius: 999px; overflow: hidden; }
.tcBudget .tcBar i { display: block; height: 100%; background: var(--gold); }
.tcBudget.isOver .tcBar i { background: var(--ink-dim); }
.tcPoint { display: grid; grid-template-columns: 5.6rem 1fr 3.2rem; gap: .4rem; align-items: center; margin-bottom: .25rem; }
.tcPoint label { font-size: .8rem; }
.tcPoint output { font-variant-numeric: tabular-nums; text-align: right; font-size: .83rem; }
.tcPickHead { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-bottom: .5rem; }
.tcPickHead input[type="search"] { flex: 1; min-width: 8rem; }
.tcList { max-height: 22rem; overflow-y: auto; border: 1px solid var(--edge); border-radius: 3px; background: var(--raise); }
.tcRow {
  display: block; width: 100%; text-align: left; font: inherit; color: inherit;
  background: none; border: 0; border-bottom: 1px solid var(--edge-soft);
  padding: .55rem .7rem; cursor: pointer;
}
.tcRow:last-child { border-bottom: 0; }
.tcRow:hover { background: var(--panel); }
.tcRow { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .55rem; align-items: center; }
.tcRow .tcIco { width: 34px; height: 34px; }
.tcRow .tcIco.isBare::after { width: 10px; height: 10px; }
.tcSetPieces { display: flex; flex-wrap: wrap; gap: .35rem; margin: .45rem 0 .55rem; }
.tcPiece {
  position: relative; padding: 0; border: 0; background: none; cursor: pointer;
  line-height: 0; border-radius: 2px;
}
.tcPiece .tcIco { width: 34px; height: 34px; }
.tcPiece .tcIco.isBare::after { width: 10px; height: 10px; }
.tcPiece .tcIco { filter: grayscale(1); opacity: .42; }
.tcPiece.isOn .tcIco { filter: none; opacity: 1; }
.tcPiece.isOn .tcIco { border-color: var(--gold); }
.tcPiece:hover .tcIco { opacity: 1; filter: none; }
.tcPiece:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tcGlyph {
  display: inline-block; width: .62rem; height: .62rem; margin-right: .4rem;
  transform: rotate(45deg); vertical-align: -.02rem;
  border: 1px solid var(--edge); background: var(--panel); flex: none;
}
.tcRow b { font-weight: 600; font-size: .87rem; }
.tcRow .tcLines { font-size: .74rem; color: var(--ink-dim); }
.tcEmpty { padding: .8rem .6rem; font-size: .84rem; color: var(--ink-dim); font-style: italic; }
.tcSet { border: 1px solid var(--edge); border-radius: 3px; background: var(--raise); padding: .65rem .8rem; margin-bottom: .6rem; }
.tcSet h3 { margin: 0 0 .15rem; font-size: .88rem; }
.tcSet .tcLines { font-size: .78rem; color: var(--ink-dim); }
.tcStamp { margin-top: 2rem; font-size: .75rem; color: var(--ink-dim); text-align: center; line-height: 1.7; }
.tcStamp code { font-size: .95em; }
@media (prefers-reduced-motion: no-preference) {
  .tcSlot, .tcBtn, .tcRow { transition: border-color .12s ease, background-color .12s ease; }
}
