/*
 * 「問題セット」パネル（web/lib/question-set.js）の見た目。
 *
 * 検証画面（明るい ../style.css）とデモゲーム・早押しモード（暗い配色）の
 * どちらに貼っても馴染むように、各ページのトークンを使い、無ければ代替に落ちる。
 */

.qset {
  --qset-line: var(--line, var(--rule, #8a8a8a55));
  --qset-face: var(--bg, var(--floor, #00000022));
  --qset-accent: var(--accent, var(--lamp, #2f6db5));
  font-size: 0.88rem;
}

.qset-choices {
  display: grid;
  gap: 0.4rem;
}

.qset-choice {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin: 0;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--qset-line);
  border-radius: 8px;
  font-weight: normal;
  font-size: 0.88rem;
  cursor: pointer;
}

.qset-choice:has(input:checked) {
  border-color: var(--qset-accent);
  background: var(--qset-face);
}

.qset-choice input {
  width: auto;
  flex: none;
  accent-color: var(--qset-accent);
}

.qset-choice-name {
  font-weight: 600;
}

.qset-choice-meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.qset-choice input:disabled + .qset-choice-name {
  color: var(--muted);
}

.qset-import {
  margin-top: 0.7rem;
  border: 1px solid var(--qset-line);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
}

.qset-import > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--qset-accent);
}

.qset-note {
  margin: 0.5rem 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.qset-warn {
  color: var(--warn-ink, var(--close, #b06f0d));
  background: var(--warn-bg, rgba(224, 169, 75, 0.12));
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
}

.qset-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.45rem 0;
}

.qset-file {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
}

.qset-file input[type="file"] {
  font: inherit;
  font-size: 0.78rem;
  max-width: 100%;
}

.qset-label {
  display: block;
  margin: 0.5rem 0 0.2rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.qset textarea {
  width: 100%;
  font: inherit;
  font-size: 0.82rem;
  color: var(--ink);
  background: var(--qset-face);
  border: 1px solid var(--qset-line);
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  resize: vertical;
}

.qset-apply {
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--qset-accent);
  background: var(--qset-accent);
  color: var(--accent-ink, #0b0e16);
}

.qset-link {
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.25rem;
  color: var(--muted);
  text-decoration: underline;
}

.qset-report:empty {
  display: none;
}

.qset-summary {
  margin: 0.6rem 0 0.2rem;
  font-weight: 600;
  font-size: 0.84rem;
}

.qset-list-title {
  margin: 0.5rem 0 0.15rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.qset-errors .qset-list-title {
  color: var(--incorrect);
}

.qset-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.qset-more {
  list-style: none;
  margin-left: -1.1rem;
}

.qset-preview {
  width: 100%;
  margin-top: 0.5rem;
  border-collapse: collapse;
  font-size: 0.76rem;
  table-layout: fixed;
}

.qset-preview th,
.qset-preview td {
  border-bottom: 1px solid var(--qset-line);
  padding: 0.22rem 0.35rem;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qset-preview th {
  color: var(--muted);
  font-weight: 600;
}

.qset-preview .qset-line {
  width: 2.6rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
  .qset-preview th:nth-child(4),
  .qset-preview td:nth-child(4),
  .qset-preview th:nth-child(5),
  .qset-preview td:nth-child(5) {
    display: none;
  }
}
