/* =====================================================================
   style.css — 難読駅名クイズ ツール固有の微調整のみ（ns-）。
   共通スタイルは /_shared/shirugear.css に任せる。
   ===================================================================== */

/* hidden 属性を共通CSSの display 指定（.sg-card / .sg-btn など）より優先させる */
#setup[hidden],
#quiz[hidden],
#result[hidden],
#next-btn[hidden],
#weak-btn[hidden],
#retry-wrong-btn[hidden],
#review[hidden],
#review-heading[hidden],
#choices[hidden],
#input-form[hidden],
#hint[hidden],
#feedback[hidden] {
  display: none;
}

/* 設定 */
.ns-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ns-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1.5px solid var(--sg-border);
  border-radius: var(--sg-radius, 10px);
  background: var(--sg-surface);
  cursor: pointer;
  font-size: 0.95rem;
}
.ns-mode:has(input:checked) {
  border-color: var(--sg-primary);
  background: color-mix(in srgb, var(--sg-primary) 12%, var(--sg-surface));
  font-weight: 700;
}
.ns-fieldset {
  border: 0;
  padding: 0;
  margin-left: 0;
  margin-right: 0;
  min-width: 0;
}
.ns-regions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.ns-region {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border: 1.5px solid var(--sg-border);
  border-radius: var(--sg-radius, 10px);
  background: var(--sg-surface);
  color: var(--sg-muted);
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
  cursor: pointer;
}
.ns-region small {
  font-weight: 400;
  font-size: 0.72rem;
}
.ns-region[aria-pressed="true"] {
  border-color: var(--sg-primary);
  background: color-mix(in srgb, var(--sg-primary) 14%, var(--sg-surface));
  color: var(--sg-primary);
}
.ns-region[aria-pressed="mixed"] {
  border-color: var(--sg-primary);
  border-style: dashed;
  color: var(--sg-fg);
}
.ns-region:focus-visible,
.ns-choice:focus-visible {
  outline: 2px solid var(--sg-primary);
  outline-offset: 2px;
}
.ns-prefs-box {
  margin-top: 10px;
  border: 1px solid var(--sg-border);
  border-radius: var(--sg-radius, 10px);
  padding: 8px 12px;
}
.ns-prefs-box > summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}
.ns-prefs-sum {
  font-weight: 400;
  color: var(--sg-muted);
}
.ns-prefs__group {
  margin: 10px 0 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sg-muted);
}
.ns-prefs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.ns-pref {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  cursor: pointer;
}
.ns-pref small {
  color: var(--sg-muted);
  font-size: 0.72rem;
}
.ns-pref.is-empty {
  opacity: 0.55;
}
.ns-tools {
  display: flex;
  gap: 14px;
  margin-top: 8px;
}
.ns-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--sg-primary);
  font: inherit;
  font-size: 0.88rem;
  text-decoration: underline;
  cursor: pointer;
}
.ns-start-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.ns-start {
  min-width: 10em;
}
.ns-start:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ns-rec {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--sg-muted);
}

/* 出題 */
.ns-status {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sg-muted);
}
.ns-bar {
  height: 6px;
  margin: 6px 0 14px;
  border-radius: 3px;
  background: var(--sg-border);
  overflow: hidden;
}
.ns-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--sg-primary);
  transition: width 0.25s;
}

/* 駅名標ふうのカード（白地・下に色の帯） */
.ns-sign {
  position: relative;
  margin: 0 auto;
  max-width: 420px;
  padding: 18px 12px 26px;
  border: 2px solid #343a40;
  border-radius: 6px;
  background: #fff;
  color: #212529;
  text-align: center;
}
.ns-sign::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12px;
  background: #3b5bdb;
  border-radius: 0 0 3px 3px;
}
.ns-sign.is-ok::after {
  background: #2f9e44;
}
.ns-sign.is-ng::after {
  background: #e03131;
}
.ns-sign__name {
  margin: 0;
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.ns-sign__sub {
  margin: 4px 0 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #495057;
  overflow-wrap: anywhere;
}
.ns-sign__pref {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: #6c757d;
}
.ns-ask {
  margin: 12px 0 10px;
  text-align: center;
  font-weight: 600;
}

.ns-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.ns-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 8px 10px;
  border: 1.5px solid var(--sg-border);
  border-radius: var(--sg-radius, 10px);
  background: var(--sg-surface);
  color: var(--sg-fg);
  font: inherit;
  font-size: 1.05rem;
  text-align: left;
  cursor: pointer;
}
.ns-choice:hover:not(:disabled) {
  border-color: var(--sg-primary);
}
.ns-choice__key {
  flex: 0 0 auto;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  background: var(--sg-border);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.6em;
  text-align: center;
}
.ns-choice__text {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ns-choice:disabled {
  cursor: default;
  opacity: 0.75;
}
.ns-choice.is-correct {
  opacity: 1;
  border-color: #2f9e44;
  background: color-mix(in srgb, #2f9e44 14%, var(--sg-surface));
  font-weight: 700;
}
.ns-choice.is-wrong {
  opacity: 1;
  border-color: #e03131;
  background: color-mix(in srgb, #e03131 12%, var(--sg-surface));
}

.ns-input {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ns-input .sg-input {
  flex: 1 1 12em;
  min-width: 0;
  font-size: 1.1rem;
}
.ns-input .sg-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.ns-hint {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--sg-muted);
}

.ns-feedback {
  margin-top: 14px;
  text-align: left;
}
.ns-fb__head {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}
.ns-fb__head.is-ok {
  color: #2b8a3e;
}
.ns-fb__head.is-ng {
  color: #c92a2a;
}
.sg-dark .ns-fb__head.is-ok {
  color: #69db7c;
}
.sg-dark .ns-fb__head.is-ng {
  color: #ff8787;
}
.ns-fb__main {
  margin: 4px 0 8px;
  font-size: 1.05rem;
}
.ns-fb__given {
  display: block;
  font-size: 0.88rem;
  color: var(--sg-muted);
}
.ns-detail {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
}
.ns-detail dt {
  color: var(--sg-muted);
  white-space: nowrap;
}
.ns-detail dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ns-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

/* 結果 */
.ns-final {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
}
.ns-comment {
  margin: 4px 0 0;
}
.ns-h3 {
  margin: 18px 0 8px;
  font-size: 1rem;
}
.ns-review {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ns-review__item {
  padding: 10px 0;
  border-bottom: 1px solid var(--sg-border);
}
.ns-review__title {
  margin: 0 0 4px;
  font-size: 1.05rem;
}
.ns-all-box {
  margin-top: 12px;
}
.ns-all-box > summary {
  cursor: pointer;
  font-weight: 600;
}
.ns-all {
  margin: 8px 0 0;
  padding-left: 1.6em;
  line-height: 1.9;
}
.ns-all .is-ng {
  color: #c92a2a;
}
.sg-dark .ns-all .is-ng {
  color: #ff8787;
}

@media (max-width: 520px) {
  .ns-regions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ns-choices {
    grid-template-columns: minmax(0, 1fr);
  }
}
