/* 世界の国クイズ固有の見た目（共通は ../common/base.css）。地図の地はダーク表示でも明るいまま（盤と同じ扱い） */
[hidden] { display: none !important; }
:root {
  --sea: #CFE2F0; --edge: #6E727A; --ctx: #E2DFD8; --other: #CFCBC3;
  --c0: #F1E4C4; --c1: #DCEAC4; --c2: #F5D6C6; --c3: #E4DCEF; --c4: #F6EDB5;
  --hl: #F0A23B; --hl-edge: #7A4A0C; --okf: #7CC795; --okf-edge: #1F6B3E; --ngf: #F0A29A; --ngf-edge: #9E2F2F;
}
.stage { -webkit-user-select: none; user-select: none; }
.board-wrap { max-width: 640px; margin: 0 auto; }
ruby rt { font-size: .5em; font-weight: 400; }

/* ---------- 問題の行 ---------- */
.qhead { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; margin-bottom: 6px; }
.prog { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 18px; margin-bottom: 2px; }
.prog i {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); font-style: normal;
  font-size: 14px; line-height: 1; font-weight: 700; color: var(--bg); display: inline-flex; align-items: center; justify-content: center;
}
.prog i.now { border-color: var(--accent); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.prog i.ok { background: var(--ok); border-color: var(--ok); }
.prog i.ng { background: var(--ng); border-color: var(--ng); }
.prog i.ok::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--bg); }
.prog i.ng::after { content: '×'; }
.ask { margin: 2px 0 0; font-size: 18px; font-weight: 700; text-align: center; min-height: 1.7em; line-height: 1.5; }
.ask b.big { font-size: clamp(22px, 6vw, 28px); color: var(--accent); }
.ask .ok { color: var(--ok); }
.ask.ng { color: var(--ng); }
.ask .alias { font-size: .7em; color: var(--ink-sub); margin-left: 2px; font-weight: 700; }

