.num { font-family: var(--font-ui); font-weight: 700; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; }
.panel { border-radius: var(--radius-l); border: 3px solid var(--brass); background: linear-gradient(var(--panel-face), var(--panel-face-2)); box-shadow: var(--shadow-inset), var(--shadow-panel); }
.btn { border: 3px solid var(--brass); border-radius: var(--radius-m); background: linear-gradient(var(--panel-face), var(--panel-face-2)); box-shadow: var(--shadow-btn); font-size: 22px; font-weight: 700; cursor: pointer; transition: transform 120ms, opacity 120ms; }
.btn:hover, .resource-card:hover { transform: translateY(-2px); }
.btn:active, .resource-card:active { transform: translateY(2px); }
.btn:active { box-shadow: var(--shadow-panel); }
.btn:focus-visible, .resource-card:focus-visible { outline: 3px solid var(--glow-gold); outline-offset: 3px; }
.btn:disabled, .btn.is-disabled, .resource-card.is-empty { opacity: .4; }
.btn:disabled, .btn.is-disabled { cursor: not-allowed; transform: none; }
.icon { width: 44px; height: 44px; display: inline-block; vertical-align: middle; fill: currentColor; stroke: var(--piece-outline); stroke-width: 2; stroke-linejoin: round; }
.icon-detail { fill: none; stroke: var(--brass-light); stroke-width: 2; }
.resource-lumber { --resource-color: var(--t-forest); }
.resource-wool { --resource-color: var(--t-pasture); }
.resource-grain { --resource-color: var(--t-field); }
.resource-brick { --resource-color: var(--t-hill); }
.resource-ore { --resource-color: var(--t-mountain); }
.player-0 { --player-color: var(--p-red); }
.player-1 { --player-color: var(--p-blue); }
.player-2 { --player-color: var(--p-cream); }
.player-3 { --player-color: var(--p-orange); }
.log-strip { display: flex; align-items: center; gap: 18px; padding: 0 24px; background: linear-gradient(var(--panel-face), var(--parchment)); border-radius: var(--radius-m); font-size: 22px; }
.log-label { color: var(--brass-dark); font-size: 16px; letter-spacing: .12em; padding-right: 20px; border-right: 1px solid var(--brass); }
.log-text { line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.turn-bar { display: flex; align-items: center; justify-content: center; gap: 20px; background: linear-gradient(var(--wood-light), var(--wood-dark)); }
.face-icon { position: relative; flex: 0 0 auto; width: 52px; height: 52px; border: 4px solid var(--brass); border-radius: var(--radius-round); background: var(--panel-face-2); box-shadow: inset 0 0 0 2px var(--brass-dark); overflow: hidden; }
.face-icon::before { content: ""; position: absolute; top: 7px; left: 50%; width: 18px; height: 18px; transform: translateX(-50%); border-radius: var(--radius-round); background: var(--wood-light); }
.face-icon::after { content: ""; position: absolute; bottom: -8px; left: 50%; width: 36px; height: 26px; transform: translateX(-50%); border-radius: var(--radius-round); background: var(--wood-light); border-bottom: 10px solid var(--player-color); }
.face-icon.is-turn { border-color: var(--glow-turn); box-shadow: 0 0 0 2px var(--glow-turn), var(--shadow-glow); }
.turn-arrow { width: 18px; height: 18px; background: var(--brass-light); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.npc-panel { border-color: var(--rose-edge); background: repeating-linear-gradient(2deg, var(--wood) 0 8px, var(--wood-light) 9px, var(--wood) 11px 24px); }
.npc-panel::after { content: ""; position: absolute; inset: -3px; border: 3px solid var(--rose-edge); border-radius: var(--radius-l); box-shadow: inset 0 0 0 2px var(--brass-dark); pointer-events: none; }
.npc-rail { position: absolute; left: 0; top: 0; width: 101px; height: 210px; border-radius: var(--radius-frame) 0 0 var(--radius-frame); background: var(--panel-face); border-right: 2px solid var(--brass-dark); }
.player-tab { position: absolute; z-index: 2; left: -3px; top: 12px; width: 12px; height: 48px; border: 2px solid var(--piece-outline); border-radius: var(--radius-s); background: var(--player-color); }
.npc-art { position: absolute; left: 101px; top: -3px; width: 436px; height: 216px; overflow: hidden; border-radius: 0 var(--radius-l) var(--radius-l) 0; background: linear-gradient(125deg, var(--panel-face), var(--panel-face-2)); box-shadow: inset -3px 0 0 var(--rose-edge); }
.portrait-silhouette { position: absolute; left: 12px; bottom: -14px; width: 164px; height: 188px; }
.portrait-silhouette::before { content: ""; position: absolute; left: 42px; top: 0; width: 72px; height: 82px; border-radius: var(--radius-round); background: var(--wood-light); }
.portrait-silhouette::after { content: ""; position: absolute; left: 0; bottom: 0; width: 164px; height: 120px; border-radius: var(--radius-round) var(--radius-round) 0 0; background: var(--wood-light); }
.npc-name { position: absolute; bottom: 12px; right: 16px; margin: 0; min-width: 210px; padding: 6px 16px; text-align: right; font-size: 24px; color: var(--text-on-wood); background: linear-gradient(90deg, var(--clear), var(--wood)); border-bottom: 2px solid var(--brass); }
.speech-bubble { position: absolute; right: 9px; top: 5px; width: 320px; min-height: 86px; padding: 12px 18px; border: 2px solid var(--brass-dark); border-radius: var(--radius-frame); background: var(--parchment); font-size: 22px; line-height: 1.5; box-shadow: var(--shadow-panel); }
.speech-bubble::before, .speech-bubble::after { content: ""; position: absolute; left: 24px; bottom: -15px; width: 20px; height: 14px; background: var(--brass-dark); clip-path: polygon(0 0, 100% 0, 0 100%); }
.speech-bubble::after { bottom: -11px; left: 26px; width: 15px; height: 11px; background: var(--parchment); }
.npc-panel.has-emblem .speech-bubble { padding-right: 62px; }
.score-badge { position: relative; width: 80px; height: 80px; display: grid; place-items: center; color: var(--text); }
.score-badge svg { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(var(--shadow-piece)); }
.laurel-leaf { fill: var(--brass-light); stroke: var(--brass-dark); stroke-width: 1; }
.laurel-ring { fill: none; stroke: var(--brass); stroke-width: 2; }
.score-face { fill: var(--panel-face); stroke: var(--brass-dark); stroke-width: 2; }
.score-badge .num { position: relative; font-size: 40px; line-height: 1; }
.npc-rail .score-badge { position: absolute; left: 9px; top: 5px; }
.stat-chip { width: 92px; height: 32px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; border: 1px solid var(--brass); border-radius: var(--radius-s); background: var(--panel-face-2); }
.stat-chip .icon { width: 26px; height: 26px; color: var(--wood); }
.stat-chip .num { font-size: 24px; }
.npc-stat { position: absolute; left: 3px; }
.npc-stat--hand { top: 91px; }
.npc-stat--dev { top: 127px; }
.npc-stat--knight { top: 163px; }
.emblem { display: grid; place-items: center; width: 44px; height: 44px; color: var(--brass-light); background: linear-gradient(var(--brass), var(--brass-dark)); clip-path: polygon(0 0, 100% 0, 92% 72%, 50% 100%, 8% 72%); }
.emblem .icon { width: 30px; height: 30px; }
.emblem.is-unheld { visibility: hidden; }
.npc-emblems { position: absolute; right: 9px; top: 5px; display: flex; }
.self-summary { padding: 9px 15px; }
.self-summary h2 { margin: 0; font-size: 19px; }
.summary-stats { position: absolute; left: 112px; top: 9px; display: flex; gap: 8px; font-size: 18px; }
.summary-stats .num { font-size: 24px; margin-left: 6px; }
.stock-row { display: flex; gap: 18px; align-items: center; margin-top: 11px; font-size: 16px; }
.stock-row .icon { width: 25px; height: 25px; color: var(--wood); }
.stock-row .num { font-size: 21px; }
.stock-emblems { position: absolute; top: 49px; right: 81px; display: flex; gap: 4px; }
.hud-band { border-top: 4px solid var(--brass); background: repeating-linear-gradient(1deg, var(--clear) 0 16px, var(--wood-light) 17px, var(--clear) 19px 27px), linear-gradient(var(--wood), var(--wood-dark)); box-shadow: var(--shadow-panel); }
.hud-self, .hud-hand, .hud-dice, .hud-actions { margin-top: -4px; }
.hud-self { border-right: 2px solid var(--brass-dark); color: var(--text-on-wood); }
.hud-self .face-icon { position: absolute; left: 0; top: 8px; width: 108px; height: 108px; border-width: 5px; }
.hud-self .face-icon::before { top: 17px; width: 38px; height: 38px; }
.hud-self .face-icon::after { bottom: -14px; width: 82px; height: 64px; border-bottom-width: 20px; }
.self-name { position: absolute; left: 120px; top: 12px; margin: 0; font-size: 24px; }
.hud-self .score-badge { position: absolute; right: 12px; top: 0; width: 84px; height: 84px; }
.score-pips { position: absolute; left: 120px; top: 98px; display: flex; gap: 5px; }
.score-pip { width: 16px; height: 16px; border: 1px solid var(--brass); border-radius: var(--radius-round); background: var(--wood-dark); }
.score-pip.is-earned { background: radial-gradient(at 35% 30%, var(--brass-light), var(--brass)); }
.self-emblems { position: absolute; left: 16px; bottom: 0; display: flex; gap: 8px; }
.preview-caption { position: absolute; left: 120px; bottom: 12px; font-size: 14px; color: var(--panel-face-2); }
.hud-hand { display: flex; gap: 12px; align-items: flex-start; padding-top: 6px; }
.resource-card { position: relative; flex: 0 0 104px; height: 156px; padding: 10px 4px; border: 3px solid var(--brass); border-radius: var(--radius-card); background: linear-gradient(150deg, var(--panel-face) 10%, color-mix(in srgb, var(--resource-color) 38%, var(--panel-face)) 90%); box-shadow: var(--shadow-inset), var(--shadow-btn); cursor: pointer; transition: transform 120ms, opacity 120ms; text-align: center; }
.resource-card::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--brass-dark); border-radius: var(--radius-s); pointer-events: none; }
.resource-card .icon { display: block; width: 64px; height: 64px; margin: 0 auto; color: var(--resource-color); filter: drop-shadow(var(--shadow-piece)); }
.resource-name { display: block; margin-top: 12px; font-size: 18px; font-weight: 700; }
.count-badge { position: absolute; right: -6px; bottom: -6px; width: 40px; height: 40px; border: 3px solid var(--brass); border-radius: var(--radius-round); background: var(--panel-face); color: var(--text); display: grid; place-items: center; font-size: 22px; box-shadow: var(--shadow-panel); }
.development-card { margin-left: 8px; color: var(--text-on-wood); background: repeating-linear-gradient(45deg, var(--clear) 0 9px, var(--teal) 10px 12px), linear-gradient(var(--teal-light), var(--teal)); }
.development-card .icon { color: var(--brass-light); }
.dice-row { display: flex; gap: 16px; padding: 6px 0 0 12px; }
.die { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 4px; width: 80px; height: 80px; padding: 13px; border: 2px solid var(--panel-face-2); border-radius: var(--radius-dice); background: linear-gradient(135deg, var(--dice-face) 60%, var(--panel-face-2)); box-shadow: var(--shadow-btn); }
.die-pip { border-radius: var(--radius-round); background: var(--text); }
.roll-button { position: absolute; bottom: 0; width: 200px; height: 60px; }
.action-row { display: flex; gap: 15px; }
.action-button { width: 104px; height: 104px; flex: 0 0 104px; padding: 4px 2px; font-size: 16px; }
.action-button > .icon { display: block; width: 36px; height: 36px; margin: 0 auto 2px; color: var(--wood); }
.cost-icons { display: flex; justify-content: center; align-items: center; gap: 1px; margin-top: 3px; }
.cost-icons .icon { width: 16px; height: 16px; color: var(--resource-color); }
.trade-cost { font-size: 13px; }
.end-turn { position: absolute; bottom: 0; width: 580px; height: 60px; background: linear-gradient(var(--teal-light), var(--teal)); color: var(--text-on-wood); letter-spacing: .08em; }
.settings-corner { display: flex; align-items: flex-start; gap: 4px; }
.corner-button { width: 32px; height: 32px; padding: 1px; border-width: 2px; border-radius: var(--radius-s); }
.corner-button .icon { width: 24px; height: 24px; color: var(--wood); }
.build-version { position: absolute; right: 16px; bottom: 1px; margin: 0; font-size: 10px; color: var(--panel-face-2); }

