/* Phone portrait only. The existing desktop and landscape table stays unchanged. */
.ep-mobile-nav,.ep-mobile-menu{display:none}
@media (max-width:600px) and (orientation:portrait){
 .electropolis-app button{touch-action:manipulation}
 .ep-playing .ep-tabletop{width:100%;height:100%;transform:none;font-size:14px;isolation:isolate}
 .ep-playing .ep-header{height:auto;min-height:54px;flex:0 0 auto;padding:8px 10px;flex-wrap:wrap;gap:6px;position:relative;z-index:16}
 .ep-playing .ep-brand-mark,.ep-playing .ep-brand>div>span{display:none}
 .ep-playing .ep-brand strong{font-size:13px}
 .ep-playing .ep-user{flex:1;justify-content:flex-end;flex-wrap:wrap;gap:5px;font-size:11px}
 .ep-playing .ep-header [data-do="name"],.ep-playing .ep-header [data-do="home"],.ep-playing .ep-header [data-do="help"],.ep-playing .ep-header [data-do="leave-open"],.ep-playing .ep-header .ep-dot{display:none}
 .ep-playing .ep-header .ep-mobile-menu{display:inline-flex}
 .ep-mobile-menu-items{display:flex;flex-direction:column;gap:10px}
 .ep-playing .ep-header .ep-button{min-height:34px;font-size:11px;padding:5px 8px}
 .ep-playing .ep-header .ep-finish-button{font-size:10px}
 .ep-playing .ep-main{display:flex;flex-direction:column;gap:14px;overflow:auto;overscroll-behavior:contain;padding:10px 10px 22px;scroll-padding-top:10px;overflow-anchor:none}
 .ep-playing .ep-main>*{flex-shrink:0;min-width:0}
 .ep-playing .ep-table-meta{flex-wrap:wrap;gap:6px 10px;order:0;font-size:11px}
 .ep-playing .ep-table-meta>strong{margin-left:auto;font-size:12px}
 .ep-playing .ep-table-meta>.ep-button{display:none}
 .ep-playing .ep-table-meta>span .ep-button{min-height:32px;font-size:10px}
 .ep-playing .ep-trends{flex:0 0 100%;gap:5px}
 .ep-playing .ep-trends>div{height:auto;min-height:58px;padding:6px}
 .ep-playing .ep-trends strong{font-size:10px;white-space:normal;line-height:1.4}
 .ep-playing .ep-trends small{font-size:10px;white-space:normal;line-height:1.4;margin-top:3px}
 .ep-playing .ep-table-shared{display:contents}
 .ep-playing .ep-panel{padding:10px;border-radius:10px}
 .ep-playing .ep-turn,.ep-playing[data-phase="build"] .ep-turn{display:flex;flex-direction:column;flex:0 0 auto;gap:10px;order:1}
 .ep-playing .ep-turn>.ep-section-head{flex-wrap:wrap;gap:5px;align-items:center}
 .ep-playing .ep-turn>.ep-section-head>div{max-width:75%}
 .ep-playing .ep-turn>.ep-section-head h2{font-size:17px}
 .ep-playing .ep-turn-hint{order:2;flex:0 0 100%;font-size:12px;text-align:left;line-height:1.5}
 .ep-playing .ep-turn>.ep-section-head>.ep-badge{margin-left:auto;font-size:10px}
 .ep-playing .ep-button{min-height:44px;padding:8px 10px;font-size:13px}
 .ep-playing .ep-market-scroll{overflow:auto;min-height:0;flex-shrink:0}
 .ep-playing .ep-market{width:max(100%,calc(var(--market-columns)*52px + 12px));min-width:0;height:170px;grid-template-columns:repeat(var(--market-columns),minmax(48px,1fr));grid-template-rows:64px 20px 64px;gap:4px;padding:6px}
 .ep-playing .ep-market button{min-width:44px;min-height:64px;padding:2px}
 .ep-playing .ep-market button>small{font-size:10px;line-height:12px}
 .ep-playing .ep-market .ep-tile{height:calc(100% - 12px);font-size:9px;gap:2px}
 .ep-playing .ep-market .ep-tile svg{width:28px;height:28px}
 .ep-playing .ep-market-flow{font-size:10px}
 .ep-playing .ep-market-scroll+.ep-muted{display:block;font-size:10px;line-height:1.5;margin:0!important}
 .ep-playing .ep-market-mobile-hint{display:inline}
 .ep-playing .ep-round-offers{gap:7px;flex:none}
 .ep-playing .ep-round-offers h3{font-size:13px}
 .ep-playing .ep-round-offers .ep-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:none;grid-auto-rows:202px;gap:8px;flex:none}
 .ep-playing .ep-round-offers .ep-card{display:flex;flex-direction:column;align-items:stretch;text-align:left;padding:9px 9px 82px;gap:5px}
 .ep-playing .ep-round-offers .ep-card>.ep-stage{font-size:9px}
 .ep-playing .ep-round-offers .ep-card>strong{font-size:12px;line-height:1.4}
 .ep-playing .ep-round-offers .ep-card>span:not(.ep-stage){font-size:11px;line-height:1.5}
 .ep-playing .ep-round-offers .ep-card>div{top:auto;bottom:10px;left:9px;right:auto}
 .ep-playing .ep-round-offers .ep-mask{grid-template-columns:repeat(5,8px);gap:2px}
 .ep-playing .ep-round-offers .ep-mask i{width:8px;height:8px}
 .ep-playing .ep-round-offers .ep-card-detail{right:7px;bottom:10px;font-size:11px;min-height:40px;min-width:44px;padding:4px 6px}
 .ep-playing .ep-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
 .ep-playing .ep-actions button{height:74px;min-height:74px;padding:6px;grid-template-rows:30px 20px;grid-template-columns:18px 1fr}
 .ep-playing .ep-actions small{font-size:11px}.ep-playing .ep-actions strong{font-size:25px}
 .ep-playing .ep-actions span,.ep-playing .ep-actions em{font-size:10px;line-height:18px}
 .ep-playing .ep-turn>.ep-primary{height:auto;min-height:44px;display:none}
 .ep-playing .ep-build-card{padding:10px;gap:14px;justify-content:space-between;flex-shrink:0}
 .ep-playing .ep-build-card h3{font-size:14px;margin:4px 0 6px!important}
 .ep-playing .ep-build-card p{font-size:12px;margin:0!important;line-height:1.6}
 .ep-playing .ep-build-card small{display:none}
 .ep-playing .ep-build-card>.ep-stage{font-size:10px}
 .ep-playing .ep-build-card .ep-mask{grid-template-columns:repeat(5,8px)}
 .ep-playing .ep-build-card .ep-mask i{width:8px;height:8px}
 .ep-playing .ep-build-controls{padding:0;gap:8px;display:block}
 .ep-playing .ep-build-controls>div{display:flex;flex-wrap:wrap;gap:6px}
 .ep-playing .ep-build-controls .ep-button{height:auto;min-height:40px;font-size:11px}
 .ep-playing .ep-build-controls>div>[data-do="undo_place"],.ep-playing .ep-build-controls>[data-do="confirm_build"]{display:none}
 .ep-playing .ep-build-controls>p{font-size:11px!important;text-align:left;line-height:1.6;margin-top:8px!important}
 .ep-playing .ep-all-cities{order:2;gap:10px;flex:0 0 auto}
 .ep-playing .ep-cities-heading{height:auto;flex-wrap:wrap;gap:3px}
 .ep-playing .ep-cities-heading h2{font-size:15px}.ep-playing .ep-cities-heading>span{font-size:10px}
 .ep-playing .ep-cities-grid{display:flex;flex-direction:column;gap:14px;flex:none}
 .ep-playing .ep-cities-grid>.ep-board-panel{display:flex;flex-direction:column;gap:10px;padding:10px;overflow:visible}
 .ep-playing .ep-cities-grid>.is-own-city{order:-1}
 .ep-playing .ep-board-panel .ep-section-head h2{font-size:15px;white-space:normal}
 .ep-playing .ep-board-panel .ep-section-head h2 small{display:block;font-size:10px}
 .ep-playing .ep-board-panel .ep-badge{font-size:10px}
 .ep-playing .ep-city-layout,.ep-playing .ep-modal-city .ep-city-layout{display:flex;flex-direction:column;gap:10px;height:auto;container-type:normal;align-items:stretch}
 .ep-playing .ep-city-layout>.ep-board,.ep-playing .ep-city-layout.has-hand>.ep-board,.ep-playing .ep-city-layout.has-end-cards>.ep-board,
 .ep-playing .ep-modal-city .ep-city-layout>.ep-board,.ep-playing .ep-modal-city .ep-city-layout.has-hand>.ep-board,.ep-playing .ep-modal-city .ep-city-layout.has-end-cards>.ep-board{width:100%;height:auto;max-width:440px;aspect-ratio:1;margin:0 auto;gap:4px;padding:5px;flex:none}
 .ep-playing .ep-cell>.ep-tile{font-size:9px;gap:2px;padding:2px}
 .ep-playing .ep-cell .ep-tile svg{width:34px;height:34px;max-height:65%}
 .ep-playing .ep-cell>span:not(.ep-tile){font-size:23px}
 .ep-playing .ep-city-hand{order:-1;width:100%;height:auto;max-height:none;flex:none;display:block}
 .ep-playing .ep-city-hand h3{font-size:12px;text-align:left;margin:0 0 6px!important}
 .ep-playing[data-phase="build"] .ep-city-hand .ep-hand{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:64px;gap:4px}
 .ep-playing[data-phase="build"] .ep-city-hand .ep-hand button{min-height:64px}
 .ep-playing[data-phase="build"] .ep-city-hand .ep-hand .ep-tile{font-size:9px}
 .ep-playing[data-phase="build"] .ep-city-hand .ep-hand svg{width:28px;height:28px}
 .ep-playing .ep-end-cards{width:100%;max-height:none;flex:none;gap:5px}
 .ep-playing .ep-end-cards h3{font-size:11px}
 .ep-playing .ep-end-cards ul{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;overflow:visible}
 .ep-playing .ep-end-cards button{font-size:11px;min-height:44px;padding:7px}
 .ep-playing .ep-end-cards button>span{font-size:10px}
 .ep-playing .ep-fuel-rack{gap:6px;min-height:64px;align-items:stretch}
 .ep-playing .ep-fuel-row{flex:1 1 0;flex-direction:column;gap:5px;align-items:center;padding:6px 0}
 .ep-playing .ep-fuel-label{display:block;flex:none;font-size:10px}
 .ep-playing .ep-fuel-stacks{justify-content:center;gap:4px;flex-wrap:wrap}
 .ep-playing .ep-fuel-pile{width:calc(22px + (var(--pile-size) - 1)*3px);height:calc(28px + (var(--pile-size) - 1)*3px)}
 .ep-playing .ep-fuel-card{width:22px;height:28px;left:calc(var(--tile-layer)*3px);top:calc(var(--tile-layer)*3px)}
 .ep-playing .ep-fuel-card svg{width:18px!important;height:18px!important}
 .ep-playing .ep-fuel-empty{width:22px;height:28px;font-size:9px}
 .ep-playing .ep-city-tools{flex-wrap:wrap;gap:6px}
 .ep-playing .ep-city-tools .ep-button{min-height:40px;padding:6px 9px;font-size:11px}
 .ep-playing .ep-shared-tracks{order:3;display:flex;flex-direction:column;flex:none;gap:10px}
 .ep-playing .ep-shared-tracks h2{font-size:15px}
 .ep-playing .ep-player-legend{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
 .ep-playing .ep-player-legend>span{font-size:11px}
 .ep-playing .ep-player-legend .ep-player-pawn{transform:scale(.85);margin-right:0}
 .ep-playing .ep-shared-tracks .ep-counter-pair{grid-template-columns:1fr;gap:12px}
 .ep-playing .ep-counter-heading h3{font-size:14px!important}.ep-playing .ep-counter-heading>span{font-size:10px}
 .ep-playing .ep-shared-tracks .ep-counter-column{height:276px;grid-template-rows:12px repeat(var(--track-rows),1fr)}
 .ep-playing .ep-shared-tracks .ep-counter-cell{font-size:13px;padding:2px 5px;gap:3px}
 .ep-playing .ep-counter-pawns{max-width:none;gap:1px;flex-wrap:wrap}
 .ep-playing .ep-counter-pawns .ep-player-pawn{width:15px;flex:0 0 15px;height:22px}
 .ep-playing .ep-counter-pawns .ep-player-pawn:before{width:7px;height:7px;left:4px}
 .ep-playing .ep-counter-pawns .ep-player-pawn:after{inset:6px 0 0}
 .ep-playing .ep-counter-pawns .ep-player-pawn>span{font-size:8px;line-height:14px}
 .ep-playing .ep-shared-tracks .ep-track-note{font-size:10px!important;line-height:1.5!important;white-space:normal}
 .ep-playing .ep-table-status{order:4;flex-wrap:wrap;gap:8px;font-size:10px}
 .ep-playing .ep-table-status .ep-button{min-height:40px;font-size:11px;padding:5px 10px}
 .ep-playing .ep-error,.ep-playing .ep-notice{position:static;order:-1;font-size:13px}
 .ep-playing .ep-mobile-nav{display:flex;flex-direction:column;flex:0 0 auto;background:#fffdf5;border-top:1px solid #b8cbb9;box-shadow:0 -3px 14px #254c441a;padding:6px 10px max(6px,env(safe-area-inset-bottom));gap:5px;z-index:2}
 .ep-mobile-links{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
 .ep-mobile-links button{min-height:42px;font-family:inherit;font-size:11px;font-weight:600;line-height:1.3;background:#edf3e8;color:#315d4e;border:1px solid #d4dfca;border-radius:7px;padding:5px 2px}
 .ep-mobile-links button:focus-visible{outline:2px solid #267768;outline-offset:1px}
 .ep-mobile-confirm{display:flex;gap:7px}.ep-mobile-confirm>.ep-primary{flex:1}
 .ep-playing .ep-mobile-confirm .ep-button{min-height:44px}
 .ep-playing[data-phase="fuel"] .ep-turn{justify-content:flex-start}
 .ep-playing[data-phase="fuel"] .ep-turn>p:not(.ep-eyebrow){font-size:12px;line-height:1.7}
 .ep-playing .ep-fuel-summary{gap:5px}.ep-playing .ep-fuel-summary>div{grid-template-columns:1fr;text-align:center;font-size:11px;padding:8px 4px}
 .ep-playing .ep-fuel-summary svg{grid-row:auto;justify-self:center}
 .ep-playing[data-phase="finished"] .ep-results{order:1;flex:none;overflow:visible}
 .ep-playing .ep-score-heading{align-items:flex-start;flex-direction:column;gap:4px;height:auto;min-height:0;margin-bottom:10px}
 .ep-playing .ep-score-heading h2{white-space:normal}
 .ep-playing .ep-score-heading:after{content:'左右にスクロールして内訳を確認できます';font-size:10px;color:#64786b}
 .ep-playing .ep-results .ep-table-scroll{max-width:100%;overflow:auto;margin:0}
 .ep-playing .ep-score-table{min-width:850px}
 .ep-playing .ep-score-table tbody th,.ep-playing .ep-score-table .ep-score-groups th:first-child{position:sticky;left:0;background:#f1f5e9;z-index:1}
 .ep-playing .ep-score-table [data-result-column="total"]{position:sticky;right:0;background:#f4efd6;z-index:1}
 .ep-playing .ep-score-table .ep-score-value{min-height:48px}
 .ep-playing .ep-score-table .ep-score-value strong{font-size:19px}
 .ep-playing .ep-score-table .ep-score-value small{font-size:9px;line-height:12px}
 .ep-playing[data-phase="finished"] .ep-results .ep-score-note{font-size:11px!important;line-height:1.6!important}
 .ep-playing .ep-modal .ep-button{min-height:42px}
 .ep-playing .ep-modal-city{padding:12px;max-height:calc(100dvh - 28px)}
 .ep-playing .ep-modal-city .ep-board-panel{padding:0}
 .ep-playing .ep-modal-city .ep-fuel-rack{height:auto}
 .ep-playing .ep-modal-city .ep-city-tools .ep-button{min-height:40px;font-size:11px}
 .ep-playing .ep-main.ep-aux-view{display:block}.ep-playing .ep-aux-view .ep-panel{padding:16px;margin:0 auto}
 .ep-playing .ep-aux-view input{font-size:16px}
 .ep-playing .ep-opening-shade{position:fixed;inset:54px 0 0;gap:10px;padding:12px;justify-content:center}
 .ep-playing .ep-opening-heading h2{font-size:23px}.ep-playing .ep-opening-heading>span{font-size:12px}
 .ep-playing .ep-opening-cards{width:100%;flex-direction:column;gap:10px}
 .ep-playing .ep-opening-cards .ep-trend-reveal{width:100%;height:clamp(96px,17dvh,130px);flex-shrink:0}
 .ep-playing .ep-opening-cards .ep-trend-back{gap:7px;padding:10px}.ep-playing .ep-opening-cards .ep-trend-back>span{font-size:28px}.ep-playing .ep-opening-cards .ep-trend-back strong{font-size:14px}
 .ep-playing .ep-opening-cards .ep-trend-front{padding:12px;gap:6px;display:grid;grid-template-columns:32px 1fr;align-content:center}
 .ep-playing .ep-opening-cards .ep-trend-front>span{grid-column:1/-1;font-size:9px}.ep-playing .ep-opening-cards .ep-trend-front>b{grid-row:2/4;font-size:24px}
 .ep-playing .ep-opening-cards .ep-trend-front h3{font-size:16px}.ep-playing .ep-opening-cards .ep-trend-front p{font-size:12px;line-height:1.5}
 .ep-playing .ep-lottery-cards{width:100%;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .ep-playing .ep-lottery-slot{gap:6px}.ep-playing .ep-lottery-position{font-size:20px}.ep-playing .ep-lottery-position small{font-size:9px;margin-left:4px}
 .ep-playing .ep-lottery-card{width:100%;height:clamp(132px,23dvh,172px)}.ep-playing .ep-lottery-card .ep-trend-front{padding:7px;gap:3px}
 .ep-playing .ep-lottery-card .ep-trend-front h3{font-size:13px}.ep-playing .ep-lottery-pawn{width:45px;height:45px}
 .ep-playing .ep-lottery-pawn .ep-player-pawn{transform:none;width:18px;height:28px;flex-basis:18px}.ep-playing .ep-lottery-pawn .ep-player-pawn:before{width:9px;height:9px;left:4px}.ep-playing .ep-lottery-pawn .ep-player-pawn:after{inset:8px 0 0}.ep-playing .ep-lottery-pawn .ep-player-pawn>span{font-size:10px;line-height:17px}.ep-playing .ep-lottery-card .ep-draw-support{gap:4px;padding:5px}
 .ep-playing .ep-lottery-card .ep-trend-back{padding:8px;gap:6px}.ep-playing .ep-lottery-card .ep-trend-back svg{width:28px;height:28px}.ep-playing .ep-lottery-card .ep-trend-back strong{font-size:35px}.ep-playing .ep-lottery-card .ep-trend-back small{font-size:7px;letter-spacing:.15em}
 .ep-playing .ep-lottery-card .ep-draw-support strong{font-size:22px}.ep-playing .ep-opening-note{font-size:10px;text-align:center}
 @media(max-height:650px){.ep-playing .ep-opening-heading>p{display:none}.ep-playing .ep-opening-heading h2{font-size:20px;margin-bottom:5px!important}.ep-playing .ep-lottery-pawn{height:28px;width:28px;margin:0}.ep-playing .ep-lottery-card .ep-draw-support{padding:4px 0;margin:0}.ep-playing .ep-lottery-card .ep-draw-support svg{width:18px;height:18px}.ep-playing .ep-lottery-card .ep-draw-support span{font-size:9px}.ep-playing .ep-opening-cards .ep-trend-front{padding:7px;gap:3px}.ep-playing .ep-opening-cards .ep-trend-front h3{font-size:14px}.ep-playing .ep-opening-cards .ep-trend-front p{font-size:11px}}
 .ep-lobby-screen input,.ep-lobby-screen .ep-profile input,.ep-lobby-screen .ep-join input{font-size:16px}
 .ep-lobby-home .ep-button,.ep-lobby-screen .ep-button{min-height:44px;font-size:13px}
 .ep-lobby-home .ep-profile{padding:14px}.ep-lobby-home .ep-profile label{font-size:12px}
 .ep-lobby-screen .ep-room-list button{min-height:52px;font-size:12px}
 .ep-lobby-screen .ep-hero h1{font-size:27px}.ep-lobby-screen .ep-hero .ep-lead{font-size:12px}
 .ep-lobby-screen .ep-main{padding:12px}.ep-lobby-screen .ep-header{padding:8px 12px}
 .ep-lobby-screen .ep-brand strong{font-size:17px}.ep-lobby-screen .ep-header .ep-button{min-height:36px}
 .ep-ready-screen .ep-main{overflow:auto}.ep-ready-screen .ep-waiting{flex:none;min-height:100%;gap:8px}
 .ep-ready-screen .ep-ready-grid{flex:none;grid-template-rows:auto auto;gap:8px}
 .ep-ready-screen .ep-ready-players{padding:8px}.ep-ready-screen .ep-seat{min-height:80px}
 .ep-ready-screen .ep-seat-identity strong{font-size:12px}.ep-ready-screen .ep-ready-table-note{display:none}
 .ep-ready-screen .ep-room-code .ep-button{min-height:36px;font-size:10px}
 .ep-ready-screen .ep-npc-counter .ep-button{width:44px;min-height:44px}
 .ep-ready-screen .ep-invite .ep-button{min-height:40px;font-size:11px}.ep-ready-screen .ep-invite input{font-size:16px;height:34px}
 .ep-ready-screen .ep-ready-bottom{padding:9px;gap:7px}.ep-ready-screen .ep-ready-bottom .ep-button{min-height:44px}
 @media(max-width:360px){
  .ep-playing .ep-header .ep-brand{display:none}.ep-playing .ep-header .ep-user{justify-content:space-between}
  .ep-playing .ep-round-offers .ep-cards{grid-auto-rows:226px}
  .ep-playing .ep-city-hand{overflow-x:auto}.ep-playing[data-phase="build"] .ep-city-hand .ep-hand{min-width:296px}
  .ep-playing .ep-cell .ep-tile svg{width:28px;height:28px}.ep-playing .ep-cell>.ep-tile{font-size:8px}
  .ep-ready-screen .ep-seat-identity strong{font-size:10px}
 }
}
