:root{--cream:#f7f0df;--text:#263d44;--muted:#657a78;--border:#d5c6ac;--shadow:0 6px 24px #65512b1a;--blue:#165c92;--green:#16865a;--red:#aa3335;--purple:#75346f;--gold:#e5b83f;--radius:19px;color-scheme:light}
*{box-sizing:border-box}html{background:var(--cream);scroll-behavior:smooth}body{margin:0;min-height:100vh;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;color:var(--text);background:radial-gradient(circle at 12% 20%,#fff9e9 0,transparent 33%),radial-gradient(circle at 85% 62%,#e3efdb 0,transparent 30%),var(--cream)}button,input,select{font:inherit}button{cursor:pointer;touch-action:manipulation}button:disabled{cursor:not-allowed;opacity:.48}a{color:#236d91}.container{max-width:1180px;margin:0 auto;padding:14px 15px 104px}header{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:14px}.brand{font-size:19px;letter-spacing:-.6px;font-weight:900;color:#2c5962;display:flex;align-items:center;gap:6px}.logo-die{width:38px;height:38px;border:2px solid #d9c49c;background:#fffaf0;display:grid;place-items:center;border-radius:12px;font-size:22px}.eyebrow{font-size:11px;font-weight:800;letter-spacing:2px;color:#8b7b57;text-transform:uppercase}.muted{color:var(--muted)}.subtitle{font-size:13px;line-height:1.5;color:var(--muted)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:45px;border:1px solid transparent;border-radius:13px;padding:11px 17px;color:#193b46;font-weight:750;background:#fffdf6;box-shadow:0 2px 0 #0000000d;white-space:normal;text-align:center}.btn.primary{background:#2e7b80;color:#fff;border-color:#22656b}.btn.dark{background:#294d55;color:#fff}.btn.gold{background:#e7ba43;border-color:#c99b25;color:#48340e}.btn.soft{border-color:#dacdae;background:#fff8e8}.btn.ghost{background:transparent;border-color:#d6c7a7}.btn.small{font-size:12px;min-height:34px;padding:7px 10px}.btn:focus-visible,.mini-card:focus-visible,.landmark:focus-visible{outline:3px solid #59a5d1;outline-offset:2px}.card-panel{background:#fffdf7e8;border:1px solid #e1d7bd;box-shadow:var(--shadow);border-radius:var(--radius);padding:20px}.hero{margin-top:12px;padding:30px 18px;text-align:center;position:relative;overflow:hidden;max-width:600px;margin-left:auto;margin-right:auto}.hero:before{content:'☁️';position:absolute;top:20px;left:15px;font-size:30px;opacity:.52}.hero:after{content:'☁️';position:absolute;top:35px;right:15px;font-size:25px;opacity:.5}.city{font-size:66px;line-height:1.4;margin:8px 0 2px;filter:drop-shadow(0 5px 0 #9f8f6744)}h1{font-size:34px;line-height:1.15;letter-spacing:-1.6px;margin:7px 0 8px;color:#2e6670}h2{font-size:20px;letter-spacing:-.6px;margin:0 0 8px}h3{font-size:15px;margin:0 0 10px}.buttonstack{display:grid;gap:10px;margin:22px auto 0;max-width:330px}.hero-note{font-size:11px;color:#8c7c68;max-width:360px;margin:18px auto 0;line-height:1.5}.form-wrap{max-width:450px;margin:22px auto}.form-grid{display:grid;gap:12px}.label{display:block;font-size:12px;font-weight:800;margin:7px 0;color:#476468}.input{width:100%;padding:13px 14px;background:#fff;border:1px solid #cfc8b9;border-radius:12px;outline:0;color:var(--text);font-size:16px}.input:focus{border-color:#32949d;box-shadow:0 0 0 3px #59b6ac30}.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.between{display:flex;justify-content:space-between;gap:8px;align-items:center}.pill{border-radius:99px;border:1px solid #d7cfb5;padding:6px 10px;background:#fff7e6;font-size:12px;display:inline-flex;gap:5px;align-items:center;font-weight:700}.pill.live{background:#e5f2e5;border-color:#c1dcc5;color:#257553}.room-code{font-size:38px;letter-spacing:3px;text-align:center;font-weight:950;margin:10px 0;user-select:all;color:#236470}.room-invite{border:1px dashed #b9aa8c;padding:15px;background:#fff9e9;border-radius:14px;margin:12px 0}.seat{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #efe7d8;padding:11px 1px}.seat:last-child{border:0}.seat-index{display:inline-grid;place-items:center;border-radius:50%;background:#ddede9;color:#366d69;width:32px;height:32px;font-weight:800;margin-right:8px}.gamebar{background:#fffdf7df;border:1px solid #e1d7be;padding:12px;border-radius:17px;margin-bottom:11px;box-shadow:0 4px 15px #5849230e}.players{display:flex;gap:9px;overflow-x:auto;scrollbar-width:none;padding:2px 1px 9px}.player{min-width:124px;flex:1 0 115px;max-width:220px;background:#fffdfa;border:1px solid #ded4bd;border-radius:13px;padding:10px 11px}.player.on{border-color:#3b9395;box-shadow:0 0 0 2px #67c4c440;background:#f2fffc}.player .who{font-size:12px;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.player .coins{font-size:22px;font-weight:950;margin-top:3px;color:#a77d1a}.current-line{padding:7px 0 3px;font-size:13px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}.bubble{font-weight:800;border-radius:9px;background:#e9f1ec;padding:7px 10px;color:#345b55}.mini-heading{display:flex;justify-content:space-between;align-items:center;margin:19px 2px 9px}.mini-heading h2{font-size:16px;margin:0}.market-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px}.mini-card{position:relative;min-height:107px;border:1px solid #b6b8ae;border-radius:10px;overflow:hidden;display:flex;flex-direction:column;text-align:center;justify-content:space-between;background:#fff;box-shadow:0 3px 0 #5e5a4923;padding:0;color:var(--text);transition:transform .12s}.mini-card:active{transform:scale(.96)}.mini-card.none{opacity:.42;filter:grayscale(.7)}.mini-top{background:var(--card-color);color:#fff;font-size:16px;padding:4px 2px;font-weight:950;letter-spacing:.4px}.mini-card .art{background:linear-gradient(160deg,#f1fbff,#fffbec 65%,#e0efd6);font-size:29px;flex:1;display:flex;align-items:center;justify-content:center;min-height:45px}.mini-card .card-name{font-size:9px;line-height:1.1;font-weight:800;min-height:21px;padding:2px 2px;color:#273b42;display:flex;align-items:center;justify-content:center}.mini-bottom{background:var(--card-color);color:#fff;display:flex;justify-content:space-between;align-items:center;padding:2px 4px;font-size:11px;font-weight:850}.coin-inline{display:inline-flex;align-items:center;gap:4px;white-space:nowrap;font-weight:950;color:#7b5608}.coin-dot{display:inline-block;width:1.02em;height:1.02em;border-radius:50%;vertical-align:-.08em;background:radial-gradient(circle at 32% 30%,#fff8ba 0 20%,#f6d763 24%,#edbb2e 58%,#c8870f 100%);border:1px solid #c48b0f;box-shadow:inset 0 1px 1px #fff8d3cc,inset 0 -1px 1px #a96d0966,0 1px 0 #fff7}.coin-price{display:inline-flex;align-items:center;gap:4px;background:transparent;color:#63480e;border:0;padding:0;border-radius:0;font-weight:950}.coin-price .coin-dot{font-size:.95em}.landmark-row{display:flex;overflow-x:auto;gap:7px;scrollbar-width:none;padding-bottom:6px}.landmark{width:82px;min-width:82px;min-height:98px;border-radius:10px;background:#f0ebe0;border:2px dashed #c8c0b0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:2px;padding:6px 4px;text-align:center;color:#726b5b}.landmark.open{background:#fdf4d6;border:2px solid #d9b450;color:#6e5719}.landmark .symbol{font-size:29px}.landmark .name{font-size:10px;font-weight:850;line-height:1.07}.landmark .cost{font-size:11px;font-weight:900}.owned-grid{display:flex;gap:5px;flex-wrap:wrap}.owned-chip{border:1px solid #d5c7a8;border-radius:8px;padding:5px 7px;background:#fffcf3;font-size:12px;display:flex;gap:4px;align-items:center}.owned-chip b{color:#bd841f}.bottom-panel{position:sticky;bottom:0;z-index:10;background:#fffaf3f8;backdrop-filter:blur(12px);padding:12px max(13px,env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(13px,env(safe-area-inset-left));margin:22px -15px -104px;border-top:1px solid #dfd2b9;box-shadow:0 -6px 22px #67512615}.actions{display:flex;gap:8px;max-width:1180px;margin:0 auto}.actions .btn{flex:1;min-width:0}.action-note{font-size:12px;color:#677e7a;margin:0 0 9px;line-height:1.45}.dice{font-size:25px;line-height:1.3}.turn-log{border-radius:13px;background:#fffdf8;border:1px solid #e5dac3;padding:13px;margin-top:14px}.turn-log details summary{cursor:pointer;font-weight:800;font-size:13px}.turn-log li{font-size:12px;line-height:1.55;color:#59706e;margin:4px 0}.overlay{position:fixed;inset:0;z-index:90;background:#163238b0;display:flex;align-items:flex-end;justify-content:center;padding:12px 12px calc(12px + env(safe-area-inset-bottom))}.dialog{background:#fffdf5;max-height:89vh;overflow:auto;width:min(100%,490px);border-radius:20px;padding:17px 18px 20px;box-shadow:0 15px 50px #061d2499}.detail-art{border-radius:14px;display:grid;place-items:center;min-height:145px;background:linear-gradient(150deg,#cee9f4 0%,#fff7db 58%,#deecc7 100%);font-size:85px;margin:10px 0}.detail-head{background:var(--card-color);padding:7px 12px;border-radius:12px 12px 0 0;color:#fff;text-align:center;font-size:23px;font-weight:900}.detail-desc{font-size:14px;line-height:1.55;color:#476369;margin:12px 0}.modal-footer{display:flex;gap:8px}.modal-footer .btn{flex:1}.warn{font-size:12px;color:#aa6148;line-height:1.5}.form-select{width:100%;border:1px solid #c9bfa9;border-radius:10px;font-size:16px;padding:9px 10px;background:white;margin-top:5px}.small-note{font-size:11px;line-height:1.5;color:#778784}.demo-tag{color:#73602d;font-size:10px;background:#f0e7c8;padding:4px 8px;border-radius:6px;font-weight:800}.hidden{display:none!important}#toast{position:fixed;z-index:120;left:50%;bottom:calc(86px + env(safe-area-inset-bottom));transform:translateX(-50%);padding:11px 15px;background:#264b53;color:white;border-radius:12px;opacity:0;pointer-events:none;transition:opacity .22s;font-size:13px;font-weight:700;max-width:92vw;box-shadow:0 8px 20px #1238}#toast.show{opacity:1}.loading{text-align:center;padding:90px 0;font-weight:800;color:#55818b}
@media(min-width:670px){.market-grid{grid-template-columns:repeat(10,minmax(0,1fr));gap:10px}.mini-card{min-height:155px}.mini-card .art{font-size:40px;min-height:80px}.mini-card .card-name{font-size:11px;min-height:29px}.mini-top{font-size:19px}.landmark{min-width:114px;width:114px;min-height:130px}.landmark .symbol{font-size:37px}.landmark .name{font-size:12px}.container{padding-bottom:120px}.bottom-panel{margin-bottom:-120px}.hero{padding:38px 30px}}
@media(min-width:1000px){.mini-card{min-height:178px}.mini-card .art{min-height:92px;font-size:49px}.mini-card .card-name{font-size:12px}.gamebar{padding:16px}}
@media(max-width:340px){.mini-card .card-name{font-size:8px}.mini-card .art{font-size:26px}.mini-card{min-height:102px}}

/* 0.2: readable market cards and a prominent dice result near turn controls. */
.market-grid{align-items:stretch}
.mini-card{min-width:0;max-width:100%;}
.mini-card .art{min-width:0;overflow:hidden;line-height:1.05;white-space:nowrap;}
.mini-card .card-name{width:100%;min-width:0;max-width:100%;font-size:9px;line-height:1.18;min-height:31px;max-height:40px;overflow:hidden;overflow-wrap:anywhere;padding:3px 2px;text-wrap:balance;}
.mini-bottom .coin-price{padding:1px 3px;white-space:nowrap}
.result-chip{color:#25595c;background:#e0f4e8;border-color:#bcdcc9}
.dice-indicator{display:flex;justify-content:space-between;gap:14px;align-items:center;border:1px solid #a4c7c1;background:linear-gradient(105deg,#e5f6ec,#f6f9e9);border-radius:14px;padding:8px 14px;margin-bottom:10px;color:#214c51;box-shadow:0 2px 6px #253f3510;flex-wrap:wrap;}
.dice-caption{font-size:12px;font-weight:850;letter-spacing:.2px;white-space:nowrap}
.dice-equation{display:flex;align-items:center;justify-content:center;gap:7px;flex-wrap:wrap;}
.die-piece{display:inline-flex;align-items:center;gap:2px;white-space:nowrap;}
.die-face{font-size:32px;line-height:1;color:#235f66;}
.die-number{font-size:14px;font-weight:900;}
.dice-operation{font-size:17px;font-weight:850;color:#6f7e7b;}
.dice-total{font-size:34px;line-height:1;font-weight:950;min-width:35px;text-align:center;color:#174c55;}
.dice-bonus{font-size:10px;border-radius:8px;background:#fcf0bf;color:#7e5714;font-weight:850;padding:5px 7px;}
.dice-wait{font-size:13px;font-weight:800;color:#678681}
@media(min-width:670px){.mini-card .card-name{font-size:9.5px;min-height:34px;max-height:45px}.mini-card .art{font-size:38px;min-height:66px}}
@media(min-width:1000px){.mini-card .card-name{font-size:10px}.mini-card .art{font-size:43px}}
@media(max-width:560px){.dice-indicator{padding:7px 11px;gap:5px;}.dice-face{font-size:27px;}.dice-total{font-size:31px;}.dice-caption{font-size:11px}.dice-equation{gap:5px}.mini-card .card-name{font-size:8.6px;min-height:28px;max-height:40px}.mini-bottom{font-size:9px;padding:2px 2px}}

/* 0.3: complete, tap-friendly card details and unmistakable Port action. */
.owned-chip{cursor:pointer;color:var(--text);font-family:inherit}.owned-chip:hover,.owned-chip:focus-visible{background:#f5e8c9;border-color:#b59253;outline-offset:2px}
.detail-dialog{max-height:min(92dvh,820px);scrollbar-width:thin;overscroll-behavior:contain}
.detail-dialog .detail-art{font-size:54px;min-height:105px;margin:8px 0}.detail-dialog h2{margin:8px 0 13px;font-size:22px}
.detail-section{background:#fffaf0;border:1px solid #eee2c9;border-radius:11px;padding:11px 12px;margin:8px 0}
.detail-section p{font-size:13.5px;line-height:1.46;color:#38595f;margin:5px 0 0;overflow-wrap:break-word}
.detail-label{font-size:10px;font-weight:950;letter-spacing:.6px;text-transform:uppercase;color:#81724d}
.detail-example{background:#edf8f3;border-color:#c7ddd2}.detail-pills{display:flex;gap:6px;flex-wrap:wrap;margin:13px 0}
.port-notice{background:#fff0bb;border:2px solid #dca02d;border-radius:12px;padding:12px;color:#76500c;display:flex;flex-direction:column;gap:3px;margin-bottom:10px;box-shadow:0 2px 8px #936c1328}
.port-notice strong{font-size:16px;color:#704700}.port-notice span{font-size:13px;line-height:1.45}
.rule-hint{margin-top:8px;background:#e9f2ef;border:1px solid #c7dfd5;padding:7px;border-radius:8px;font-size:12px;color:#376c66}
@media(min-width:670px){.detail-dialog{max-width:540px}.overlay{align-items:center}}
@media(max-width:560px){.detail-dialog .detail-art{min-height:85px;font-size:49px}.detail-section{padding:9px 10px}.detail-dialog h2{font-size:19px}}

/* 0.4: table layout around the market, recognizable miniature cards for every player. */
.container.game-screen{max-width:1440px;padding-bottom:118px}
.gamebar-compact{padding:10px 13px;margin-bottom:12px}
.gamebar-compact .current-line{padding-top:8px}
.compact-help{margin-left:auto;font-size:11px}
.table-board{display:grid;grid-template-columns:minmax(158px,185px) minmax(0,1fr) minmax(158px,185px);grid-template-areas:"nw center ne" "sw center se";gap:12px;align-items:start}
.player-seat{min-width:0;border:1px solid #cdd5c6;background:#fffcf3;border-radius:13px;padding:10px 9px;box-shadow:0 3px 11px #3e543314;overflow:hidden}
.player-seat[data-seat="nw"]{grid-area:nw}.player-seat[data-seat="ne"]{grid-area:ne}.player-seat[data-seat="sw"]{grid-area:sw}.player-seat[data-seat="se"]{grid-area:se}.player-seat[data-seat="fifth"]{grid-area:fifth}
.table-board.players-5{grid-template-areas:"nw center ne" "sw center se" ". center fifth"}
.player-seat.is-turn{border:2px solid #3f9b8d;background:#f0fbf4;box-shadow:0 0 0 3px #55b7a326}
.player-seat.is-you .seat-title .seat-num{background:#225f76}
.seat-top{display:flex;align-items:flex-start;justify-content:space-between;gap:5px}
.seat-title{display:flex;align-items:center;gap:5px;min-width:0}
.seat-num{display:grid;place-items:center;width:20px;height:20px;border-radius:7px;background:#75827b;color:white;font-size:11px;font-weight:900;flex-shrink:0}
.seat-player-name{font-size:12px;line-height:1.15;font-weight:900;overflow-wrap:anywhere;min-width:0}
.seat-player-name small{display:block;font-size:9px;font-weight:800;color:#258577;margin-top:3px}
.seat-money{display:inline-flex;align-items:center;gap:5px;font-size:13px;white-space:nowrap;font-weight:950;color:#956a16}
.seat-subtitle{font-size:10px;color:#687a77;margin:9px 0 7px;font-weight:750}
.seat-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;max-height:260px;overflow-y:auto;scrollbar-width:thin}
.seat-empty{grid-column:1/-1;color:#8e9994;font-size:10px;padding:10px 0}
.seat-card{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:space-between;min-width:0;min-height:72px;padding:0;border:1px solid #b4c2b6;border-radius:6px;overflow:hidden;background:linear-gradient(#f2f9fb,#fef9e6);color:#2c3b3a;cursor:pointer}
.seat-card:hover,.seat-card:focus-visible{outline:2px solid #e6ac33;outline-offset:0;transform:translateY(-1px)}
.seat-card-value{width:100%;height:16px;line-height:16px;background:var(--card-color);color:white;text-align:center;font-size:10px;font-weight:950}
.seat-card-emoji{font-size:23px;line-height:1.25;min-height:30px;display:grid;place-items:center}
.seat-card-label{font-size:7px;line-height:1.03;font-weight:750;padding:1px;max-height:17px;min-height:15px;overflow:hidden;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.seat-card-quantity{position:absolute;right:1px;top:17px;z-index:1;background:#ffe37f;border-radius:6px;padding:0 2px;font-size:9px;font-weight:950;color:#67450c;border:1px solid #cfa547}
.seat-landmarks{display:flex;flex-wrap:wrap;gap:3px;align-items:center;margin-top:9px;border-top:1px dashed #e6dfd1;padding-top:6px}
.seat-landmarks-label{font-size:9px;color:#7d745d;font-weight:800;margin-right:3px}
.seat-landmark{background:#fff7db;border:1px solid #d6b86b;cursor:pointer;border-radius:6px;padding:2px;font-size:14px;line-height:1.2}



.table-center{grid-area:center;min-width:0;padding:0 1px}
.table-center .mini-heading{margin:10px 0 7px}.table-center .mini-heading h2{font-size:14px}
.table-center .mini-heading .muted{font-size:10px}
/* On a typical 1200-1400px monitor: market cards about 15% narrower and shorter. */
.table-center .market-grid{gap:6px}
.table-center .mini-card{min-height:150px}
.table-center .mini-card .mini-top{font-size:15px;padding:2px 1px}
.table-center .mini-card .art{min-height:63px;font-size:35px}
.table-center .mini-card .card-name{font-size:8.5px;min-height:31px;max-height:40px}
.table-center .mini-card .mini-bottom{font-size:9px;padding:2px 3px}
.table-center .mini-card .coin-price{font-size:9px}
.table-center .landmark{min-width:0;width:calc((100% - 36px)/7);min-height:95px;flex:1;padding:5px 2px}
.table-center .landmark .symbol{font-size:26px}.table-center .landmark .name{font-size:9px}.table-center .landmark .cost{font-size:9px}
.control-tray{max-width:1440px;margin:0 auto}
/* CSS drawing of die faces and a tumble that lands in the existing results tray. */
.die-tile{display:inline-grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);padding:7px;width:43px;height:43px;border:1.5px solid #afc5c8;border-radius:9px;background:linear-gradient(135deg,#fff,#fafbf2);box-shadow:0 3px 0 #789199,0 5px 8px #334f3c2a;flex-shrink:0;transform-origin:center}
.die-pip{display:block;border-radius:50%;width:7px;height:7px;place-self:center;background:#264f5c;box-shadow:inset 0 1px 1px #13262d80}
.die-piece{display:inline-flex;align-items:center;gap:4px}
.die-number{font-size:13px;font-weight:950;color:#375e60}
.dice-equation{min-height:48px}
.dice-rolling{border-color:#dfbd5d;background:linear-gradient(95deg,#fff0c7,#ecf7e6)}
.dice-rolling .die-tile.tumbling{animation:die-toss .94s cubic-bezier(.18,.55,.23,1) both}
.dice-rolling .die-piece:nth-child(2) .die-tile{animation-delay:.07s}
.dice-rattle{font-weight:850;color:#ad7d26}
@keyframes die-toss{0%{transform:translate3d(-14px,-23px,0) rotate(-270deg) scale(.78);filter:blur(1px)}28%{transform:translate3d(8px,-16px,0) rotate(-120deg) scale(1.1)}58%{transform:translate3d(-4px,-10px,0) rotate(45deg) scale(.98)}75%{transform:translate3d(3px,1px,0) rotate(-13deg) scale(1.05)}89%{transform:translate3d(0,-6px,0) rotate(5deg)}100%{transform:translate3d(0,0,0) rotate(0) scale(1);filter:none}}
@media(max-width:1100px) and (min-width:801px){.table-board{grid-template-columns:minmax(130px,152px) minmax(0,1fr) minmax(130px,152px);gap:8px}.seat-card-emoji{font-size:21px}.seat-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.table-center .mini-card{min-height:133px}.table-center .mini-card .art{font-size:29px;min-height:53px}}
@media(max-width:800px){
 .container.game-screen{padding-left:10px;padding-right:10px}
 .table-board{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:"nw ne" "center center" "sw se";gap:8px}
 .table-board.players-5{grid-template-areas:"nw ne" "center center" "sw se" ". fifth"}
 .player-seat{padding:8px}.seat-cards{display:flex;flex-wrap:nowrap;overflow-x:auto;max-height:none;padding-bottom:3px}
 .seat-card{min-width:51px;width:51px;min-height:72px;flex:0 0 51px}.seat-card-emoji{font-size:22px}

 .seat-player-name{font-size:12px}.seat-money{font-size:12px}
 .table-center .market-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}
 .table-center .mini-card{min-height:96px}.table-center .mini-card .mini-top{font-size:12px}
 .table-center .mini-card .art{font-size:26px;min-height:39px}
 .table-center .mini-card .card-name{font-size:8px;min-height:28px;max-height:33px}
 .table-center .mini-card .mini-bottom{font-size:9px;padding:2px}
 .table-center .landmark{min-width:65px;width:75px;flex:0 0 75px;min-height:85px}
 .compact-help{display:none}
 .table-center .mini-heading{margin:15px 2px 7px}
 .bottom-panel{margin-left:-10px;margin-right:-10px}
}
@media(max-width:440px){.seat-card{min-width:47px;width:47px;flex-basis:47px}.seat-card-emoji{font-size:21px}.seat-card-label{font-size:6.8px}.seat-top{flex-wrap:wrap}.table-center .mini-card .art{font-size:24px}.table-center .mini-card .card-name{font-size:7.5px}.die-tile{width:36px;height:36px;padding:6px}.die-pip{width:6px;height:6px}.dice-equation{min-height:39px}.dice-indicator{gap:5px}.dice-total{font-size:26px}}
@media(prefers-reduced-motion:reduce){.dice-rolling .die-tile.tumbling{animation:none}}

/* 0.4.2: readable white prices on colored market card footers */
.mini-bottom .coin-price,.mini-bottom .coin-price > span:last-child { color:#fff; text-shadow:0 1px 1px rgba(0,0,0,.20); }

/* 0.5: game seats can be human or computer. */
.local-player-field{background:#fffaf0;border:1px solid #e5d9bf;padding:10px 12px;margin:8px 0;border-radius:13px}.local-player-field .label{margin:7px 0 2px}.seat-kind{width:auto;min-width:127px;font-size:13px;margin:0;padding:6px 9px}.bot-setup{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:14px;font-weight:800;padding:7px 0}.bot-level{width:auto;min-width:112px;font-size:13px;margin:0;padding:8px}.bot-add-row{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-top:15px;padding:11px;border:1px dashed #cbbd9c;border-radius:12px;background:#fff9e9}.bot-thinking{background:#ecf5ff;border:1px solid #c5dbed;border-radius:11px;padding:10px;animation:botGlow 1.5s ease-in-out infinite alternate}@keyframes botGlow{from{background:#ecf5ff}to{background:#e0f6e7}}@media(max-width:400px){.seat-kind{min-width:110px}}


/* 0.5.2: high-contrast category symbol on every card (market and every player's hand). */
.mini-card .art{position:relative;isolation:isolate}
.mini-card .art .art-emoji{display:inline-block;transform:translateX(-4px)}
.card-type-stamp{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;background:#fffdf4;color:#304451;border:1.4px solid #536568;border-radius:6px;box-shadow:0 1px 2px #17262840;line-height:1}
.card-type-svg{width:76%;height:76%;display:block;overflow:visible}
.mini-card .card-type-stamp.type-market{position:absolute;z-index:2;right:4px;bottom:6px;width:25px;height:25px;pointer-events:none}
.seat-card .card-type-stamp.type-owned{position:absolute;z-index:2;top:19px;left:2px;width:20px;height:20px;pointer-events:none;border-width:1.2px;border-radius:5px}
.seat-card .seat-card-emoji{transform:translateX(5px)}
.detail-dialog .detail-art{position:relative}
.detail-dialog .card-type-stamp.type-detail{position:absolute;top:12px;right:12px;width:56px;height:56px;border-radius:12px;border-width:2px}
.detail-category{display:flex;align-items:center;gap:8px;margin:4px 0 14px;color:#38575c;font-size:13px;font-weight:800}
.detail-category .card-type-stamp.type-inline{width:29px;height:29px;border-radius:7px}
.symbol-legend{border:1px solid #ded6c6;background:#fff9ef;border-radius:9px;margin:3px 0 9px;padding:7px 10px;color:#496066;font-size:11px}
.symbol-legend summary{cursor:pointer;font-weight:800;list-style:disclosure-closed}
.symbol-legend[open] summary{margin-bottom:8px}
.symbol-legend-items{display:grid;grid-template-columns:repeat(auto-fit,minmax(125px,1fr));gap:7px;padding:3px 0}
.symbol-legend-item{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:650}
.symbol-legend-item .legend-stamp{width:24px;height:24px}
@media(max-width:800px){.mini-card .card-type-stamp.type-market{width:20px;height:20px;right:2px;bottom:4px}.seat-card .card-type-stamp.type-owned{width:18px;height:18px;top:19px;left:2px}}
@media(max-width:440px){.mini-card .card-type-stamp.type-market{width:19px;height:19px;right:2px;bottom:3px}.seat-card .card-type-stamp.type-owned{width:17px;height:17px;left:2px;top:19px}.detail-dialog .card-type-stamp.type-detail{width:42px;height:42px}}



/* Online UX version 0.6 */
.network-banner{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:9px;padding:9px 12px;margin:8px 0 12px;border-radius:12px;font-size:12px;font-weight:800;line-height:1.4;border:1px solid #a6cfc0;background:#eaf8f1;color:#25604b}.network-banner.issue{border-color:#e1b172;background:#fff1d7;color:#85531b}.network-banner .btn{min-height:31px;padding:5px 9px;font-size:11px}.room-invite button:disabled{opacity:.48}.seat .row{margin-left:auto;justify-content:flex-end}

/* 0.6.1: visible, privacy-preserving network diagnostics */
.network-diag{margin:13px 0 2px;padding:10px;border:1px solid #d8ceb8;border-radius:12px;background:#fffaf0;color:#35565a;font-size:12px}
.network-diag summary{font-weight:800;cursor:pointer;overflow-wrap:anywhere}
.network-diag-body{padding:8px 1px 1px}
.network-diag-body p{line-height:1.45;margin:6px 0}
.network-diag-body ol{margin:8px 0;padding:8px 8px 8px 27px;border-radius:8px;background:#f6f5ed;max-height:150px;overflow-y:auto;font-size:11px;line-height:1.55}
.network-diag-body .row{margin:12px 0;gap:6px}


/* Visual-only change #1: compact top game bar.
   No JavaScript, server configuration or game rules are changed. */
.gamebar.gamebar-compact {
  padding: 5px 9px;
  margin-bottom: 6px;
}
.gamebar-compact .result-chip { display: none !important; }
.gamebar-compact .between { gap: 4px; }
.gamebar-compact .eyebrow {
  font-size: 6.6px; /* 11px -> -40% */
  letter-spacing: 1.1px;
  line-height: 1.2;
}
.gamebar-compact .current-line {
  font-size: 7.8px; /* 13px -> -40% */
  padding: 2px 0 0;
  line-height: 1.2;
  gap: 4px;
}
.gamebar-compact .current-line .bubble {
  padding: 3px 6px;
  font-size: inherit;
  border-radius: 6px;
}


/* v0.9 — visual change #2: exactly six market cards per row on iPhone.
   The card click handlers, market contents and network logic are untouched. */
@media (max-width: 600px) {
  .table-center .market-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
  }
  .table-center .mini-card {
    min-width: 0;
    min-height: 102px;
    border-radius: 8px;
  }
  .table-center .mini-card .mini-top {
    font-size: 11px;
    padding: 2px 1px;
  }
  .table-center .mini-card .art {
    font-size: 23px;
    min-height: 34px;
  }
  .table-center .mini-card .card-name {
    font-size: 7.4px;
    line-height: 1.08;
    min-height: 29px;
    max-height: 36px;
    padding: 2px 1px;
  }
  .table-center .mini-card .mini-bottom {
    font-size: 8px;
    padding: 2px;
  }
  .table-center .mini-card .coin-price { font-size: 8px; }
  .table-center .mini-card .card-type-stamp.type-market {
    width: 16px;
    height: 16px;
    right: 2px;
    bottom: 3px;
  }
}
@media (max-width: 350px) {
  .table-center .mini-card .card-name { font-size: 7px; }
}


/* v0.9.1 — visual change #3: landmark cards 20% narrower; full names remain visible.
   Only presentation rules: no changes to game state or networking. */
.table-center .landmark-row {
  justify-content: space-between;
  gap: 7px;
  align-items: stretch;
}
.table-center .landmark {
  width: calc(((100% - 36px) / 7) * .8);
  flex: 0 0 calc(((100% - 36px) / 7) * .8);
  min-width: 0;
  min-height: 104px;
  padding: 6px 2px;
}
.table-center .landmark .name {
  display: block;
  width: 100%;
  font-size: 9px;
  line-height: 1.13;
  overflow-wrap: anywhere;
  hyphens: auto;
  white-space: normal;
}
@media (max-width: 800px) {
  .table-center .landmark-row { justify-content: flex-start; }
  .table-center .landmark {
    width: 60px;    /* 75px in v0.9 -> 60px (-20%) */
    min-width: 60px;
    flex: 0 0 60px;
    min-height: 104px;
    padding: 5px 2px;
  }
  .table-center .landmark .symbol { font-size: 24px; }
  .table-center .landmark .name { font-size: 8.5px; line-height: 1.14; letter-spacing: -.25px; }
}


/* 0.9.2 — present the existing host-authoritative log directly under the compact bar.
   No game engine, rules, room transport, or stored game data are changed. */
.turn-log.turn-log-top {
  margin: 0 0 10px;
  padding: 9px 11px;
  background: #fffdf8;
  border-radius: 12px;
}
.journal-heading {display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:5px}
.journal-heading strong {font-size:12px;color:#36585a}
.journal-hint {font-size:10px;color:#86928b}
.journal-recent,.journal-history {margin:0;padding:0;list-style:none}
.journal-recent {max-height:122px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.turn-log .journal-entry {display:flex;align-items:baseline;gap:5px;margin:0;padding:3px 0;border-top:1px solid #f0eadb;font-size:11px;line-height:1.37;color:#405e60}
.journal-entry .journal-icon {flex:0 0 18px;text-align:center;font-size:12px}
.journal-entry .journal-message {min-width:0;flex:1;overflow-wrap:anywhere}
.journal-entry .journal-message strong {color:#29474b;font-weight:800}
.journal-entry .journal-message b {font-weight:850;color:#246d65}
.journal-entry .journal-time {color:#938b77;font-variant-numeric:tabular-nums;font-size:9px;flex:0 0 auto}
.journal-empty {padding:4px 0;font-size:11px;color:#8b8c7a}
.journal-full {margin-top:5px;padding-top:5px;border-top:1px dashed #e7dec9}
.journal-full summary {font-size:11px!important;color:#507679;cursor:pointer;font-weight:750}
.journal-history {max-height:260px;overflow-y:auto;overscroll-behavior:contain;margin-top:7px}
.journal-history .journal-status {opacity:.76}
@media(max-width:600px) {
 .turn-log.turn-log-top {padding:7px 9px;margin-bottom:7px}
 .journal-heading strong {font-size:11px}
 .journal-hint {font-size:9px}
 .turn-log .journal-entry {font-size:10.5px;padding:2px 0}
 .journal-entry .journal-time {font-size:8.5px}
 .journal-recent {max-height:108px}
}


/* v0.9.3 — visual change #5: each player holds a compact, vertically
   scrolling 3-column grid on phones/tablets instead of a horizontal strip.
   Cards remain accessible through the existing show-card buttons. */
@media (max-width: 800px) {
  .player-seat .seat-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    max-width: 174px;
    max-height: 195px;
    padding: 1px 2px 3px 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-width: thin;
    align-content: start;
  }
  .player-seat .seat-card {
    width: auto;
    min-width: 0;
    max-width: none;
    flex: none;
    height: 61px;
    min-height: 61px;
    border-radius: 5px;
  }
  .player-seat .seat-card-value {
    height: 14px;
    line-height: 14px;
    font-size: 9px;
  }
  .player-seat .seat-card-emoji {
    font-size: 18px;
    line-height: 1;
    min-height: 23px;
  }
  .player-seat .seat-card-label {
    font-size: 6.8px;
    line-height: 1.03;
    min-height: 13px;
    max-height: 16px;
    padding: 1px;
  }
  .player-seat .seat-card-quantity {
    top: 15px;
    font-size: 8px;
    padding: 0 1px;
  }
  .player-seat .seat-card .card-type-stamp.type-owned {
    top: 15px;
    left: 1px;
    width: 15px;
    height: 15px;
  }
}


/* 0.9.5 — display-only Port income advisor. Compact for narrow iPhone screens. */
.port-advice{margin:9px 0 12px;background:#f7f9f3;border:1px solid #bbd7ca;border-radius:12px;padding:9px;color:#2b5154}
.port-advice-heading{font-weight:900;font-size:13px;display:flex;align-items:center;justify-content:space-between;gap:5px;margin-bottom:8px}
.port-advice-heading span{font-weight:600;color:#64827e;font-size:10px;text-align:right}
.port-advice-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.port-advice-option{padding:8px 7px;background:#fff;border:1px solid #d9e4da;border-radius:9px;min-width:0;overflow-wrap:anywhere}
.port-advice-best{background:#e7f6e8;border-color:#73b587;box-shadow:inset 0 0 0 1px #83c496}
.port-advice-title{font-size:11px;font-weight:850;display:flex;gap:5px;align-items:center;flex-wrap:wrap}
.port-best-tag{background:#338455;color:white;border-radius:30px;padding:2px 5px;font-size:9px;white-space:nowrap}
.port-advice-gain{font-size:20px;font-weight:950;color:#246b55;margin:5px 0 2px;line-height:1.2;white-space:normal}
.port-advice-secondary{font-size:10px;line-height:1.35;color:#5e7571;margin:4px 0}
.port-advice-note{font-size:10px;line-height:1.4;color:#637b73;margin-top:7px}
.port-advice-tie{font-size:11px;font-weight:750;color:#387b64;margin-top:7px}
@media(max-width:365px){.port-advice{padding:7px}.port-advice-option{padding:7px 5px}.port-advice-gain{font-size:17px}.port-advice-title{font-size:10px}.port-advice-secondary{font-size:9px}}

.bottom-panel-port{max-height:min(76dvh,630px);overflow-y:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch}

/* v0.9.7 — show bot actions in the fixed control tray without changing game logic */
.bot-thinking {color:#365d61}
.bot-live-events {list-style:none;margin:6px 0 0;padding:0;max-height:77px;overflow-y:auto;overscroll-behavior:contain}
.bot-live-events .journal-entry {display:flex;gap:5px;align-items:baseline;padding:3px 0;border-top:1px solid #e8e4d8;font-size:11px;line-height:1.35;color:#37585b}
.bot-live-events .journal-time {font-size:9px}
.bot-live-events .journal-message {overflow-wrap:anywhere}
.bot-live-empty {font-size:11px;margin-top:4px;color:#7c8581}

/* v0.9.8 — large comfortable card purchase dialog on iPhone, with a fixed
   buy/cancel bar; descriptions scroll vertically without hiding the buttons. */
.detail-dialog .detail-scroll { min-width:0; }
.auto-end-notice { color:#246b59; font-weight:750; }
@media (max-width: 600px) {
  .overlay { align-items:center; padding: max(10px,env(safe-area-inset-top)) 10px max(10px,env(safe-area-inset-bottom)); }
  .detail-dialog {
    box-sizing:border-box; width:100%; max-width:500px;
    height:87vh; height:87dvh;
    max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px);
    padding:12px 14px 14px; border-radius:19px;
    display:flex; flex-direction:column; overflow:hidden;
  }
  .detail-dialog .detail-scroll {
    flex:1 1 auto; min-height:0; overflow-y:auto; overflow-x:hidden;
    overscroll-behavior:contain; -webkit-overflow-scrolling:touch;
  }
  .detail-dialog .modal-footer {
    flex:0 0 auto; margin-top:7px; padding-top:10px;
    border-top:1px solid #eadfc9; background:#fffdf5;
  }
  .detail-dialog .modal-footer .btn { min-height:44px; }
}
