@font-face{font-family:Gemelli;src:url('ui/GEMELLI_.TTF')}@font-face{font-family:PortTitle;src:url('ui/LTe50890.ttf')}@font-face{font-family:GameText;src:url('ui/LTe50261.ttf')}*{box-sizing:border-box}html{min-height:100%;background:#201a14}body{margin:0 auto;max-width:760px;min-height:100dvh;background:#382b20 url('ui/bkg_wood.png') repeat;color:#10100b;font-family:Arial,sans-serif;font-size:20px;line-height:1.32;box-shadow:0 0 30px #000}button,input,select{font:inherit}button,summary,select{cursor:pointer}button{color:#f1d381;background:transparent;border:10px solid transparent;border-image:url('ui/btn_standard_default.9.png') 12 fill stretch;min-height:46px;line-height:1.1;font-weight:bold;padding:0 10px;text-shadow:0 1px 1px #20170e}button:hover:not(:disabled){filter:brightness(1.13)}button:active:not(:disabled){border-image-source:url('ui/btn_standard_pressed.9.png')}button:disabled{opacity:.42;cursor:default}button:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #f0c664;outline-offset:2px}button small{display:block;font-size:12px;font-weight:normal;margin-top:5px}input:not([type=checkbox]):not([type=range]),select{max-width:100%;min-width:0;min-height:45px;border:8px solid transparent;border-image:url('ui/bkg_textview.9.png') 10 fill stretch;padding:0 8px;color:#17130d;background:transparent}select{border-image-source:url('ui/btn_dropdown_default.9.png');border-image-slice:12;color:#f2d18b;font-family:Gemelli,serif;padding-right:16px}input[type=checkbox]{width:20px;height:20px;accent-color:#477428}label{display:block}h1,h2,h3,p{margin:0 0 16px}h1{font-family:Gemelli,serif;font-size:32px;font-weight:normal;line-height:1.25}h2{font-size:24px}h3{font-size:21px}h1.screen-title{color:#f2d68b;margin:8px 12px 10px;font-family:PortTitle,Gemelli,serif;font-size:36px}p:last-child{margin-bottom:0}.stats{display:flex;align-items:center;gap:8px;padding:5px 6px 9px;height:96px;background:url('ui/bkg_topbar.png') repeat-x bottom;background-size:58px 96px;position:sticky;top:0;z-index:20;color:#f3d68c;box-shadow:0 2px 5px #0009}.hud-readings{flex:1;min-width:0}.hud-date{font-family:Gemelli,serif;background:#0e0f10;border-radius:30px;box-shadow:inset 0 0 0 2px #51483c,1px 3px 2px #000;padding:2px 10px;white-space:nowrap;overflow:hidden;font-size:26px;line-height:1.25}.hud-resources{display:flex;justify-content:space-between;background:#101113;box-shadow:inset 0 0 0 2px #4c4335,1px 2px 2px #000;border-radius:24px;margin-top:5px;font-family:Gemelli,serif;font-size:24px;padding:0 8px 0 0;line-height:36px}.hud-resources span{display:flex;align-items:center;gap:7px;white-space:nowrap}.hud-resources img{width:34px;height:34px;object-fit:contain}.hud-nav{display:flex;gap:2px;align-self:flex-end}.round-button{width:62px;height:62px;min-height:0;padding:7px;border:0;border-image:none;background:url('ui/btn_round_default.png') center/100% 100% no-repeat}.round-button img{width:100%;height:100%;object-fit:contain}.round-button:active{background-image:url('ui/btn_round_pressed.png')}main{padding:0 8px 12px;min-height:calc(100dvh - 150px)}.game-screen{padding-top:1px;min-width:0}.parchment{border:18px solid transparent;border-image:url('ui/bkg_scroll.9.png') 24 fill stretch;padding:8px 4px;margin:12px 0;color:#0b0c08}.game-screen.parchment{padding:10px 7px}.paper.parchment{margin-top:0}.scene-art,.harbor-image{display:block;width:100%;max-width:520px;height:auto;max-height:330px;object-fit:cover;margin:0 auto 14px}.scene-art{border-radius:6px}.port-paper p{font-size:21px}.port-choices,.story-choices{display:flex;flex-direction:column;gap:5px}.choice{border:0;border-image:none;background:transparent url('ui/btn_forward.png') right center/32px 32px no-repeat;display:block;width:100%;text-align:left;color:#080a06;text-shadow:none;min-height:50px;font-size:21px;font-weight:bold;padding:8px 40px 8px 0;line-height:1.2}.choice:hover:not(:disabled){background-color:#8e703018}.choice:active:not(:disabled){border-image:none;background-color:#8e70302b}.notification{color:#ebd49f;font-size:14px;padding:5px 10px;text-align:center;text-shadow:1px 1px 2px #000}.tabbar{display:flex;gap:4px;margin-bottom:12px}.tabbar button{flex:1;padding:2px 3px;min-width:0;border-image:url('ui/btn_tab_default.9.png') 10 fill stretch;font-family:Gemelli,serif;font-size:21px;font-weight:normal}.tabbar .selected{border-image-source:url('ui/btn_tab_pressed_disabled.9.png')}.market-heading{display:flex;justify-content:space-between;gap:10px;align-items:center;margin:10px 0}.market-heading h1{margin:0;font-family:PortTitle,serif}.market-heading>span{font-family:Gemelli,serif;font-size:19px}.checkline{display:flex;align-items:center;gap:8px;font-size:15px;margin:8px 0 16px}.good-row{display:grid;grid-template-columns:58px 1fr 58px;gap:10px;padding:14px 0;border-bottom:1px solid #85784777}.good-row:first-child{padding-top:0}.good-row:last-child{border-bottom:0}.quantity{background:url('ui/bkg_quantity.png') center/100% 100% no-repeat;height:68px;padding-top:28px;text-align:center;font-size:24px;line-height:32px}.trade-end button{width:58px;min-height:46px;font-size:0;border:0;border-image:none;padding:0;margin-top:2px;background:url('ui/btn_square_default.9.png') center/100% 100% no-repeat}.trade-end button::after{content:'';display:block;width:34px;height:34px;margin:auto;background:center/contain no-repeat}.sell-arrow::after{background-image:url('ui/btn_back.png')!important}.buy-arrow::after{background-image:url('ui/btn_forward.png')!important}.good-copy h2{margin:4px 0 10px;font-size:24px}.good-copy p{font-size:18px;margin-bottom:8px}.good-copy small{font-size:15px}.actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.actions>*{max-width:100%}.section{border-top:1px solid #8d7d5266;margin-top:22px;padding-top:18px}.kv{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:6px 0;min-width:0}.kv span:first-child{overflow-wrap:anywhere}.kv span:last-child{text-align:right;flex-shrink:0}.meter{height:10px;background:#692123;border:2px solid #33291c;box-shadow:0 1px 2px #000;margin-bottom:10px}.meter>span{height:100%;display:block;background:url('ui/bkg_progress_green.png') center/100% 100% no-repeat}.small,.muted{font-size:16px;color:#383329}.eyebrow{font-size:14px;margin-bottom:6px;color:#66522c}.journal-item{border-bottom:1px solid #8c7e5677;padding:14px 0}.battle-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.combatants{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin:15px 0}.combatant h3{font-size:20px}.combatant .kv{font-size:16px}.combat-lens{width:260px;height:260px;max-width:100%;margin:auto;background:url('ui/bkg_combat.png') center/contain no-repeat;display:flex;align-items:center;justify-content:center}.combat-lens img{width:65%;height:58%;object-fit:contain}.battle-log{border-top:1px solid #998964;margin-top:20px;padding-top:14px}.battle-log p{font-size:18px}.intro-screen{padding:10px 4px;color:#f2d48a}.intro-form{display:grid;grid-template-columns:135px minmax(0,1fr);gap:12px 8px;align-items:center}.intro-form h1,.intro-form>button,.intro-form>p{grid-column:1/-1}.intro-form label{font-weight:bold;font-size:19px}.intro-form .muted{color:#eadfc4}.intro-form h1{margin:8px 0 14px}.map-head{display:flex;justify-content:space-between;align-items:center;color:#eed398;padding:10px}.map-head h1{font-size:26px;margin:0}.map-head small{font-size:14px}.chart{position:relative;aspect-ratio:1048/1024;background:#204964 url('chart.png') center/100% 100% no-repeat;overflow:hidden;box-shadow:0 1px 7px #000}.chart svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.pin{position:absolute;transform:translate(-50%,-50%);border:0;border-image:none;border-radius:0;background:transparent;min-height:24px;width:auto;max-width:120px;padding:0;color:#fff;text-shadow:1px 1px 2px #000,-1px -1px 1px #000;font-family:Gemelli,serif;font-size:13px;white-space:nowrap;font-weight:normal;line-height:1;z-index:2}.pin img{display:block;width:30px;height:20px;object-fit:contain;margin:auto}.pin .map-flag{display:inline;width:20px;height:14px;margin-left:4px;vertical-align:middle}.pin span{display:inline}.pin.active{outline:2px solid #f6ce70;outline-offset:3px}.pin.here{opacity:1}.pin.sea{font-size:11px;color:#d7e2ec}.ship{position:absolute;transform:translate(-50%,-100%);width:45px;pointer-events:none;z-index:3}.map-caption{font-size:13px;color:#f0d99f;text-align:center;margin:8px 0}.destination{color:#f0d49b;background:url('ui/bkg_wood.png');padding:12px 8px}.destination>label{font-family:Gemelli,serif;font-size:20px;margin-bottom:6px}.destination select{width:100%}.course-meta{font-size:14px;margin-top:10px}.destination .actions{justify-content:center}.end-score{font-size:60px;font-family:Gemelli,serif}.end-screen{text-align:center}footer{padding:5px 14px 18px;text-align:center;color:#ead298;font-size:14px}summary{display:inline-block;border:7px solid transparent;border-image:url('ui/btn_standard_default.9.png') 10 fill stretch;padding:0 12px;color:#efd08a}.head-actions{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:8px;padding:14px 0}.head-actions>*{max-width:100%}.head-actions button,.head-actions select{font-size:16px}.music-volume{font-size:14px;display:flex;align-items:center;gap:8px}.music-volume input{width:95px}.head-actions #save-status{flex-basis:100%}dialog{max-width:min(600px,94vw);max-height:90dvh;overflow:auto;color:#13110b;background:transparent;border:20px solid transparent;border-image:url('ui/bkg_scroll.9.png') 24 fill stretch;padding:16px;font-size:18px}dialog::backdrop{background:#000b}#toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:100;width:min(90vw,560px);padding:16px;background:#161511;color:#f2d78f;box-shadow:0 2px 8px #000;font-size:16px}body[data-layout=mobile]{max-width:520px}body[data-layout=desktop]{max-width:760px}@media(max-width:540px){body{font-size:18px}.stats{height:88px;background-size:53px 88px;gap:5px}.hud-date{font-size:22px;padding-left:8px}.hud-resources{font-size:20px;line-height:30px}.hud-resources img{width:29px;height:29px}.hud-resources span{gap:3px}.round-button{width:49px;height:49px;padding:5px}.hud-nav{gap:0}main{padding:0 3px 8px}.parchment{border-width:14px;padding:7px 3px}.game-screen.parchment{padding:5px 2px}h1.screen-title{font-size:31px;margin:8px 9px}.port-paper p,.choice{font-size:19px}.choice{padding-right:32px;background-size:28px;min-height:48px}.intro-form{grid-template-columns:115px minmax(0,1fr);gap:10px 6px}.intro-form label{font-size:17px}.intro-form h1{font-size:28px}.good-row{grid-template-columns:50px 1fr 50px;gap:8px}.quantity{height:60px;padding-top:25px;font-size:22px;line-height:28px}.trade-end button{width:50px;height:44px}.good-copy h2{font-size:21px}.good-copy p{font-size:17px}.tabbar button{font-size:18px}h2{font-size:23px}.combatants{gap:10px}.kv{font-size:17px}.battle-buttons button{font-size:17px}.pin{font-size:11px}.pin img{width:22px;height:16px}.pin .map-flag{width:16px}.pin.sea{font-size:9px}.ship{width:30px}.map-head{padding:8px 5px}.map-head h1{font-size:23px}.map-head small{font-size:12px}}@media(max-width:370px){.hud-date{font-size:18px}.hud-resources{font-size:17px}.round-button{width:44px;height:44px}.intro-form{grid-template-columns:100px minmax(0,1fr)}.intro-form label{font-size:16px}.market-heading>span{font-size:15px}}

.chart-viewport{width:100%;height:calc(100dvh - 345px);min-height:320px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#bda574 #2a3c45}.chart{width:1048px;height:1024px;aspect-ratio:auto}.pin,.pin.sea{font-size:18px;max-width:none}.pin img{width:40px;height:30px}.pin .map-flag{width:28px;height:20px}.ship{width:50px}.map-head{padding:8px}.map-head h1{font-family:Gemelli,serif}.destination{padding:6px}.destination>label{display:none}.destination .actions{margin:7px 0 0}.course-meta{margin-top:6px}.map-caption{margin:3px;font-size:12px}.destination select{font-size:22px}.map-head small{font-size:13px}

body[data-screen=market] .tabbar{margin:10px 3px}.market-heading{color:#eed28a;padding:0 8px}.market-heading h1{font-family:PortTitle,Gemelli,serif;font-size:34px}body[data-screen=market] .checkline{color:#ead8ae;margin-left:12px}.goods-list.parchment{padding:8px 4px}.chart-viewport{height:calc(100dvh - 235px);min-height:320px}.map-caption{display:none}.map-controls{display:grid;grid-template-columns:64px minmax(0,1fr) 64px;align-items:center;gap:4px;margin:5px 0;color:#f3d691}.chart-command{position:relative;border:0;border-image:none;background:none;padding:0;min-height:64px;width:64px;line-height:1}.chart-command img{width:64px;height:64px;object-fit:contain}.chart-command .chart-command-symbol{position:absolute;top:12px;left:12px;width:40px;height:40px}.chart-command span{position:absolute;top:65px;left:0;width:100%;font-size:11px;text-shadow:1px 1px #000}.course-selection{background:transparent;border:10px solid transparent;border-image:url('ui/btn_long_default.9.png') 20 fill stretch;padding:0}.course-selection select{border:0;border-image:none;background:none;width:100%;min-height:30px;padding:0;font-size:23px;text-align:center;text-align-last:center}.course-selection p{font-family:Gemelli,serif;text-align:center;font-size:18px;margin:3px 0}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}

body[data-screen=event] h1.screen-title{font-family:Gemelli,serif;font-size:30px}.paper .scene-art{width:90%}.paper.parchment{max-height:calc(100dvh - 160px);overflow-y:auto;scrollbar-width:thin}.paper p{font-size:19px}.port-paper.parchment{max-height:calc(100dvh - 160px);overflow-y:auto;scrollbar-width:thin}

/* Naval controls remain in flow to avoid overlapping the enemy or each other. */
.combat-heading{color:#e7cd8e;font-size:16px;padding:8px;margin:0}
.combat-stage{display:grid;gap:10px;min-width:0}
.combat-stage .combat-lens{position:relative;display:block;width:100%;height:auto;aspect-ratio:1;max-width:440px;margin:0 auto}
.combat-stage .combat-lens>.enemy-vessel{position:absolute;left:15%;top:0;width:70%;height:47%;object-fit:contain}
.combat-comparison{position:absolute;left:8%;top:45%;width:84%;border-collapse:collapse;color:#fff;font-size:19px;font-weight:bold;text-shadow:1px 1px #333}
.combat-comparison th{color:#f3d480;text-align:center;padding:1px 5px}
.combat-comparison td{text-align:center;white-space:nowrap}
.gunnery-status{color:#f3d480;font-size:15px;margin:0;text-align:center}
.ammunition-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;min-width:0}
.ammunition-actions button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:80px;padding:4px 0;font-size:16px}
.ammunition-actions img{display:block;width:42px;height:42px;object-fit:contain}
.combat-stage .battle-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0}
.combat-stage .battle-buttons button{min-width:0;min-height:60px;font-family:Gemelli,serif;font-size:21px;font-weight:normal;padding:2px 0}
.combat-stage .battle-buttons small{font-family:Arial,sans-serif;font-size:11px;margin-top:4px}
.combat-names{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;color:#f1d58a;margin:10px 0}
.combat-names>div{min-width:0;border:10px solid transparent;border-image:url('ui/btn_long_default.9.png') 18 fill stretch;padding:0}
.combat-names h3{font-size:20px;text-align:center;overflow-wrap:anywhere;margin-bottom:3px}
.combat-names .meter{margin:0}
.naval-combat .battle-log{margin:8px 0;min-height:120px}
.naval-combat .battle-log p{font-size:19px}
@media(max-width:540px){.combat-comparison{font-size:16px}.combat-comparison th{padding:0 3px}.combat-stage .battle-buttons button{font-size:19px}.combat-names h3{font-size:17px}.ammunition-actions button{font-size:14px}}

.commodity-art{width:52px;height:52px;object-fit:contain;vertical-align:middle;margin-right:9px}.good-copy h2{display:flex;align-items:center;min-height:52px}.port-status{display:inline-flex;vertical-align:middle;gap:5px;margin-left:12px}.port-status img{width:32px;height:32px;object-fit:contain}.pin .map-status{position:absolute;left:50%;bottom:100%;display:flex;gap:3px;transform:translateX(-50%);margin-bottom:4px}.pin .map-status img{width:30px;height:30px;object-fit:contain;margin:0}.head-actions #offline-status{flex-basis:100%;font-size:13px;color:#e4cf9f}@media(max-width:540px){.commodity-art{width:40px;height:43px;margin-right:6px}.good-copy h2{font-size:20px;min-height:43px}.good-row{grid-template-columns:48px minmax(0,1fr) 48px}.good-copy{min-width:0}.port-status{margin-left:8px;gap:3px}}
