/* Set Builder — document-style layout, same brand system as the game. */

.builder-body { overflow: auto; background: #F4F5F7; height: auto; min-height: 100%; }

.b-header { background: #fff; border-bottom: 4px solid var(--cardinal); position: sticky; top: 0; z-index: 10; }
.b-header-inner {
  max-width: 1280px; margin: 0 auto; padding: 14px clamp(16px, 3vw, 32px);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.b-back { font-family: var(--sans); font-weight: 700; font-size: 13px; color: var(--cardinal); text-decoration: none; }
.b-back:hover { text-decoration: underline; }
.b-brand img { height: 42px; display: block; }

.b-main { max-width: 1280px; margin: 0 auto; padding: clamp(24px, 4vw, 44px) clamp(16px, 3vw, 32px) 60px; }
.b-title { font-family: var(--serif); font-weight: 900; font-size: clamp(32px, 5vw, 50px); margin: 0 0 10px; }
.b-title span { color: var(--cardinal); }
.b-lede { font-size: 16px; color: #4B5563; max-width: 68ch; line-height: 1.6; margin: 0 0 32px; }

.b-cols { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 980px) { .b-cols { grid-template-columns: 1fr; } }

.b-panel { background: #fff; border: 1px solid var(--gray); border-radius: 16px; padding: clamp(18px, 2.4vw, 28px); }

.b-h2 {
  font-family: var(--sans); font-weight: 700; font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--cardinal); margin: 28px 0 14px;
  padding-bottom: 8px; border-bottom: 2px solid var(--gray);
}
.b-h2:first-child { margin-top: 0; }
.b-h2.flush { margin: 0; border: 0; padding: 0; }
.b-count { color: #6B7280; letter-spacing: .04em; text-transform: none; font-size: 12px; margin-left: 8px; }

.b-grid2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 620px) { .b-grid2 { grid-template-columns: 1fr; } }

.b-field { display: block; margin-bottom: 12px; }
.b-field span {
  display: block; font-family: var(--sans); font-weight: 700; font-size: 10px;
  letter-spacing: .14em; text-transform: uppercase; color: #6B7280; margin-bottom: 5px;
}
.b-field input, .b-field textarea, #bulkText, #fileInput {
  width: 100%; font-family: var(--body); font-size: 15px; color: var(--ink);
  padding: 11px 13px; border: 2px solid var(--gray); border-radius: 10px; background: #fff;
}
.b-field input:focus, .b-field textarea:focus, #bulkText:focus {
  outline: none; border-color: var(--cardinal);
}
#bulkText { resize: vertical; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13.5px; line-height: 1.55; }

.b-opts { display: grid; gap: 8px; margin-bottom: 14px; }
.b-opt { display: flex; gap: 10px; align-items: center; }
.b-radio { display: flex; align-items: center; gap: 6px; cursor: pointer; flex: 0 0 auto; }
.b-radio input { accent-color: var(--cardinal); width: 18px; height: 18px; cursor: pointer; }
.b-radio span {
  font-family: var(--sans); font-weight: 700; font-size: 13px; width: 20px;
  text-align: center; color: #6B7280;
}
.b-radio input:checked + span { color: var(--cardinal); }
.b-optinput {
  flex: 1; font-family: var(--body); font-size: 15px; padding: 10px 13px;
  border: 2px solid var(--gray); border-radius: 10px;
}
.b-optinput:focus { outline: none; border-color: var(--cardinal); }

.b-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.b-tab {
  font-family: var(--sans); font-weight: 700; font-size: 12px; letter-spacing: .04em;
  padding: 9px 15px; border-radius: 999px; border: 2px solid var(--gray);
  background: #fff; color: #6B7280; cursor: pointer;
}
.b-tab.is-active { background: var(--cardinal); border-color: var(--cardinal); color: #fff; }

.b-tabpanel { display: none; }
.b-tabpanel.is-active { display: block; }

.b-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.btn.small { padding: 8px 14px; font-size: 12px; }

.b-help { font-size: 13.5px; color: #6B7280; line-height: 1.6; margin: 0 0 12px; }
.b-help code {
  background: #F0F1F3; padding: 1px 5px; border-radius: 4px;
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; color: var(--cardinal-dark);
}
.b-example {
  background: #F7F7F8; border-left: 4px solid var(--cardinal); border-radius: 8px;
  padding: 14px 16px; font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; margin: 0 0 14px; color: #374151;
}

.b-report { border-radius: 10px; padding: 12px 15px; margin-top: 14px; font-size: 14px; line-height: 1.55; }
.b-report p { margin: 0 0 5px; word-break: break-word; }
.b-report p:last-child { margin: 0; }
.b-report.is-ok { background: #EAF7EF; border: 1px solid #1F7A46; color: #14532D; }
.b-report.is-warn { background: #FFF8E6; border: 1px solid #B7791F; color: #7A5300; }
.b-report.is-bad { background: #FCECEF; border: 1px solid var(--cardinal); color: var(--cardinal-dark); }

.b-listhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--gray); margin-bottom: 14px; }

.b-qlist { list-style: none; margin: 0 0 6px; padding: 0; max-height: 480px; overflow-y: auto; }
.b-qitem {
  display: flex; gap: 12px; justify-content: space-between; align-items: flex-start;
  padding: 13px 0; border-bottom: 1px solid var(--gray);
}
.b-qitem:last-child { border-bottom: 0; }
.b-qmain { min-width: 0; }
.b-qtext { margin: 0 0 4px; font-size: 14.5px; line-height: 1.45; font-weight: 700; }
.b-qans { margin: 0 0 3px; font-size: 13px; color: #1F7A46; }
.b-qans b { font-family: var(--sans); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.b-qref { margin: 0; font-size: 12px; color: #9CA3AF; }
.b-empty { color: #9CA3AF; padding: 26px 0; text-align: center; font-size: 14px; }

.b-qbtns { display: flex; gap: 4px; flex: 0 0 auto; }
.b-qbtns button {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--gray);
  background: #fff; color: #6B7280; cursor: pointer; font-family: var(--sans);
  font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0;
}
.b-qbtns button[data-act="edit"], .b-qbtns button[data-act="load"] { width: auto; padding: 0 11px; }
.b-qbtns button:hover { border-color: var(--cardinal); color: var(--cardinal); }
.b-qbtns button[data-act="del"]:hover { background: var(--cardinal); color: #fff; }

.b-actions { display: grid; gap: 9px; grid-template-columns: 1fr 1fr; }
@media (max-width: 620px) { .b-actions { grid-template-columns: 1fr; } }
.b-actions .btn { padding: 13px 16px; font-size: 13px; text-align: center; }

.b-saved { display: grid; gap: 8px; }
.b-savedrow {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 14px; border: 1px solid var(--gray); border-left: 5px solid #1F7A46; border-radius: 10px;
}
.b-savedrow b { font-size: 14.5px; }
.b-savedrow .s { font-size: 12.5px; color: #6B7280; }

.b-footer { text-align: center; padding: 26px 20px 40px; font-size: 12px; color: #9CA3AF; }


/* ============================ Host screen ============================ */

.host-setup { display: grid; gap: 20px; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); margin-bottom: 22px; }
@media (max-width: 900px) { .host-setup { grid-template-columns: 1fr; } }

.host-code-card {
  background: var(--cardinal); color: #fff; border-radius: 16px;
  padding: 26px 24px; text-align: center;
}
.host-code-label {
  font-family: var(--sans); font-weight: 700; font-size: 11px; letter-spacing: .2em;
  text-transform: uppercase; opacity: .85; margin-bottom: 6px;
}
.host-code {
  font-family: var(--sans); font-weight: 700; font-size: clamp(56px, 11vw, 96px);
  letter-spacing: .16em; line-height: 1.05; margin-bottom: 10px;
}
.host-url { font-size: 13.5px; opacity: .92; margin-bottom: 16px; }
.host-url b { font-weight: 700; }
.host-code-card .btn.btn-secondary { background: #fff; color: var(--cardinal); border-color: #fff; }

.host-select {
  width: 100%; font-family: var(--body); font-size: 15px; padding: 11px 13px;
  border: 2px solid var(--gray); border-radius: 10px; background: #fff; margin-bottom: 4px;
}
.host-cols { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 900px) { .host-cols { grid-template-columns: 1fr; } }

.host-roster { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 420px; overflow-y: auto; }
.host-row {
  display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--gray); border-radius: 10px; font-size: 14.5px;
}
.host-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.host-kick {
  font-family: var(--sans); font-weight: 700; font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: #6B7280; background: #fff; cursor: pointer;
  border: 1px solid var(--gray); border-radius: 8px; padding: 5px 10px;
}
.host-kick:hover { background: var(--cardinal); color: #fff; border-color: var(--cardinal); }
.host-body .board-list { list-style: none; margin: 0; padding: 0; }