/* ---------- 地図 ---------- */
.map-box { position: relative; background: var(--sea); border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.wmap { display: block; width: 100%; height: auto; max-height: 58vh; margin: 0 auto; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; cursor: pointer; }
.wmap.zoomed { touch-action: none; cursor: grab; }
.wmap.panning { cursor: grabbing; }
.wmap .sea { fill: var(--sea); }
.wmap .sh { stroke: var(--edge); stroke-width: .8px; vector-effect: non-scaling-stroke; stroke-linejoin: round; fill-rule: evenodd; }
.wmap .cty[data-col="0"], .wmap .dzo[data-col="0"] { fill: var(--c0); }
.wmap .cty[data-col="1"], .wmap .dzo[data-col="1"] { fill: var(--c1); }
.wmap .cty[data-col="2"], .wmap .dzo[data-col="2"] { fill: var(--c2); }
.wmap .cty[data-col="3"], .wmap .dzo[data-col="3"] { fill: var(--c3); }
.wmap .cty[data-col="4"], .wmap .dzo[data-col="4"] { fill: var(--c4); }
.wmap .other { fill: var(--other); stroke: #9C9A93; }
.wmap .dzh { fill: url(#hatch); }
.wmap .hatch-bg { fill: var(--ctx); }
.wmap .hatch-ln { stroke: #9C9A93; stroke-width: 1.6; }
.wmap .sh.ctx { fill: var(--ctx); stroke: #A8A69F; }
.wmap .sh.hl { fill: var(--hl); stroke: var(--hl-edge); stroke-width: 1.6px; }
.wmap .sh.show { fill: var(--hl); stroke: var(--hl-edge); stroke-width: 1.6px; animation: blink .7s ease-in-out infinite alternate; }
.wmap .sh.ok { fill: var(--okf); stroke: var(--okf-edge); stroke-width: 1.4px; }
.wmap .sh.ng { fill: var(--ngf); stroke: var(--ngf-edge); stroke-width: 1.4px; }
.wmap .mark { fill: #FFFFFF; stroke: #3F4349; }
.wmap .mark.ctx { display: none; }
.wmap .mark.hl, .wmap .mark.show { fill: var(--hl); stroke: var(--hl-edge); }
.wmap .mark.ok { fill: var(--okf); stroke: var(--okf-edge); }
.wmap .mark.ng { fill: var(--ngf); stroke: var(--ngf-edge); }
.wmap .ring { fill: none; stroke: #D9480F; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.wmap .ring.show { animation: blink .7s ease-in-out infinite alternate; }
.wmap .hint-ring { fill: rgba(240, 162, 59, .12); stroke: #D9480F; stroke-dasharray: 8 6; vector-effect: non-scaling-stroke; pointer-events: none; }
.wmap .cap-o { fill: #FFFFFF; stroke: #1F2328; }
.wmap .cap-i { fill: #1F2328; }
.wmap .cap-t, .wmap .label { fill: #1F2328; font-weight: 700; dominant-baseline: central; paint-order: stroke; stroke: #FFFFFF; stroke-linejoin: round; pointer-events: none; }
.wmap .label { text-anchor: middle; }
.wmap .label.ng { fill: #8E2626; }
.wmap .label.ok { fill: #17522F; }
.wmap text { font-family: var(--font); }
@keyframes blink { from { opacity: 1; } to { opacity: .45; } }

/* 地図のすぐ下: ヒントと、拡大・縮小のボタン */
.map-tools { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; flex-wrap: wrap; }
.map-tools .spacer { flex: 1; }
.find-note { font-size: 14px; color: var(--ink-sub); display: inline-flex; align-items: center; gap: 2px; }
.find-note .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #3F4349; background: #FFFFFF; margin: 0 2px; }
.zoom { display: flex; gap: 6px; }
.zbtn {
  appearance: none; font: inherit; width: 44px; height: 44px; border-radius: var(--radius); border: 2px solid var(--line-strong);
  background: var(--surface); color: var(--accent); font-size: 24px; font-weight: 700; line-height: 1; cursor: pointer; padding: 0; touch-action: manipulation;
}
.zbtn.wide { width: auto; padding: 0 12px; font-size: 15px; }
.zbtn:disabled { opacity: .4; cursor: default; border-style: dashed; }
.zbtn:focus-visible { outline: 3px solid var(--warn); outline-offset: 1px; }

/* ---------- 4択 ---------- */
.choices4 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 640px; margin: 10px auto 0; }
.opt {
  appearance: none; font: inherit; display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 6px 12px; text-align: left; position: relative;
  border-radius: var(--radius); border: 2px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; touch-action: manipulation;
}
.opt .n { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--accent); color: var(--accent); font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); }
.opt .t { font-size: clamp(17px, 4.6vw, 22px); font-weight: 700; line-height: 1.4; word-break: keep-all; overflow-wrap: anywhere; }
.opt .t.long { font-size: clamp(15px, 3.9vw, 19px); }
.opt .t .alias { font-size: .7em; color: var(--ink-sub); margin-left: 2px; }
.opt:hover:not([aria-disabled="true"]) { border-color: var(--accent); }
.opt:active:not([aria-disabled="true"]) { transform: translateY(1px); }
.opt:focus-visible { outline: 3px solid var(--warn); outline-offset: 2px; }
.opt.ng { border-color: var(--ng); color: var(--ng); background: transparent; cursor: default; }
.opt.ng .t { text-decoration: line-through; text-decoration-thickness: 2px; }
.opt.ng .n { border-color: var(--ng); color: var(--ng); }
.opt.ng.shake { animation: shake .35s ease-out; }
.opt.ok { border-color: var(--ok); background: var(--ok); color: var(--bg); }
.opt.ok .n { border-color: var(--bg); color: var(--bg); background: transparent; }
.opt.ok .t .alias { color: var(--bg); }
.opt.show { border-color: var(--ok); border-width: 3px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
@keyframes shake { 20% { transform: translateX(-8px); } 45% { transform: translateX(7px); } 70% { transform: translateX(-4px); } 100% { transform: none; } }

/* ---------- 国の説明（まちがえたとき）・ヒント ---------- */
.info, .hintbox {
  margin: 10px auto 0; max-width: 640px; box-sizing: border-box; border-radius: var(--radius); padding: 10px 12px; text-align: left;
  background: var(--surface); border: 2px solid var(--ng); color: var(--ink); font-size: 16px;
}
.hintbox { border: 2px dashed var(--warn); }
.hintbox p { margin: 0; }
.info-name { margin: 0; font-size: 21px; font-weight: 700; color: var(--ng); line-height: 1.5; }
.info-name .alias { font-size: .65em; color: var(--ink-sub); margin-left: 4px; }
.info-formal { margin: 0 0 4px; font-size: 14px; color: var(--ink-sub); }
.info-dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 4px 0 0; }
.info-dl dt { font-weight: 700; color: var(--ink-sub); font-size: 14px; padding-top: 2px; white-space: nowrap; }
.info-dl dd { margin: 0; line-height: 1.6; }
.info-dl dd small { color: var(--ink-sub); font-size: 14px; }
.info-picked { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line); font-size: 15px; }

.linkbtn { display: inline-flex; align-items: center; text-decoration: none; }
#next { min-width: 120px; }
.timer { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 18px; min-width: 64px; text-align: right; margin-left: auto; }
.turnbar .status { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.tag { display: inline-block; white-space: nowrap; font-size: 14px; font-weight: 700; padding: 0 8px; border-radius: 999px; border: 1.5px solid currentColor; margin-left: 6px; vertical-align: middle; color: var(--accent); }
.tag.retry { color: var(--ng); }
.callout { z-index: 5; top: 38%; }

/* ---------- 設定 ---------- */
.scopes .choice span .cnt { font-style: normal; font-size: 14px; color: var(--ink-sub); margin-left: 4px; font-weight: 400; }
.hint.found { margin: -4px 0 8px; }

/* ---------- 結果 ---------- */
.result-box { position: static; margin: 10px auto 0; max-width: 640px; }
.result-box .big { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.result-box .weak { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 6px 0 10px; }
.result-box .weak span { border: 2px solid var(--ng); border-radius: 6px; padding: 4px 8px; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.35; font-size: 14px; }
.result-box .weak span b { color: var(--ng); }
.credit { margin: 6px 0 0; font-size: 14px; }

/* ---------- 解説 ---------- */
.country-list { columns: 3 11em; column-gap: 20px; font-size: 14px; line-height: 1.8; margin: 6px 0 18px; padding-left: 1.2em; }
.country-list li { break-inside: avoid; }
.country-list small { color: var(--ink-sub); }

@media (max-width: 480px) {
  .stage { padding: 8px; }
  .qhead { min-height: 48px; }
  .ask { font-size: 16px; }
  .opt { min-height: 52px; padding: 4px 8px; gap: 6px; }
  .opt .n { width: 24px; height: 24px; }
  .info-name { font-size: 19px; }
  .controls .btn.icon { padding: 0 9px; }
  .map-tools { gap: 6px; }
  .find-note { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wmap .sh.show, .wmap .ring.show, .opt.ng.shake { animation: none; }
}
/* 英語のページ: 4択の国名の別名（Ivory Coast など）は次の行に（日本語のページには効かない） */
:root:lang(en) .opt .t .alias { display: block; margin-left: 0; }
/* 英語のページ: 手番のバーの文が長いので、スマホ幅では時計まで1行に収まるよう少し小さく（日本語のページには効かない） */
@media (max-width: 420px) { :root:lang(en) .turnbar .st-text { font-size: 15px; } :root:lang(en) .timer { min-width: 48px; } }
/* 上のバーの高さを一定に（No.93。数字は一番長い文が画面の幅（360px・375px 以上・641px 以上）で何行になるか。--tb-rt はふりがなの分。base.css・turnbar.js） */
.turnbar { --tb-msg-lines: 2; --tb-st-lines: 2.5; --tb-rt: 11px; --tb-st-rt: 11px; }
@media (min-width: 375px) { .turnbar { --tb-msg-lines: 2; --tb-st-lines: 2.5; } }
@media (min-width: 641px) { .turnbar { --tb-msg-lines: 1; --tb-st-lines: 1; } }
:root:lang(en) .turnbar { --tb-msg-lines: 2; --tb-st-lines: 2; --tb-rt: 0px; --tb-st-rt: 0px; }
@media (min-width: 375px) { :root:lang(en) .turnbar { --tb-msg-lines: 2; --tb-st-lines: 2; } }
@media (min-width: 641px) { :root:lang(en) .turnbar { --tb-msg-lines: 1; --tb-st-lines: 1; } }
/* 上のバーの高さ ここまで */
