:root {
  color-scheme: dark;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  background: #071214;
  color: #f8f3df;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { min-height: 100dvh; overflow-x: hidden; background: radial-gradient(circle at 50% 10%, #214145 0, #0b1d20 38%, #061012 100%); }
button, input, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.v3-launch { position: relative; display: grid; align-content: center; gap: 28px; min-height: 100dvh; padding: max(32px, env(safe-area-inset-top)) max(24px, calc((100vw - 820px) / 2)) max(28px, env(safe-area-inset-bottom)); overflow: hidden; isolation: isolate; }
.v3-launch::after { content: ""; position: absolute; inset: 0; z-index: -2; background: linear-gradient(90deg, rgba(4,14,17,.94) 0, rgba(4,14,17,.78) 38%, rgba(4,14,17,.22) 72%), linear-gradient(180deg, rgba(4,13,16,.08), rgba(4,13,16,.84)); }
.v3-launch-sky { position: absolute; inset: 0; z-index: -3; background: #0b1d20 url("./assets/generated/v3/launch-hero.webp") center / cover no-repeat; animation: v3-launch-drift 24s ease-in-out infinite alternate; }
.v3-launch-sky::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 72% 28%, rgba(235,210,137,.18), transparent 26%), linear-gradient(180deg, rgba(11,35,41,.08), rgba(2,9,11,.38)); mix-blend-mode: screen; }
.v3-launch-sky::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 120px 24px rgba(2,8,10,.64); }
@keyframes v3-launch-drift { from { transform: scale(1.01); } to { transform: scale(1.045) translate3d(-.6%, -.35%, 0); } }
.v3-launch > header { max-width: 680px; }
.v3-launch small { color: #d9c77c; font-weight: 900; letter-spacing: .18em; }
.v3-launch h1 { max-width: 720px; margin: 8px 0 12px; font-family: Georgia, "Yu Mincho", serif; font-size: clamp(42px, 8vw, 82px); line-height: .98; letter-spacing: -.04em; text-shadow: 0 4px 30px #061012; }
.v3-launch header p { max-width: 640px; margin: 0; color: #d8dfd6; font-size: clamp(14px, 2vw, 18px); line-height: 1.8; }
.v3-launch-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.v3-launch-actions button, .v3-new-world button { min-height: 72px; padding: 14px 18px; border: 1px solid #6f8176; border-radius: 6px; background: rgba(7,20,22,.86); cursor: pointer; text-align: left; box-shadow: inset 0 0 0 2px rgba(255,255,255,.04); }
.v3-launch-actions button strong, .v3-launch-actions button span { display: block; }
.v3-launch-actions button strong { font: 800 18px/1.4 Georgia, "Yu Mincho", serif; }
.v3-launch-actions button span { margin-top: 4px; color: #aab8ae; font-size: 12px; }
button.is-primary, .v3-launch-actions .is-primary { border-color: #d9c77c; background: linear-gradient(135deg, #48604d, #263e36); }
button:disabled { opacity: .45; cursor: not-allowed; }
.v3-new-world { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px; border: 1px solid #566f67; background: rgba(6,19,21,.94); }
.v3-new-world label { display: grid; gap: 6px; }
.v3-new-world label span { color: #d9c77c; font-size: 12px; font-weight: 800; }
.v3-new-world input, .v3-new-world select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #70837a; border-radius: 3px; background: #102527; color: #fff; }
.v3-new-world p { grid-column: 1 / -1; margin: 0; color: #aab8ae; font-size: 12px; }
.v3-new-world > div { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.v3-new-world button { min-height: 44px; text-align: center; }
.v3-launch > footer { display: flex; justify-content: space-between; color: #71857c; font-size: 10px; font-weight: 800; letter-spacing: .12em; }

.v3-generation { display: grid; place-content: center; justify-items: center; min-height: 100dvh; padding: 24px; text-align: center; background: radial-gradient(circle, rgba(34,68,71,.9), rgba(7,18,20,.98) 64%), url("./assets/generated/v3/launch-hero.webp") center / cover no-repeat; }
.v3-generation-mark { position: relative; display: grid; place-items: center; width: 130px; aspect-ratio: 1; margin-bottom: 24px; }
.v3-generation-mark i { position: absolute; inset: 8px; border: 1px solid #cdbd77; border-radius: 50%; animation: v3-spin 9s linear infinite; }
.v3-generation-mark i:nth-child(2) { inset: 25px; border-style: dashed; animation-direction: reverse; animation-duration: 6s; }
.v3-generation-mark b { color: #f0dfa1; font: 700 28px Georgia, serif; }
.v3-generation small { color: #d8c675; letter-spacing: .2em; }
.v3-generation h1 { margin: 8px 0; font: 700 clamp(28px, 5vw, 46px) Georgia, "Yu Mincho", serif; }
.v3-generation p { min-height: 1.5em; margin: 0 0 20px; color: #b6c3ba; }
.v3-generation-track { width: min(520px, 80vw); height: 8px; padding: 2px; border: 1px solid #61786e; background: #061012; }
.v3-generation-track i { display: block; width: var(--progress, 0%); height: 100%; background: linear-gradient(90deg, #6d9c77, #e0ca78); transition: width .2s; }
.v3-generation > strong { margin-top: 8px; color: #e4d58e; }
@keyframes v3-spin { to { transform: rotate(360deg); } }

.v3-game { min-height: 100dvh; background: #071214; }
.v3-game-header { position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 8px max(16px, calc((100vw - 1180px) / 2)); border-bottom: 1px solid #546b61; background: #0c1f21; box-shadow: 0 4px 16px #020708; }
.v3-game-header > div:first-child { display: grid; gap: 2px; }
.v3-game-header small { color: #cdbd77; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.v3-game-header strong { font: 800 18px/1.2 Georgia, "Yu Mincho", serif; }
.v3-header-actions { display: flex; gap: 8px; }
.v3-header-actions button, .v3-world-map button { min-height: 42px; padding: 8px 14px; border: 2px solid #e9e7d8; border-radius: 4px; background: #102a2d; box-shadow: inset 0 0 0 2px #455b55, 2px 2px #000; cursor: pointer; font-size: 12px; font-weight: 800; }
.v3-header-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.v3-ui-icon { display: block; flex: 0 0 auto; width: 20px; height: 20px; color: #e8d687; }
.v3-inline-icon { display: inline-block; flex: 0 0 auto; width: 14px; height: 14px; margin-right: 4px; color: currentColor; vertical-align: -2px; }
.v3-effect-icon { display: block; width: 16px; height: 16px; color: #fff9df; }
.v3-play-layout { position: relative; display: grid; place-items: center; min-height: calc(100dvh - 216px); padding: 18px 16px; overflow: hidden; background: linear-gradient(rgba(14,38,37,.88), rgba(8,25,26,.94)), url("./assets/generated/terrain-natural-texture.png") center / 720px 720px; background-blend-mode: normal, soft-light; }
.v3-field-shell { position: relative; width: min(900px, calc(100vw - 32px), calc((100dvh - 252px) * 1.18)); aspect-ratio: 13 / 11; border: 4px solid #e9e7d8; border-radius: 6px; background: #071214; box-shadow: 0 0 0 3px #273c38, 0 18px 50px #020708; overflow: hidden; }
.v3-game.is-personal-battle .v3-field-shell { border-color: #f0d47e; box-shadow: 0 0 0 3px #6a4937, 0 18px 50px #020708; }
.v3-field { display: grid; grid-template-columns: repeat(var(--field-columns), minmax(0, 1fr)); grid-template-rows: repeat(var(--field-rows), minmax(0, 1fr)); width: 100%; height: 100%; }
.v3-tile { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 0; border: 0; outline: 1px solid rgba(0,0,0,.045); background: #72985d; color: rgba(22,52,34,.55); overflow: hidden; font: 900 clamp(8px, 1.6vw, 18px)/1 system-ui, sans-serif; }
.v3-tile::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 22%, rgba(255,255,255,.08), transparent 30%), linear-gradient(140deg, transparent 60%, rgba(0,0,0,.08)); pointer-events: none; }
.v3-tile.is-grass:nth-child(3n) { background: #789e61; }
.v3-tile.is-sand { background: #c2a766; color: #6d5a27; }
.v3-tile.is-tundra { background: #80978a; }
.v3-tile.is-snow { background: #cedbd5; color: #60736d; }
.v3-tile.is-water { background: repeating-linear-gradient(165deg, #326875 0 5px, #3c7780 6px 9px); color: #a5d3d3; }
.v3-tile.is-beach { background: linear-gradient(155deg, #d0bd7d, #aa9561); color: #705f38; }
.v3-tile.is-shoal { background: repeating-linear-gradient(165deg, #78aeb0 0 5px, #9bc1b8 6px 9px); color: #e0f1df; }
.v3-tile.is-tidal-flat { background: radial-gradient(circle at 25% 35%, #7d8f73 0 8%, transparent 9%), #819a81; color: #d8e8d0; }
.v3-tile.is-river { background: linear-gradient(90deg, #7ca15d 0 28%, #3c7c87 30% 70%, #7ca15d 72%); color: #d1eded; }
.v3-tile.is-canyon-river { background: linear-gradient(90deg, #5a624e 0 26%, #2f6b76 30% 70%, #5a624e 74%); color: #d3ebdf; }
.v3-tile.is-canal { background: linear-gradient(90deg, #9ca65c 0 34%, #4b8790 36% 64%, #9ca65c 66%); color: #d7eeee; }
.v3-tile.is-spring { background: radial-gradient(circle, #75b6b5 0 28%, #568d6a 31% 54%, #7ea861 57%); color: #e3f3de; }
.v3-tile.is-oasis { background: radial-gradient(circle at 52% 56%, #417f7b 0 22%, #4f7e49 24% 47%, #c2a766 49%); color: #e5edbd; }
.v3-tile.is-road { background: linear-gradient(90deg, #789858 0 29%, #b39763 31% 69%, #789858 71%); color: #6f5835; }
.v3-tile.is-road:nth-child(even) { background: linear-gradient(#789858 0 29%, #b39763 31% 69%, #789858 71%); }
.v3-tile.is-forest { background: #356746; color: #142f23; text-shadow: 1px 1px #65915d; }
.v3-tile.is-marsh { background: repeating-radial-gradient(ellipse at 30% 70%, #496f5b 0 14%, #657b57 16% 31%); color: #bad0a8; }
.v3-tile.is-farmland { background: repeating-linear-gradient(90deg, #80934d 0 4px, #aa9a55 5px 8px); color: #f0d98d; }
.v3-tile.is-hill { background: #718557; color: #4a553a; }
.v3-tile.is-mountain { background: #59675c; color: #29342d; }
.v3-tile.is-volcano { background: radial-gradient(circle at 50% 65%, #e1733d 0 12%, #6e4238 15% 42%, #4d5148 45%); color: #ffd18d; }
.v3-tile.is-crater { background: radial-gradient(circle, #4d5148 0 27%, #7c755f 30% 48%, #657652 51%); color: #ddd0a3; }
.v3-tile.is-cave { background: radial-gradient(ellipse at 50% 70%, #151d1b 0 32%, #66725f 35% 56%, #75895b 59%); color: #d5cfac; }
.v3-tile.is-mine { background: repeating-linear-gradient(135deg, #4f584f 0 6px, #76705a 7px 11px); color: #f0d791; }
.v3-tile.is-ruins { background: linear-gradient(135deg, #8c835f 0 35%, #5f704f 36% 63%, #9b9069 64%); color: #efe2b2; }
.v3-tile.is-floating-island { background: radial-gradient(ellipse at 50% 25%, #b6d6d2 0 20%, #738c75 23% 42%, #536957 45%); color: #f5eac4; }
.v3-tile.is-sky-peak { background: linear-gradient(135deg, #d4e0dc 0 24%, #65736d 26% 67%, #384640 69%); color: #fff4cf; }
.v3-tile.is-settlement-ground { background: #ae9669; }
.v3-tile[class*="is-settlement-"]:not(.is-settlement-ground) { background: #9b825c; color: #fff1bd; text-shadow: 1px 2px #2b2117; }
.v3-field .v3-tile[style*="--v3-terrain-position"] { background-image: url("./assets/generated/v3/field-terrain-atlas-v2.webp"); background-position: var(--v3-terrain-position); background-size: 400% 400%; background-repeat: no-repeat; image-rendering: auto; }
.v3-tile.is-fog, .v3-tile.is-ungenerated, .v3-tile.is-void { background: #101f20; color: transparent; }
.v3-tile.is-adjacent[data-v3-move] { cursor: pointer; }
.v3-tile.is-adjacent[data-v3-move]:hover, .v3-tile.is-adjacent[data-v3-move]:focus-visible { z-index: 2; outline: 3px solid #fff1a5; outline-offset: -3px; filter: brightness(1.15); }
.v3-tile.is-combat-player { z-index: 1; outline: 3px solid #f8e9a5; outline-offset: -3px; }
.v3-tile.is-combat-enemy { z-index: 1; outline: 3px solid #df7769; outline-offset: -3px; animation: v3-enemy-pulse 1.4s ease-in-out infinite alternate; }
.v3-tile.is-military-target { z-index: 1; outline: 3px solid #f0cb65; outline-offset: -3px; box-shadow: inset 0 0 0 4px rgba(111,31,28,.62); animation: v3-military-pulse 1.5s ease-in-out infinite alternate; }
.v3-atlas-art { background-position: var(--v3-art-position); background-repeat: no-repeat; background-size: 400% 400%; }
.v3-atlas-art.is-entity-atlas { background-image: url("./assets/generated/v3/field-entity-atlas.webp"); }
.v3-atlas-art.is-object-atlas { background-image: url("./assets/generated/v3/field-object-atlas.webp"); }
.v3-atlas-art.is-military-atlas { background-image: linear-gradient(rgba(81,17,18,.16), rgba(22,7,8,.45)), url("./assets/generated/tactical-icons/e-infantry-1.png"); background-position: center; background-size: cover; }
.v3-landmark-art { position: absolute; z-index: 1; width: 116%; aspect-ratio: 1; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(3,8,7,.68)); }
.v3-player-sprite, .v3-entity { position: relative; z-index: 2; display: block; width: 94%; aspect-ratio: 1; border: 0; border-radius: 0; background-color: transparent; filter: drop-shadow(0 2px 2px rgba(5,12,9,.9)); }
.v3-player-sprite { filter: drop-shadow(0 0 2px #fff2b1) drop-shadow(0 2px 2px rgba(5,12,9,.92)); }
.v3-entity { width: 88%; }
.v3-crisis-symbol { position: relative; z-index: 3; display: grid; place-items: center; width: 72%; aspect-ratio: 1; border: 2px solid #fff0b3; border-radius: 50%; background: radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--crisis-color) 68%, white), var(--crisis-color) 58%, #24151d); color: #fffbe8; box-shadow: 0 0 0 2px rgba(22,10,15,.68), 0 0 12px color-mix(in srgb, var(--crisis-color) 64%, transparent); font-style: normal; animation: v3-crisis-pulse 1.6s ease-in-out infinite alternate; }
.v3-crisis-symbol > i { font: 900 clamp(8px, 1.5vw, 16px)/1 Georgia, "Yu Mincho", serif; }
.v3-crisis-symbol > small { position: absolute; right: -3px; bottom: -3px; display: grid; place-items: center; min-width: 15px; height: 15px; border: 1px solid #fff0b3; border-radius: 50%; background: #28151b; color: #fff0b3; font: 900 8px/1 sans-serif; }
.v3-combatants .v3-crisis-symbol { width: 58%; }
@keyframes v3-crisis-pulse { from { scale: .94; filter: brightness(.92); } to { scale: 1.03; filter: brightness(1.18); } }
.v3-entity.is-group-battle { width: 82%; border: 2px solid #ffe18b; border-radius: 50%; box-shadow: 0 0 0 2px rgba(73,20,19,.76), 0 2px 4px #07100d; }
.v3-combatants { position: relative; z-index: 2; display: flex; align-items: end; justify-content: center; width: 92%; }
.v3-combatants .v3-player-sprite, .v3-combatants .v3-entity { width: 66%; }
.v3-combatants .v3-entity { margin-left: -18%; translate: 0 -12%; }
.v3-field-vignette { position: absolute; inset: 0; box-shadow: inset 0 0 60px 16px rgba(5,15,16,.46); pointer-events: none; }
.v3-world-effect-visual { position: absolute; z-index: 2; inset: 0; opacity: calc(.3 + var(--effect-strength, .5) * .28); pointer-events: none; mix-blend-mode: screen; }
.v3-world-effect-visual::before, .v3-world-effect-visual::after { content: ""; position: absolute; inset: -20%; pointer-events: none; }
.v3-world-effect-visual.is-rain::before { background: repeating-linear-gradient(105deg, transparent 0 15px, rgba(167,216,229,.58) 16px 17px, transparent 18px 31px); background-size: 48px 58px; animation: v3-effect-rain .72s linear infinite; }
.v3-world-effect-visual.is-storm { background: rgba(40,65,82,.2); }
.v3-world-effect-visual.is-storm::before { background: repeating-linear-gradient(108deg, transparent 0 11px, rgba(178,218,231,.72) 12px 14px, transparent 15px 26px); background-size: 42px 48px; animation: v3-effect-rain .42s linear infinite; }
.v3-world-effect-visual.is-storm::after { background: rgba(225,240,255,.58); opacity: 0; animation: v3-effect-lightning 5.2s steps(1) infinite; }
.v3-world-effect-visual.is-snow::before { background-image: radial-gradient(circle, rgba(255,255,255,.88) 0 2px, transparent 2.5px), radial-gradient(circle, rgba(239,250,250,.72) 0 1.5px, transparent 2px); background-position: 0 0, 22px 28px; background-size: 44px 52px, 35px 43px; animation: v3-effect-snow 7s linear infinite; }
.v3-world-effect-visual.is-blizzard::before { background: repeating-linear-gradient(102deg, transparent 0 12px, rgba(244,252,255,.8) 13px 17px, transparent 18px 28px); background-size: 54px 36px; animation: v3-effect-blizzard .8s linear infinite; filter: blur(.5px); }
.v3-world-effect-visual.is-sandstorm { background: linear-gradient(90deg, rgba(155,103,46,.1), rgba(232,190,105,.28), rgba(134,83,39,.12)); mix-blend-mode: soft-light; }
.v3-world-effect-visual.is-sandstorm::before { background: repeating-linear-gradient(174deg, transparent 0 12px, rgba(250,212,134,.38) 13px 17px, transparent 18px 31px); background-size: 70px 42px; animation: v3-effect-sand 1.15s linear infinite; filter: blur(1px); }
.v3-world-effect-visual.is-heatwave { background: repeating-radial-gradient(ellipse at 50% 115%, rgba(235,120,56,.22) 0 5%, transparent 7% 14%); mix-blend-mode: overlay; animation: v3-effect-heat 2.8s ease-in-out infinite alternate; }
.v3-world-effect-visual.is-fog::before, .v3-world-effect-visual.is-fog::after { background: radial-gradient(ellipse at 25% 44%, rgba(213,230,226,.55), transparent 38%), radial-gradient(ellipse at 75% 62%, rgba(190,214,210,.5), transparent 42%); filter: blur(10px); animation: v3-effect-fog 12s ease-in-out infinite alternate; }
.v3-world-effect-visual.is-fog::after { translate: -12% 4%; animation-direction: alternate-reverse; animation-duration: 16s; }
.v3-world-effect-visual.is-ashfall::before { background-image: radial-gradient(circle, rgba(80,67,62,.8) 0 1.5px, transparent 2px), radial-gradient(circle, rgba(151,133,124,.72) 0 1px, transparent 1.5px); background-position: 0 0, 17px 19px; background-size: 31px 37px, 27px 33px; animation: v3-effect-ash 8s linear infinite; }
.v3-tile.has-world-effect::before { content: ""; position: absolute; z-index: 1; inset: 0; border: 1px solid rgba(226,239,232,.12); pointer-events: none; }
@keyframes v3-effect-rain { to { background-position: -48px 58px; } }
@keyframes v3-effect-lightning { 0%, 8%, 11%, 100% { opacity: 0; } 9%, 10% { opacity: .8; } }
@keyframes v3-effect-snow { to { background-position: 20px 52px, 4px 71px; } }
@keyframes v3-effect-blizzard { to { background-position: -108px 36px; } }
@keyframes v3-effect-sand { to { background-position: 140px 0; } }
@keyframes v3-effect-heat { from { transform: scaleY(.98); filter: blur(0); } to { transform: scaleY(1.03); filter: blur(1.5px); } }
@keyframes v3-effect-fog { to { translate: 18% -3%; } }
@keyframes v3-effect-ash { to { background-position: 10px 74px, 2px 85px; } }
@keyframes v3-enemy-pulse { from { filter: brightness(.96); } to { filter: brightness(1.22); } }
@keyframes v3-military-pulse { from { filter: brightness(.95); } to { filter: brightness(1.18); } }

.v3-personal-battle-status { position: absolute; z-index: 4; top: 12px; right: 12px; display: grid; gap: 5px; width: min(270px, calc(100% - 24px)); min-height: 82px; padding: 10px 12px 10px 78px; border: 3px solid #f0e8ce; border-radius: 5px; background: rgba(28,12,13,.94); box-shadow: inset 0 0 0 2px #76514b, 3px 4px 0 rgba(0,0,0,.65); }
.v3-personal-battle-art { position: absolute; top: 8px; left: 9px; display: block; width: 60px; aspect-ratio: 1; border: 1px solid #a97c63; border-radius: 4px; background-color: #351819; filter: drop-shadow(0 2px 2px #080303); }
.v3-personal-battle-status header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.v3-personal-battle-status small { color: #e0c978; font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.v3-personal-battle-status > strong { font: 800 18px/1.2 Georgia, "Yu Mincho", serif; }
.v3-personal-battle-status > div { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 7px; font-size: 10px; }
.v3-personal-battle-status > div > i { height: 7px; background: #351718; }
.v3-personal-battle-status > div > i > b { display: block; height: 100%; background: #c15e50; transition: width .18s; }
.v3-personal-battle-status em { color: #f6e5d0; font-style: normal; font-weight: 800; }

.v3-status-window, .v3-place-window, .v3-message-window, .v3-encounter-card, .v3-inventory-card { border: 3px solid #efeee2; border-radius: 5px; background: rgba(5,19,22,.96); box-shadow: inset 0 0 0 2px #536761, 4px 5px 0 rgba(0,0,0,.6); }
.v3-status-window { position: absolute; z-index: 3; top: 28px; left: max(24px, calc((100vw - 1120px) / 2)); width: 190px; padding: 12px 14px; }
.v3-status-window header { display: flex; justify-content: space-between; padding-bottom: 7px; border-bottom: 1px solid #64756e; }
.v3-status-window header > span { display: grid; justify-items: end; gap: 1px; }
.v3-status-window header small { color: #dccb7e; }
.v3-status-window dl { display: grid; gap: 4px; margin: 8px 0; font-size: 12px; }
.v3-status-window dl div { display: flex; justify-content: space-between; }
.v3-status-window dt { color: #b9c4bc; }
.v3-status-window dd { margin: 0; font-weight: 800; }
.v3-hp-track { height: 5px; background: #351d1d; }
.v3-hp-track i { display: block; height: 100%; background: #69a66c; }
.v3-place-window { position: absolute; z-index: 3; right: max(24px, calc((100vw - 1120px) / 2)); bottom: 30px; display: grid; gap: 4px; width: 230px; padding: 11px 14px; }
.v3-place-window small { color: #dbc879; font-weight: 800; }
.v3-place-window strong { font-family: Georgia, "Yu Mincho", serif; font-size: 17px; }
.v3-place-window span { color: #b7c3ba; font-size: 10px; }
.v3-place-window .v3-weather-label { display: flex; align-items: center; overflow: hidden; padding: 4px 6px; border-left: 2px solid #73877e; background: #102729; color: #dbe6df; font-weight: 800; white-space: nowrap; }
.v3-place-window .v3-weather-label span, .v3-place-window .v3-race-effect-label span { overflow: hidden; text-overflow: ellipsis; }
.v3-place-window .v3-weather-label:not(.is-clear) { border-left-color: #d4c16e; color: #fff1bd; }
.v3-place-window .v3-race-effect-label { display: flex; align-items: center; overflow: hidden; padding: 4px 6px; border-left: 2px solid #667b74; background: #0c2022; color: #aebeb6; font-weight: 800; white-space: nowrap; }
.v3-place-window .v3-race-effect-label.is-active { border-left-color: #9b82cf; color: #e9ddff; }
.v3-place-window .v3-military-summary { margin-top: 3px; padding-top: 5px; border-top: 1px solid #536761; color: #d6c47b; font-weight: 800; }
.v3-place-window .v3-military-summary.is-active { color: #ffe7a0; }
.v3-command-area { display: grid; grid-template-columns: minmax(0, 1fr) 144px; gap: 12px; min-height: 152px; padding: 12px max(16px, calc((100vw - 1180px) / 2)) max(12px, env(safe-area-inset-bottom)); border-top: 1px solid #52685f; background: #071416; }
.v3-message-window { min-height: 112px; padding: 12px 16px; overflow: hidden; }
.v3-message-window div { display: grid; gap: 4px; }
.v3-message-window p { margin: 0; color: #899a92; font-size: 11px; line-height: 1.5; }
.v3-message-window p.is-latest { color: #fff8dd; font-size: 14px; }
.v3-message-window p.is-latest::before { content: "▸ "; color: #e3ce79; }
.v3-dpad { display: grid; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); align-content: center; justify-content: center; }
.v3-dpad button { display: grid; place-items: center; border: 1px solid #81928a; background: linear-gradient(145deg, #1d3b3e, #102729); cursor: pointer; }
.v3-dpad button .v3-ui-icon { width: 22px; height: 22px; }
.v3-dpad button:hover, .v3-dpad button:focus-visible { background: #38564e; }
.v3-dpad button:nth-child(1) { grid-column: 2; }
.v3-dpad button:nth-child(2) { grid-row: 2; grid-column: 1; }
.v3-dpad i { grid-row: 2; grid-column: 2; display: grid; place-items: center; border: 1px solid #4e635b; color: #d4c474; font: normal 10px/1 system-ui; }
.v3-dpad button:nth-child(4) { grid-row: 2; grid-column: 3; }
.v3-dpad button:nth-child(5) { grid-row: 3; grid-column: 2; }
.v3-personal-battle-commands { display: grid; align-content: center; gap: 8px; }
.v3-personal-battle-commands button { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 7px; min-height: 46px; padding: 6px 10px; border: 1px solid #997a65; border-radius: 3px; background: #3b2322; cursor: pointer; text-align: left; }
.v3-personal-battle-commands button .v3-ui-icon { width: 25px; height: 25px; }
.v3-personal-battle-commands button span { display: grid; }
.v3-personal-battle-commands button:focus-visible { outline: 3px solid #f0d47e; outline-offset: 2px; }
.v3-personal-battle-commands strong { font-size: 13px; }
.v3-personal-battle-commands small { color: #c7b5a1; font-size: 8px; }

.v3-modal, .v3-world-map { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(1,7,8,.82); backdrop-filter: blur(5px); }
.v3-encounter-card { display: grid; grid-template-columns: 100px 1fr; gap: 18px; width: min(620px, 100%); padding: 20px; }
.v3-encounter-card > i { display: block; align-self: center; width: 100px; aspect-ratio: 1; border: 3px solid #e6d68f; border-radius: 12px; background-color: #24191a; box-shadow: inset 0 0 16px rgba(0,0,0,.44), 0 4px 10px rgba(0,0,0,.48); }
.v3-encounter-card small, .v3-inventory-card small, .v3-world-map small { color: #d8c576; font-weight: 900; letter-spacing: .12em; }
.v3-encounter-card h2 { margin: 4px 0 8px; font: 800 30px Georgia, "Yu Mincho", serif; }
.v3-encounter-card p { color: #c8d1cb; }
.v3-encounter-card footer { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.v3-encounter-card button, .v3-inventory-card button { min-height: 44px; padding: 8px 16px; border: 1px solid #87978f; border-radius: 3px; background: #153034; cursor: pointer; font-weight: 800; }
.v3-enemy-hp { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; font-size: 11px; }
.v3-enemy-hp > i { height: 7px; background: #32191a; }
.v3-enemy-hp b { display: block; height: 100%; background: #a9584d; }
.v3-inventory-card { width: min(560px, 100%); padding: 18px; }
.v3-inventory-card > header { display: flex; justify-content: space-between; align-items: center; }
.v3-inventory-card h2 { margin: 2px 0 12px; }
.v3-inventory-card > header button { display: grid; place-items: center; width: 44px; padding: 0; }
.v3-inventory-card > div { display: grid; gap: 6px; min-height: 120px; }
.v3-inventory-card > div > button { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; text-align: left; }
.v3-inventory-card > div > button i { grid-row: 1 / span 2; display: block; width: 34px; aspect-ratio: 1; border: 1px solid #6b7f70; border-radius: 5px; background-color: #263d34; font-style: normal; }
.v3-inventory-card > div > button span { display: grid; }
.v3-inventory-card > div > button small { color: #9eada5; letter-spacing: 0; }
.v3-inventory-card > footer { display: flex; justify-content: flex-end; margin-top: 18px; padding-top: 12px; border-top: 1px solid #53665f; }
.v3-inventory-card button.is-danger { display: inline-flex; align-items: center; gap: 7px; border-color: #905b55; color: #e6b5ae; background: #321d1f; }

.v3-underworld { position: fixed; inset: 0; z-index: 22; display: grid; place-items: center; padding: 18px; background: rgba(1,5,7,.9); backdrop-filter: blur(7px); }
.v3-underworld-card { display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(1180px, 100%); max-height: calc(100dvh - 36px); overflow: hidden; border: 3px solid #e9e2c8; border-radius: 6px; background: #091719; box-shadow: inset 0 0 0 2px #584d46, 0 18px 60px #000; }
.v3-underworld-card > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; border-bottom: 1px solid #66594d; background: linear-gradient(90deg, rgba(25,17,19,.98), rgba(12,31,31,.78)), url("./assets/generated/dungeon-main-cave.png") center 58% / cover; }
.v3-underworld-card > header small, .v3-criminal-section small, .v3-underworld-summary small, .v3-criminal-organization > header small, .v3-broker-card small { color: #d9c577; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.v3-underworld-card > header h1 { margin: 2px 0; font: 800 28px Georgia, "Yu Mincho", serif; }
.v3-underworld-card > header p { margin: 0; color: #aeb9b1; font-size: 11px; }
.v3-underworld-card button, .v3-underworld-card input, .v3-underworld-card select { min-height: 44px; border: 1px solid #786e62; border-radius: 3px; background: #15282a; color: #f7f1dc; }
.v3-underworld-card button { padding: 8px 12px; cursor: pointer; font-weight: 800; }
.v3-underworld-card button:hover:not(:disabled), .v3-underworld-card button:focus-visible { border-color: #e0cd80; background: #29403d; }
.v3-underworld-card button:focus-visible, .v3-underworld-card input:focus-visible, .v3-underworld-card select:focus-visible { outline: 3px solid #e0cd80; outline-offset: 2px; }
.v3-underworld-card > header > button { flex: 0 0 auto; min-width: 80px; }
#v3UnderworldContent { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; min-height: 0; padding: 14px; overflow-y: auto; overscroll-behavior: contain; }
.v3-underworld-summary { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border: 1px solid #675d51; background: #675d51; }
.v3-underworld-summary > div { display: grid; gap: 2px; min-width: 0; padding: 10px 12px; background: #101f21; }
.v3-underworld-summary strong { overflow: hidden; font: 800 16px/1.3 Georgia, "Yu Mincho", serif; text-overflow: ellipsis; white-space: nowrap; }
.v3-underworld-summary span { overflow: hidden; color: #a9b4ad; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.v3-criminal-result { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-left: 4px solid #d6b45f; background: #29231d; }
.v3-criminal-result span { color: #c6c1ae; font-size: 11px; }
.v3-criminal-section, .v3-criminal-organization { grid-column: 1 / -1; min-width: 0; padding: 14px; border: 1px solid #53625c; background: #0d2022; }
.v3-criminal-section > header, .v3-criminal-organization > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.v3-criminal-section h2, .v3-criminal-organization h2 { margin: 2px 0 0; font: 800 20px Georgia, "Yu Mincho", serif; }
.v3-criminal-section > header > b, .v3-criminal-section > header > div + b { max-width: 55%; color: #c7b96f; font-size: 10px; text-align: right; }
.v3-criminal-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.v3-criminal-action, .v3-operation-card { display: grid; align-content: start; gap: 8px; min-width: 0; padding: 12px; border: 1px solid #645d52; background: #14282a; }
.v3-criminal-action.is-locked, .v3-operation-card.is-locked { background: #111c1e; }
.v3-criminal-action > header, .v3-operation-card > header { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.v3-criminal-action header b { color: #d3bd70; font-size: 10px; }
.v3-criminal-action h3, .v3-operation-card h3 { margin: 0; font: 800 16px/1.3 Georgia, "Yu Mincho", serif; }
.v3-criminal-action p, .v3-operation-card p { margin: 0; color: #aeb9b2; font-size: 10px; line-height: 1.55; }
.v3-criminal-action footer { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; margin-top: auto; }
.v3-criminal-action footer span { color: #d5c779; font-size: 10px; }
.v3-criminal-action footer button { min-width: 0; padding-inline: 8px; font-size: 10px; }
.v3-broker-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid #6a5d50; background: #1c2223; }
.v3-broker-card > div { display: grid; gap: 2px; }
.v3-broker-card strong { font: 800 16px Georgia, "Yu Mincho", serif; }
.v3-broker-card span { color: #aab5ae; font-size: 10px; }
.v3-broker-card > b { color: #79b78b; font-size: 11px; }
.v3-criminal-candidates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.v3-criminal-candidates > button { display: grid; align-content: center; text-align: left; }
.v3-criminal-candidates small { color: #aeb8b1; letter-spacing: 0; }
.v3-criminal-candidates > p { grid-column: 1 / -1; color: #9da9a2; font-size: 11px; }
.v3-criminal-name { display: grid; grid-template-columns: 100px minmax(0, 1fr); align-items: center; gap: 8px; margin-bottom: 8px; }
.v3-criminal-name span { color: #c9d0ca; font-size: 11px; }
.v3-criminal-name input { width: 100%; padding: 8px 10px; }
.v3-criminal-organization { padding: 0; border-color: #76664f; background: #0b1a1c; }
.v3-criminal-organization > header { align-items: center; margin: 0; padding: 14px; border-bottom: 1px solid #5b5348; background: linear-gradient(115deg, #29221e, #102527); }
.v3-criminal-organization > header p { margin: 4px 0 0; color: #b2bbb4; font-size: 10px; }
.v3-criminal-organization > header dl { display: grid; grid-template-columns: repeat(3, auto); gap: 18px; margin: 0; }
.v3-criminal-organization > header dl div { display: grid; text-align: right; }
.v3-criminal-organization > header dt { color: #b3bcb5; font-size: 9px; }
.v3-criminal-organization > header dd { margin: 0; color: #e3d384; font-size: 17px; font-weight: 900; }
.v3-criminal-finance { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; padding: 10px 14px 0; }
.v3-criminal-finance button { min-height: 44px; font-size: 10px; }
.v3-criminal-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 14px 0; }
.v3-criminal-columns .v3-criminal-section { grid-column: auto; padding: 12px; }
.v3-criminal-organization > .v3-criminal-section { margin: 10px 14px 14px; }
.v3-criminal-roster, .v3-active-orders, .v3-completed-orders { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.v3-criminal-roster li, .v3-active-orders li, .v3-completed-orders li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 7px 9px; border: 1px solid #45554f; background: #102426; }
.v3-criminal-roster li > span, .v3-active-orders li > span { display: grid; min-width: 0; }
.v3-criminal-roster small, .v3-active-orders small { overflow: hidden; color: #aab5ae; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.v3-criminal-roster li > span:last-child { flex: 0 0 auto; text-align: right; }
.v3-criminal-roster li > span:last-child b { color: #dac879; }
.v3-active-orders li > b, .v3-completed-orders span { flex: 0 0 auto; color: #d7c576; font-size: 10px; }
.v3-active-orders button { flex: 0 0 auto; min-height: 38px; }
.v3-criminal-section details { margin-top: 8px; }
.v3-criminal-section summary { min-height: 44px; padding: 12px 8px; color: #d7c779; cursor: pointer; font-size: 11px; font-weight: 800; }
.v3-operation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.v3-operation-card > header small { color: #d7c575; letter-spacing: 0; }
.v3-operation-card > header b { font-size: 10px; }
.v3-operation-card > strong { min-height: 2.6em; font-size: 12px; }
.v3-operation-card dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0; }
.v3-operation-card dl div { padding: 5px; background: #0a191b; text-align: center; }
.v3-operation-card dt { color: #9fa9a3; font-size: 8px; }
.v3-operation-card dd { margin: 1px 0 0; color: #e0d083; font-size: 10px; font-weight: 800; }
.v3-operation-card label { display: grid; grid-template-columns: 50px minmax(0, 1fr); align-items: center; gap: 6px; color: #adb7b1; font-size: 9px; }
.v3-operation-card select { width: 100%; min-width: 0; padding: 6px; font-size: 10px; }
.v3-operation-card > button { margin-top: auto; }
.v3-criminal-decision { margin: 10px 14px 0; padding: 12px; border: 2px solid #b9785f; background: #311f1e; }
.v3-criminal-decision > header { display: flex; justify-content: space-between; gap: 10px; }
.v3-criminal-decision > header span { color: #efb998; font-size: 10px; font-weight: 900; }
.v3-criminal-decision > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 9px; }
.v3-criminal-decision button { display: grid; text-align: left; }
.v3-criminal-decision small { color: #cbb9ad; letter-spacing: 0; }

.v3-world-map { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; place-items: stretch; gap: 8px; padding: max(12px, env(safe-area-inset-top)) max(14px, calc((100vw - 1380px) / 2)) max(12px, env(safe-area-inset-bottom)); background: #071416; }
.v3-world-map > header { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; }
.v3-world-map h1 { margin: 3px 0; font: 800 28px Georgia, "Yu Mincho", serif; }
.v3-world-map p { margin: 0; color: #aebbb3; font-size: 11px; }
.v3-world-date { display: grid; min-width: 116px; padding: 7px 11px; border-left: 1px solid #65776f; text-align: right; }
.v3-world-date span { color: #8fa097; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.v3-world-date strong { color: #ead98d; font: 800 15px Georgia, "Yu Mincho", serif; }
.v3-world-layers { display: flex; gap: 6px; }
.v3-world-layers button { min-height: 36px; padding: 5px 16px; border-width: 1px; color: #aebbb3; box-shadow: none; }
.v3-world-layers button.is-active { border-color: #e5cf7c; color: #fff7d7; background: #3e594b; }
.v3-world-map-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 10px; min-height: 0; overflow: hidden; }
.v3-world-map-stage { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.v3-world-map-canvas { min-height: 0; display: grid; place-items: center; overflow: auto; border: 3px solid #e9e7d8; border-radius: 4px; background: linear-gradient(rgba(23,59,67,.72), rgba(10,31,34,.78)), url("./assets/generated/terrain-natural-texture.png") center / 720px 720px; box-shadow: inset 0 0 0 2px #516861, inset 0 0 54px rgba(2,10,11,.62); }
.v3-world-map canvas { display: block; width: min(100%, calc((100dvh - 250px) * 1.6)); height: auto; image-rendering: auto; filter: saturate(.96) contrast(1.04); cursor: crosshair; }
.v3-world-history-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0 0; }
.v3-world-history-control label { display: grid; grid-template-columns: auto minmax(100px, 1fr) auto; align-items: center; gap: 9px; color: #aebbb3; font-size: 10px; }
.v3-world-history-control input { width: 100%; accent-color: #d8c576; }
.v3-world-history-control output { min-width: 148px; color: #ead98d; text-align: right; }
.v3-world-history-control button { min-height: 34px; padding: 4px 10px; border-width: 1px; box-shadow: none; }
.v3-world-intelligence { display: grid; gap: 8px; min-height: 0; padding-right: 2px; overflow-y: auto; scrollbar-color: #63786e #0b1c1e; }
.v3-world-intelligence > section { padding: 10px; border: 1px solid #50655d; background: #0b2022; }
.v3-world-intelligence header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.v3-world-intelligence header > strong { font: 800 17px Georgia, "Yu Mincho", serif; }
.v3-world-summary > div:first-of-type { display: grid; grid-template-columns: repeat(auto-fit, minmax(52px, 1fr)); gap: 4px; margin: 9px 0; }
.v3-world-summary > div:first-of-type span { display: grid; justify-items: center; padding: 6px 2px; background: #142c2e; color: #9fafa6; font-size: 9px; }
.v3-world-summary > div:first-of-type b { color: #fff5ce; font-size: 15px; }
.v3-world-nation-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.v3-world-nation-list button { display: grid; grid-template-columns: 10px minmax(0, 1fr); align-items: center; gap: 6px; min-height: 38px; padding: 5px 7px; border: 1px solid #435750; box-shadow: none; text-align: left; }
.v3-world-nation-list button.is-selected { border-color: #ead98d; background: #344e43; }
.v3-world-nation-list i, .v3-world-dossier > header > i { display: block; width: 9px; height: 22px; background: var(--nation-color, #74865d); }
.v3-world-nation-list span { display: grid; min-width: 0; }
.v3-world-nation-list strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.v3-world-nation-list small { color: #91a098; font-size: 8px; letter-spacing: 0; }
.v3-world-dossier > header { display: grid; grid-template-columns: 13px minmax(0, 1fr); justify-content: start; }
.v3-world-dossier > header > i { width: 13px; height: 42px; }
.v3-world-dossier > header div { display: grid; }
.v3-world-dossier > header strong { font: 800 18px Georgia, "Yu Mincho", serif; }
.v3-world-dossier > header span { color: #a9b6ae; font-size: 10px; }
.v3-world-dossier dl { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 10px 0 7px; font-size: 10px; }
.v3-world-dossier dl div { display: flex; justify-content: space-between; gap: 6px; border-bottom: 1px solid #2b403a; }
.v3-world-dossier dt { color: #91a29a; }
.v3-world-dossier dd { margin: 0; color: #f4e9bd; font-weight: 800; }
.v3-world-dossier p { display: grid; gap: 3px; margin: 7px 0 0; color: #aebbb3; font-size: 10px; line-height: 1.45; }
.v3-world-dossier p > strong { color: #e5d181; }
.v3-world-dossier p > small { color: #8fa098; letter-spacing: 0; }
.v3-world-dossier .v3-dossier-war { display: block; padding: 6px; border-left: 2px solid #ad685e; background: #241a1a; }
.v3-world-current-polity { background: #10272a !important; box-shadow: inset 0 0 0 2px #243c3c; }
.v3-world-effects { background: #101f25 !important; }
.v3-world-effects > header > span { display: grid; }
.v3-world-effects > header > span > small { color: #d8c576; font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.v3-world-effects > header > span > strong { font: 800 16px Georgia, "Yu Mincho", serif; }
.v3-world-effects > header > b { color: #f1df98; font-size: 11px; }
.v3-world-effect-local, .v3-world-effect-celestial, .v3-world-effect-race, .v3-world-effect-market, .v3-world-effect-crisis { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 7px 0; padding: 6px 7px; border-left: 2px solid #d4c16e; background: #172c30; }
.v3-world-effect-local > strong, .v3-world-effect-celestial > strong, .v3-world-effect-market > strong { display: inline-flex; align-items: center; }
.v3-world-effect-celestial { border-left-color: #a68acb; background: #211d30; }
.v3-world-effect-race { border-left-color: #657a73; }
.v3-world-effect-race.is-active { border-left-color: #9b82cf; background: #211d2c; }
.v3-world-effect-market { border-left-color: #b76b5b; background: #2b1b1b; }
.v3-world-effect-crisis { border-left-color: #9b65b3; background: #251b2c; }
.v3-world-effect-local strong, .v3-world-effect-celestial strong, .v3-world-effect-race strong, .v3-world-effect-market strong, .v3-world-effect-crisis strong { flex: none; color: #fff1bd; font-size: 11px; }
.v3-world-effect-local span, .v3-world-effect-celestial span, .v3-world-effect-race span, .v3-world-effect-market span, .v3-world-effect-crisis span { color: #aabbb6; font-size: 8px; line-height: 1.35; text-align: right; }
.v3-world-effects ul { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.v3-world-effects li { display: grid; grid-template-columns: 27px minmax(0, 1fr) auto; align-items: center; gap: 6px; min-height: 34px; padding: 4px 5px; border: 1px solid #31494b; background: #0c1b1e; }
.v3-world-effects li > i { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid color-mix(in srgb, var(--effect-color) 72%, white); border-radius: 50%; background: color-mix(in srgb, var(--effect-color) 52%, #0b1b1d); color: #fff9df; font-style: normal; }
.v3-world-effects li > span { display: grid; min-width: 0; }
.v3-world-effects li strong { color: #eceddf; font-size: 9px; }
.v3-world-effects li small { overflow: hidden; color: #8fa29e; font-size: 7px; letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
.v3-world-effects li em { color: #ddc979; font-size: 8px; font-style: normal; font-weight: 800; }
.v3-world-effects li.is-crisis { border-color: color-mix(in srgb, var(--effect-color, #9b65b3) 55%, #31494b); background: #181522; }
.v3-world-effects li.is-crisis > i > b { color: #fff9df; font-size: 10px; }
.v3-dossier-settlement { display: grid; gap: 4px; margin-top: 9px; padding-top: 8px; border-top: 1px solid #465c56; }
.v3-dossier-settlement > small { color: #d8c576; font-weight: 900; letter-spacing: .12em; }
.v3-dossier-settlement > strong { color: #f0ead0; font: 800 15px Georgia, "Yu Mincho", serif; }
.v3-dossier-settlement > span { color: #aebbb3; font-size: 9px; }
.v3-dossier-settlement > div { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.v3-dossier-settlement > div > i { padding: 3px 6px; border: 1px solid #6e7962; border-radius: 999px; color: #e1d68f; background: #203635; font-size: 9px; font-style: normal; font-weight: 800; }
.v3-decision-profile { display: grid; gap: 8px; margin-top: 10px; padding-top: 9px; border-top: 1px solid #52645d; }
.v3-decision-profile > header { display: grid; justify-content: stretch; gap: 1px; }
.v3-decision-profile > header small, .v3-decision-profile > div > small { color: #d8c576; font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.v3-decision-profile > header strong { color: #f1e8c7; font: 800 14px Georgia, "Yu Mincho", serif; }
.v3-decision-profile > header span { color: #9dafaa; font-size: 9px; }
.v3-temperament-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.v3-temperament-grid > span { display: grid; grid-template-columns: 1fr auto; gap: 2px 6px; padding: 5px 6px; background: #142d2e; }
.v3-temperament-grid b { color: #c9d2cc; font-size: 9px; }
.v3-temperament-grid i { color: #f0dc8c; font-size: 9px; font-style: normal; font-weight: 900; }
.v3-temperament-grid meter { grid-column: 1 / -1; width: 100%; height: 5px; border: 0; background: #0a1b1d; }
.v3-temperament-grid meter::-webkit-meter-bar { height: 5px; border: 0; border-radius: 0; background: #0a1b1d; }
.v3-temperament-grid meter::-webkit-meter-optimum-value { background: #b6a14f; }
.v3-temperament-grid meter::-moz-meter-bar { background: #b6a14f; }
.v3-population-groups { display: grid; gap: 5px; padding: 6px; background: #102426; }
.v3-population-groups > header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 8px; }
.v3-population-groups > header span { color: #8fa39e; font-size: 8px; }
.v3-population-groups > section { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 3px 6px; align-items: center; }
.v3-population-groups > section > small { grid-row: 1 / span 4; color: #d8c576; font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.v3-population-groups > section > span { display: flex; min-width: 0; justify-content: space-between; gap: 6px; color: #b9c5bf; font-size: 8px; }
.v3-population-groups > section b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v3-population-groups > section i { flex: none; color: #e2ce78; font-style: normal; }
.v3-decision-balance { display: flex !important; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; margin: 0 !important; padding: 5px 6px !important; background: #102426; }
.v3-decision-balance strong, .v3-decision-balance span { font-size: 8px; }
.v3-decision-balance[data-status="stable"] strong { color: #91c1a4; }
.v3-decision-balance[data-status="watch"] strong { color: #e0b56b; }
.v3-world-dossier .v3-decision-axes { grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0; }
.v3-world-dossier .v3-decision-axes div { padding: 3px 4px; background: #102426; border: 0; }
.v3-decision-axes dd[data-sign="positive"] { color: #e2ce78; }
.v3-decision-axes dd[data-sign="negative"] { color: #89b8b5; }
.v3-decision-axes dd[data-sign="neutral"] { color: #aebbb3; }
.v3-decision-probabilities { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; }
.v3-decision-probabilities > small { grid-column: 1 / -1; }
.v3-decision-probabilities > span { display: contents; font-size: 9px; }
.v3-decision-probabilities b { color: #bec9c2; font-weight: 700; }
.v3-decision-probabilities i { color: #f0dc8c; font-style: normal; font-weight: 900; text-align: right; }
.v3-decision-agendas ul { margin: 3px 0 0; padding-left: 15px; color: #b6c0ba; font-size: 9px; line-height: 1.4; }
.v3-world-chronicle ol, .v3-world-chronicle { min-height: 0; }
.v3-world-chronicle ol { display: grid; gap: 0; margin: 8px 0 0; padding: 0; list-style: none; }
.v3-world-chronicle li { display: grid; padding: 7px 0; border-top: 1px solid #2e433d; }
.v3-world-chronicle li.is-priority-4, .v3-world-chronicle li.is-priority-5 { border-left: 2px solid #b86c5d; padding-left: 7px; }
.v3-world-chronicle time { color: #d8c576; font-size: 9px; }
.v3-world-chronicle li strong { font-size: 11px; }
.v3-world-chronicle li span { color: #91a199; font-size: 9px; line-height: 1.45; }
.v3-world-map > footer { display: flex; align-items: center; gap: 15px; min-height: 44px; font-size: 10px; }
.v3-world-map > footer span { display: flex; align-items: center; gap: 6px; }
.v3-world-map > footer i { display: block; width: 14px; height: 8px; background: #f4e5b5; }
.v3-world-map > footer i.is-player { width: 12px; height: 12px; border: 2px solid #fff; border-radius: 50%; background: none; }
.v3-world-map > footer i.is-mission { width: 12px; height: 12px; border: 2px solid #ffd878; border-radius: 50%; background: #74231f; }
.v3-world-map > footer i.is-effect { height: 10px; border: 1px dashed #e9d78b; border-radius: 50%; background: radial-gradient(circle, #6ea6bd, transparent 70%); }
.v3-world-map > footer i.is-road { height: 2px; background: #e4d5a0; }
.v3-world-map > footer i.is-site { width: 9px; height: 9px; rotate: 45deg; background: #d98758; }
.v3-world-map > footer > strong { margin-left: auto; color: #d9c979; }
.v3-world-map > footer > div { display: flex; gap: 6px; }
.v3-world-map > footer button { min-height: 36px; padding: 5px 10px; border-width: 1px; box-shadow: none; }
.v3-toast { position: fixed; z-index: 40; left: 50%; bottom: 24px; translate: -50% 20px; padding: 10px 16px; border: 1px solid #e1d488; border-radius: 3px; background: #102628; opacity: 0; pointer-events: none; transition: .2s; }
.v3-toast.is-visible { translate: -50% 0; opacity: 1; }

.v3-commerce { position: fixed; inset: 0; z-index: 24; display: grid; place-items: center; padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom)); background: rgba(1,7,8,.88); backdrop-filter: blur(7px); }
.v3-commerce-card { display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(1180px, 100%); max-height: calc(100dvh - 36px); border: 3px solid #eee9d6; border-radius: 6px; background: #0a191b; box-shadow: inset 0 0 0 2px #4b635c, 0 24px 70px #010404; overflow: hidden; }
.v3-commerce-card > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border-bottom: 1px solid #536a62; background: linear-gradient(90deg, rgba(12,36,36,.98), rgba(16,40,42,.76)), url("./assets/generated/adventure/guild.png") center 54% / cover; }
.v3-commerce-card > header small, .v3-commerce-section small, .v3-company-board > header small { color: #d7c572; font-size: 9px; font-weight: 900; letter-spacing: .13em; }
.v3-commerce-card > header h1 { margin: 2px 0; font: 800 28px/1.1 Georgia, "Yu Mincho", serif; }
.v3-commerce-card > header p { margin: 3px 0 0; color: #aebbb3; font-size: 11px; }
.v3-commerce-card > header button { flex: none; min-width: 72px; min-height: 44px; border: 1px solid #8b9a93; border-radius: 3px; background: #173336; cursor: pointer; font-weight: 800; }
#v3CommerceContent { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); align-content: start; gap: 12px; min-height: 0; padding: 14px; overflow: auto; overscroll-behavior: contain; }
.v3-commerce-section, .v3-company-board { min-width: 0; padding: 14px; border: 1px solid #52675f; border-radius: 4px; background: #0d2224; box-shadow: inset 0 0 0 1px rgba(255,255,255,.025); }
.v3-commerce-section > header, .v3-charter-card > header, .v3-company-board > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.v3-commerce-section h2, .v3-company-board h2 { margin: 2px 0 6px; font: 800 20px/1.2 Georgia, "Yu Mincho", serif; }
.v3-commerce-section p, .v3-company-board p { color: #b3c0b8; font-size: 12px; line-height: 1.55; }
.v3-commerce-section button, .v3-company-board button { min-height: 44px; padding: 8px 10px; border: 1px solid #768b82; border-radius: 3px; background: #173336; cursor: pointer; text-align: left; }
.v3-commerce-section button:hover:not(:disabled), .v3-commerce-section button:focus-visible, .v3-company-board button:hover:not(:disabled), .v3-company-board button:focus-visible { border-color: #ead782; background: #29473f; outline: none; }
.v3-commerce-section button strong, .v3-commerce-section button small, .v3-company-board button strong, .v3-company-board button small { display: block; }
.v3-commerce-section button small, .v3-company-board button small { margin-top: 3px; color: #aab7af; font-size: 10px; line-height: 1.4; letter-spacing: 0; }
.v3-commerce-section ul { display: grid; gap: 5px; margin: 8px 0; padding: 0; list-style: none; }
.v3-commerce-section li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 9px; border: 1px solid #334b45; background: #0a1a1c; font-size: 11px; }
.v3-commerce-section li span { color: #aab7af; text-align: right; }
.v3-commerce-section.is-empty { display: grid; align-content: center; min-height: 178px; background: repeating-linear-gradient(135deg, #0d2224 0 12px, #102729 13px 24px); }
.v3-market-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.v3-market-effect { display: block; margin: 7px 0 10px; padding: 8px 9px; border-left: 3px solid #b76b5b; background: #2b1b1b; }
.v3-market-effect b { color: #ffd4b5; }
.v3-market-effect span { color: #c9b4aa; }
.v3-market-grid article { display: grid; gap: 7px; min-width: 0; padding: 10px; border: 1px solid #405951; background: #091a1c; }
.v3-market-grid article header, .v3-market-grid article div { display: flex; justify-content: space-between; gap: 6px; }
.v3-market-grid article p { margin: 0; color: #e7dcad; }
.v3-market-grid article button { flex: 1; min-width: 0; font-size: 10px; text-align: center; }
.v3-trade-ledger { grid-row: span 1; }
.v3-company-requirements { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.v3-company-requirements li { display: grid; text-align: center; }
.v3-company-requirements li.is-met { border-color: #76976e; background: #173324; }
.v3-company-name { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; margin: 10px 0; color: #d9c979; font-size: 11px; font-weight: 800; }
.v3-company-name input, .v3-company-form select { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid #647b72; border-radius: 3px; background: #071719; color: #f8f3df; }
.v3-strategy-grid, .v3-candidate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.v3-company-board { grid-column: 1 / -1; padding: 0; overflow: visible; }
.v3-company-board > header { padding: 16px; border-bottom: 1px solid #5b7067; border-radius: 3px 3px 0 0; background: linear-gradient(115deg, #183c37, #112729); }
.v3-company-board > header > div:last-child { display: flex; align-items: center; gap: 10px; }
.v3-company-board > header span { color: #b9c5bd; font-size: 11px; }
.v3-company-board > .v3-commerce-section { margin: 12px; }
.v3-charter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.v3-charter-card { min-width: 0; padding: 11px; border: 1px solid #475e56; background: #09191b; }
.v3-charter-card header span { display: grid; }
.v3-charter-card header b { color: #d7bf72; font-size: 11px; }
.v3-charter-card.is-active { border-color: #71936c; background: #112d24; }
.v3-charter-card.is-pending { border-color: #b18b54; background: #302717; }
.v3-charter-card > div { display: grid; gap: 6px; }
.v3-company-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 12px 12px; }
.v3-company-columns .v3-commerce-section { padding: 12px; }
.v3-company-columns details { margin-top: 10px; }
.v3-company-columns summary { min-height: 44px; padding: 12px 8px; color: #e3d183; cursor: pointer; font-weight: 800; }
.v3-company-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.v3-company-form label { display: grid; gap: 4px; color: #b6c2ba; font-size: 10px; }
.v3-company-form > button { align-self: end; text-align: center; font-weight: 800; }
.v3-company-incident { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px; padding: 10px 12px; border: 1px solid #bd735d; background: #3b201d; }
.v3-company-incident > div { display: flex; flex-wrap: wrap; gap: 6px; }


@media (min-width: 721px) and (min-height: 681px) {
  .v3-command-area { height: 152px; min-height: 152px; }
  .v3-message-window { height: 128px; min-height: 0; overflow-y: auto; }
}

@media (max-width: 720px) {
  .v3-game { display: grid; grid-template-rows: 58px auto minmax(0, 1fr); }
  .v3-launch { align-content: end; gap: 18px; }
  .v3-launch-sky { background-position: 62% center; }
  .v3-launch-actions { grid-template-columns: 1fr; }
  .v3-new-world { grid-template-columns: 1fr; }
  .v3-game-header { min-height: 58px; padding-inline: 7px; }
  .v3-game-header > div:first-child { min-width: 0; max-width: 92px; }
  .v3-game-header > div:first-child strong, .v3-game-header > div:first-child small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .v3-game-header strong { font-size: 14px; }
  .v3-header-actions { gap: 3px; }
  .v3-header-actions button { width: 44px; min-width: 44px; min-height: 44px; padding: 6px 5px; font-size: 10px; }
  .v3-header-actions button span { display: none; }
  .v3-play-layout { align-content: start; min-height: 0; padding: 0; }
  .v3-field-shell { width: 100%; aspect-ratio: 13 / 11; border-width: 0 0 3px; border-radius: 0; }
  .v3-status-window { top: 8px; left: 8px; width: 136px; padding: 8px 10px; border-width: 2px; }
  .v3-status-window header { font-size: 11px; }
  .v3-status-window dl { margin: 5px 0; font-size: 9px; }
  .v3-place-window { right: 8px; bottom: 8px; width: 164px; padding: 7px 9px; border-width: 2px; }
  .v3-place-window strong { font-size: 13px; }
  .v3-place-window span { font-size: 8px; }
  .v3-personal-battle-status { top: 8px; right: 8px; width: 220px; min-height: 68px; padding: 7px 9px 7px 60px; border-width: 2px; }
  .v3-personal-battle-art { top: 6px; left: 7px; width: 48px; }
  .v3-personal-battle-status small { font-size: 6px; }
  .v3-personal-battle-status > strong { font-size: 14px; }
  .v3-command-area { grid-template-columns: minmax(0, 1fr) 140px; min-height: 0; padding: 8px 8px max(8px, env(safe-area-inset-bottom)); }
  .v3-message-window { min-height: 128px; max-height: none; height: 100%; padding: 10px; overflow: auto; border-width: 2px; }
  .v3-message-window p { font-size: 9px; }
  .v3-message-window p.is-latest { font-size: 12px; }
  .v3-dpad { grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); }
  .v3-personal-battle-commands button { min-height: 48px; }
  .v3-encounter-card { grid-template-columns: 70px 1fr; gap: 12px; padding: 14px; }
  .v3-encounter-card > i { width: 70px; font-size: 25px; }
  .v3-encounter-card h2 { font-size: 23px; }
  .v3-world-map { gap: 6px; padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom)); }
  .v3-world-map > header { grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px; }
  .v3-world-map h1 { font-size: 21px; }
  .v3-world-map > header p { display: none; }
  .v3-world-map > header button { min-width: 44px; min-height: 44px; padding: 5px 8px; border-width: 1px; box-shadow: none; font-size: 9px; }
  .v3-world-date { min-width: 82px; padding: 5px 7px; }
  .v3-world-date strong { font-size: 11px; }
  .v3-world-layers { gap: 4px; }
  .v3-world-layers button { flex: 1; min-height: 44px; padding: 5px; }
  .v3-world-map-workspace { display: block; overflow-y: auto; }
  .v3-world-map-stage { min-height: 0; }
  .v3-world-map-canvas { min-height: 210px; max-height: 38dvh; }
  .v3-world-map canvas { width: 100%; }
  .v3-world-history-control { grid-template-columns: 1fr auto; gap: 6px; padding: 6px 0; }
  .v3-world-history-control label { grid-template-columns: auto minmax(80px, 1fr); gap: 6px; }
  .v3-world-history-control output { grid-column: 2; min-width: 0; text-align: left; }
  .v3-world-history-control button { min-height: 44px; }
  .v3-world-intelligence { overflow: visible; padding: 0 0 8px; }
  .v3-world-intelligence > section { padding: 9px; }
  .v3-world-effect-local, .v3-world-effect-celestial, .v3-world-effect-race, .v3-world-effect-market { align-items: flex-start; flex-direction: column; }
  .v3-world-effect-local span, .v3-world-effect-celestial span, .v3-world-effect-race span, .v3-world-effect-market span { text-align: left; }
  .v3-world-nation-list button { min-height: 44px; }
  .v3-world-map > footer { flex-wrap: wrap; gap: 8px 14px; }
  .v3-underworld { padding: 0; }
  .v3-underworld-card { width: 100%; max-height: 100dvh; border: 0; border-radius: 0; }
  .v3-underworld-card > header { padding: max(10px, env(safe-area-inset-top)) 10px 9px; }
  .v3-underworld-card > header h1 { font-size: 22px; }
  .v3-underworld-card > header p { display: none; }
  #v3UnderworldContent { grid-template-columns: 1fr; gap: 9px; padding: 9px 9px max(12px, env(safe-area-inset-bottom)); }
  .v3-underworld-summary, .v3-criminal-result, .v3-criminal-section, .v3-criminal-organization { grid-column: 1; }
  .v3-underworld-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v3-criminal-result { align-items: flex-start; flex-direction: column; }
  .v3-criminal-action-grid, .v3-criminal-candidates, .v3-operation-grid, .v3-criminal-columns { grid-template-columns: 1fr; }
  .v3-criminal-action footer { grid-template-columns: 1fr; }
  .v3-broker-card { align-items: stretch; flex-direction: column; }
  .v3-criminal-name { grid-template-columns: 1fr; }
  .v3-criminal-organization > header { align-items: flex-start; flex-direction: column; }
  .v3-criminal-organization > header dl { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .v3-criminal-organization > header dl div { text-align: left; }
  .v3-criminal-finance { justify-content: stretch; }
  .v3-criminal-finance button { flex: 1 1 110px; }
  .v3-criminal-columns { padding-inline: 9px; }
  .v3-criminal-organization > .v3-criminal-section { margin-inline: 9px; }
  .v3-criminal-decision { margin-inline: 9px; }
  .v3-criminal-decision > div { grid-template-columns: 1fr; }
  .v3-world-map > footer > span:not(:first-child) { display: none; }
  .v3-world-map > footer > strong { width: calc(100% - 90px); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .v3-world-map > footer > div { width: 100%; }
  .v3-world-map > footer > div button { flex: 1; min-height: 44px; }
  .v3-commerce { place-items: stretch; padding: 0; }
  .v3-commerce-card { max-height: 100dvh; border-width: 0; border-radius: 0; }
  .v3-commerce-card > header { position: sticky; top: 0; z-index: 2; padding: max(10px, env(safe-area-inset-top)) 10px 9px; }
  .v3-commerce-card > header h1 { font-size: 22px; }
  .v3-commerce-card > header p { display: none; }
  #v3CommerceContent { grid-template-columns: 1fr; gap: 9px; padding: 9px 9px max(12px, env(safe-area-inset-bottom)); }
  .v3-commerce-section, .v3-company-board { grid-column: 1; }
  .v3-market-grid, .v3-strategy-grid, .v3-candidate-grid, .v3-charter-grid, .v3-company-columns, .v3-company-form { grid-template-columns: 1fr; }
  .v3-company-requirements { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v3-company-name { grid-template-columns: 1fr; }
  .v3-company-board > header { align-items: flex-start; }
  .v3-company-board > header > div:last-child { display: grid; justify-items: end; }
  .v3-company-columns { padding-inline: 9px; }
  .v3-company-incident { align-items: stretch; flex-direction: column; }
  .v3-company-incident button { flex: 1 1 120px; }
}

@media (max-height: 680px) and (orientation: landscape) {
  .v3-game-header { min-height: 48px; }
  .v3-play-layout { min-height: calc(100dvh - 162px); padding: 0; }
  .v3-field-shell { width: min(720px, calc((100dvh - 162px) * 1.18)); }
  .v3-command-area { position: absolute; z-index: 6; right: 6px; bottom: 6px; grid-template-columns: 220px 140px; min-height: 94px; padding: 6px; border: 0; background: transparent; }
  .v3-message-window { min-height: 88px; max-height: 92px; padding: 8px; }
  .v3-message-window p:not(.is-latest) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Solo automation stays reachable without covering the field. */
.v3-auto-toolbar { display: flex; align-items: center; gap: 10px; padding: 6px max(12px, calc((100vw - 1180px) / 2)); border-bottom: 1px solid #405b53; background: #0b2022; }
.v3-auto-toolbar button, .v3-auto-card button { min-width: 44px; min-height: 44px; padding: 8px 12px; border: 1px solid #92a59a; border-radius: 4px; background: #173336; cursor: pointer; }
#v3AutoOpen { flex: none; color: #eddda1; font-weight: 800; }
#v3AutoOpen[aria-pressed="true"] { border-color: #dfc878; background: #304b3a; }
#v3AutoBar { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; }
#v3AutoBar > div { flex: 1; min-width: 0; }
#v3AutoBar strong, #v3AutoBar small { display: block; overflow-wrap: anywhere; font-size: 12px; }
#v3AutoBar small { margin-top: 3px; color: #b0c2b6; font-size: 11px; }
#v3AutoBar button { flex: none; }
.v3-auto-modal { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; padding: 16px; background: rgba(1, 8, 9, .9); }
.v3-auto-card { width: min(700px, 100%); max-height: calc(100dvh - 32px); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; background: #0d2224; border: 2px solid #d8d5bc; border-radius: 6px; }
.v3-auto-card > header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid #607268; }
.v3-auto-card h1 { margin: 2px 0; font-size: 24px; }
.v3-auto-card header small { color: #dcc77e; }
#v3AutoForm { overflow: auto; overscroll-behavior: contain; padding: 18px; }
.v3-auto-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.v3-auto-grid label { display: grid; align-content: start; gap: 6px; min-width: 0; color: #e2e8da; font-size: 13px; }
.v3-auto-grid select, .v3-auto-grid input[type="number"] { width: 100%; min-width: 0; min-height: 44px; padding: 8px; color: #fff; background: #0b181b; border: 1px solid #72897c; border-radius: 3px; }
.v3-auto-grid .v3-auto-check { display: flex; align-items: center; min-height: 44px; gap: 8px; }
.v3-auto-check input { flex: none; width: 22px; height: 22px; accent-color: #b8c97b; }
#v3AutoForm details { margin-top: 16px; border: 1px solid #506a5b; border-radius: 4px; }
#v3AutoForm summary { display: flex; align-items: center; min-height: 48px; padding: 10px 12px; cursor: pointer; color: #e2d18a; font-weight: 700; }
#v3AutoForm summary::before { content: '＋'; margin-right: 8px; }
#v3AutoForm details[open] > summary::before { content: '−'; }
#v3AutoForm fieldset { min-width: 0; margin: 12px; padding: 12px; border: 1px solid #405b51; }
#v3AutoForm legend { padding: 0 6px; color: #d5c582; }
#v3AutoForm p { color: #bbcbc0; font-size: 12px; line-height: 1.7; }
#v3AutoForm footer { position: sticky; bottom: -18px; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 0; background: #0d2224; }
#v3AutoError { color: #ffb6a3 !important; }
.v3-auto-log { padding: 0 18px 10px 36px; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.v3-auto-card :focus-visible, .v3-auto-toolbar :focus-visible { outline: 3px solid #f1d778; outline-offset: 2px; }
@media (min-width: 721px) and (min-height: 681px) {
  .v3-play-layout { min-height: calc(100dvh - 274px); }
  .v3-field-shell { width: min(900px, calc(100vw - 32px), calc((100dvh - 310px) * 1.18)); }
}
@media (max-width: 720px) {
  .v3-game { grid-template-rows: 58px auto auto minmax(0, 1fr); }
  .v3-auto-toolbar { flex-wrap: wrap; gap: 6px; padding: 6px 8px; }
  #v3AutoBar { flex-basis: 100%; }
  #v3AutoBar strong { font-size: 11px; }
  .v3-auto-modal { padding: 8px; }
  .v3-auto-card { max-height: calc(100dvh - 16px); }
  .v3-auto-card > header, #v3AutoForm { padding: 12px; }
  .v3-auto-grid { grid-template-columns: minmax(0, 1fr); }
  #v3AutoForm footer { bottom: -12px; }
}

/* The council follows the same saved character and world as field play. */
.v3-campaign-hint { color: #c4d0c3; font-size: 12px; margin-right: auto; }
.v3-campaign-modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 18px; background: #02090ce8; }
.v3-campaign-card { width: min(1000px, 100%); max-height: calc(100dvh - 36px); display: grid; grid-template-rows: auto auto minmax(0, 1fr); overflow: hidden; border: 2px solid #d8d5bc; border-radius: 6px; background: #0d2224; }
.v3-campaign-card > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #526c61; }
.v3-campaign-card h1 { margin: 4px 0; font-size: 24px; }
.v3-campaign-card h2 { margin: 0 0 10px; font-size: 18px; line-height: 1.5; }
.v3-campaign-card h3 { margin: 0; font-size: 15px; }
.v3-campaign-card button, .v3-campaign-card summary { min-height: 44px; padding: 10px 14px; border: 1px solid #91a398; border-radius: 4px; background: #1a3938; cursor: pointer; }
.v3-campaign-card button:disabled { cursor: default; opacity: .55; }
.v3-campaign-card :focus-visible { outline: 3px solid #efd477; outline-offset: 2px; }
.v3-campaign-content { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 18px; }
.v3-campaign-content p { font-size: 14px; line-height: 1.7; margin: 8px 0; }
.v3-campaign-next { color: #f1dc90; }
.v3-campaign-overview, .v3-campaign-section, .v3-campaign-content details { margin-bottom: 20px; }
.v3-campaign-requirements { padding: 0; list-style: none; display: grid; gap: 6px; }
.v3-campaign-requirements li { display: flex; gap: 12px; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #29433e; }
.v3-campaign-requirements strong { flex-shrink: 0; }
.v3-campaign-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.v3-campaign-actions article { min-width: 0; padding: 14px; border: 1px solid #486256; border-radius: 4px; display: flex; flex-direction: column; align-items: stretch; background: #102c2b; }
.v3-campaign-actions article button { margin-top: 12px; }
.v3-campaign-actions article small { color: #d6c589; margin-top: auto; }
.v3-campaign-card .v3-campaign-reason { color: #edbd9c; }
.v3-campaign-consequence { color: #bdcec1; }
.v3-campaign-result { margin: 0; padding: 10px 18px; background: #193b35; font-size: 14px; line-height: 1.5; }
.v3-campaign-result:empty { display: none; }
.v3-campaign-history { padding-left: 22px; line-height: 1.8; font-size: 14px; }
.v3-campaign-history time { color: #d6c589; }
@media (max-width: 700px) {
  .v3-campaign-hint { display: none; }
  .v3-campaign-modal { padding: 0; }
  .v3-campaign-card { width: 100%; max-height: 100dvh; border: 0; border-radius: 0; }
  .v3-campaign-card > header { padding: max(10px, env(safe-area-inset-top)) 12px 10px; }
  .v3-campaign-content { padding: 12px; }
  .v3-campaign-actions { grid-template-columns: minmax(0, 1fr); }
}

.v3-market-effect summary { min-height: 44px; padding: 10px 0; cursor: pointer; color: #ffd4b5; line-height: 1.6; }
.v3-market-effect p { line-height: 1.7; color: #c9b4aa; }
.v3-commerce-section > header > button { flex-shrink: 0; white-space: nowrap; }
.v3-campaign-section > summary { margin-bottom: 12px; font-weight: 700; }
.v3-campaign-ending { border: 1px solid #ddc279; padding: 16px; background: #284134; margin-bottom: 18px; }

/* Council navigation and illustrated decisions share the field's SVG vocabulary. */
#v3CampaignOpen { display: inline-flex; align-items: center; gap: 8px; }
.v3-campaign-card { grid-template-rows: auto auto auto auto minmax(0, 1fr); }
.v3-campaign-card > header { grid-row: 1; }
.v3-campaign-stats { grid-row: 2; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 10px 18px; background: #152e2e; border-bottom: 1px solid #38554d; }
.v3-campaign-stats > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
.v3-campaign-stats span { display: grid; gap: 3px; font-size: 12px; color: #c2cec2; }
.v3-campaign-stats strong { color: #fff5d6; font-variant-numeric: tabular-nums; font-size: 18px; }
.v3-campaign-tabs { grid-row: 3; display: flex; gap: 4px; padding: 6px 12px; overflow-x: auto; background: #0b1f22; }
.v3-campaign-tabs [role="tab"] { display: flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-bottom: 3px solid transparent; white-space: nowrap; background: transparent; color: #cedace; }
.v3-campaign-tabs [aria-selected="true"] { color: #fff2b7; border-bottom-color: #dfc674; background: #26443d; }
.v3-campaign-content { grid-row: 5; }
.v3-campaign-result { grid-row: 4; max-height: min(220px, 25dvh); overflow: auto; padding: 8px 18px; border-bottom: 1px solid #486d5a; }
.v3-campaign-result > strong, .v3-result-deltas, .v3-result-deltas > span { display: flex; align-items: center; gap: 6px; }
.v3-result-deltas { flex-wrap: wrap; column-gap: 14px; margin-top: 6px; color: #fff4c3; font-variant-numeric: tabular-nums; }
.v3-result-deltas .v3-ui-icon { width: 16px; height: 16px; }
.v3-campaign-result summary { min-height: 44px; padding: 7px 0; border: 0; background: transparent; font-size: 12px; color: #c5d6c6; }
.v3-campaign-result p { margin: 4px 0; }
.v3-result-cause { color: #e6c59e; font-size: 12px; }
.v3-campaign-card h2, .v3-action-card h3 { display: flex; align-items: center; gap: 8px; }
.v3-campaign-overview h2 { display: block; }
.v3-campaign-overview h2 small { display: block; font-weight: 400; color: #acbbb0; font-size: 12px; }
.v3-action-card h3 { line-height: 1.6; }
.v3-action-card h3 .v3-ui-icon { width: 27px; height: 27px; padding: 7px; box-sizing: content-box; border-radius: 8px; background: #213f36; }
.v3-campaign-actions .v3-action-card { border-color: #3c6052; background: linear-gradient(145deg, #183b32, #102927); }
.v3-campaign-actions .v3-action-card button { background: #315245; color: #fff2bb; font-weight: 700; }
.v3-action-cost { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: #e2ce8d; font-size: 13px; margin-top: auto; }
.v3-action-cost .v3-ui-icon { width: 16px; height: 16px; }
.v3-action-cost span + .v3-ui-icon { margin-left: 10px; }
.v3-campaign-actions .v3-action-card.is-final-choice { border-color: #b2a56b; }
.v3-campaign-requirements li > span { display: flex; align-items: center; gap: 8px; }
.v3-campaign-requirements .v3-ui-icon { width: 17px; height: 17px; }
.v3-campaign-progress { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); list-style: none; padding: 0; gap: 6px; margin: 0 0 20px; }
.v3-campaign-progress li { display: grid; justify-items: center; gap: 7px; padding: 10px 0; border-bottom: 2px solid #355448; color: #a3b4a7; font-size: 12px; }
.v3-campaign-progress .is-reached { color: #f4deb1; border-color: #dbc278; }
.v3-campaign-progress [aria-current] { background: #28453a; border-radius: 6px 6px 0 0; }
.v3-campaign-guidance { display: flex; gap: 12px; border: 1px solid #8a885d; border-left-width: 4px; background: #263f31; padding: 14px; margin-bottom: 16px; }
.v3-campaign-guidance > .v3-ui-icon { width: 32px; height: 32px; }
.v3-campaign-shortcuts { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.v3-campaign-shortcuts button, .v3-council-month > span, .v3-country-back { display: inline-flex; align-items: center; gap: 8px; }
.v3-council-month { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; padding-top: 14px; border-top: 1px solid #496758; color: #c8d4be; font-size: 13px; }
.v3-country-list-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.v3-country-list-header label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.v3-country-list-header select { min-height: 44px; max-width: 100%; padding: 8px; border: 1px solid #7d9788; background: #17382f; color: #fff4d3; font: inherit; }
.v3-country-list { display: grid; gap: 6px; }
.v3-country-list > button { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px; }
.v3-country-list > button > span:first-of-type { flex: 1; min-width: 0; }
.v3-country-list strong, .v3-country-list small { display: block; }
.v3-country-list small { color: #bcd0bd; font-size: 12px; margin-top: 3px; }
.v3-country-score { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; color: #f3daa0; }
.v3-country-detail { margin: 18px 0; }
.v3-country-status, .v3-country-factors { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.v3-country-factors span, .v3-country-status span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid #3c6352; border-radius: 5px; font-size: 12px; background: #19362d; }
.v3-country-factors .v3-ui-icon { width: 16px; height: 16px; }
.v3-country-detail blockquote, .v3-final-council blockquote { margin: 12px 0; padding-left: 14px; border-left: 3px solid #bea765; color: #f1e4bf; line-height: 1.9; font-size: 14px; }
.v3-final-council { display: flex; align-items: flex-start; gap: 18px; padding: 22px; margin-bottom: 16px; background: radial-gradient(ellipse at top left, #375a47, #122c2d 80%); border: 1px solid #aea16c; border-radius: 6px; }
.v3-council-emblem { width: 80px; height: 80px; flex: 0 0 auto; color: #ebd08a; }
.v3-final-council small { color: #cfba81; font-size: 12px; }
.v3-campaign-ending { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.v3-campaign-ending > div { flex: 1; min-width: 180px; }
.v3-campaign-ending > ol { flex-basis: 100%; padding-left: 22px; }
.v3-campaign-ending > ol li { padding: 7px 0; }
.v3-adopted-policies { padding: 0; list-style: none; }
.v3-adopted-policies li { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid #345647; }
.v3-quest-marker { position: absolute; right: 0; top: 0; width: 55%; height: 55%; z-index: 4; display: grid; place-items: center; border: 2px solid #ffd581; border-radius: 5px; color: #ffe4a1; background: #192c2a99; pointer-events: none; }
.v3-quest-marker .v3-ui-icon { width: 72%; height: 72%; color: #ffe4a1; }
@media (max-width: 640px) {
  .v3-campaign-stats { padding: 8px 12px; gap: 6px; }
  .v3-campaign-stats > div { gap: 5px; }
  .v3-campaign-stats .v3-ui-icon { width: 16px; height: 16px; }
  .v3-campaign-stats strong { font-size: 16px; }
  .v3-campaign-tabs { padding: 4px; gap: 2px; }
  .v3-campaign-tabs [role="tab"] { flex: 1; flex-direction: column; gap: 4px; padding: 7px; font-size: 12px; }
  .v3-campaign-result { padding: 8px 12px; }
  .v3-final-council { padding: 14px; gap: 10px; }
  .v3-final-council .v3-council-emblem { width: 46px; height: 60px; }
  .v3-campaign-card h1 { font-size: 21px; }
  .v3-campaign-content .v3-campaign-actions { gap: 10px; }
  .v3-campaign-requirements { font-size: 13px; }
  .v3-campaign-requirements strong { white-space: nowrap; }
  .v3-council-month > button { flex: 1; }
}
@media (max-height: 600px) {
  .v3-campaign-card > header { padding: 6px 12px; }
  .v3-campaign-card h1 { font-size: 18px; }
  .v3-campaign-stats { padding-top: 5px; padding-bottom: 5px; }
  .v3-campaign-stats span { display: flex; align-items: center; gap: 7px; }
  .v3-campaign-tabs [role="tab"] { flex-direction: row; }
  .v3-campaign-result { max-height: 90px; }
}

/* Automation reports replace repeated movement lines while an execution is active. */
.v3-auto-toolbar { flex-wrap: wrap; }
#v3AutoResponses { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
.v3-auto-report { font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.v3-auto-report strong { display: block; color: #eddda1; }
.v3-auto-report p { margin: 5px 0; }
.v3-auto-report button { min-height: 44px; min-width: 44px; padding: 6px 10px; margin: 4px 4px 0 0; color: #eee5bb; background: #183537; border: 1px solid #81998a; border-radius: 4px; cursor: pointer; }
.v3-message-window > .v3-auto-report { display: none; }
.has-auto-report .v3-message-window > .v3-auto-report { display: block; }
.has-auto-report #v3Messages { display: none; }
.is-personal-battle #v3Messages { display: block; }
.is-personal-battle .v3-message-window > .v3-auto-report { display: none; }
#v3AutoMapBar { padding: 10px; border: 1px solid #718878; }
#v3AutoMapBar [data-auto-report] { margin-top: 8px; }
#v3AutoForm footer { flex-wrap: wrap; }
.v3-combat-forecast { margin: 4px 0 0; font-size: 11px; color: #eee1b1; }
@media (max-width: 720px) {
  #v3AutoBar { flex-wrap: wrap; }
  #v3AutoBar > div { flex-basis: 100%; }
  #v3AutoResponses { max-height: 100px; overflow-y: auto; }
  .has-auto-report .v3-message-window { font-size: 12px; }
}
@media (min-width: 721px) and (min-height: 681px) {
  .has-auto-report .v3-play-layout { min-height: calc(100dvh - 350px); }
  .has-auto-report .v3-field-shell { width: min(900px, calc(100vw - 32px), calc((100dvh - 380px) * 1.18)); }
}

/* Developer tools use a native modal: background gameplay cannot receive input. */
.v3-developer { width: min(1080px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0 24px 24px; border: 1px solid #658c85; border-radius: 14px; background: #102323; color: #e5eeea; overflow: auto; box-sizing: border-box; }
.v3-developer::backdrop { background: #030b0bce; }
.v3-developer > header { position: sticky; top: 0; z-index: 2; padding: 14px 0 4px; background: #102323; border-bottom: 1px solid #355350; }
.v3-developer h1 { margin: 2px 0; font-size: 24px; }
.v3-developer small, .v3-developer code { color: #a7c2b9; overflow-wrap: anywhere; }
.v3-developer p { line-height: 1.65; overflow-wrap: anywhere; }
.v3-developer nav { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 0; }
.v3-developer button { padding: 10px 14px; min-height: 44px; border: 1px solid #527871; border-radius: 6px; background: #203c38; color: #f1f6e6; font: inherit; cursor: pointer; }
.v3-developer button[aria-pressed="true"], .v3-developer button[type="submit"] { background: #d1c580; color: #142623; border-color: #e1dba8; }
.v3-developer button:disabled { opacity: .45; cursor: default; }
.v3-developer :focus-visible { outline: 3px solid #efde87; outline-offset: 2px; }
.v3-developer input, .v3-developer select { width: 100%; min-width: 0; box-sizing: border-box; padding: 10px; margin: 6px 0; color: #f3f4e9; background: #071c1c; border: 1px solid #5b7e75; border-radius: 4px; font: inherit; font-size: 16px; }
.v3-developer input:disabled { opacity: .5; }
.v3-developer-parameters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 22px 0; }
.v3-developer-parameters label { display: flex; flex-direction: column; gap: 3px; }
.v3-developer-parameters small { line-height: 1.65; }
.v3-developer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 14px 0; }
.v3-developer-actions label { flex: 1 1 120px; max-width: 190px; }
.v3-developer-variable, .v3-developer details { padding: 16px 0; border-bottom: 1px solid #355350; }
.v3-developer-variable > div { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.v3-developer-variable output { color: #f1df87; overflow-wrap: anywhere; white-space: pre-wrap; }
.v3-developer-variable code { display: block; margin-top: 8px; }
.v3-developer a { color: #9fdac2; overflow-wrap: anywhere; }
.v3-developer details summary { cursor: pointer; line-height: 1.6; }
.v3-developer details article { padding: 12px; margin: 8px 0; background: #19312e; border-radius: 6px; }
.v3-developer details article p { margin: 6px 0; }
.v3-developer-table { overflow-x: auto; }
.v3-developer table { border-collapse: collapse; width: 100%; white-space: nowrap; }
.v3-developer th, .v3-developer td { text-align: right; padding: 10px; border-bottom: 1px solid #355350; }
.v3-developer caption { text-align: left; white-space: normal; line-height: 1.6; padding: 10px 0; }
.v3-launch footer [data-v3-developer] { color: inherit; background: transparent; border: 1px solid currentColor; padding: 6px 10px; border-radius: 4px; }
@media (max-width: 600px) {
  .v3-developer { padding: 0 14px 18px; }
  .v3-developer h1 { font-size: 20px; }
  .v3-developer-parameters { grid-template-columns: minmax(0, 1fr); }
  .v3-developer nav { display: grid; grid-template-columns: 1fr 1fr; }
  .v3-developer nav button { padding: 9px 4px; }
}

.v3-developer-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }

.v3-policy-category { display: block; margin: -3px 0 10px; color: #d6c78e; font-size: 12px; }
