.debate-board-panel {
  margin-top: 18px;
  display: grid;
  gap: 16px;
  padding-bottom: max(180px, calc(100dvh - 540px));
}

.debate-board-panel[hidden] { display: none; }

.debate-board-editor {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.debate-board-editor-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}

.debate-board-editor-head h2,
.debate-board-editor-head p { margin: 0; }
.debate-board-editor-head > p { color: var(--muted); font-weight: 800; }

.debate-topic-input,
.debate-team-inputs label,
.debate-name-inputs label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 900;
}

.debate-topic-input textarea,
.debate-team-inputs input,
.debate-name-inputs input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.debate-topic-input textarea { resize: vertical; line-height: 1.5; }
.debate-format-picker { display: flex; align-items: end; gap: 12px; margin-bottom: 12px; }
.debate-format-picker label { display: grid; gap: 6px; color: var(--muted); font-weight: 900; }
.debate-format-picker select { min-width: 120px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 34px 9px 12px; background: #fff; color: var(--ink); font: inherit; font-weight: 900; }
.debate-format-picker .debate-hide-names { display: flex; align-items: center; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 13px; background: rgba(255,255,255,.7); cursor: pointer; }
.debate-hide-names input { width: 18px; height: 18px; accent-color: #8c5a24; }
.debate-team-inputs { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.debate-name-inputs { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.debate-name-inputs h3 { margin: 0 0 7px; color: var(--muted); font-size: .9rem; }
.debate-name-inputs section > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.debate-speaker-entry { display: grid; gap: 6px; }
.debate-closing-choice { display: flex !important; grid-template-columns: none; align-items: center; gap: 6px; width: max-content; color: #a33b35 !important; font-size: .78rem; cursor: pointer; }
.debate-closing-choice input { width: 17px; height: 17px; margin: 0; accent-color: #b83d37; }
.debate-team-inputs[hidden] { display: none; }
.debate-board-panel.hide-debate-names .debate-speaker-name input { display: none; }

.debate-board-scroll {
  overflow-x: auto;
  border-radius: 18px;
  background: #1d1710;
  box-shadow: 0 20px 46px rgba(17, 15, 11, 0.24);
}

.debate-blackboard {
  position: relative;
  isolation: isolate;
  min-width: 820px;
  min-height: 640px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(62px, .22fr) minmax(150px, .42fr) minmax(62px, .22fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 28px 24px;
  border: 13px solid #5d351d;
  border-radius: 18px;
  background:
    linear-gradient(93deg, transparent 48%, rgba(255,255,255,.025) 50%, transparent 52%),
    radial-gradient(circle at 23% 30%, rgba(255,255,255,.035), transparent 28%),
    #183b32;
  color: #f7f2db;
  box-shadow: inset 0 0 0 3px #2a160d, inset 0 0 38px rgba(0,0,0,.42);
}

.debate-blackboard.hide-names .debate-speaker strong,
.debate-blackboard.hide-names .debate-team strong { display: none; }
.debate-blackboard.hide-names .debate-speaker,
.debate-blackboard.hide-names .debate-team { gap: 0; }

.debate-closing-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 2px solid #ff857d;
  border-radius: 50%;
  background: rgba(155, 28, 25, .82);
  color: #fff4ef;
  font-size: .9rem;
  font-style: normal;
  font-weight: 1000;
  line-height: 1;
  writing-mode: horizontal-tb;
  box-shadow: 0 0 14px rgba(255, 83, 75, .38);
}

.debate-blackboard::after {
  content: "";
  position: absolute;
  right: 3%; bottom: 17px; left: 3%; height: 6px;
  z-index: -1;
  border-radius: 50%;
  background: rgba(237, 225, 185, .25);
  filter: blur(1px);
}

.debate-topic,
.debate-speaker,
.debate-team { display: grid; justify-items: center; align-content: center; }

.debate-side-seats {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(var(--seat-count), minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.debate-topic strong,
.debate-speaker strong,
.debate-speaker b,
.debate-team strong,
.debate-team b {
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: .08em;
}

.debate-topic strong.debate-topic-copy { width: max-content; height: 15em; display: flex; align-items: flex-end; gap: .08em; writing-mode: horizontal-tb; }
.debate-topic-copy span { flex: 0 0 auto; writing-mode: vertical-lr; text-orientation: upright; white-space: nowrap; }

.debate-topic {
  min-height: 570px;
  border-inline: 1px solid rgba(247,242,219,.24);
  padding-inline: 20px;
}

.debate-topic small { margin-bottom: 12px; color: #d8bf72; font-weight: 900; letter-spacing: .2em; }
.debate-topic strong { font-size: clamp(1.35rem, 2.4vw, 2.2rem); line-height: 1.25; }
.debate-speaker,
.debate-team { min-height: 360px; gap: 18px; }
.debate-speaker b,
.debate-team b { color: #d8bf72; font-size: .9rem; }
.debate-speaker strong,
.debate-team strong { max-height: 300px; line-height: 1.5; }
.debate-speaker strong { font-size: clamp(1.3rem, 2vw, 1.75rem); font-weight: 950; }
.debate-team strong { font-size: clamp(1.05rem, 1.45vw, 1.35rem); }
.debate-speaker.is-pro strong,
.debate-team.is-pro strong { color: #ffd6cf; }
.debate-speaker.is-con strong,
.debate-team.is-con strong { color: #d8eaff; }

@media (max-width: 560px) {
  .debate-board-panel { margin: 10px 10px 0; gap: 10px; }
  .debate-board-editor { padding: 14px; }
  .debate-board-editor-head { display: grid; gap: 4px; align-items: start; }
  .debate-format-picker { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
  .debate-format-picker select { min-width: 0; width: 100%; }
  .debate-format-picker .debate-hide-names { grid-column: 1 / -1; }
  .debate-name-inputs { grid-template-columns: 1fr; gap: 12px; }
  .debate-team-inputs { gap: 8px; }
  .debate-blackboard { min-width: 920px; min-height: 620px; padding: 20px 16px; }
  .debate-topic { min-height: 560px; }
  .debate-topic strong.debate-topic-copy { height: 15em; }
  .debate-speaker,
  .debate-team { min-height: 330px; }
}