/* 状態連動 HUD と銀行・発展カードの共通ダイアログ。 */
.npc-panel.is-turn::after { border-color: var(--glow-turn); box-shadow: var(--shadow-glow); }
.speech-bubble:empty { display: none; }
.action-button { position: relative; }
.action-stock { position: absolute; right: 5px; top: 3px; font-size: 14px; }
.btn.is-selected { outline: 3px solid var(--glow-gold); outline-offset: 2px; }
.resource-card:disabled, .resource-card.is-disabled { opacity: .4; cursor: not-allowed; transform: none; }
.resource-display, .resource-display:hover, .resource-display:active { cursor: default; transform: none; }
.hit-group.is-disabled { pointer-events: none; }
.die.is-seven { border-color: var(--text-danger); }
.die.is-seven .die-pip { background: var(--text-danger); }
.die.is-rolling { animation: dice-roll 150ms ease-in-out infinite alternate; }
@keyframes dice-roll { from { transform: rotate(-8deg) translateY(-3px); } to { transform: rotate(8deg) translateY(3px); } }
.game-modal-overlay { position: absolute; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg-scrim); }
.game-modal { width: 780px; padding: 32px; border-color: var(--brass); background: repeating-linear-gradient(2deg, var(--clear) 0 18px, var(--wood-light) 19px, var(--clear) 20px 40px), linear-gradient(var(--wood), var(--wood-dark)); color: var(--text-on-wood); }
.game-modal-title { margin: 0 0 24px; font-size: 30px; }
.game-modal-body { padding: 24px; border-radius: var(--radius-m); background: var(--panel-face); color: var(--text); font-size: 22px; }
.game-modal-body p { margin: 0 0 20px; }
.modal-choices { display: flex; flex-wrap: wrap; gap: 16px; }
.modal-choices + .modal-choices { margin-top: 24px; }
.modal-choice { min-width: 120px; min-height: 56px; padding: 10px 16px; color: var(--text); }
.game-modal-body .modal-summary { margin: 24px 0 0; min-height: 30px; }
.game-modal-footer { display: flex; justify-content: flex-end; gap: 16px; margin-top: 24px; }
