/* ANOTHER WORLD MAP — Música Terra PLAYGROUND */
@font-face { font-family: "Cormorant Garamond"; font-weight: 300; font-style: normal; font-display: swap; src: url("../fonts/cormorant-garamond-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/cormorant-garamond-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 300; font-style: italic; font-display: swap; src: url("../fonts/cormorant-garamond-latin-300-italic.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/cormorant-garamond-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 300; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }

:root {
  --bg: #070a12; --ink: #ece8dd; --dim: rgba(228, 233, 243, .88); --faint: rgba(180, 195, 225, .36);
  --gold: #f0cf8e; --cyan: #9ad0e6; --glass: rgba(9, 12, 22, .88);
  --ui: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", "Segoe UI", sans-serif;
  --serif: "Cormorant Garamond", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --mincho: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sab: env(safe-area-inset-bottom, 0px); --sat: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--ui); font-size: 13px; line-height: 1.6; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body { background: radial-gradient(120% 90% at 50% 38%, #0f1526 0%, #090d18 46%, #05070d 100%); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, #track:focus-visible, a:focus-visible, input:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }
a { color: inherit; }
.mono { font-family: var(--mono); font-weight: 400; letter-spacing: .04em; }
.serif { font-family: var(--serif); }

#cv { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; transition: opacity 1.2s ease; }
body.boot #cv { opacity: 0; }

/* ── 上部 ── */
#top { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; justify-content: space-between; align-items: flex-start; padding: calc(16px + var(--sat)) 20px 0; pointer-events: none; transition: opacity .8s ease; }
#top > * { pointer-events: auto; }
.brand { display: flex; align-items: baseline; gap: 9px; margin: 0; }
.brand .mt { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--dim); text-decoration: none; }
.brand .mt:hover { color: #fff; }
/* 「PLAYGROUND」のロゴ：他の作品と共通の規定スタイル（Fraunces・暗い背景用のグラデーション） */
a.pg { border: 0; text-decoration: none; font-family: 'Fraunces', Georgia, serif; font-size: 13px; font-weight: 680; letter-spacing: -.01em; font-variation-settings: 'opsz' 48; background: linear-gradient(120deg, #f3ece1 0%, #e6b98a 45%, #f0a92c 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: #e6b98a; transition: opacity .3s ease; }
a.pg:hover { opacity: .78; }
#ttl { margin: 5px 0 0; font-family: var(--serif); font-weight: 400; font-size: 23px; letter-spacing: .2em; line-height: 1.15; }
#sub { margin: 4px 0 0; font-family: var(--mincho); font-size: 12.5px; letter-spacing: .14em; color: rgba(240, 236, 226, .92); }
html[lang="en"] #sub { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 16px; letter-spacing: .03em; }
.ctrl { display: flex; gap: 8px; }
.icon { width: 34px; height: 34px; border: 1px solid var(--faint); border-radius: 50%; font-size: 13px; color: var(--ink); background: rgba(9, 12, 21, .6); transition: color .2s, border-color .2s; }
.icon:hover { color: var(--ink); border-color: rgba(200, 212, 235, .5); }
.icon.on { color: var(--gold); border-color: rgba(240, 207, 142, .6); }
#bInfo { font-family: var(--serif); font-style: italic; font-size: 16px; }
#bLang { font-size: 11px; }

/* ── 序曲 ── */
#intro { position: fixed; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 24px; pointer-events: none; opacity: 0; transition: opacity 1.6s ease; }
body.overture #intro { opacity: 1; }
body.overture.overture-go #intro { opacity: 0; }
body.overture:not(.overture-go) #top .brandbox, body.overture:not(.overture-go) #dock { opacity: 0; }
#dock, #top .brandbox { transition: opacity 1.4s ease; }
.i-kicker { margin: 0 0 14px; font-size: 11px; letter-spacing: .4em; color: var(--gold); }
.i-title { margin: 0; font-family: var(--serif); font-weight: 300; font-size: clamp(34px, 7.4vw, 86px); letter-spacing: .22em; text-indent: .22em; line-height: 1.1; text-shadow: 0 0 40px rgba(5, 7, 13, .9); }
.i-sub { margin: 10px 0 0; font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(16px, 2.2vw, 24px); color: var(--dim); text-shadow: 0 0 20px rgba(5, 7, 13, 1); }
.i-ja { margin: 16px 0 0; font-family: var(--mincho); font-size: 13px; letter-spacing: .24em; color: var(--dim); text-shadow: 0 0 20px rgba(5, 7, 13, 1); }
html[lang="en"] .i-ja { font-family: var(--ui); letter-spacing: .04em; }
.i-hint { position: absolute; bottom: calc(36px + var(--sab)); margin: 0; font-size: 12px; letter-spacing: .1em; color: rgba(228, 233, 243, .8); text-shadow: 0 0 12px rgba(5, 7, 13, 1); }

/* ── 下部 ── */
#dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 26px 20px calc(12px + var(--sab)); background: linear-gradient(to top, rgba(5, 7, 13, .94) 0%, rgba(5, 7, 13, .78) 58%, rgba(5, 7, 13, 0) 100%); }
.d-row1 { display: flex; align-items: flex-end; gap: 18px; }
.d-year { flex: none; }
#year { display: block; font-weight: 300; font-size: 62px; line-height: .86; letter-spacing: .02em; font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum", "tnum"; min-width: 2.25em; }
#note { flex: 1; min-width: 0; margin: 0 0 3px; font-size: 13px; line-height: 1.6; color: #fff; text-shadow: 0 0 10px rgba(5, 7, 13, 1); opacity: 0; transform: translateY(4px); transition: opacity .5s ease, transform .5s ease; max-width: 44em; }
#note.on { opacity: 1; transform: none; }
#note b { font-weight: 400; color: var(--gold); margin-right: .5em; }
#tools { flex: 0 1 auto; min-width: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 10px; margin-bottom: 3px; }
.seg { display: inline-flex; border: 1px solid var(--faint); border-radius: 999px; overflow: hidden; background: rgba(9, 12, 21, .72); }
.seg button { padding: 5px 13px; font-size: 12px; letter-spacing: .06em; color: var(--ink); transition: color .2s, background .2s; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--faint); }
.seg button:hover { color: #fff; background: rgba(180, 195, 225, .12); }
.seg button.on { color: #10131c; background: var(--gold); }
.seg.loose { border: 0; background: none; gap: 6px; overflow: visible; }
.seg.loose button { border: 1px solid var(--faint); border-radius: 999px; background: rgba(9, 12, 21, .72); }
.seg.loose button.on { color: var(--gold); background: rgba(240, 207, 142, .14); border-color: rgba(240, 207, 142, .8); }
html[lang="en"] .seg button { font-family: var(--mono); font-weight: 400; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }

.d-row2 { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
#bPlay { flex: none; width: 36px; height: 36px; border: 1px solid rgba(240, 207, 142, .5); border-radius: 50%; display: grid; place-items: center; color: var(--gold); }
#bPlay:hover { background: rgba(240, 207, 142, .1); }
#bPlay .ic { width: 0; height: 0; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent currentColor; margin-left: 3px; }
#bPlay.on .ic { width: 10px; height: 12px; border: 0; margin: 0; background: linear-gradient(to right, currentColor 0 3.5px, transparent 3.5px 6.5px, currentColor 6.5px 10px); }
#track { position: relative; flex: 1; height: 44px; cursor: pointer; touch-action: none; margin: 0 8px; }
.rail, #fill { position: absolute; left: 0; top: 14px; height: 1px; background: rgba(190, 203, 230, .5); }
#fill { height: 2px; margin-top: -.5px; }
.rail { right: 0; }
#fill { background: var(--gold); }
#thumb { position: absolute; top: 14px; width: 13px; height: 13px; margin: -6px 0 0 -6.5px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(240, 207, 142, .16); transition: box-shadow .2s; }
#track.drag #thumb, #track:hover #thumb { box-shadow: 0 0 0 8px rgba(240, 207, 142, .2); }
#marks { position: absolute; inset: 0; pointer-events: none; }
.tk { position: absolute; top: 10px; width: 1px; height: 9px; background: rgba(190, 203, 230, .6); }
.tk b { position: absolute; top: 14px; left: 0; transform: translateX(-50%); font-size: 11px; font-weight: 400; color: rgba(232, 236, 245, .92); }
.ev { position: absolute; top: 2px; width: 22px; height: 24px; margin-left: -11px; pointer-events: auto; }
.ev::after { content: ""; position: absolute; left: 8px; top: 9px; width: 5px; height: 5px; transform: rotate(45deg); border: 1px solid var(--gold); background: var(--bg); transition: background .2s; }
.ev:hover::after { background: var(--gold); }
.d-row3 { display: flex; justify-content: space-between; gap: 16px; margin-top: 4px; font-size: 11.5px; color: rgba(228, 233, 243, .86); letter-spacing: .02em; }
#lgB { text-align: right; flex: none; }

/* ── 国のパネル ── */
#panel, #list { position: fixed; z-index: 6; background: var(--glass); border: 1px solid rgba(180, 195, 225, .3); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 4px; opacity: 0; pointer-events: none; transition: opacity .35s ease, transform .35s ease; }
#panel { top: calc(96px + var(--sat)); right: 20px; width: 292px; padding: 16px 18px 14px; transform: translateX(10px); max-height: calc(100vh - 96px - var(--sat) - var(--dockh, 190px) - 10px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(180, 195, 225, .3) transparent; }
#panel.on, #list.on { opacity: 1; pointer-events: auto; transform: none; }
.p-close { position: absolute; top: 6px; right: 8px; width: 30px; height: 30px; font-size: 20px; color: var(--ink); }
.p-close:hover { color: var(--ink); }
.p-year { margin: 0 0 8px; font-size: 11px; letter-spacing: .14em; color: var(--dim); text-transform: uppercase; }
.p-col h2 { margin: 0; font-family: var(--mincho); font-weight: 500; font-size: 20px; letter-spacing: .06em; line-height: 1.3; display: flex; align-items: center; gap: 8px; }
html[lang="en"] .p-col h2 { font-family: var(--serif); font-weight: 500; font-size: 23px; letter-spacing: .02em; }
.p-col .flag { font-size: 18px; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.p-col.c0 h2 { color: var(--gold); } .p-col.c1 h2 { color: var(--cyan); }
.p-big { margin: 6px 0 8px; font-family: var(--serif); font-weight: 300; font-size: 40px; line-height: 1; font-feature-settings: "lnum", "tnum"; }
.p-big small { font-family: var(--ui); font-size: 12.5px; margin-left: 5px; color: var(--dim); letter-spacing: .04em; }
.p-col dl { margin: 0; }
.p-col dl div { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 0; border-top: 1px solid rgba(180, 195, 225, .2); }
.p-col dt { font-size: 12px; color: var(--dim); } .p-col dd { margin: 0; font-size: 13px; color: #fff; }
.p-none { margin: 10px 0 6px; font-size: 12px; color: var(--ink); }
.p-span { margin: 7px 0 0; font-size: 10.5px; color: rgba(228, 233, 243, .8); }
.p-note { margin: 8px 0 0; font-size: 12px; line-height: 1.65; color: var(--dim); }
.p-cols.two { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; --eq: 92px; }
/* 比較：2列の行をそろえ、GDPと同じ面積比の円を数字の後ろに置く */
.p-cols.two .p-col { display: contents; }
.p-cols.two .c0 > * { grid-column: 1; } .p-cols.two .c1 > * { grid-column: 2; }
.p-cols.two h2 { grid-row: 1; } .p-cols.two .p-big, .p-cols.two .p-none { grid-row: 2; } .p-cols.two dl { grid-row: 4; } .p-cols.two .p-span { grid-row: 5; }
.p-cols.two .p-big { position: relative; width: var(--eq); height: var(--eq); margin: 4px 0 2px; display: flex; align-items: center; justify-content: center; text-align: center; }
.p-cols.two .p-big span { position: relative; text-shadow: 0 0 10px rgba(7, 10, 18, .9), 0 0 3px rgba(7, 10, 18, .7); white-space: nowrap; }
.p-eq { position: absolute; left: 50%; top: 50%; width: calc(var(--eq) * var(--f)); height: calc(var(--eq) * var(--f)); border-radius: 50%; transform: translate(-50%, -50%); box-shadow: inset 0 0 0 1px rgba(240, 207, 142, .2); background: radial-gradient(circle at 40% 34%, rgba(240, 207, 142, .36), rgba(240, 207, 142, .2) 78%); animation: eqIn .7s cubic-bezier(.2, .7, .2, 1) both; }
.c1 .p-eq { box-shadow: inset 0 0 0 1px rgba(154, 208, 230, .2); background: radial-gradient(circle at 40% 34%, rgba(154, 208, 230, .36), rgba(154, 208, 230, .2) 78%); }
.p-eq.still { animation: none; }
@keyframes eqIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.82); } }
.p-eqc { grid-row: 3; grid-column: 1 / -1; margin: 2px 0 8px; display: flex; align-items: baseline; gap: 10px; font-size: 10.5px; letter-spacing: .1em; color: rgba(228, 233, 243, .78); }
.p-eqc::after { content: ''; order: 1; flex: 1; height: 1px; background: rgba(180, 195, 225, .2); align-self: center; }
.p-eqc b { order: 2; font-weight: 400; font-size: 12px; color: #fff; letter-spacing: .02em; }
@media (prefers-reduced-motion: reduce) { .p-eq { animation: none; } }
.p-cols.two .p-col h2 { font-size: 15px; min-height: 2.7em; align-items: flex-start; } html[lang="en"] .p-cols.two .p-col h2 { font-size: 17px; }
.p-cols.two .p-big { font-size: 25px; } .p-cols.two .p-big small { display: block; margin: 3px 0 0; font-size: 10px; }
.p-cols.two dl div { display: block; padding: 3px 0; } .p-cols.two dt { font-size: 9.5px; }
.p-ct { margin: 12px 0 2px; font-size: 11.5px; color: var(--dim); letter-spacing: .06em; }
.p-chart { display: block; width: 100%; height: 86px; cursor: ew-resize; touch-action: none; }
.p-act { margin-top: 8px; }
.b-cmp { width: 100%; padding: 7px 10px; border: 1px solid var(--faint); border-radius: 999px; font-size: 12px; color: var(--ink); letter-spacing: .06em; }
.b-cmp:hover { color: var(--ink); border-color: rgba(200, 212, 235, .5); }
.b-cmp.on { color: var(--cyan); border-color: rgba(154, 208, 230, .6); }

/* ── 一覧 ── */
#list { top: calc(96px + var(--sat)); left: 20px; width: 264px; bottom: 190px; display: flex; flex-direction: column; transform: translateX(-10px); }
.l-head { position: relative; padding: 14px 16px 10px; }
.l-title { margin: 0 0 8px; font-size: 11px; letter-spacing: .14em; color: var(--dim); text-transform: uppercase; }
#q { width: 100%; padding: 6px 10px; font: inherit; font-size: 12px; color: var(--ink); background: rgba(5, 7, 13, .6); border: 1px solid var(--faint); border-radius: 999px; -webkit-appearance: none; appearance: none; }
#q::placeholder { color: rgba(228, 233, 243, .66); }
.l-body { flex: 1; margin: 0; padding: 0 8px 10px; list-style: none; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(170, 185, 215, .3) transparent; }
.l-body li { position: relative; display: flex; align-items: baseline; gap: 8px; padding: 5px 8px 6px; cursor: pointer; border-radius: 3px; }
.l-body li:hover { background: rgba(170, 185, 215, .08); }
.l-body li.sel .nm { color: var(--gold); }
.l-body .n { width: 22px; font-size: 11px; color: rgba(228, 233, 243, .8); text-align: right; }
.l-body .nm { flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-body .v { font-size: 12px; color: var(--ink); }
.l-body i { position: absolute; left: 38px; bottom: 2px; height: 1px; max-width: calc(100% - 46px); background: rgba(240, 207, 142, .6); }

#tip { position: fixed; left: 0; top: 0; z-index: 7; padding: 4px 10px; font-size: 12.5px; background: rgba(8, 11, 20, .9); border: 1px solid rgba(170, 185, 215, .22); border-radius: 3px; pointer-events: none; opacity: 0; transition: opacity .15s; white-space: nowrap; }
#tip.on { opacity: 1; } #tip .mono { color: var(--gold); margin-left: 6px; font-size: 12px; }
#toast { position: fixed; left: 50%; bottom: calc(178px + var(--sab)); z-index: 8; transform: translate(-50%, 6px); padding: 7px 16px; font-size: 12px; background: rgba(8, 11, 20, .92); border: 1px solid rgba(240, 207, 142, .35); border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .4s, transform .4s; max-width: calc(100vw - 32px); text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ── この作品について ── */
#modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(3, 5, 10, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#modal[hidden] { display: none; }
.modal-box { position: relative; width: min(640px, 100%); max-height: min(84vh, 760px); overflow-y: auto; padding: 34px 36px 26px; background: #0b0f1a; border: 1px solid rgba(170, 185, 215, .2); border-radius: 4px; scrollbar-width: thin; }
.modal-close { position: sticky; float: right; top: 0; margin: -18px -20px 0 0; width: 34px; height: 34px; font-size: 20px; color: var(--dim); }
.modal-body h2 { margin: 0 0 12px; font-family: var(--serif); font-weight: 400; font-size: 26px; letter-spacing: .2em; }
.modal-body h3 { margin: 24px 0 6px; font-size: 11px; font-weight: 500; letter-spacing: .18em; color: var(--gold); }
.modal-body p, .modal-body li { font-size: 13.5px; line-height: 1.85; color: rgba(240, 237, 229, .96); }
.modal-body .lead { font-family: var(--mincho); font-size: 14px; line-height: 2; }
html[lang="en"] .modal-body .lead { font-family: var(--serif); font-size: 17.5px; line-height: 1.6; }
.modal-body ul { margin: 0; padding-left: 1.2em; } .modal-body li { margin: 4px 0; } .modal-body b { font-weight: 600; color: var(--ink); }
.modal-body .links { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 26px 0 0; padding-top: 14px; border-top: 1px solid rgba(180, 195, 225, .25); font-size: 12px; color: var(--dim); }
.nos { position: relative; z-index: 30; max-width: 640px; margin: 18vh auto 0; padding: 0 24px; } .nos h2 { font-family: var(--mincho); font-weight: 500; font-size: 20px; } .nos p { font-size: 14px; line-height: 2; }

/* ── スマートフォン ── */
@media (max-width: 760px) {
  #top { padding: calc(12px + var(--sat)) 14px 0; }
  #ttl { font-size: 18px; letter-spacing: .18em; } #sub { font-size: 11.5px; } html[lang="en"] #sub { font-size: 14px; }
  .brand .mt { font-size: 9.5px; } .icon { width: 34px; height: 34px; } .ctrl { gap: 6px; }
  #dock { padding: 22px 14px calc(10px + var(--sab)); }
  .d-row1 { flex-wrap: wrap; gap: 6px 12px; align-items: flex-end; }
  #year { font-size: 46px; }
  #note { font-size: 12px; min-height: 3.3em; }
  #tools { order: 3; flex: 0 0 calc(100% + 28px); margin: 4px -14px 0; padding: 0 14px 2px; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  #tools::-webkit-scrollbar { display: none; }
  .seg { flex: none; } .seg button { padding: 6px 12px; }
  .d-row2 { margin-top: 8px; gap: 10px; } #track { margin: 0 6px; }
  .d-row3 { display: block; font-size: 10.5px; line-height: 1.55; } #lgB { display: block; text-align: left; }
  #panel { top: auto; right: 10px; left: 10px; width: auto; bottom: calc(var(--dockh, 210px) + 4px); padding: 12px 14px 10px; transform: translateY(10px); max-height: 46vh; overflow-y: auto; }
  .p-cols.two { --eq: 70px; } .p-cols.two .p-big { font-size: 21px; }
  .p-big { font-size: 30px; margin: 2px 0 6px; } .p-col h2 { font-size: 17px; } html[lang="en"] .p-col h2 { font-size: 20px; }
  .p-col dl { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; } .p-chart { height: 62px; } .p-note { display: none; } .p-ct { margin-top: 8px; }
  #list { top: calc(78px + var(--sat)); left: 10px; right: 10px; width: auto; bottom: calc(var(--dockh, 210px) + 4px); }
  body.has-panel #note { visibility: hidden; }
  #toast { bottom: calc(var(--dockh, 210px) + 12px); }
  .modal-box { padding: 28px 22px 20px; }
}
@media (max-height: 520px) and (min-width: 761px) { #year { font-size: 44px; } #panel { top: 70px; max-height: calc(100vh - 70px - var(--dockh, 150px) - 10px); } #list { top: 70px; bottom: 150px; } }
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01s !important; } }
@media (max-height: 520px) { #year { font-size: 34px; } .d-row3, #sub { display: none; } #dock { padding-top: 12px; } .d-row2 { margin-top: 2px; } #note { font-size: 11px; } }
.p-note.strong { display: block !important; margin-top: 10px; font-size: 12px; color: var(--ink); }

/* ── 1人あたりの凡例 ── */
.lgL { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; min-width: 0; }
#lgP { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
#lgP[hidden] { display: none; }
#lgP b { font-weight: 400; margin-right: 4px; }
#lgP i { width: 54px; height: 7px; border-radius: 2px; background: linear-gradient(to right, rgb(52, 66, 104), rgb(84, 118, 168), rgb(176, 178, 176)); }
#lgP i.r { background: linear-gradient(to right, rgb(176, 178, 176), rgb(238, 204, 138), rgb(255, 244, 214)); }

/* ── 物語 ── */
.seg.loose button.b-story { color: #10131c; background: linear-gradient(120deg, #f3ece1 0%, #f0cf8e 100%); border-color: transparent; font-weight: 600; padding-left: 16px; padding-right: 16px; }
.seg.loose button.b-story:hover { color: #000; background: #fff; }
.seg.loose button.b-story.on { color: #10131c; background: var(--gold); }
.seg.loose button.b-story.hint { animation: hint 1.8s ease-in-out 4; }
@keyframes hint { 0%, 100% { box-shadow: 0 0 0 0 rgba(240, 207, 142, 0); } 50% { box-shadow: 0 0 0 8px rgba(240, 207, 142, .28); } }
#stories { position: fixed; z-index: 6; top: calc(96px + var(--sat)); left: 20px; width: 320px; max-height: calc(100vh - 96px - var(--dockh, 190px) - 8px); display: flex; flex-direction: column; background: var(--glass); border: 1px solid rgba(180, 195, 225, .3); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 4px; opacity: 0; pointer-events: none; transform: translateX(-10px); transition: opacity .35s ease, transform .35s ease; }
#stories.on { opacity: 1; pointer-events: auto; transform: none; }
.st-list { list-style: none; margin: 0; padding: 0 8px 10px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(180, 195, 225, .35) transparent; }
.st-list button { display: grid; grid-template-columns: 22px 1fr; gap: 1px 8px; width: 100%; padding: 8px 8px; text-align: left; border-radius: 3px; }
.st-list button:hover { background: rgba(180, 195, 225, .1); }
.st-list .mono { grid-row: span 2; font-size: 11px; color: var(--gold); padding-top: 3px; }
.st-list b { font-family: var(--mincho); font-weight: 500; font-size: 15.5px; letter-spacing: .05em; color: #fff; }
html[lang="en"] .st-list b { font-family: var(--serif); font-size: 18px; letter-spacing: .01em; }
.st-list small { font-size: 12px; line-height: 1.55; color: var(--dim); }
#story { position: fixed; z-index: 6; left: 20px; bottom: calc(var(--dockh, 190px) - 6px); width: min(470px, calc(100vw - 40px)); padding: 15px 18px 13px; background: rgba(9, 12, 22, .93); border: 1px solid rgba(240, 207, 142, .45); border-radius: 4px; overflow: hidden; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .4s ease, transform .4s ease; }
#story.on { opacity: 1; pointer-events: auto; transform: none; }
.s-bar { position: absolute; left: 0; top: 0; height: 2px; width: 0; background: var(--gold); }
.s-head { display: flex; align-items: baseline; gap: 10px; }
.s-ch { font-family: var(--mincho); font-size: 12.5px; letter-spacing: .1em; color: var(--gold); }
html[lang="en"] .s-ch { font-family: var(--serif); font-style: italic; font-size: 15px; letter-spacing: .02em; }
.s-n { font-size: 11px; color: var(--dim); }
.s-x { margin: -6px -8px 0 auto; width: 30px; height: 30px; font-size: 20px; color: var(--ink); }
.s-text { margin: 7px 0 11px; font-size: 14.5px; line-height: 1.85; color: #fff; }
html[lang="en"] .s-text { font-size: 14.5px; line-height: 1.65; }
.s-ctl { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.s-ctl button { padding: 6px 14px; border: 1px solid var(--faint); border-radius: 999px; font-size: 12px; color: var(--ink); letter-spacing: .04em; }
.s-ctl button:hover { color: #fff; border-color: rgba(220, 228, 245, .7); }
.s-ctl button[disabled] { opacity: .35; pointer-events: none; }
.s-ctl .s-prev { margin-right: auto; }
.s-ctl .s-next, .s-ctl .s-nextch { color: #10131c; background: var(--gold); border-color: transparent; font-weight: 600; }
.s-ctl .s-next:hover, .s-ctl .s-nextch:hover { color: #000; background: #fff; }
body.story-on #note { visibility: hidden; }
body.story-on .d-year { visibility: visible; }
@media (min-width: 981px) { body.story-on #dock .d-row1 { align-items: flex-end; } }
@media (max-width: 980px) {
  #story { left: 10px; right: 10px; width: auto; bottom: calc(var(--dockh, 210px) + 4px); padding: 12px 14px 11px; }
  .s-text { font-size: 13.5px; line-height: 1.75; margin: 5px 0 9px; }
  body.story-on #panel { display: none; }
  #stories { top: calc(78px + var(--sat)); left: 10px; right: 10px; width: auto; max-height: calc(100vh - 78px - var(--dockh, 210px) - 8px); }
}

/* ── とても狭い画面（幅350px以下）：題名を1行に収める ── */
@media (max-width: 350px) {
  #ttl { font-size: 16px; letter-spacing: .13em; } html[lang="en"] #sub { font-size: 12.5px; }
}

/* ── 比べる国を選んでいる間（スマホ）：パネルを1行に縮め、地図を広く見せる ── */
.p-pick { display: none; }
@media (max-width: 760px) {
  #panel.picking { padding: 10px 12px; overflow: hidden; }
  #panel.picking > :not(.p-pick) { display: none; }
  #panel.picking .p-pick { display: flex; align-items: center; gap: 10px; }
  .p-pick p { flex: 1; min-width: 0; margin: 0; font-size: 12.5px; line-height: 1.45; color: #fff; }
  .p-pick-b { display: flex; gap: 6px; flex: none; }
  .p-pick button { font: inherit; font-size: 12px; padding: 7px 11px; border-radius: 999px; border: 1px solid rgba(180, 195, 225, .4); background: transparent; color: var(--ink, #e8ecf4); cursor: pointer; }
  .p-pick .b-plist { border-color: rgba(240, 207, 142, .7); color: var(--gold); }
}
