/* 鍛冶場「合戦の時刻の流れ」v0.1.1（kajiba/kassen/）。クラス名は kt- で始め、共通のクラスと重ねない。 */
.kt-page {
  --kt-first: #3f6f8f;
  --kt-first-soft: #e3edf3;
  --kt-second: #8a5a33;
  --kt-second-soft: #f2e9e0;
  --kt-moved: #963434;
  min-width: 0;
}
.kt-page > * { min-width: 0; }
.kt-lead { margin: 12px 0; color: var(--ink); }
.kt-login p { margin: 0 0 10px; }
.kt-login p:last-child { margin-bottom: 0; }

.kt-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 8px 0;
}
.kt-controls label { display: grid; gap: 4px; min-width: 0; font-size: var(--text-sm); color: var(--muted); }
.kt-controls select { width: 100%; min-width: 0; min-height: 40px; font-size: var(--text-base); }
.kt-status { margin: 4px 0 12px; }

.kt-summary { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 0; margin-bottom: 12px; }
.kt-summary-head { margin: 0 0 4px; overflow-wrap: anywhere; }
.kt-summary-sides { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.kt-summary-sides li { min-width: 0; overflow-wrap: anywhere; }

.kt-key {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 4px;
  border-radius: 4px;
  border: 1px solid currentColor;
  text-align: center;
  font-weight: 700;
  font-size: var(--text-sm);
}
.kt-key-first, .kt-side-first .kt-key { color: var(--kt-first); background: var(--kt-first-soft); }
.kt-key-second, .kt-side-second .kt-key { color: var(--kt-second); background: var(--kt-second-soft); }
.kt-key-moved { color: var(--kt-moved); background: #fff; border-style: dashed; }

.kt-time { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.kt-slider { flex: 1 1 220px; min-width: 0; display: flex; }
.kt-slider input { width: 100%; min-height: 32px; }
#kassenTimeLabel { font-variant-numeric: tabular-nums; font-weight: 700; }

.kt-map { margin: 8px 0 4px; min-width: 0; }
.kt-map-frame { width: 100%; min-width: 0; }
.kt-svg { display: block; width: 100%; height: auto; max-width: 980px; margin: 0 auto; }
.kt-vertical { max-width: 420px; }
.kt-map figcaption { font-size: var(--text-sm); color: var(--muted); margin-top: 4px; }
.kt-legend { font-size: var(--text-sm); color: var(--muted); margin: 4px 0 16px; line-height: 1.9; }

.kt-svg text { font-family: var(--font-sans); fill: var(--ink); }
.kt-svg .kt-wing { font-size: 13px; font-weight: 700; fill: var(--muted); }
.kt-svg .kt-name { font-size: 13px; font-weight: 700; }
.kt-svg .kt-mark { font-size: 13px; font-weight: 800; }
.kt-svg .kt-sub { font-size: 11px; fill: var(--muted); }
.kt-svg .kt-num { font-size: 10px; fill: var(--muted); }
.kt-svg .kt-link { stroke: var(--line); stroke-width: 2; }
.kt-svg .kt-front { stroke-dasharray: 4 4; }
.kt-svg .kt-box { fill: var(--paper); stroke: var(--line); stroke-width: 1.5; }
.kt-svg .kt-own-first .kt-box { fill: var(--kt-first-soft); stroke: var(--kt-first); }
.kt-svg .kt-own-second .kt-box { fill: var(--kt-second-soft); stroke: var(--kt-second); }
.kt-svg .kt-own-first .kt-mark { fill: var(--kt-first); }
.kt-svg .kt-own-second .kt-mark { fill: var(--kt-second); }
.kt-svg .kt-moved .kt-box { stroke: var(--kt-moved); stroke-dasharray: 5 3; stroke-width: 2; }
.kt-svg .kt-moved .kt-mark { fill: var(--kt-moved); }
.kt-svg .kt-hatchfill { stroke: none; opacity: .5; pointer-events: none; }
.kt-svg .kt-hatch { stroke: var(--kt-moved); stroke-width: 1.2; }
.kt-svg .kt-changed .kt-box { stroke-width: 3.5; }
.kt-svg .kt-unknown .kt-box { stroke-dasharray: 2 3; }
.kt-svg .kt-honjin .kt-box { stroke-width: 2.5; }
.kt-svg .kt-bar-bg { fill: #fff; stroke: var(--line); stroke-width: .8; }
.kt-svg .kt-own-first .kt-bar { fill: var(--kt-first); }
.kt-svg .kt-own-second .kt-bar { fill: var(--kt-second); }

.kt-section { margin: 20px 0; min-width: 0; }
.kt-section h2 { font-size: 1.1rem; margin: 0 0 6px; }
.kt-events { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.kt-events li { border-bottom: 1px solid var(--line); }
.kt-event-button {
  display: grid;
  grid-template-columns: 9.5em 4.5em minmax(0, 1fr);
  gap: 4px 10px;
  width: 100%;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.kt-event-button:hover, .kt-event-button:focus-visible { background: var(--bg); }
.kt-event-button[aria-current="true"] { background: var(--kt-first-soft); }
.kt-event-time { font-variant-numeric: tabular-nums; }
.kt-event-kind { font-weight: 700; }
.kt-event-fell .kt-event-kind { color: var(--kt-moved); }
.kt-event-held_at_start .kt-event-kind, .kt-event-konida_changed .kt-event-kind, .kt-event-disappeared .kt-event-kind { font-weight: 400; color: var(--muted); }
.kt-event-detail { min-width: 0; overflow-wrap: anywhere; }

.kt-table-wrap { max-width: 100%; overflow-x: auto; }
.kt-table { width: 100%; min-width: 0; border-collapse: collapse; font-size: var(--text-table); }
.kt-table th, .kt-table td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.kt-table thead th { color: var(--text-table-head); white-space: nowrap; }
.kt-table td { font-variant-numeric: tabular-nums; }
.kt-row-moved th, .kt-row-moved td { background: #fbf1f1; }
.kt-table .kt-group th { background: transparent; color: var(--ink); font-weight: 700; padding-top: 12px; }
.kt-notes ul, .kt-sources ul { margin: 0; padding-left: 1.2em; }

@media (max-width: 560px) {
  .kt-controls { grid-template-columns: minmax(0, 1fr); }
  .kt-event-button { grid-template-columns: minmax(0, 1fr) auto; }
  .kt-event-detail { grid-column: 1 / -1; }
  .kt-table { font-size: var(--text-sm); }
  .kt-table th, .kt-table td { padding: 5px 4px; }
}
