/* iPhone presentation profile. Game rules and saved games remain shared.
   Explicit activation prevents these compact rules from affecting iPad/desktop. */
.phone-tools,#phone-rotation-screen{display:none}
html[data-layout="phone"]{--phone-header:34px;--phone-gap:4px;--phone-pad-left:max(6px,env(safe-area-inset-left));--phone-pad-right:max(6px,env(safe-area-inset-right));font-size:13px;overscroll-behavior:none}
html[data-layout="phone"] body{width:100%;height:var(--phone-height,100dvh);min-width:0;min-height:0;overflow:hidden;-webkit-text-size-adjust:100%;touch-action:manipulation}
html[data-layout="phone"] #app{height:100%;padding:env(safe-area-inset-top) var(--phone-pad-right) env(safe-area-inset-bottom) var(--phone-pad-left);overflow:hidden}
html[data-layout="phone"] button{touch-action:manipulation}
html[data-layout="phone"] .game-hud{height:var(--phone-header);padding:0 2px;gap:10px;min-height:0}
html[data-layout="phone"] .brand{min-height:32px;gap:6px}
html[data-layout="phone"] .game-hud .brand-mark{width:23px;height:26px;font-size:19px}
html[data-layout="phone"] .game-hud .brand>span:last-child{font-size:13px;letter-spacing:1px}
html[data-layout="phone"] .game-hud .brand small,html[data-layout="phone"] .brand-mark>span{display:none}
html[data-layout="phone"] .game-subtitle{font-size:10px;letter-spacing:2px;margin-right:auto}
html[data-layout="phone"] .game-hud nav{gap:5px}
html[data-layout="phone"] .game-hud nav button{height:32px;min-height:32px;font-size:11px;padding:3px 11px}
html[data-layout="phone"] .game-hud nav button span{display:inline}
html[data-layout="phone"] .season-track{padding:0;justify-content:flex-start;flex:1;gap:0}
html[data-layout="phone"] .season-counter{border:0;background:none;font-size:12px;padding:0;line-height:30px}
html[data-layout="phone"] .season-counter small{display:inline;font-size:10px;margin-left:6px}
html[data-layout="phone"] .phone-tools{display:flex;align-items:center;gap:5px;margin-left:auto;min-width:0}
html[data-layout="phone"] .phone-layout-label{font-size:10px;color:#b9c5a1;white-space:nowrap;border:1px solid #a9935655;border-radius:4px;padding:4px 8px}
html[data-layout="phone"] .phone-objective{height:32px;min-height:32px;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:1px solid #c0a25c88;border-radius:5px;padding:4px 10px;background:#42533a;color:#f3e1ac;font-size:11px}

/* Full board: merchants / four ports and six public orders / player rack / actions. */
html[data-layout="phone"] .tabletop,html[data-layout="phone"] .tabletop.variant-game,html[data-layout="phone"] body.story-game .tabletop,html[data-layout="phone"] body.story-game .tabletop:has(.delivery-bar){display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:34px minmax(0,1fr) 72px 44px;gap:var(--phone-gap);height:calc(100% - var(--phone-header));min-height:0;max-height:none;max-width:none;width:100%;padding:0 0 4px;align-content:stretch;overflow:visible}
html[data-layout="phone"] .tabletop>.match-summary,html[data-layout="phone"] .tabletop>.royal-objective,html[data-layout="phone"] .tabletop>.story-panel,html[data-layout="phone"] .tabletop>.strategy-rack{display:none}
html[data-layout="phone"] .turn-strip,html[data-layout="phone"] .story-game .turn-strip{grid-row:1;padding:0;max-width:none;width:100%;min-height:0}
html[data-layout="phone"] .opponents{height:100%;gap:6px;align-items:stretch}
html[data-layout="phone"] .merchant-chip,html[data-layout="phone"] .story-game .merchant-chip{height:34px;min-height:34px;flex-direction:row;text-align:left;padding:2px 7px;gap:6px;border-radius:5px;border-bottom-width:2px;box-shadow:0 2px 4px #0003;align-items:center;overflow:hidden}
html[data-layout="phone"] .merchant-chip .crest,html[data-layout="phone"] .story-game .merchant-chip .crest{display:inline-flex;width:22px;height:25px;font-size:14px}
html[data-layout="phone"] .merchant-chip strong,html[data-layout="phone"] .story-game .merchant-chip strong{font-size:11px;line-height:12px;letter-spacing:0}
html[data-layout="phone"] .merchant-chip small{font-size:9px;line-height:11px;margin-top:2px;letter-spacing:0}
html[data-layout="phone"] .first-marker{font-size:8px;margin-left:4px}
html[data-layout="phone"] .story-game .merchant-chip .character-chip{height:25px;width:25px}
html[data-layout="phone"] .tabletop .play-surface,html[data-layout="phone"] .variant-game .play-surface{grid-row:2;display:grid;grid-template-columns:minmax(0,1fr) minmax(192px,29%);height:100%!important;min-height:0!important;max-height:none;gap:7px;padding:0;overflow:visible}
html[data-layout="phone"] .board-section{height:100%;min-height:0;padding:0;overflow:visible;filter:none;display:grid;grid-template-rows:minmax(0,1fr) 29px;gap:3px;border:1px solid #c1a45c80;border-radius:8px;background:#143d3b url('/assets/sea-mat.webp') center/cover;box-shadow:inset 0 0 22px #03202377}
html[data-layout="phone"] .board-section::before,html[data-layout="phone"] .board-section::after,html[data-layout="phone"] .board-heading,html[data-layout="phone"] .sea-separator{display:none}
html[data-layout="phone"] .tabletop .board-window,html[data-layout="phone"] .variant-game .board-window{width:100%;min-width:0;height:100%!important;min-height:0;overflow:visible;padding:3px 7px 0}
html[data-layout="phone"] .board{position:relative;inset:auto!important;width:100%;height:100%;transform:none!important;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:3px 13px}
html[data-layout="phone"] .port-group{position:relative;inset:auto!important;height:100%;min-height:0;min-width:0}
html[data-layout="phone"] .port-cluster{position:relative;inset:auto;width:100%;height:100%;display:grid;grid-template-columns:minmax(43px,1fr) repeat(3,44px);align-items:center;justify-content:space-between;gap:4px;transform:none}
html[data-layout="phone"] .port-tile{position:relative;inset:auto!important;width:100%;max-width:80px;height:100%;max-height:78px;min-height:42px;transform:none;filter:drop-shadow(0 2px 0 #8e7545);justify-self:center}
html[data-layout="phone"] .port-tile .hex-art{padding:2px}
html[data-layout="phone"] .port-tile.monopoly .hex-art{padding:3px;background:var(--port-owner)}
html[data-layout="phone"] .port-tile img{object-fit:cover}
html[data-layout="phone"] .port-name{left:0;right:0;bottom:8px;padding:3px 0;gap:0;border:0;background:#eee2bbed;box-shadow:0 1px 2px #193c3066}
html[data-layout="phone"] .port-name>span{display:none}
html[data-layout="phone"] .port-name strong{font:11px 'Songti SC',serif;letter-spacing:0;white-space:nowrap}
html[data-layout="phone"] .monopoly-label{top:0;left:50%;font-size:8px;padding:1px 3px;border-width:1px;transform:translateX(-50%);z-index:5}
html[data-layout="phone"] .berth{position:relative;inset:auto!important;transform:none;width:44px;height:44px;min-height:44px;padding:0;justify-self:center;border-width:1px;box-shadow:0 2px 0 #7d704c,0 3px 4px #052f2f88}
html[data-layout="phone"] .berth:not(:disabled):active{transform:translateY(1px)}
html[data-layout="phone"] .berth:hover,html[data-layout="phone"] .berth.dockable,html[data-layout="phone"] .berth.buyable{box-shadow:0 2px 0 #7e6c3e,0 0 0 2px #ead38438}
html[data-layout="phone"] .berth.selected{box-shadow:0 2px 0 #7e6c3e,0 0 0 3px #f5d271aa}
html[data-layout="phone"] .berth-top>b{height:15px;width:15px;font-size:10px;left:-3px;top:-3px}
html[data-layout="phone"] .berth .property-token{height:21px;width:20px;right:-4px;top:-7px}
html[data-layout="phone"] .ship-slot{height:100%;width:100%}
html[data-layout="phone"] .ship-slot img{width:43px;height:38px;filter:drop-shadow(0 2px 1px #4e432466)}
html[data-layout="phone"] .ship-slot small{height:13px;width:13px;font-size:9px;bottom:-2px;right:-1px}
html[data-layout="phone"] .anchor-mark{font-size:19px}
html[data-layout="phone"] .rental-yard{position:relative;inset:auto;grid-row:2;margin:0 3px 2px;padding:2px 5px;display:flex;align-items:center;gap:6px;border-radius:4px;box-shadow:none;overflow:hidden}
html[data-layout="phone"] .rental-heading{display:block;margin:0;flex-shrink:0}
html[data-layout="phone"] .rental-heading h3{font-size:10px;letter-spacing:1px;margin:0 0 1px}
html[data-layout="phone"] .rental-heading>span{font-size:8px;line-height:9px}
html[data-layout="phone"] .rental-heading small{display:none}
html[data-layout="phone"] .rental-fleet{height:23px;gap:4px}
html[data-layout="phone"] .rental-slip{display:flex;align-items:center;justify-content:center;gap:1px;border-width:0 0 2px;border-radius:3px;padding:0 3px;min-width:0;overflow:hidden}
html[data-layout="phone"] .rental-owner{position:static;font-size:10px}
html[data-layout="phone"] .rental-ships{height:21px;min-width:0;padding:0;flex:1;gap:0}
html[data-layout="phone"] .rental-ship{max-width:23px;min-width:0}
html[data-layout="phone"] .rental-ship img{width:25px;height:22px;filter:none}
html[data-layout="phone"] .rental-slip>small{display:none}
html[data-layout="phone"] .rental-empty{font-size:11px}
html[data-layout="phone"] .rental-overflow{font-size:8px;margin-left:1px}

/* Public and held cards keep their recipe and reward visible; tap opens full detail. */
html[data-layout="phone"] .market{height:100%;min-height:0;display:grid;grid-template-columns:1fr;grid-template-rows:repeat(3,minmax(0,1fr));padding:0;gap:4px;overflow:visible}
html[data-layout="phone"] .market-title{display:none}
html[data-layout="phone"] .market-tier{margin:0;padding:0 0 0 13px;min-height:0;display:block}
html[data-layout="phone"] .tier-heading{position:absolute;inset:0 auto 0 0;width:10px;margin:0;height:auto;font-size:9px;line-height:10px;justify-content:center}
html[data-layout="phone"] .tier-heading>span:first-child{writing-mode:vertical-rl;gap:2px;letter-spacing:1px}
html[data-layout="phone"] .tier-dot{height:4px;width:4px}
html[data-layout="phone"] .tier-heading .deck-count{display:none}
html[data-layout="phone"] .order-pair{height:100%;padding:0;grid-template-columns:1fr 1fr;gap:5px}
html[data-layout="phone"] .order-card{height:100%;min-height:0;transform:none!important;border-radius:4px;border-top-width:3px;box-shadow:0 2px 0 #9b885b;overflow:visible}
html[data-layout="phone"] .order-card:hover{box-shadow:0 2px 0 #9b885b}
html[data-layout="phone"] .order-card.selected{box-shadow:0 0 0 2px #f3ce78}
html[data-layout="phone"] .market .order-main,html[data-layout="phone"] .hand-area .order-main{height:100%;min-height:40px;padding:3px;display:grid;grid-template-columns:minmax(0,1fr) 24px;align-items:center;justify-content:center;gap:1px}
html[data-layout="phone"] .card-tier,html[data-layout="phone"] .market .card-tier,html[data-layout="phone"] .hand-area .card-tier,html[data-layout="phone"] .card-name,html[data-layout="phone"] .ready-note{display:none}
html[data-layout="phone"] .recipe,html[data-layout="phone"] .market .recipe,html[data-layout="phone"] .hand-area .recipe{min-height:0;margin:0;gap:0;display:flex;justify-content:center;align-items:center;flex-wrap:wrap}
html[data-layout="phone"] .ingredient{justify-content:center;gap:0;height:19px}
html[data-layout="phone"] .ingredient img,html[data-layout="phone"] .market .ingredient img,html[data-layout="phone"] .hand-area .ingredient img{width:20px;height:20px}
html[data-layout="phone"] .ingredient b,html[data-layout="phone"] .market .ingredient b,html[data-layout="phone"] .hand-area .ingredient b{font-size:12px;line-height:18px}
html[data-layout="phone"] .recipe:has(.ingredient:nth-child(3)),html[data-layout="phone"] .market .recipe:has(.ingredient:nth-child(3)),html[data-layout="phone"] .hand-area .recipe:has(.ingredient:nth-child(3)){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;width:100%;max-width:78px;min-height:0;margin:0}
html[data-layout="phone"] .recipe:has(.ingredient:nth-child(3)) .ingredient,html[data-layout="phone"] .market .recipe:has(.ingredient:nth-child(3)) .ingredient{height:17px}
html[data-layout="phone"] .recipe:has(.ingredient:nth-child(3)) img,html[data-layout="phone"] .market .recipe:has(.ingredient:nth-child(3)) img,html[data-layout="phone"] .hand-area .recipe:has(.ingredient:nth-child(3)) .ingredient img{width:16px;height:16px}
html[data-layout="phone"] .recipe:has(.ingredient:nth-child(3)) b,html[data-layout="phone"] .market .recipe:has(.ingredient:nth-child(3)) b{font-size:11px;line-height:16px}
html[data-layout="phone"] .card-reward{display:flex;flex-direction:column;gap:0;align-items:center;justify-content:center}
html[data-layout="phone"] .card-reward b,html[data-layout="phone"] .market .card-reward b,html[data-layout="phone"] .hand-area .card-reward b{font-size:19px;line-height:20px}
html[data-layout="phone"] .card-reward>span,html[data-layout="phone"] .market .card-reward>span{font-size:8px;line-height:10px}
html[data-layout="phone"] .empty-order{height:100%;min-height:0;font-size:10px}
html[data-layout="phone"] .personal{grid-row:3;min-height:0!important;margin:0;padding:4px 7px;border-radius:7px;background:#102b23e8;border-top-width:1px;box-shadow:0 2px 3px #031b1466;overflow:visible}
html[data-layout="phone"] .personal-label{display:none}
html[data-layout="phone"] .personal-content,html[data-layout="phone"] .variant-game .personal-content{height:100%;min-height:0;padding:0;gap:10px;display:grid;grid-template-columns:1.1fr 1fr 65px 1fr;align-items:stretch}
html[data-layout="phone"] .personal-content>div{grid-column:auto;min-width:0;position:relative}
html[data-layout="phone"] .area-heading{height:13px;min-height:13px;font-size:10px;line-height:12px;margin:0 0 3px;color:#d6c69c}
html[data-layout="phone"] .area-heading>span{font-size:9px;white-space:nowrap}
html[data-layout="phone"] .inventory-area .area-heading>span{display:none}
html[data-layout="phone"] .hand-cards{height:45px;max-width:none;gap:6px;padding:0}
html[data-layout="phone"] .hand-empty{height:45px;transform:none!important;gap:0;border-radius:4px}
html[data-layout="phone"] .hand-empty>span{font-size:17px;line-height:18px}
html[data-layout="phone"] .hand-empty small{font-size:9px}
html[data-layout="phone"] .hand-area .order-main{height:42px;min-height:40px}
html[data-layout="phone"] .hand-area .recipe .ingredient b{font-size:10px}
html[data-layout="phone"] .hand-area .deliver-button{display:none}
html[data-layout="phone"] .material-stacks{height:45px;max-width:none;gap:5px;padding:0;justify-content:space-between}
html[data-layout="phone"] .material-card{position:relative;height:45px;min-height:40px;width:calc(25% - 4px);min-width:35px;max-width:none;padding:0 2px;transform:none!important;margin:0!important;border-radius:4px;box-shadow:0 2px 0 #998554;overflow:visible}
html[data-layout="phone"] .material-card>span{font-size:9px;position:absolute;left:0;right:0;top:2px;line-height:10px}
html[data-layout="phone"] .material-card img{width:30px;height:30px;margin-top:10px}
html[data-layout="phone"] .material-card>b{font-size:12px;line-height:16px;width:18px;height:18px;bottom:-2px;right:-2px;border-width:1px}
html[data-layout="phone"] .cash-area .area-heading{text-align:center;display:block}
html[data-layout="phone"] .coin-balance{height:45px;min-height:0;gap:2px;justify-content:center;filter:none}
html[data-layout="phone"] .coin-balance img{width:24px;height:30px}
html[data-layout="phone"] .coin-balance>span{display:none}
html[data-layout="phone"] .coin-balance strong{font-size:26px;line-height:30px}
html[data-layout="phone"] .dock-area{padding:0;border:0}
html[data-layout="phone"] .idle-income-note{display:none}
html[data-layout="phone"] .dock-ships{height:45px;gap:0;justify-content:flex-start}
html[data-layout="phone"] .dock-ship{height:45px;min-width:30px;max-width:45px;flex:1;position:relative;padding:0}
html[data-layout="phone"] .dock-ship img{width:44px;max-width:100%;height:36px;filter:drop-shadow(0 2px 1px #031c1999)}
html[data-layout="phone"] .dock-ship>span{font-size:9px;line-height:10px;position:absolute;bottom:0;left:0;right:0;text-align:center}
html[data-layout="phone"] .no-ships{font-size:10px;line-height:14px}
html[data-layout="phone"] .more-ships{font-size:10px}
html[data-layout="phone"] .building-ship{position:absolute;bottom:0;right:0;font-size:8px;background:#17382be8;max-width:85px;line-height:12px;text-align:center;border-radius:3px;padding:1px 3px}
html[data-layout="phone"] .building-ship img{display:none}
html[data-layout="phone"] .dock-area:has(.boat-button) .dock-ships{padding-right:80px}
html[data-layout="phone"] .boat-button{position:absolute;right:0;bottom:0;width:78px;min-height:41px;height:41px;font-size:10px;padding:3px;line-height:14px;white-space:normal;border-radius:4px}

/* The bottom rail never pushes the board out of view; selection is an overlay. */
html[data-layout="phone"] .action-area,html[data-layout="phone"] .variant-game .action-area,html[data-layout="phone"] .story-game .action-area{grid-row:4;position:relative;inset:auto;margin:0;padding:0;min-height:0;height:100%;background:none;z-index:8}
html[data-layout="phone"] .action-bar,html[data-layout="phone"] .action-bar.delivery-bar{height:100%;min-height:0;display:flex;flex-direction:row;align-items:center;gap:7px;padding:1px 5px;box-shadow:0 2px 0 #041b13;border-radius:6px;overflow:visible}
html[data-layout="phone"] .turn-prompt{align-items:center;gap:6px;min-width:0;flex:1}
html[data-layout="phone"] .turn-prompt>.crest,html[data-layout="phone"] .phase-coins,html[data-layout="phone"] .story-task-return{display:none}
html[data-layout="phone"] .turn-prompt>div{min-width:0}
html[data-layout="phone"] .turn-prompt strong{font-size:10px;line-height:13px;white-space:nowrap;display:block;overflow:hidden;text-overflow:ellipsis}
html[data-layout="phone"] .turn-prompt strong>span{font-size:9px;margin-left:3px}
html[data-layout="phone"] .turn-prompt p{font-size:10px;line-height:13px;margin:2px 0 0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
html[data-layout="phone"] .turn-actions,html[data-layout="phone"] .variant-game .turn-actions{flex-shrink:0;flex-wrap:nowrap;gap:5px;align-items:center;justify-content:flex-end}
html[data-layout="phone"] .turn-actions .end-button{min-height:40px;height:40px;padding:4px 9px;font-size:11px;line-height:14px;border-radius:4px;border-bottom-width:2px;margin:0}
html[data-layout="phone"] .turn-actions .strategy-shortcut{background:#2d4c38;color:#e4d7ac;border-color:#b4a36b88;min-width:70px;font-size:10px;padding:4px 7px}
html[data-layout="phone"] .delivery-choices{display:flex;gap:4px;align-items:center}
html[data-layout="phone"] .deliver-now{height:40px;min-height:40px;min-width:0;font-size:10px;padding:4px 7px;line-height:13px;white-space:normal;gap:1px}
html[data-layout="phone"] .deliver-now span,html[data-layout="phone"] .deliver-now strong{display:block;font-size:9px;line-height:13px;font-weight:500}
html[data-layout="phone"] .delivery-bar .turn-prompt{flex:1;min-width:80px}
html[data-layout="phone"] .delivery-end{max-width:155px}
html[data-layout="phone"] .selection-panel,html[data-layout="phone"] .variant-game .selection-panel{position:absolute;bottom:calc(100% + 5px);left:50%;right:auto;transform:translateX(-50%);width:min(590px,calc(100vw - 30px));max-height:calc(var(--phone-height,100dvh) - 70px);overflow:auto;margin:0;padding:9px 45px 9px 12px;border-width:1px;border-radius:7px;box-shadow:0 4px 0 #7b6742,0 12px 25px #031711aa}
html[data-layout="phone"] .selection-copy{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 10px}
html[data-layout="phone"] .selection-copy>strong{font-size:15px;line-height:19px;width:auto;grid-column:1}
html[data-layout="phone"] .selection-copy>p{font-size:11px;line-height:16px;width:auto;margin:0;grid-column:1}
html[data-layout="phone"] .selection-copy>button,html[data-layout="phone"] .selection-note{grid-column:2;grid-row:1/3;width:auto;margin:0;min-height:42px;font-size:12px;padding:5px 10px;white-space:normal;max-width:190px}
html[data-layout="phone"] .close-selection{height:40px;width:40px;top:0;right:0;font-size:25px}
html[data-layout="phone"] .tutorial-note{display:none}

/* Setup uses two independent settings columns, with Start always in reach. */
html[data-layout="phone"] .journey-modes{height:36px;max-width:440px;min-height:0;margin:0 auto 4px;padding:2px;gap:4px;border-radius:5px}
html[data-layout="phone"] .journey-modes button{height:30px;min-height:30px;font-size:12px}
html[data-layout="phone"] .journey-modes button small{display:inline;font-size:9px;margin:0 0 0 7px;letter-spacing:0}
html[data-layout="phone"] .welcome{height:calc(100% - var(--phone-header) - 40px);min-height:0;max-width:none;width:100%;padding:0 0 5px;display:block;overflow:hidden}
html[data-layout="phone"] .welcome-table,html[data-layout="phone"] .game-title{display:none}
html[data-layout="phone"] .welcome-copy{height:100%;width:100%;max-width:none;margin:0;display:block}
html[data-layout="phone"] .setup{height:100%;max-width:none;min-height:0;padding:8px 12px;display:grid;grid-template-columns:1.1fr 1fr;grid-template-rows:32px minmax(0,1fr) 40px;gap:5px 19px;border-radius:7px;box-shadow:0 3px 0 #756344;overflow:hidden}
html[data-layout="phone"] .setup>.section-head{grid-row:1;grid-column:1;margin:0;align-items:center}
html[data-layout="phone"] .section-head h2{font-size:18px;letter-spacing:1px}
html[data-layout="phone"] .section-head>span{font-size:9px}
html[data-layout="phone"] .setup>.mode-tabs{grid-row:1;grid-column:2;padding:2px;gap:3px}
html[data-layout="phone"] .mode-tabs button{min-height:26px;font-size:11px;padding:0 4px}
html[data-layout="phone"] .setup>.mode-help,html[data-layout="phone"] .setup>.local-note{display:none}
html[data-layout="phone"] .setup>.match-options{grid-row:2;grid-column:1;min-height:0;border:0;padding:0;margin:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
html[data-layout="phone"] .participants{grid-row:2;grid-column:2;min-height:0;padding:0 0 0 12px;border-left:1px solid #aca78066;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
html[data-layout="phone"] .setup .setting-line,html[data-layout="phone"] .match-options .setting-line{padding:3px 0;font-size:11px;min-height:24px}
html[data-layout="phone"] .setting-line small{font-size:9px;margin-top:2px}
html[data-layout="phone"] .test-badge{font-size:8px;padding:2px 5px}
html[data-layout="phone"] .victory-tabs{gap:5px}
html[data-layout="phone"] .victory-tabs button{min-height:40px;padding:5px 7px}
html[data-layout="phone"] .victory-tabs strong{font-size:11px}
html[data-layout="phone"] .victory-tabs small{font-size:9px;margin-top:3px}
html[data-layout="phone"] .match-fields{gap:10px;margin-top:7px}
html[data-layout="phone"] .match-fields label{font-size:11px}
html[data-layout="phone"] .match-fields select,html[data-layout="phone"] .match-fields input{min-height:34px;height:34px;font-size:16px;padding:4px 7px;margin-top:3px}
html[data-layout="phone"] .match-fields small{font-size:9px;margin-top:3px}
html[data-layout="phone"] .royal-round-note{padding-top:0;font-size:11px}
html[data-layout="phone"] .strategy-toggle{margin:7px 0 0;gap:7px;min-height:36px;align-items:center}
html[data-layout="phone"] .strategy-toggle input{height:20px;width:20px;flex-shrink:0}
html[data-layout="phone"] .strategy-toggle strong{font-size:11px}
html[data-layout="phone"] .strategy-toggle small{font-size:9px;margin-top:3px}
html[data-layout="phone"] .match-options>.text-link{font-size:10px;min-height:28px;padding:4px 0;margin-top:0}
html[data-layout="phone"] .stepper{gap:12px}
html[data-layout="phone"] .stepper button{height:34px;width:38px;font-size:20px}
html[data-layout="phone"] .stepper b{font-size:13px}
html[data-layout="phone"] .ai-settings{margin:2px 0 3px}
html[data-layout="phone"] .ai-settings label{padding:3px 0;gap:6px;font-size:11px}
html[data-layout="phone"] .ai-settings select{height:34px;min-height:34px;font-size:16px;padding:2px 5px;max-width:110px}
html[data-layout="phone"] .ai-avatar{font-size:13px}
html[data-layout="phone"] .seed-details{margin:1px 0 0;font-size:10px}
html[data-layout="phone"] .seed-details summary{padding:4px 0;min-height:28px;line-height:20px}
html[data-layout="phone"] .seed-details label{font-size:10px;margin-bottom:2px;gap:5px}
html[data-layout="phone"] .seed-details input{min-height:34px;font-size:16px;padding:3px 5px;width:110px}
html[data-layout="phone"] .setup>.start-button{grid-column:1;grid-row:3;height:40px;min-height:40px;font-size:13px;letter-spacing:1px;padding:5px 12px}
html[data-layout="phone"] .setup:not(:has(.continue-button))>.start-button{grid-column:1/-1;justify-content:center;gap:12px}
html[data-layout="phone"] .setup>.continue-button{grid-column:2;grid-row:3;margin:0;height:40px;min-height:40px;font-size:11px;padding:5px 10px}
html[data-layout="phone"] .continue-button>span{font-size:9px}

/* Story landing keeps chapter and cast entry points beside the illustrated opening. */
html[data-layout="phone"] .story-home{height:calc(100% - var(--phone-header));min-height:0;max-width:none;padding:0 0 4px;display:grid;grid-template-columns:1.05fr 1fr;grid-template-rows:36px minmax(0,1fr) 53px;gap:5px 10px;overflow:hidden}
html[data-layout="phone"] .story-home>.journey-modes{grid-column:1/-1;grid-row:1;margin:0;justify-self:center;width:440px;max-width:100%;height:36px}
html[data-layout="phone"] .journey-hero{grid-column:1;grid-row:2/4;min-height:0;height:100%;border-radius:7px;box-shadow:none;align-items:flex-end}
html[data-layout="phone"] .journey-hero-copy{padding:14px 18px;max-width:none;align-self:flex-end}
html[data-layout="phone"] .journey-hero:after{background:linear-gradient(0deg,#092724f5,#0927249c 50%,#09272422)}
html[data-layout="phone"] .story-eyebrow{font-size:9px;letter-spacing:1px}
html[data-layout="phone"] .journey-hero h1{font-size:23px;line-height:1.3;letter-spacing:2px;margin:8px 0}
html[data-layout="phone"] .journey-hero p{font-size:10px;line-height:1.65;margin:0 0 10px}
html[data-layout="phone"] .journey-actions{gap:5px;flex-wrap:nowrap}
html[data-layout="phone"] .journey-actions button{height:40px;min-height:40px;font-size:11px;padding:5px 9px;line-height:15px}
html[data-layout="phone"] .journey-footnote{font-size:8px;line-height:13px;margin-top:9px}
html[data-layout="phone"] .chapter-section{grid-column:2;grid-row:2;min-height:0}
html[data-layout="phone"] .story-section-heading{margin:0 0 5px;flex-direction:row;align-items:center;gap:5px;height:20px}
html[data-layout="phone"] .story-section-heading .story-eyebrow{display:none}
html[data-layout="phone"] .story-section-heading h2{font-size:12px;letter-spacing:0;margin:0}
html[data-layout="phone"] .story-section-heading>span{font-size:8px}
html[data-layout="phone"] .chapter-grid{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:none;grid-auto-rows:60px;height:100%;gap:5px;overflow-y:auto;overscroll-behavior:contain;align-content:start;scrollbar-width:thin}
html[data-layout="phone"] .chapter-card{display:grid;grid-template-columns:24% 1fr;border-radius:5px;min-height:0;overflow:hidden}
html[data-layout="phone"] .chapter-card>img{height:100%;width:100%;min-height:0;aspect-ratio:auto;object-fit:cover}
html[data-layout="phone"] .chapter-copy{position:relative;padding:5px 8px;display:grid;grid-template-columns:minmax(0,1fr) 63px;align-items:center;gap:2px 6px;min-height:0}
html[data-layout="phone"] .chapter-copy>.story-eyebrow{font-size:8px;letter-spacing:0;grid-column:1;line-height:10px}
html[data-layout="phone"] .chapter-copy b{font-size:8px;padding:1px 3px}
html[data-layout="phone"] .chapter-copy h3{font-size:15px;letter-spacing:1px;line-height:17px;margin:0;grid-column:1}
html[data-layout="phone"] .chapter-copy p,html[data-layout="phone"] .chapter-copy>small{display:none}
html[data-layout="phone"] .chapter-link{grid-column:2;grid-row:1/3;min-height:40px;height:100%;margin:0;border:1px solid #cdb27530;border-radius:4px;padding:4px;justify-content:center;font-size:10px;gap:2px}
html[data-layout="phone"] .chapter-link span{display:none}
html[data-layout="phone"] .cast-section{grid-column:2;grid-row:3;min-height:0}
html[data-layout="phone"] .cast-section>.story-section-heading{display:none}
html[data-layout="phone"] .cast-grid{height:100%;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
html[data-layout="phone"] .cast-card{height:100%;min-height:0;padding:4px;gap:5px;border-radius:5px}
html[data-layout="phone"] .cast-card img{height:28px;width:28px}
html[data-layout="phone"] .cast-card strong{font-size:11px;margin:0}
html[data-layout="phone"] .cast-card small{font-size:8px;display:block;line-height:12px;margin-top:2px}
html[data-layout="phone"] .cast-card>b,html[data-layout="phone"] .story-save-note{display:none}

/* Result pages and dialogs are arranged for the same short landscape viewport. */
html[data-layout="phone"] .results{height:calc(100% - var(--phone-header));max-width:850px;margin:0 auto;padding:0 12px 4px;overflow-y:auto;scrollbar-width:thin}
html[data-layout="phone"] .results>.eyebrow,html[data-layout="phone"] .result-seal,html[data-layout="phone"] .result-seed{display:none}
html[data-layout="phone"] .results h1{font-size:23px;line-height:28px;letter-spacing:1px;margin:2px 0 4px}
html[data-layout="phone"] .winner-line{font-size:12px;line-height:17px;margin:0 0 7px}
html[data-layout="phone"] .results-table{padding:0 8px;margin:0;border-width:1px;box-shadow:0 3px 0 #756043;border-radius:5px}
html[data-layout="phone"] .result-row{height:34px;min-height:0;grid-template-columns:1.7fr repeat(4,1fr);padding:3px 5px;font-size:12px}
html[data-layout="phone"] .result-heading{height:24px;font-size:10px}
html[data-layout="phone"] .result-row>span:first-child{gap:6px;font-size:11px}
html[data-layout="phone"] .result-row .crest{height:24px;width:22px;font-size:13px}
html[data-layout="phone"] .result-row>strong{font-size:21px}
html[data-layout="phone"] .results>p:not(.winner-line){font-size:9px;line-height:13px;margin:6px 0}
html[data-layout="phone"] .result-actions{gap:8px;margin:8px 0 0;flex-wrap:nowrap}
html[data-layout="phone"] .result-actions button{min-height:40px;height:40px;font-size:12px;padding:5px 16px}
html[data-layout="phone"] .story-result{height:calc(100% - var(--phone-header));max-width:none;margin:0;padding:0 0 4px;display:grid;grid-template-columns:36% minmax(0,1fr);overflow:hidden}
html[data-layout="phone"] .story-result-art{height:100%;border-radius:7px 0 0 7px}
html[data-layout="phone"] .story-result-art>img{height:100%;object-fit:cover}
html[data-layout="phone"] .story-result-art>div{padding:17px}
html[data-layout="phone"] .story-result-art h1{font-size:24px;margin:7px 0 0;line-height:1.5}
html[data-layout="phone"] .story-result-copy{min-height:0;padding:10px 14px;overflow-y:auto;border-radius:0 7px 7px 0;scrollbar-width:thin}
html[data-layout="phone"] .story-result-copy .story-dialogue{padding:0;gap:10px}
html[data-layout="phone"] .story-result-copy .story-dialogue>img{width:44px;height:44px}
html[data-layout="phone"] .story-result-copy .story-dialogue h3{font-size:18px;margin:2px 0 5px}
html[data-layout="phone"] .story-result-copy .story-dialogue p{font-size:11px;line-height:1.7}
html[data-layout="phone"] .result-lessons{font-size:10px;gap:6px 13px;padding:4px 0;margin:9px 0}
html[data-layout="phone"] .story-result-copy>p{font-size:9px;line-height:1.6;margin:8px 0 0}
html[data-layout="phone"] dialog{width:min(610px,calc(100vw - var(--phone-pad-left) - var(--phone-pad-right) - 14px));max-height:calc(var(--phone-height,100dvh) - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));padding:14px 18px;border-width:2px;border-radius:8px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
html[data-layout="phone"] dialog h2{font-size:21px;line-height:26px;margin:0 30px 12px 0;letter-spacing:0}
html[data-layout="phone"] dialog h3{font-size:15px;margin:14px 0 6px}
html[data-layout="phone"] dialog p{font-size:12px;line-height:1.75;margin-bottom:11px}
html[data-layout="phone"] dialog .primary,html[data-layout="phone"] dialog .secondary{min-height:42px;font-size:12px;padding:8px 13px}
html[data-layout="phone"] .modal-close{height:40px;width:40px;min-height:40px;font-size:26px;margin:-7px -13px 0 0;position:sticky;top:-10px;z-index:6;background:#eddfbaee;border-radius:5px}
html[data-layout="phone"] .modal-actions{flex-direction:row;gap:8px}
html[data-layout="phone"] .game-menu{grid-template-columns:1fr 1fr;gap:8px}
html[data-layout="phone"] .game-menu button{min-height:43px;font-size:12px}
html[data-layout="phone"] .goods-detail{gap:18px}
html[data-layout="phone"] .goods-detail>img{width:85px;height:70px}
html[data-layout="phone"] .goods-detail p{margin:3px 0}
html[data-layout="phone"] .quantity-label{margin:10px 0;font-size:12px}
html[data-layout="phone"] .quantity-label input,html[data-layout="phone"] .strategy-target select{font-size:16px;min-height:40px;padding:5px 9px}
html[data-layout="phone"] .player-goods{gap:12px}
html[data-layout="phone"] .player-goods img{width:27px;height:27px}
html[data-layout="phone"] .player-goods>span{font-size:11px}
html[data-layout="phone"] #modal .strategy-rack{padding:10px}
html[data-layout="phone"] #modal .strategy-rack-heading{align-items:center}
html[data-layout="phone"] #modal .strategy-rack-heading strong{font-size:14px}
html[data-layout="phone"] #modal .strategy-rack-heading small{max-width:none;font-size:10px;line-height:15px}
html[data-layout="phone"] #modal .strategy-rack-actions{flex-direction:row;gap:8px}
html[data-layout="phone"] #modal .strategy-hand{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
html[data-layout="phone"] #modal .strategy-card{min-height:60px;padding:6px;gap:5px}
html[data-layout="phone"] #modal .strategy-card strong{font-size:11px}
html[data-layout="phone"] #modal .strategy-card small{font-size:9px;line-height:14px}
html[data-layout="phone"] #modal .strategy-symbol{font-size:24px;min-width:20px}
html[data-layout="phone"] #modal .strategy-card>b{font-size:10px;margin-left:auto}
html[data-layout="phone"] .strategy-guide article{padding:9px 0;gap:10px}
html[data-layout="phone"] .strategy-guide h3{margin:0 0 4px}
html[data-layout="phone"] .strategy-guide article p{font-size:12px;line-height:1.65}
html[data-layout="phone"] .strategy-detail>.strategy-symbol{display:none}
html[data-layout="phone"] .strategy-target{gap:5px;margin:10px 0;font-size:12px}
html[data-layout="phone"] .variant-note,html[data-layout="phone"] .strategy-unavailable{padding:7px;font-size:11px!important}
html[data-layout="phone"] .chapter-preview>img{width:36%;aspect-ratio:1.4;float:left;margin:0 15px 8px 0}
html[data-layout="phone"] .chapter-preview p{font-size:12px;line-height:1.75}
html[data-layout="phone"] .chapter-preview:after{content:'';display:block;clear:both}
html[data-layout="phone"] .story-dialogue{gap:12px;padding:8px 0}
html[data-layout="phone"] .story-dialogue>img{width:56px;height:56px}
html[data-layout="phone"] .story-dialogue h3{font-size:19px;margin:4px 0 7px}
html[data-layout="phone"] .story-dialogue p{font-size:12px;line-height:1.75}
html[data-layout="phone"] .intro-scene{width:35%;float:left;margin:0 14px 8px 0}
html[data-layout="phone"] .intro-scene img{height:140px;object-fit:cover}
html[data-layout="phone"] .intro-scene>span{font-size:13px;letter-spacing:1px;bottom:8px;left:9px}
html[data-layout="phone"] .intro-controls{clear:both;margin-top:10px;gap:8px}
html[data-layout="phone"] .intro-controls>span{font-size:10px}
html[data-layout="phone"] #modal .story-panel{display:block;padding:10px 12px}
html[data-layout="phone"] #modal .story-panel-top{font-size:11px;gap:8px}
html[data-layout="phone"] #modal .story-panel-top>button{min-height:40px;font-size:11px}
html[data-layout="phone"] #modal .story-progress{margin:6px 0 10px}
html[data-layout="phone"] #modal .lesson-copy{gap:10px}
html[data-layout="phone"] #modal .lesson-copy>img{height:44px;width:44px}
html[data-layout="phone"] #modal .lesson-copy h2{font-size:18px;margin:4px 0}
html[data-layout="phone"] #modal .lesson-copy p{font-size:12px;line-height:1.65;color:#bdcdb5;margin:0}
html[data-layout="phone"] #modal .lesson-guidance{flex-direction:row;gap:9px;margin-top:9px;padding:7px}
html[data-layout="phone"] #modal .lesson-guidance p{font-size:11px;color:#e4d8ad;margin:0}
html[data-layout="phone"] #modal .lesson-guidance button{font-size:11px;min-height:40px;padding:5px 9px}
html[data-layout="phone"] #modal .lesson-checklist{font-size:11px}
html[data-layout="phone"] #modal .lesson-checklist summary{min-height:36px;padding:8px 0}
html[data-layout="phone"] #modal .lesson-checklist ol{gap:8px 15px}
html[data-layout="phone"] #modal .royal-objective{display:flex;padding:12px;gap:12px}
html[data-layout="phone"] #modal .royal-heading{width:100%;gap:8px}
html[data-layout="phone"] #modal .royal-heading h2{color:#f4e7c5;font-size:20px;margin:0 0 4px}
html[data-layout="phone"] #modal .royal-heading p{font-size:11px;color:#cbd1b1;margin:0}
html[data-layout="phone"] #modal .royal-seal{font-size:30px}
html[data-layout="phone"] #modal .royal-materials{gap:20px;justify-content:space-between}
html[data-layout="phone"] #modal .royal-materials>span{font-size:11px}
html[data-layout="phone"] #modal .royal-materials b{font-size:22px;margin-top:3px}
html[data-layout="phone"] #modal .royal-submit{width:100%;flex-direction:row;align-items:center;gap:10px}
html[data-layout="phone"] #modal .royal-submit small{font-size:10px}
html[data-layout="phone"] #modal .royal-rivals{flex-wrap:wrap;font-size:10px;gap:7px 14px;padding-top:7px}
html[data-layout="phone"] #toast{bottom:max(54px,calc(env(safe-area-inset-bottom) + 50px));max-width:80vw;padding:8px 14px;font-size:11px;line-height:16px;border-radius:5px;z-index:30}

/* Smaller landscape phones and Safari's expanded browser controls. */
@media(max-width:740px){
 html[data-layout="phone"] .game-hud{gap:6px}
 html[data-layout="phone"] .game-hud .brand>span:last-child{font-size:15px;letter-spacing:1px}
 html[data-layout="phone"] .season-counter small{display:none}
 html[data-layout="phone"] .phone-objective{max-width:195px;font-size:10px;padding:4px 7px}
 html[data-layout="phone"] .opponents{gap:4px}
 html[data-layout="phone"] .merchant-chip{padding:2px 4px;gap:4px}
 html[data-layout="phone"] .merchant-chip strong{font-size:10px}
 html[data-layout="phone"] .merchant-chip small{font-size:8px}
 html[data-layout="phone"] .merchant-chip .crest{height:23px;width:19px;font-size:12px}
 html[data-layout="phone"] .tabletop .play-surface{grid-template-columns:minmax(0,1fr) 188px;gap:5px}
 html[data-layout="phone"] .board-window{padding:3px 4px 0}
 html[data-layout="phone"] .board{gap:2px 7px}
 html[data-layout="phone"] .port-cluster{grid-template-columns:minmax(33px,1fr) repeat(3,44px);gap:3px}
 html[data-layout="phone"] .port-name strong{font-size:10px}
 html[data-layout="phone"] .personal-content{grid-template-columns:1.1fr 1fr 52px .95fr;gap:7px}
 html[data-layout="phone"] .material-stacks{gap:4px}
 html[data-layout="phone"] .material-card{min-width:30px}
 html[data-layout="phone"] .material-card img{width:27px}
 html[data-layout="phone"] .coin-balance img{width:20px}
 html[data-layout="phone"] .coin-balance strong{font-size:23px}
 html[data-layout="phone"] .area-heading>span{font-size:8px}
 html[data-layout="phone"] .dock-area:has(.boat-button) .dock-ships{padding-right:68px}
 html[data-layout="phone"] .boat-button{width:66px;font-size:9px}
 html[data-layout="phone"] .turn-actions .end-button{font-size:10px;padding:4px 7px}
 html[data-layout="phone"] .turn-actions .strategy-shortcut{min-width:62px;font-size:9px;padding:4px 6px}
 html[data-layout="phone"] .turn-prompt strong>span{font-size:8px}
 html[data-layout="phone"] .delivery-bar .turn-prompt{display:none}
 html[data-layout="phone"] .delivery-bar .turn-actions{width:100%;justify-content:space-between;gap:5px}
 html[data-layout="phone"] .delivery-choices{flex:1;justify-content:center}
 html[data-layout="phone"] .delivery-end{max-width:135px}
 html[data-layout="phone"] .setup{gap:5px 12px;padding:7px 10px}
 html[data-layout="phone"] .participants{padding-left:10px}
 html[data-layout="phone"] .story-home{gap:5px 7px}
 html[data-layout="phone"] .journey-hero-copy{padding:12px}
 html[data-layout="phone"] .journey-hero h1{font-size:21px}
 html[data-layout="phone"] .journey-actions button{font-size:10px;padding:4px 7px}
 html[data-layout="phone"] .cast-card img{height:24px;width:24px}
 html[data-layout="phone"] .cast-card small{display:none}
 html[data-layout="phone"] .chapter-copy{padding:4px 5px;grid-template-columns:minmax(0,1fr) 53px;gap:2px 4px}
 html[data-layout="phone"] .chapter-copy h3{font-size:14px}
 html[data-layout="phone"] .chapter-copy>.story-eyebrow{font-size:7px}
 html[data-layout="phone"] .story-section-heading>span{display:none}
}
@media(max-height:350px) and (orientation:landscape){
 html[data-layout="phone"]{--phone-header:30px;--phone-gap:3px}
 html[data-layout="phone"] .tabletop,html[data-layout="phone"] .tabletop.variant-game,html[data-layout="phone"] body.story-game .tabletop,html[data-layout="phone"] body.story-game .tabletop:has(.delivery-bar){grid-template-rows:30px minmax(0,1fr) 65px 42px;padding-bottom:2px}
 html[data-layout="phone"] .game-hud .brand{min-height:28px}
 html[data-layout="phone"] .game-hud nav button,html[data-layout="phone"] .phone-objective{height:28px;min-height:28px}
 html[data-layout="phone"] .merchant-chip,html[data-layout="phone"] .story-game .merchant-chip{height:30px;min-height:30px}
 html[data-layout="phone"] .merchant-chip .crest{height:23px;width:20px;font-size:13px}
 html[data-layout="phone"] .board-section{grid-template-rows:minmax(0,1fr) 26px;gap:0}
 html[data-layout="phone"] .tabletop .board-window{padding-top:1px}
 html[data-layout="phone"] .port-tile{max-height:49px;min-height:40px}
 html[data-layout="phone"] .port-name{bottom:5px;padding:2px 0}
 html[data-layout="phone"] .rental-yard{height:24px;margin-bottom:1px;padding:1px 4px}
 html[data-layout="phone"] .rental-heading h3{font-size:9px}
 html[data-layout="phone"] .rental-fleet{height:21px}
 html[data-layout="phone"] .personal{padding:2px 6px}
 html[data-layout="phone"] .personal-content{gap:8px}
 html[data-layout="phone"] .area-heading{height:12px;min-height:12px;margin-bottom:2px}
 html[data-layout="phone"] .journey-hero-copy{padding:10px 14px}
 html[data-layout="phone"] .journey-hero h1{font-size:20px;margin:6px 0}
 html[data-layout="phone"] .journey-hero p{font-size:9px;line-height:1.5;margin-bottom:7px}
 html[data-layout="phone"] .journey-footnote{display:none}
 html[data-layout="phone"] .story-home{grid-template-rows:32px minmax(0,1fr) 43px;gap:4px 8px}
 html[data-layout="phone"] .story-home>.journey-modes{height:32px}
 html[data-layout="phone"] .story-home>.journey-modes button{height:26px;min-height:26px}
 html[data-layout="phone"] .story-section-heading{height:15px;margin-bottom:3px}
 html[data-layout="phone"] .chapter-grid{height:100%;gap:3px}
 html[data-layout="phone"] .chapter-copy{padding:2px 6px}
 html[data-layout="phone"] .chapter-copy>.story-eyebrow{font-size:7px;line-height:9px}
 html[data-layout="phone"] .chapter-copy h3{font-size:13px;line-height:15px}
 html[data-layout="phone"] .results h1{font-size:20px;line-height:24px;margin:0 0 3px}
 html[data-layout="phone"] .winner-line{font-size:11px;line-height:15px;margin-bottom:5px}
 html[data-layout="phone"] .result-row{height:31px}
 html[data-layout="phone"] .result-heading{height:22px}
 html[data-layout="phone"] .result-actions{margin-top:5px}
 html[data-layout="phone"] .results>p:not(.winner-line){margin:5px 0}
}

/* Browser prototypes cannot force Safari rotation, so portrait has a clear entry state. */
html[data-layout="phone"][data-orientation="portrait"] #app{visibility:hidden;pointer-events:none}
html[data-layout="phone"][data-orientation="portrait"] #phone-rotation-screen{position:fixed;inset:0;z-index:100;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:30px max(24px,env(safe-area-inset-right)) 30px max(24px,env(safe-area-inset-left));text-align:center;color:#f3e4bd;background:radial-gradient(ellipse at 50% 35%,#355a45,#102d25 75%)}
html[data-layout="phone"] .phone-rotation-icon{font-size:52px;line-height:1.2;color:#dec487;margin-bottom:24px;filter:drop-shadow(0 4px 2px #071c16)}
html[data-layout="phone"] #phone-rotation-screen h1{font:27px 'Songti SC',serif;letter-spacing:3px;margin:0 0 18px}
html[data-layout="phone"] #phone-rotation-screen p{font-size:13px;line-height:1.9;color:#c2c9ac;max-width:280px;margin:0 0 10px}
html[data-layout="phone"][data-orientation="portrait"] dialog[open]{visibility:hidden;pointer-events:none}
html[data-layout="phone"][data-orientation="portrait"] dialog::backdrop{visibility:hidden;background:transparent;backdrop-filter:none;pointer-events:none}
/* Prevent older responsive delivery rules from creating a second action row. */
html[data-layout="phone"] .action-bar.delivery-bar{flex-wrap:nowrap}
html[data-layout="phone"] .delivery-bar .turn-actions{width:auto}
html[data-layout="phone"] .delivery-bar .delivery-choices{flex:0 1 auto}
html[data-layout="phone"] .match-fields{margin-bottom:7px}
html[data-layout="phone"] .match-fields label{gap:1px}
@media(max-width:740px){
 html[data-layout="phone"] .delivery-bar .turn-actions{width:100%}
 html[data-layout="phone"] .delivery-bar .delivery-choices{flex:1}
}

/* iPad uses the same single-screen contract as iPhone, with roomier controls. */
html[data-layout="phone"][data-device="tablet"]{--phone-header:44px;--phone-gap:7px;font-size:15px}
html[data-layout="phone"][data-device="tablet"] #app{padding:max(8px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
html[data-layout="phone"][data-device="tablet"] .game-hud{height:var(--phone-header);padding:0 4px;gap:14px}
html[data-layout="phone"][data-device="tablet"] .game-hud .brand-mark{width:30px;height:34px;font-size:23px}
html[data-layout="phone"][data-device="tablet"] .game-hud .brand>span:last-child{font-size:18px;letter-spacing:3px}
html[data-layout="phone"][data-device="tablet"] .game-subtitle{font-size:12px}
html[data-layout="phone"][data-device="tablet"] .game-hud nav button{height:38px;min-height:38px;font-size:13px;padding:5px 15px}
html[data-layout="phone"][data-device="tablet"] .phone-objective{height:38px;min-height:38px;max-width:330px;font-size:13px}
html[data-layout="phone"][data-device="tablet"] .tabletop,html[data-layout="phone"][data-device="tablet"] .tabletop.variant-game,html[data-layout="phone"][data-device="tablet"] body.story-game .tabletop,html[data-layout="phone"][data-device="tablet"] body.story-game .tabletop:has(.delivery-bar){grid-template-rows:44px minmax(0,1fr) 96px 54px;padding-bottom:0}
html[data-layout="phone"][data-device="tablet"] .merchant-chip,html[data-layout="phone"][data-device="tablet"] .story-game .merchant-chip{height:44px;min-height:44px;padding:4px 10px;gap:8px}
html[data-layout="phone"][data-device="tablet"] .merchant-chip .crest,html[data-layout="phone"][data-device="tablet"] .story-game .merchant-chip .crest{width:28px;height:32px;font-size:17px}
html[data-layout="phone"][data-device="tablet"] .merchant-chip strong,html[data-layout="phone"][data-device="tablet"] .story-game .merchant-chip strong{font-size:14px;line-height:16px}
html[data-layout="phone"][data-device="tablet"] .merchant-chip small{font-size:11px;line-height:13px}
html[data-layout="phone"][data-device="tablet"] .tabletop .play-surface,html[data-layout="phone"][data-device="tablet"] .variant-game .play-surface{grid-template-columns:minmax(0,1fr) minmax(282px,28%);gap:10px}
html[data-layout="phone"][data-device="tablet"] .board-section{grid-template-rows:minmax(0,1fr) 36px;gap:5px}
html[data-layout="phone"][data-device="tablet"] .tabletop .board-window,html[data-layout="phone"][data-device="tablet"] .variant-game .board-window{padding:6px 12px 0}
html[data-layout="phone"][data-device="tablet"] .board{gap:7px 24px}
html[data-layout="phone"][data-device="tablet"] .port-cluster{grid-template-columns:minmax(80px,1fr) repeat(3,58px);gap:8px}
html[data-layout="phone"][data-device="tablet"] .port-tile{max-width:112px;max-height:112px;min-height:68px}
html[data-layout="phone"][data-device="tablet"] .port-name{bottom:12px;padding:5px 0}
html[data-layout="phone"][data-device="tablet"] .port-name strong{font-size:15px}
html[data-layout="phone"][data-device="tablet"] .berth{width:58px;height:58px;min-height:58px}
html[data-layout="phone"][data-device="tablet"] .ship-slot img{width:54px;height:48px}
html[data-layout="phone"][data-device="tablet"] .rental-yard{margin:0 5px 4px;padding:4px 8px;gap:10px}
html[data-layout="phone"][data-device="tablet"] .rental-heading h3{font-size:12px}
html[data-layout="phone"][data-device="tablet"] .rental-fleet{height:28px;gap:7px}
html[data-layout="phone"][data-device="tablet"] .rental-ship img{width:31px;height:27px}
html[data-layout="phone"][data-device="tablet"] .market{gap:7px}
html[data-layout="phone"][data-device="tablet"] .market-tier{padding-left:17px}
html[data-layout="phone"][data-device="tablet"] .tier-heading{width:13px;font-size:11px;line-height:12px}
html[data-layout="phone"][data-device="tablet"] .order-pair{gap:7px}
html[data-layout="phone"][data-device="tablet"] .market .order-main,html[data-layout="phone"][data-device="tablet"] .hand-area .order-main{grid-template-columns:minmax(0,1fr) 32px;padding:5px}
html[data-layout="phone"][data-device="tablet"] .ingredient img,html[data-layout="phone"][data-device="tablet"] .market .ingredient img,html[data-layout="phone"][data-device="tablet"] .hand-area .ingredient img{width:26px;height:26px}
html[data-layout="phone"][data-device="tablet"] .ingredient b,html[data-layout="phone"][data-device="tablet"] .market .ingredient b,html[data-layout="phone"][data-device="tablet"] .hand-area .ingredient b{font-size:15px}
html[data-layout="phone"][data-device="tablet"] .card-reward b,html[data-layout="phone"][data-device="tablet"] .market .card-reward b,html[data-layout="phone"][data-device="tablet"] .hand-area .card-reward b{font-size:25px;line-height:26px}
html[data-layout="phone"][data-device="tablet"] .personal{padding:7px 11px}
html[data-layout="phone"][data-device="tablet"] .personal-content,html[data-layout="phone"][data-device="tablet"] .variant-game .personal-content{grid-template-columns:1.15fr 1.05fr 80px 1fr;gap:15px}
html[data-layout="phone"][data-device="tablet"] .area-heading{height:16px;min-height:16px;font-size:12px;line-height:15px;margin-bottom:5px}
html[data-layout="phone"][data-device="tablet"] .hand-cards,html[data-layout="phone"][data-device="tablet"] .material-stacks,html[data-layout="phone"][data-device="tablet"] .coin-balance,html[data-layout="phone"][data-device="tablet"] .dock-ships{height:63px}
html[data-layout="phone"][data-device="tablet"] .hand-empty,html[data-layout="phone"][data-device="tablet"] .material-card,html[data-layout="phone"][data-device="tablet"] .dock-ship{height:63px;min-height:56px}
html[data-layout="phone"][data-device="tablet"] .material-card img{width:41px;height:41px;margin-top:15px}
html[data-layout="phone"][data-device="tablet"] .material-card>b{font-size:15px;width:22px;height:22px;line-height:20px}
html[data-layout="phone"][data-device="tablet"] .coin-balance img{width:32px;height:40px}
html[data-layout="phone"][data-device="tablet"] .coin-balance strong{font-size:34px;line-height:38px}
html[data-layout="phone"][data-device="tablet"] .dock-ship img{width:54px;height:48px}
html[data-layout="phone"][data-device="tablet"] .action-bar,html[data-layout="phone"][data-device="tablet"] .action-bar.delivery-bar{gap:11px;padding:4px 8px}
html[data-layout="phone"][data-device="tablet"] .turn-prompt strong{font-size:14px;line-height:16px}
html[data-layout="phone"][data-device="tablet"] .turn-prompt p{font-size:12px;line-height:15px}
html[data-layout="phone"][data-device="tablet"] .turn-actions .end-button,html[data-layout="phone"][data-device="tablet"] .deliver-now{height:46px;min-height:46px;font-size:13px;padding:6px 13px}

.phone-player-name{display:none}
html[data-layout="phone"] .phone-player-name{display:inline;font-weight:600;color:var(--player)}
html[data-layout="phone"] .port-name strong{font-size:12px}
html[data-layout="phone"] .merchant-chip strong{font-size:12px}
html[data-layout="phone"] .merchant-chip small{font-size:10px}
html[data-layout="phone"] .turn-prompt strong{font-size:12px}
html[data-layout="phone"] .turn-prompt p{font-size:11px}
html[data-layout="phone"] .turn-actions .end-button{font-size:12px}
html[data-layout="phone"] .material-card>span{font-size:10px}
html[data-layout="phone"] .area-heading{font-size:11px}
/* Optional short-viewport profile.
   Activate only on gameplay: html[data-phone-density="short"][data-page="game"].
   Runtime should use visualViewport's usable height (<= 330px), since Safari's
   browser chrome can shrink it without changing CSS viewport media queries.
   Assumes at least 300px visual height, including a 21px bottom safe area.
   Header and merchants share one row; all board/order controls remain >=40px. */
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .game-hud{position:absolute;top:env(safe-area-inset-top);left:var(--phone-pad-left);width:205px;height:28px;padding:0 2px;gap:4px;z-index:10}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .game-hud .brand{min-height:26px;gap:0;flex-shrink:0}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .game-hud .brand>span:last-child{display:none}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .game-hud .brand-mark{width:20px;height:23px;font-size:17px}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .game-hud nav button[data-ui="rules"]{display:none}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .game-hud nav button{height:28px;min-height:28px;padding:3px 6px;font-size:10px}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .game-hud nav button span{display:none}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .season-counter{font-size:10px;line-height:26px}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .season-counter small{display:none}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .phone-tools{margin:0;flex-shrink:0}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .phone-objective{height:28px;min-height:28px;max-width:70px;padding:3px 5px;font-size:10px}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .tabletop,html[data-layout="phone"][data-phone-density="short"][data-page="game"] .tabletop.variant-game,html[data-layout="phone"][data-phone-density="short"][data-page="game"] body.story-game .tabletop{height:100%;grid-template-rows:28px minmax(0,1fr) 62px 42px;gap:3px;padding-bottom:2px}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .turn-strip{padding-left:212px}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .opponents{gap:4px}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .merchant-chip{height:28px;min-height:28px;padding:1px 4px;gap:4px;border-bottom-width:2px}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .merchant-chip>span:not(.crest){min-width:0}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .merchant-chip strong{font-size:10px;line-height:11px;overflow:hidden;text-overflow:ellipsis}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .merchant-chip small{font-size:8px;line-height:10px;margin-top:1px;overflow:hidden;text-overflow:ellipsis}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .merchant-chip .crest,html[data-layout="phone"][data-phone-density="short"][data-page="game"] .merchant-chip .character-chip{width:17px;height:20px;font-size:11px;flex-shrink:0}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .personal{padding:2px 6px}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .area-heading{height:11px;min-height:11px;line-height:11px;margin-bottom:2px;font-size:10px}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .market{gap:2px}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .market .order-main{min-height:40px;padding:1px 3px}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .board-section{grid-template-rows:minmax(0,1fr) 26px;gap:0}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .tabletop .board-window{padding-top:1px}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .port-tile{max-height:60px;min-height:40px}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .rental-yard{height:24px;margin-bottom:1px;padding:1px 4px}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .rental-heading h3{font-size:9px}
html[data-layout="phone"][data-phone-density="short"][data-page="game"] .rental-fleet{height:21px}
