.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.port-stage{margin-bottom:12px;min-width:0}.port-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:9px}.port-toolbar strong{display:block;font-size:14px;color:#3b6557}.port-toolbar small{font-size:10px;color:#7c8874}.port-toolbar button{background:#eee8d7;font-size:11px;min-height:38px;padding:6px 11px}.port-layout{display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:12px;align-items:stretch}.port-map-wrap{min-width:0}.port-stage .live-harbor{height:auto;aspect-ratio:1860/846;border-radius:7px;isolation:isolate;touch-action:manipulation}.live-harbor>img{object-fit:fill;pointer-events:none;user-select:none}.live-harbor .map-label{font-size:8px;padding:1px 5px}.live-harbor .map-note{font-size:8px;pointer-events:none}.world-actors{position:absolute;inset:0;pointer-events:none}.world-actor{position:absolute;pointer-events:auto;transform:translate(-50%,-100%);display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:0;padding:0;border:0;border-radius:0;background:none;min-height:0;min-width:36px;overflow:visible;line-height:1;transition:none;isolation:isolate}.world-actor:hover,.world-actor:active{background:none;transform:translate(-50%,-100%)}.world-actor:disabled{opacity:1;cursor:default}.world-actor .avatar{width:46px;height:69px;pointer-events:none;filter:drop-shadow(0 2px 0 #524e3720)}.world-actor:hover .avatar{filter:drop-shadow(0 0 3px #fff7bf)}.world-name{display:flex;align-items:center;gap:3px;padding:3px 5px;border:1px solid #d7ceb4;background:#fffbedf2;border-radius:4px;color:#384b3d;box-shadow:0 2px 0 #6c684e30;white-space:nowrap;pointer-events:none;font-size:8px;line-height:1.2}.world-name b{font-weight:800}.world-name small{font-size:7px;color:var(--role)}.world-name i{width:4px;height:4px;border-radius:50%;background:#758a6c}.world-actor.offline .world-name i{background:#b4b0a0}.world-actor.self .world-name{background:#fff1b3;border-color:#b9984f}.world-actor.self:before{content:'';position:absolute;width:28px;height:8px;bottom:18px;border:1px solid #e5bd5b;border-radius:50%;z-index:-1;background:#f9e2a080}.world-bubble{position:absolute;bottom:calc(100% + 3px);left:50%;transform:translateX(-50%);min-width:38px;max-width:160px;width:max-content;background:#fffff7;border:1px solid #8e9d85;border-radius:8px 8px 8px 2px;box-shadow:0 2px 0 #61735533;padding:7px 9px;font-size:10px;font-weight:500;line-height:1.5;color:#355544;pointer-events:none;white-space:pre-wrap;overflow-wrap:anywhere}.world-bubble[hidden]{display:none}.world-actor:has(.world-bubble:not([hidden])){z-index:1800!important}.walk-target{position:absolute;width:18px;height:9px;border:2px solid #fff2af;border-radius:50%;box-shadow:0 0 0 2px #617c58;transform:translate(-50%,-50%);z-index:4;pointer-events:none;animation:target-pulse .6s ease-in-out infinite alternate}.walk-target[hidden]{display:none}.port-hint{display:flex;align-items:center;justify-content:space-between;gap:4px;font-size:9px;color:#7a866e;margin-top:7px}.port-dpad{display:flex;gap:3px}.port-dpad button{padding:2px;min-width:29px;min-height:29px;border-radius:4px;background:#f7f3e5;font-size:13px}.port-recent{display:flex;align-items:center;flex-wrap:wrap;gap:5px 10px;min-height:27px;font-size:9px;color:#7c896f}.port-recent strong{font-size:9px;color:#3c7d62}.port-recent span:not(:only-child){background:#e8efdd;border-radius:4px;padding:2px 6px}.port-chat{display:grid;grid-template-rows:35px minmax(70px,1fr) auto;background:#fffcf3;border:1px solid #d8ddca;border-radius:7px;overflow:hidden;min-width:0;max-height:340px}.port-chat-head{display:flex;justify-content:space-between;align-items:center;padding:7px 11px;background:#e9eedf;color:#426752;font-size:12px}.port-chat-head span{font-size:9px;color:#89937d}.port-messages{overflow:auto;padding:10px;overscroll-behavior:contain;scrollbar-width:thin;min-height:0}.chat-empty{font-size:11px;line-height:1.9;color:#8b947f;text-align:center;margin:18px 0}.chat-line{margin-bottom:10px}.chat-line>div{display:flex;gap:5px;align-items:baseline;margin-bottom:3px;line-height:1.4}.chat-line b{font-size:10px}.chat-line small{font-size:8px;color:#90967f}.chat-line p{font-size:11px;line-height:1.65;margin:0;background:#f0f0e3;border-radius:2px 7px 7px;padding:7px 9px;white-space:pre-wrap;overflow-wrap:anywhere}.chat-line.mine p{background:#e4ecd9}.port-chat-form{padding:7px 9px;background:#fbf8e9;border-top:1px solid #e2e4d3}.port-chat-form textarea{resize:none;min-height:48px;max-height:85px;font-size:11px;line-height:1.6;padding:7px 8px;border-radius:4px}.port-chat-form>div{display:flex;justify-content:space-between;align-items:center;gap:6px;margin-top:4px}.port-chat-form small{font-size:8px;color:#8c927b}.port-chat-form button{min-height:34px;font-size:10px;padding:3px 9px;border-radius:4px}.chat-feedback{display:block;min-height:12px;font-size:8px;color:#6b8763}.chat-readonly{font-size:10px;margin:0;padding:12px;background:#f2efdf;color:#7f8c71}.port-stage.expanded{position:fixed;inset:12px;z-index:100;background:#f6f2e4;padding:17px 19px;border:2px solid #b8bea3;box-shadow:0 0 0 30px #273f3bd9;border-radius:12px;overflow:auto;display:flex;flex-direction:column}.port-stage.expanded .port-toolbar{flex-shrink:0;margin-bottom:16px}.port-stage.expanded .port-toolbar strong{font-size:20px}.port-stage.expanded .port-toolbar small{font-size:12px}.port-stage.expanded .port-layout{grid-template-columns:minmax(0,1fr) 280px;gap:18px;flex:1;align-items:start}.port-stage.expanded .port-chat{height:100%;max-height:100%;min-height:400px}.port-stage.expanded .world-actor .avatar{width:58px;height:88px}.port-stage.expanded .world-name{font-size:10px;padding:4px 7px}.port-stage.expanded .world-name small{font-size:9px}.port-stage.expanded .world-bubble{font-size:12px;max-width:190px;padding:8px 11px}.port-stage.expanded .map-label{font-size:10px}.port-stage.expanded .port-hint{font-size:11px;margin-top:12px}.port-stage.expanded .port-recent{font-size:11px;margin-top:10px}.port-stage.expanded .port-recent strong{font-size:11px}.port-stage.expanded .chat-line p{font-size:12px}.port-stage.expanded .chat-line b{font-size:11px}.port-stage.expanded .chat-line small{font-size:9px}.port-stage.expanded .port-chat-head{font-size:14px}.port-stage.expanded .port-chat-form textarea{font-size:13px;min-height:70px}.port-stage.expanded .port-chat-form small{font-size:9px}.port-stage.expanded .port-chat-form button{font-size:12px;min-height:40px}.port-expanded{overflow:hidden}.teacher-live-port{margin-bottom:18px}.teacher-live-port .port-layout{grid-template-columns:minmax(0,1fr) 230px}@keyframes target-pulse{to{opacity:.65;transform:translate(-50%,-50%) scale(1.15)}}
@media(max-width:1180px){.port-layout{grid-template-columns:1fr}.port-chat{height:235px;max-height:235px}.port-stage.expanded .port-layout{grid-template-columns:minmax(0,1fr) 260px}.port-stage.expanded .port-chat{height:100%;min-height:300px}.teacher-live-port .port-layout{grid-template-columns:1fr}}
@media(max-width:760px){.port-stage.expanded{inset:5px;padding:12px}.port-stage.expanded .port-layout{grid-template-columns:1fr}.port-stage.expanded .port-chat{height:270px;max-height:270px;min-height:230px}.port-stage.expanded .world-actor .avatar,.world-actor .avatar{width:36px;height:54px}.world-name,.port-stage.expanded .world-name{font-size:8px;padding:2px 3px}.world-name small{display:none}.port-stage.expanded .world-bubble{font-size:10px;max-width:130px}.port-hint{align-items:flex-start}.port-stage.expanded .port-toolbar strong{font-size:16px}.port-stage.expanded .port-hint{font-size:9px}}
@media(prefers-reduced-motion:reduce){.walk-target{animation:none}}

/* Student game: the harbor is the stage; interface panels float over it. */
body.student-game{height:100dvh;overflow:hidden;background:#2d504d;--world-sprite-h:clamp(44px,7.2dvh,56px)}
.world-actor{min-width:44px}.world-actor:disabled{pointer-events:none}
.student-game #app,.game-shell{width:100%;height:100dvh;overflow:hidden}
.game-shell{position:fixed;inset:0;pointer-events:none}
.glass-panel{background:rgba(255,252,235,.76);border:1px solid rgba(243,240,212,.86);border-radius:12px;box-shadow:0 4px 18px #243d3724;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);pointer-events:auto}
.student-game .topbar-shell{position:fixed;inset:0 0 auto;z-index:40;background:linear-gradient(180deg,#e7eddbd9,#f7f0d9a8);border-bottom:1px solid #f4f4dc73;backdrop-filter:blur(2px)}
.student-game .topbar{height:52px;max-width:none;padding:0 18px;gap:10px}
.student-game .brand-mark{width:31px;height:31px;border-width:2px}.student-game .brand-mark img{width:23px;height:23px}
.student-game .brand-name{font-size:17px;text-shadow:0 1px #fff8}.student-game .brand-sub{display:none}
.student-game .header-actions{gap:9px}.student-game .header-actions button{min-height:32px;padding:4px 9px;font-size:11px}.student-game .header-actions .tag{font-size:10px;padding:3px 7px}.student-game .connection{font-size:10px}.student-game .room-code{font-size:14px}
.student-game .port-stage,.student-game .port-stage.expanded{position:fixed;inset:0;z-index:0;padding:0;margin:0;border:0;border-radius:0;background:#2d504d;box-shadow:none;overflow:hidden;display:block;pointer-events:none}
.student-game .port-stage:before{content:'';position:absolute;inset:0;background:linear-gradient(#263f4145,#425f4855),url('/assets/harbor-v2.png') center/cover;opacity:.5}
.student-game .port-layout{display:contents}.student-game .port-map-wrap{position:absolute;inset:0;pointer-events:none}
/* Keep the picture, actors and map coordinates in one box. Frame the courtyard
   around (65.5%,55%) so decorative sea does not displace the playable ground. */
.student-game .port-stage .live-harbor{position:absolute;left:50%;top:50%;width:max(112vw,calc(112dvh * 1860 / 846));height:max(112dvh,calc(112vw * 846 / 1860));aspect-ratio:1860/846;transform:translate(-65.5%,-55%);border:0;border-radius:0;box-shadow:none;overflow:visible;pointer-events:auto}
.student-game .live-harbor>img{display:block;width:100%;height:100%;object-fit:fill}.student-game .live-harbor:focus-visible{outline:0;box-shadow:inset 0 0 0 3px #f5e2a077}
.student-game .world-actors{overflow:visible}.student-game .port-stage .world-actor .avatar{height:var(--world-sprite-h);width:calc(var(--world-sprite-h) * .6667);filter:drop-shadow(0 1px 0 #2e42343b)}
.student-game .world-name{font-size:9px;padding:3px 5px;background:#fffce8e6;border-color:#8c9a78b0;box-shadow:0 1px 3px #223d3d3d;gap:3px}.student-game .world-name b{font-size:9px;letter-spacing:-.2px}.student-game .world-name small{font-size:7.5px}.student-game .world-name i{width:4px;height:4px}
.student-game .port-stage .world-bubble{font-size:11px;max-width:170px;padding:6px 9px;background:#fffef1ed;line-height:1.5}
.student-game .map-label{font-size:10px;padding:2px 6px;background:#fff4d2c9;border-color:#b2aa85aa}.student-game .map-note{display:none}
.student-game .port-toolbar{position:absolute;top:64px;left:50%;transform:translateX(-50%);z-index:20;display:flex;gap:7px;align-items:center;margin:0;padding:7px 10px;max-width:calc(100vw - 570px);width:max-content;background:#f6f4dcb8;border:1px solid #f5f0d69c;border-radius:10px;backdrop-filter:blur(2px);pointer-events:auto;box-shadow:0 2px 10px #274c3326}
.student-game .port-toolbar>div{min-width:0}.student-game .port-toolbar strong{font-size:11px;white-space:nowrap}.student-game .port-toolbar small{display:block;font-size:9px;white-space:nowrap}.student-game .port-toolbar button{min-height:32px;padding:3px 8px;font-size:10px;white-space:nowrap;background:#fff9dd9c}.student-game .port-toolbar .fullscreen-control{min-width:30px;padding:0;font-size:20px}.student-game .port-toolbar .port-offer-shortcut{background:#2c7669e6;color:#fff8df;border-color:#679d79}
.student-game .port-hint{position:absolute;left:285px;right:300px;bottom:88px;z-index:12;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:6px;margin:0;pointer-events:none}.student-game .port-hint>span{padding:4px 9px;border-radius:20px;background:#f8f4d8bd;color:#344e40;font-size:10px;box-shadow:0 1px 4px #203d3222;white-space:nowrap}.student-game .port-dpad{gap:4px;pointer-events:auto}.student-game .port-dpad button{background:#fff8ded1;min-width:33px;min-height:30px;border-color:#b4bd92a8}
.student-game .port-recent{position:absolute;top:121px;left:50%;transform:translateX(-50%);z-index:12;max-width:calc(100vw - 580px);width:max-content;justify-content:center;min-height:0;line-height:1.5;font-size:10px;color:#244b39;text-shadow:0 1px #fff9;pointer-events:none;gap:4px}.student-game .port-recent strong{font-size:10px}.student-game .port-recent>span{background:#f8f5d9bd;border-radius:5px;padding:3px 7px}
.student-game .port-chat{position:absolute;right:15px;top:117px;bottom:90px;width:268px;height:auto;max-height:none;min-height:0;z-index:22;grid-template-rows:36px minmax(45px,1fr) auto;background:rgba(255,252,235,.7);border:1px solid #fff6d69e;backdrop-filter:blur(2px);box-shadow:0 3px 15px #254c3624;pointer-events:auto;border-radius:12px}
.student-game .port-chat-head{background:#e3eacbb5;padding:5px 10px;font-size:12px;gap:5px}.port-chat-head button{margin-left:auto;border:0;background:transparent;padding:0;min-height:25px;min-width:27px;font-size:18px;line-height:1}.student-game .port-chat-head span{font-size:9px}
.student-game .port-messages{padding:9px}.student-game .chat-line{margin-bottom:8px}.student-game .chat-line p{font-size:11px;background:#fffff28c;padding:6px 8px;color:#294e3c}.student-game .chat-line.mine p{background:#dbeac2a6}.student-game .chat-line b{font-size:10px}.student-game .chat-line small{font-size:8px;color:#52634a}.student-game .chat-empty{color:#53684e;text-shadow:0 1px #fff8;font-size:11px}
.student-game .port-chat-form{background:#f6f0d4a8;padding:7px 9px;border-color:#e2e7c39c}.student-game .port-chat-form textarea{background:#fffdf0b8;font-size:12px;min-height:52px;height:52px;line-height:1.5}.student-game .port-chat-form button{min-height:32px;font-size:11px;padding:3px 10px}.student-game .port-chat-form small{color:#5b7057;font-size:8px}.student-game .chat-feedback{min-height:10px;font-size:8px}
.port-chat.minimized{height:36px!important;min-height:36px!important;max-height:36px!important;bottom:auto!important;grid-template-rows:35px}.port-chat.minimized .port-messages,.port-chat.minimized .port-chat-form,.port-chat.minimized .chat-readonly{display:none}
.game-orders{position:absolute;left:15px;top:66px;width:246px;z-index:21;overflow:hidden}.game-identity{display:flex;align-items:center;gap:9px;padding:10px 13px 7px;border-bottom:1px solid #e4e5c78a}.game-identity .avatar{width:34px;height:51px}.game-identity .nickname{font-size:17px;line-height:1.4}.game-identity .nation{font-size:10px}.game-identity small{font-size:9px;color:#69785d}
.game-orders details>summary,.game-inventory details>summary{display:flex;align-items:center;gap:7px;list-style:none;cursor:pointer;padding:10px 12px;color:#3b6048;font-size:12px;user-select:none}.game-orders summary::-webkit-details-marker,.game-inventory summary::-webkit-details-marker{display:none}.game-orders summary>.tag{font-size:9px;padding:2px 6px;margin-left:auto}.hud-chevron{font-size:15px;font-weight:800;line-height:1;transition:transform .15s}.glass-panel details[open]>summary .hud-chevron{transform:rotate(180deg)}
.hud-order-scroll{padding:1px 13px 9px;max-height:calc(100dvh - 292px);overflow:auto;scrollbar-width:thin;overscroll-behavior:contain}.game-orders .goal-list{gap:11px;margin-top:6px}.game-orders .goal{padding-left:25px;font-size:11px}.game-orders .goal-number{width:19px;height:19px;font-size:9px;background:#eee4bfab;border-color:#cdbf8e88}.game-orders .goal-title{font-size:10px;line-height:1.4}.game-orders .goal .row{gap:4px;align-items:start}.game-orders .goal .row b{font-size:10px;white-space:nowrap}.game-orders .goal-hint{font-size:8px;color:#647457}.game-orders .progress{height:3px;margin-top:5px;background:#c9d1ae80}.game-orders .goal .stamp{font-size:8px;padding:0 3px;right:-3px;top:-4px;background:#e9efd28c}.game-orders .cooldown{margin-top:12px;padding:7px 9px;background:#f7efcea6;border-color:#d8c99077;font-size:10px}.game-orders .cooldown strong{font-size:17px}.game-orders .speed{font-size:9px}.game-orders button.small{min-height:31px;font-size:10px;padding:4px 7px}.game-orders .section-label{font-size:10px;margin-top:9px}
.game-inventory{position:absolute;left:15px;bottom:90px;width:246px;z-index:23;overflow:hidden}.game-inventory summary{min-height:46px}.game-inventory summary>span:first-child{font-size:11px;font-weight:800;white-space:nowrap}.game-inventory summary small{font-size:9px}.inventory-preview{display:flex;gap:0;margin-left:auto}.inventory-preview .item-icon{width:21px;height:24px}.game-inventory .hud-chevron{margin-left:0}.hud-inventory-scroll{padding:0 10px 6px;max-height:27dvh;overflow:auto;scrollbar-width:thin}.game-inventory .inv-grid{gap:5px}.game-inventory .inv-item{background:#fffbdd94;border-color:#e3d8b47d;font-size:10px;padding:4px;gap:3px}.game-inventory .inv-item .item-icon{width:26px;height:26px}.game-inventory .inv-item strong{font-size:11px}.game-inventory .smallprint{font-size:9px;margin:6px 0 0;line-height:1.6;color:#607651}
.game-dock{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);z-index:40;display:flex;align-items:stretch;gap:4px;max-width:calc(100vw - 24px);padding:6px 9px;background:#f7f1d7d1;border:1px solid #fff8d7c9;border-radius:14px;backdrop-filter:blur(2px);box-shadow:0 4px 22px #1c3c3c3b;pointer-events:auto}.game-dock button{position:relative;display:grid;justify-items:center;align-content:center;gap:1px;padding:3px 12px;min-width:75px;min-height:49px;font-size:11px;background:transparent;border-color:transparent;border-radius:9px;color:#3c624f;white-space:nowrap}.game-dock button:hover,.game-dock button.active{background:#e5ecd0d4;border-color:#b9c8a599}.dock-mark{font-size:21px;color:#668168;line-height:1.2;font-family:Georgia,serif}.game-dock .badge{position:absolute;right:1px;top:0;min-width:17px;height:17px;margin:0;font-size:9px;background:#427a5c;color:#fff8dc}
.game-notice,.game-news{position:absolute;top:165px;left:50%;transform:translateX(-50%);z-index:24;max-width:min(500px,calc(100vw - 580px));padding:9px 13px;font-size:11px;line-height:1.6;color:#526747;text-align:center}.game-notice button{min-height:30px;padding:3px 8px;font-size:10px}.game-news{top:auto;bottom:181px;background:#f8f2d2c2;max-width:390px;pointer-events:none;display:flex;align-items:center;gap:8px}.game-news .tag{font-size:9px;flex-shrink:0}.game-news>span{font-size:10px}
.game-drawer-layer{position:fixed;inset:0;z-index:35;pointer-events:auto}.game-drawer-backdrop{position:absolute;inset:0;width:100%;height:100%;border:0;border-radius:0;background:#193c3e4f;cursor:default;min-height:0}.game-drawer-backdrop:hover{background:#193c3e4f}.game-drawer-backdrop:active{transform:none}.game-drawer{position:absolute;top:70px;bottom:90px;left:50%;transform:translateX(-50%);width:min(960px,calc(100vw - 38px));display:flex;flex-direction:column;overflow:hidden;background:#f9f6e5ed;box-shadow:0 8px 40px #1e373966}.game-drawer-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:13px 18px;border-bottom:1px solid #d0d9bea8;background:#f3edcff2;flex-shrink:0}.game-drawer-head h1{font-size:19px;margin:0}.game-drawer-head button{min-height:34px;font-size:11px;padding:5px 10px;flex-shrink:0}.game-drawer-body{padding:18px;overflow:auto;min-height:0;overscroll-behavior:contain;scrollbar-width:thin}.game-drawer .merchant-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.game-drawer .merchant .merchant-identity .avatar{width:42px;height:63px}.game-drawer .merchant .merchant-identity{min-height:63px}.game-drawer .merchant .goods-list{height:auto;max-height:95px;min-height:60px}.game-drawer .merchant .nickname{font-size:14px}.game-drawer .card{background:#fffcecda;box-shadow:0 3px 0 #d9d8c655}.game-drawer .panel-head h2{font-size:19px}.game-drawer .lesson-grid{grid-template-columns:1fr 1fr}
.game-focused .game-orders,.game-focused .game-inventory,.game-focused .game-dock,.game-focused .game-notice,.game-focused .game-news,.game-focused .student-port .port-chat,.game-focused .student-port .port-hint,.game-focused .student-port .port-recent{visibility:hidden;pointer-events:none}.student-game #toast{bottom:87px;z-index:1000}.student-game #toast.show{padding:9px 16px;font-size:12px}
/* Teacher keeps the management layout; only the explicit large-map view fills it. */
.teacher-port.expanded{inset:0;border:0;border-radius:0;padding:0;background:#2d504d;overflow:hidden}.teacher-port.expanded .port-layout{display:contents}.teacher-port.expanded .port-map-wrap{position:absolute;inset:0}.teacher-port.expanded .live-harbor{position:absolute;left:50%;top:50%;width:max(112vw,calc(112dvh * 1860 / 846));height:max(112dvh,calc(112vw * 846 / 1860));transform:translate(-65.5%,-55%);border:0;border-radius:0;box-shadow:none;aspect-ratio:1860/846;overflow:visible}.teacher-port.expanded .port-toolbar{position:absolute;z-index:30;left:18px;top:15px;padding:9px 13px;background:#fff8dfc9;border-radius:9px}.teacher-port.expanded .port-toolbar strong{font-size:14px}.teacher-port.expanded .port-toolbar small{font-size:10px;display:block}.teacher-port.expanded .port-chat{position:absolute;z-index:30;right:18px;top:95px;bottom:32px;width:270px;height:auto;min-height:0;max-height:none;background:#fffbe6c2;backdrop-filter:blur(2px)}.teacher-port.expanded .world-actor .avatar{width:35px;height:53px}.teacher-port.expanded .world-name{font-size:9px;padding:3px 5px}.teacher-port.expanded .world-bubble{font-size:11px}.teacher-port.expanded .port-hint,.teacher-port.expanded .port-recent{position:absolute;bottom:20px;left:20px;z-index:20;background:#fff8deb8;padding:5px 10px;border-radius:6px}.teacher-port.expanded .port-recent{bottom:50px}
@media(max-width:1050px){.game-orders,.game-inventory{width:219px;left:11px}.student-game .port-chat{right:11px;width:235px}.student-game .port-toolbar{max-width:calc(100vw - 490px);top:62px}.student-game .port-toolbar strong{display:none}.student-game .port-toolbar small{font-size:9px}.student-game .port-toolbar button{font-size:9px;padding:3px 6px}.student-game .port-recent{max-width:calc(100vw - 490px);top:114px}.student-game .port-hint{left:245px;right:255px}.student-game .port-hint>span{font-size:9px;white-space:normal;text-align:center}.game-notice{max-width:calc(100vw - 490px)}.game-drawer .merchant-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.game-drawer .lesson-grid{grid-template-columns:1fr}}
@media(max-width:760px){.student-game .topbar{height:46px;padding:0 10px}.student-game .brand-name{font-size:14px}.student-game .brand-mark{width:26px;height:26px}.student-game .brand-mark img{width:19px;height:19px}.student-game .header-actions{gap:2px}.student-game .header-actions button{font-size:9px;padding:3px 5px;min-height:29px}.student-game .header-actions .room-code{font-size:12px}.student-game .header-actions .tag,.student-game .connection{display:none}.game-orders{left:8px;top:57px;width:195px}.game-identity{padding:6px 10px;gap:6px}.game-identity .avatar{width:27px;height:41px}.game-identity .nickname{font-size:14px}.game-identity .nation{font-size:9px}.game-identity small{font-size:8px}.game-orders details>summary{padding:7px 10px;font-size:11px}.hud-order-scroll{max-height:33dvh;padding:0 10px 7px}.game-orders .goal-list{gap:9px}.game-orders .goal-title{font-size:9px}.game-orders .goal-hint{font-size:8px}.game-inventory{left:8px;bottom:82px;width:195px}.game-inventory details>summary{min-height:39px;padding:6px 9px}.inventory-preview .item-icon{width:18px;height:21px}.game-inventory summary>span:first-child{font-size:10px}.hud-inventory-scroll{max-height:25dvh}.student-game .port-chat{right:8px;top:auto;bottom:82px;width:220px;height:40dvh;min-height:180px;max-height:340px}.student-game .port-chat.minimized{top:auto;bottom:82px!important}.student-game .port-chat-head{font-size:11px}.student-game .port-chat-head span{font-size:8px}.student-game .port-toolbar{top:57px;left:auto;right:8px;transform:none;max-width:calc(100vw - 224px);padding:5px;gap:4px}.student-game .port-toolbar>div{display:none}.student-game .port-toolbar .fullscreen-control{display:none}.student-game .port-toolbar button{min-height:29px;font-size:9px;padding:3px 6px}.student-game .port-toolbar .port-offer-shortcut{font-size:9px}.student-game .port-recent{left:auto;right:8px;top:98px;max-width:calc(100vw - 230px);transform:none;font-size:8px;justify-content:flex-end}.student-game .port-recent strong{font-size:8px}.student-game .port-recent>span{padding:2px 4px}.student-game .port-hint{left:auto;right:9px;bottom:130px;gap:0}.student-game .port-hint>span{display:none}.student-game .port-dpad{gap:3px}.student-game .port-dpad button{min-width:29px;min-height:29px}.student-game .world-name,.student-game .port-stage.expanded .world-name{font-size:8px;padding:2px 4px}.student-game .world-name b{font-size:8px}.student-game .world-name small{display:inline;font-size:7px}.student-game .port-stage .world-bubble{font-size:10px;max-width:140px}.game-dock{bottom:9px;gap:0;padding:4px;max-width:calc(100vw - 14px);width:min(475px,calc(100vw - 14px))}.game-dock button{min-width:0;flex:1;padding:3px 5px;font-size:9px;min-height:47px}.dock-mark{font-size:19px}.game-dock .badge{right:0}.game-notice{top:160px;width:calc(100vw - 24px);max-width:370px;font-size:10px;padding:7px 10px}.game-news{bottom:173px;width:calc(100vw - 30px);font-size:10px}.game-drawer{top:57px;bottom:78px;width:calc(100vw - 16px)}.game-drawer-head{padding:10px}.game-drawer-head h1{font-size:15px}.game-drawer-head button{font-size:9px;min-height:31px;padding:4px 7px}.game-drawer-body{padding:11px}.game-drawer .merchant-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.game-drawer .merchant .merchant-identity{flex-direction:column;gap:3px;text-align:center}.game-drawer .merchant .merchant-identity .avatar{height:54px;width:36px}.game-drawer .merchant .nickname{font-size:12px}.game-drawer .filter-row{gap:7px}.game-drawer .filters{gap:2px}.game-drawer .filters button{font-size:10px;min-height:32px;padding:4px 7px}.game-drawer .filter-row select{font-size:11px;min-height:34px}.game-drawer .merchant .trade-button{font-size:10px;min-height:39px}.game-drawer .listing-cards{grid-template-columns:1fr}}
@media(max-width:760px) and (orientation:portrait){.student-game .port-stage .live-harbor{width:234vw;height:calc(234vw * 846 / 1860);top:52%;}.student-game .port-stage:before{opacity:.6}.student-game .port-stage .world-actor .avatar{height:44px;width:29px}.student-game .map-label{font-size:8px}.game-orders{width:180px}.game-inventory{width:180px}.inventory-preview .item-icon:nth-child(n+4){display:none}}
@media(max-height:570px) and (min-width:761px){.game-orders{width:220px}.game-identity{padding:5px 10px}.game-identity .avatar{width:27px;height:41px}.game-identity .nickname{font-size:14px}.game-orders details>summary{padding:6px 10px}.hud-order-scroll{max-height:calc(100dvh - 245px)}.game-orders .goal-list{gap:6px}.game-orders .goal-hint{display:none}.game-orders .cooldown{margin-top:7px}.student-game .port-chat{top:100px;bottom:79px}.game-inventory{bottom:79px}.game-dock{bottom:7px}.student-game .port-hint{bottom:79px}.student-game .port-toolbar{top:59px}.student-game .port-recent{top:105px}}

/* Let the moving world show through the HUD without blurring small sprites. */
.glass-panel{backdrop-filter:blur(1px);-webkit-backdrop-filter:blur(1px)}
.game-orders{background:rgba(255,252,235,.66)}
.student-game .port-chat{background:rgba(255,252,235,.58);backdrop-filter:none;-webkit-backdrop-filter:none}
.student-game .port-chat-head{background:rgba(227,234,203,.65)}
.student-game .chat-line p{background:rgba(255,255,242,.74)}
.student-game .chat-line.mine p{background:rgba(219,234,194,.76)}
.student-game .port-chat-form{background:rgba(246,240,212,.62)}
.student-game .port-chat-form textarea{background:rgba(255,253,240,.8)}
.student-game .port-hint>span{display:none}
.game-orders:has(+ .game-inventory details[open]) .hud-order-scroll{max-height:max(65px,calc(73dvh - 340px))}

/* Country first, nickname second; no activity dot beside the name. */
.world-name{gap:4px}.world-name .world-nation{order:0;padding-right:4px;border-right:1px solid #a7b49788;font-size:8px;font-weight:800;color:var(--role);white-space:nowrap}.world-name b{order:1}.world-name .self-label{order:2;display:inline-flex;align-items:center;font-size:7px;font-style:normal;line-height:1.2;color:#786532;background:#f6e8a8;border:1px solid #c8b66b;padding:1px 3px;border-radius:3px}.world-name .self-label[hidden]{display:none}.student-game .world-name .world-nation{font-size:8px}.world-actor.offline .world-nation{opacity:.7}

/* A stable ten-slot bag, including visibly empty stock slots. */
.game-inventory{width:320px}.game-inventory details>summary{min-height:43px;justify-content:space-between}.game-inventory summary>span:first-child{font-size:12px}.game-inventory summary small{font-size:10px;margin-left:5px}.game-inventory .hud-chevron{margin-left:auto}.game-inventory .hud-inventory-scroll{max-height:none;padding:0 10px 9px;overflow:visible}.game-inventory .bag-slots{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-auto-rows:78px;gap:6px}.bag-slot{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0;padding:5px 2px 4px;border:1px solid #d4c99b;background:linear-gradient(#fff7ddc9,#f2e8c2b8);border-radius:7px;box-shadow:inset 0 0 0 1px #fff8,0 1px 0 #66754524;color:#3b5842}.bag-slot .item-icon{width:36px;height:36px;flex-shrink:0;image-rendering:pixelated}.bag-slot-name{display:block;font-size:9px;line-height:1.25;font-weight:800;white-space:nowrap;letter-spacing:-.2px}.bag-slot-count{display:block;font-size:9px;line-height:1.2;white-space:nowrap;font-weight:700;color:#3b6547}.bag-slot.empty{background:#f5efd284;border-style:dashed;border-color:#c9c7a4;box-shadow:inset 0 0 0 1px #fff4}.bag-slot.empty .item-icon{opacity:.35;filter:grayscale(.55)}.bag-slot.empty .bag-slot-name{color:#7d866d}.bag-slot.empty .bag-slot-count{color:#68765d;font-weight:600}.game-inventory .smallprint{font-size:9px;line-height:1.4;margin:6px 0 0}.game-orders:has(+ .game-inventory details[open]) .hud-order-scroll{max-height:max(65px,calc(100dvh - 525px))}

.world-picker{position:fixed;left:10px;top:10px;z-index:250;width:min(335px,calc(100vw - 20px));max-height:min(410px,calc(100dvh - 24px));display:flex;flex-direction:column;overflow:hidden;background:#fff9e5eb;border-color:#e6dfbcae;box-shadow:0 9px 32px #19392d66;pointer-events:auto}.world-picker-head{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:11px 13px;background:#e5edcbe0;border-bottom:1px solid #bacb9b91;flex-shrink:0}.world-picker-head strong{font-size:13px;color:#365d42}.world-picker-head small{display:block;font-size:9px;color:#708161;margin-top:2px}.world-picker-head button{border:0;background:#fbf6da8c;min-height:32px;min-width:32px;padding:0;font-size:20px;border-radius:6px}.world-picker-list{padding:6px;overflow:auto;min-height:0;overscroll-behavior:contain;scrollbar-width:thin}.world-picker-row{display:flex;align-items:center;gap:9px;width:100%;padding:5px 8px;min-height:59px;text-align:left;border:1px solid #dce2c2;border-radius:7px;background:#fffbeaab;margin-bottom:5px}.world-picker-row:last-child{margin-bottom:0}.world-picker-row:hover,.world-picker-row:focus-visible{background:#e9f0d6;border-color:#98b07f}.world-picker-row .picker-avatar{width:30px;height:45px;flex-shrink:0}.picker-person{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}.picker-person>span{display:flex;align-items:center;gap:7px}.picker-person small{font-size:10px;color:#5f8053;font-weight:800;white-space:nowrap}.picker-person b{font-size:12px;color:#314c39;overflow-wrap:anywhere}.picker-person em{font-size:9px;font-style:normal;font-weight:400;color:#7a8669}.picker-select{font-size:10px;color:#527549;white-space:nowrap}.world-picker-note{margin:0;padding:7px 12px 9px;font-size:9px;line-height:1.5;color:#7a8167;border-top:1px solid #e0e3c58c;flex-shrink:0}
@media(max-width:760px){.game-inventory{width:min(320px,calc(100vw - 16px))}.game-inventory .bag-slots{grid-auto-rows:70px;gap:5px}.bag-slot .item-icon{width:31px;height:31px}.bag-slot-name,.bag-slot-count{font-size:8px}.game-inventory details>summary{min-height:38px}.game-orders:has(+ .game-inventory details[open]) .hud-order-scroll{max-height:max(65px,calc(100dvh - 470px))}.world-name .world-nation,.student-game .world-name .world-nation{font-size:7px;padding-right:3px}.world-name .self-label{font-size:7px;padding:0 2px}}
@media(max-height:570px){.game-inventory .bag-slots{grid-auto-rows:59px}.bag-slot .item-icon{width:26px;height:26px}.bag-slot-name,.bag-slot-count{font-size:8px}.game-inventory .smallprint{display:none}.game-orders:has(+ .game-inventory details[open]) .hud-order-scroll{max-height:65px}}
.port-toolbar .port-offer-shortcut{margin-left:auto;background:#e7edd8;color:#416c4f;border-color:#9eb68b}.port-offer-shortcut[hidden]{display:none}
.world-actor:disabled{pointer-events:none}.world-actor:hover{z-index:1850!important}

/* Explain the authoritative chat pause without dimming the editable draft. */
.student-game .chat-feedback.blocked{color:#8b3d23;background:#fff0d4c9;border-radius:4px;padding:4px 5px;line-height:1.5;font-size:10px;margin-top:4px;min-height:24px}.student-game .port-chat-form button:disabled{opacity:.72}

/* v1.6: a dedicated movement surface keeps walking separate from merchant taps. */
body.student-game{--bagbar-height:126px}
.student-game .port-hint{left:18px;right:auto;bottom:var(--bagbar-height);z-index:24;gap:4px;align-items:center;pointer-events:none}
.student-game .port-joystick{position:relative;display:block;flex-shrink:0;width:138px;height:138px;min-width:138px;min-height:138px;padding:0;border:2px solid #fff3c4bb;border-radius:50%;touch-action:none;user-select:none;-webkit-user-select:none;pointer-events:auto;color:#47634f;background:radial-gradient(circle at center,#fff7dfc4 0 33%,#d5dbb4b8 34% 52%,#fff7dfb8 53% 69%,#aab9958c 70%);box-shadow:inset 0 2px 8px #fff8,0 4px 16px #213d3b33;transition:box-shadow .15s;cursor:grab;--stick-x:0px;--stick-y:0px}
.student-game .port-joystick:hover,.student-game .port-joystick:active{transform:none;background:radial-gradient(circle at center,#fff7dfc4 0 33%,#d5dbb4b8 34% 52%,#fff7dfb8 53% 69%,#aab9958c 70%)}
.student-game .port-joystick:focus-visible{outline:3px solid #e6bd60;outline-offset:3px}
.joystick-rim{position:absolute;inset:4px;border:1px solid #70835e66;border-radius:50%;pointer-events:none}.joystick-rim i{position:absolute;font-size:14px;font-weight:800;font-style:normal;line-height:1;color:#6c7e558c}.joystick-rim i:nth-child(1){top:3px;left:calc(50% - 5px)}.joystick-rim i:nth-child(2){right:3px;top:calc(50% - 7px)}.joystick-rim i:nth-child(3){bottom:3px;left:calc(50% - 5px)}.joystick-rim i:nth-child(4){left:3px;top:calc(50% - 7px)}
.joystick-knob{position:absolute;left:50%;top:50%;display:grid;place-items:center;width:56px;height:56px;transform:translate(-50%,-50%) translate(var(--stick-x),var(--stick-y));border:2px solid #acaf7e;border-radius:50%;background:radial-gradient(circle at 35% 25%,#fffef1,#e6e8c8 70%);color:#4b6b52;box-shadow:0 4px 7px #314c3a44,inset 0 2px 2px #fff9;pointer-events:none;transition:transform .12s ease-out}.joystick-knob>span{font-size:10px;letter-spacing:.5px;font-weight:800}
.port-joystick.dragging{cursor:grabbing}.port-joystick.dragging .joystick-knob{transition:none}.port-joystick.held .joystick-knob{background:radial-gradient(circle at 35% 25%,#5e9a80,#347260 70%);border-color:#a7c593;color:#fff8d8}.student-game .port-joystick:disabled{opacity:.5;cursor:default}
.pad-caption{font-size:9px;background:#fffae4c4;border-radius:9px;color:#365442;padding:2px 7px;line-height:1.4}
.student-game .port-chat{bottom:var(--bagbar-height)}
.student-game .port-chat.minimized{bottom:var(--bagbar-height)!important}
.student-game .game-orders .hud-order-scroll{max-height:max(65px,calc(100dvh - 475px))}
.student-game .world-actor.in-trade-range:not(.offline) .world-name{border-color:#47825f;box-shadow:0 0 0 1px #72a87880,0 1px 3px #223d3d3d}
.student-game .game-drawer{bottom:var(--bagbar-height)}
.student-game #toast{bottom:calc(var(--bagbar-height) + 8px)}
.student-game .game-news{bottom:calc(var(--bagbar-height) + 168px)}
@media(max-width:760px){
  body.student-game{--bagbar-height:112px}
  .student-game .port-hint{left:9px;right:auto;bottom:var(--bagbar-height)}
  .student-game .port-joystick{width:128px;height:128px;min-width:128px;min-height:128px}
  .student-game .port-chat{bottom:var(--bagbar-height);width:min(220px,calc(100vw - 154px))}
  .student-game .port-chat.minimized{bottom:var(--bagbar-height)!important}
  .student-game .game-orders .hud-order-scroll{max-height:max(65px,calc(100dvh - 455px))}
  .student-game .game-orders{top:88px}
  .student-game .port-toolbar{top:88px}
  .student-game .port-recent{top:130px}
  .student-game .game-drawer{top:88px}
}
@media(max-height:570px){
  body.student-game{--bagbar-height:105px}
  .student-game .port-joystick{width:116px;height:116px;min-width:116px;min-height:116px}.joystick-knob{width:50px;height:50px}
  .student-game .pad-caption{display:none}
}

/* A locator follows the selected merchant through movement and state refreshes. */
.merchant-location-marker{position:fixed;z-index:80;width:160px;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:1px;pointer-events:none;text-align:center}
.merchant-location-marker[hidden]{display:none}
.location-person{max-width:160px;padding:4px 9px;border:2px solid #fff7ce;border-radius:20px;background:#70521bf2;color:#fff7da;box-shadow:0 3px 12px #263e3b55;font-size:12px;font-weight:800;white-space:nowrap;line-height:1.4}
.merchant-location-marker>b{font-size:23px;line-height:1;color:#ffe28a;text-shadow:0 2px #645021,1px 0 #645021,-1px 0 #645021;animation:location-arrow .7s ease-in-out infinite alternate}
.student-game .world-actor.find-target{z-index:2100!important}.student-game .world-actor.find-target .world-name{outline:2px solid #ffef9a;outline-offset:2px;box-shadow:0 0 0 4px #b88a33b3}.student-game .world-actor.find-target .avatar{filter:drop-shadow(0 0 4px #fff4a1)!important}
.student-game .world-actor.find-target:after{content:'';position:absolute;width:40px;height:13px;bottom:1px;left:50%;transform:translateX(-50%);border:2px solid #ffe7a1;background:#ffe48b55;border-radius:50%;box-shadow:0 0 8px #fff2a1;z-index:-1;animation:location-ring .7s ease-in-out infinite alternate}
@keyframes location-arrow{to{transform:translateY(6px)}}
@keyframes location-ring{to{opacity:.55;transform:translateX(-50%) scale(1.18)}}
@media(prefers-reduced-motion:reduce){.merchant-location-marker>b,.student-game .world-actor.find-target:after{animation:none}}
