/* Light, compact player list and matching map keys. */
body #team-panel.team-panel:not([hidden]){display:flex!important;flex-direction:column;gap:0;width:218px!important;max-width:calc(var(--game-width,100vw) - 24px)!important;max-height:min(340px,calc(var(--game-height,100dvh) - 124px))!important;padding:9px!important;overflow:hidden!important;background:#f8fcf5;border:1px solid #86ac91;border-radius:17px;box-shadow:0 6px 22px #183b2929;color:#254c3d}
#team-panel .section-label{position:static;top:auto;flex:none;display:flex;align-items:center;gap:6px;min-height:32px;padding:0 0 6px;border-bottom:1px solid #e0e9db;background:transparent}
#team-panel .team-panel-title{display:flex;align-items:center;gap:6px;font-size:13px;line-height:20px;flex:1;font-weight:700}
#team-panel .team-panel-title svg{width:17px;height:17px;flex:none}
#team-panel #team-alive{font:500 11px/20px Consolas,monospace;color:#567c65;white-space:nowrap}
#team-panel #team-close{width:28px;height:28px;min-height:28px;padding:5px;border:1px solid #d5e1d0;border-radius:50%;background:#fff;color:#587260}
#team-panel #team-close svg{width:15px;height:15px}
#team-list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#a6c0aa transparent;padding:3px 0}
#team-list:focus-visible{outline:2px solid #74a28a;outline-offset:-2px;border-radius:9px}
#team-panel .team-member{display:flex;align-items:center;gap:6px;min-height:34px;padding:4px;border:0;border-bottom:1px solid #e5ecdf;font-size:12px;line-height:18px;color:#2a503f}
#team-panel .team-member:last-child{border-bottom:0}
#team-panel .team-member.is-self{background:#e5f2dc;border-radius:9px;border-bottom-color:transparent}
#team-panel .team-avatar{display:grid;place-items:center;flex:0 0 24px;width:24px;height:24px;border:1px solid #adcbb9;border-radius:50%;background:#eff5eb;color:#345a4b;font-size:12px;line-height:1}
#team-panel .is-self .team-avatar{background:#d5eadd;border-color:#83ab99}
#team-panel .team-member>.team-presence,.team-legend .team-presence{display:inline-block;width:6px;height:6px;border-radius:50%;background:#409d55;flex:0 0 6px}
#team-panel .team-name{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#team-panel .team-tags{display:flex;align-items:center;gap:3px;flex:none;margin-left:auto}
#team-panel .team-chip{font:500 9px/16px 'Microsoft YaHei',sans-serif;border:1px solid #b4cabb;border-radius:5px;padding:0 3px;color:#66816e;white-space:nowrap}
#team-panel .team-self-tag{background:#c6e7b3;border-color:#a9d596;color:#30633d}
#team-panel .team-state{border-color:#d6dbd0;color:#818b7e;font-size:9px}
#team-panel .team-member.dead{color:#8b9589}
#team-panel .dead .team-name{text-decoration:line-through;text-decoration-color:#a9b3a5}
#team-panel .dead .team-avatar{background:#f0f2ed;border-color:#d2d9cc;color:#9aa494}
#team-panel .dead>.team-presence,.team-legend .is-dead{background:#a6afa0}
#team-panel .reconnecting>.team-presence{background:#c39243}
#team-panel .team-legend{display:flex;align-items:center;gap:12px;flex:none;padding:6px 4px 0;border-top:1px solid #e0e9db;font-size:10px;line-height:18px;color:#6a816d}
#team-panel .team-legend>span{display:flex;align-items:center;gap:5px;white-space:nowrap}
body.touch-directional:is(.playing-portrait,.playing-landscape) #team-panel.team-panel{right:calc(8px + var(--hud-right,0px))!important;bottom:calc(64px + var(--hud-bottom,0px))!important;width:min(218px,calc(var(--game-width,100vw) - 156px - var(--hud-left,0px) - var(--hud-right,0px)))!important}

#map-modal .map-modal{background:#f8fbf5;border:1px solid #d8e4d3;border-radius:18px;box-shadow:0 12px 45px #102e2529;max-height:calc(var(--game-height,100dvh) - 24px);overflow:auto}
#map-modal .modal-title{gap:8px;margin-bottom:10px;align-items:center}
#map-modal .modal-title h2{font-size:18px;line-height:26px;font-weight:750;color:#244d3b}
#map-modal .modal-title>.icon-button{order:2;width:32px;height:32px;min-height:32px;border:1px solid #dae5d5;border-radius:50%;background:#fff}
#map-modal .modal-title>.icon-button svg{width:17px;height:17px}
#map-modal #map-time{order:1;flex-basis:auto;max-width:max-content;border:1px solid #dce8d6;border-radius:14px;background:#edf5e7;padding:3px 8px;font-size:11px;line-height:17px;color:#60865e}
#map-modal #map-canvas{border:1px solid #d8ddcc;border-radius:12px;background:#e7e3d5}
#map-modal .map-sidebar{gap:8px;margin-top:10px;padding:0;color:#375d48}
#map-modal .map-sidebar>.map-key-group,#map-modal .map-sidebar>.map-key-group:first-child{border:1px solid #e0e8d8;border-radius:12px;padding:9px;background:#f0f5eb;margin:0}
#map-modal .map-key-group h3{margin:0 0 6px;font-size:11px;line-height:16px;font-weight:600;color:#6a8167}
#map-modal .map-legend-row{gap:5px;grid-template-columns:repeat(3,minmax(0,1fr))}
#map-modal .map-sidebar>.map-key-group:nth-child(2) .map-legend-row{grid-template-columns:repeat(2,minmax(0,1fr))}
#map-modal .map-legend-row>span{display:flex;align-items:center;gap:5px;min-width:0;min-height:32px;padding:4px 5px;border:1px solid #e1e8da;border-radius:8px;background:#fffef9;white-space:nowrap;font-size:12px;line-height:22px;color:#375543}
#map-modal .map-legend-row>.energy-legend{grid-column:auto}
#map-modal .map-legend .loot-key{display:inline-grid;place-items:center;width:20px;height:20px;line-height:20px;border-radius:5px;font-size:12px;font-weight:650}
#map-modal .map-legend .green{width:8px;height:8px;margin:6px;flex:0 0 8px}
#map-modal .map-legend-row>span:nth-child(2)>b:not(.loot-key){width:8px;height:8px;margin:6px;flex:0 0 8px}
body.playing-landscape #map-modal .map-sidebar{margin-top:0;padding-right:0}
body.playing-landscape #map-modal .map-key-group:first-child .map-legend-row>span{font-size:11px;padding:4px 3px;gap:3px}
body.playing-landscape #map-modal .map-key-group:first-child .loot-key{width:18px;height:18px;line-height:18px}
body.playing-landscape #map-modal .map-key-group:first-child .map-legend b:not(.loot-key){margin:5px}
body.touch-directional.playing-portrait #map-modal #map-canvas{width:min(100%,calc(var(--game-height,100dvh) - 300px))}
@media(max-width:350px){#map-modal .map-legend-row>span{font-size:11px;padding:4px;gap:3px}#map-modal .map-sidebar>.map-key-group{padding:7px}}

/* Runner task: one shared card for expanded and collapsed states. */
body #mission.is-hunter .runner-mission-icon,body #mission.is-hunter .runner-mission-summary{display:none!important}
body #mission.mission:not(.is-hunter){display:block;width:340px;max-width:calc(var(--game-width,100vw) - 24px);height:auto;max-height:calc(var(--game-height,100dvh) - 160px);padding:12px 14px;border:1px solid #d7e3d3;border-radius:17px;background:#f8fbf5f5;box-shadow:0 4px 16px #24473420;overflow:auto}
body #mission:not(.is-hunter) .mission-header{display:grid;grid-template-columns:18px minmax(0,1fr) auto;grid-template-rows:24px auto;gap:5px 7px;min-height:0;cursor:pointer;padding:0;position:static}
body #mission:not(.is-hunter) .mission-tag{display:block!important;grid-column:1/3;grid-row:1;align-self:center;padding:0;border:0;border-radius:0;background:none;color:#718574;font-size:11px;line-height:20px;font-weight:400;letter-spacing:1px}
body #mission:not(.is-hunter) .mission-header .icon-button{grid-column:3;grid-row:1;justify-self:end;position:static;width:28px;height:28px;min-height:28px;padding:5px;color:#537b67;margin:-2px -4px 0 0}
body #mission:not(.is-hunter) .runner-mission-icon{display:grid;grid-column:1;grid-row:2;place-items:center;color:#ce594b}
body #mission:not(.is-hunter) .runner-mission-icon svg{width:18px;height:18px}
body #mission:not(.is-hunter) .mission-header #mission-title{grid-column:2;grid-row:2;font-size:13px;line-height:24px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;color:#294d3e}
body #mission:not(.is-hunter) #mission-countdown{display:none!important}
body #mission:not(.is-hunter) .runner-mission-summary{display:flex!important;grid-column:3;grid-row:2;align-items:center;gap:7px;position:static;margin:0;padding:0;border:0;background:none;white-space:nowrap;line-height:22px;font-variant-numeric:tabular-nums}
body #mission:not(.is-hunter) .runner-mission-summary>span{padding:1px 6px;border-radius:7px;background:#ffebe3;color:#bf5e46;font-size:10px}
body #mission:not(.is-hunter) .runner-mission-summary>strong{padding:0;border:0;font-size:10px;font-weight:500;color:#748569}
body #mission:not(.is-hunter):not(.is-collapsed) .runner-mission-summary>strong{display:none}
body #mission:not(.is-hunter) #alarm-message{font-size:12px!important;line-height:1.8!important;margin:12px 0!important;color:#6b7e70}
body #mission:not(.is-hunter) #alarm-message .alarm-number{font-size:inherit!important;color:#cf5b43}
body #mission:not(.is-hunter) .mission-objective{margin:0;padding-top:9px;border-top:1px solid #e0e7d9;font-size:11px;line-height:20px;gap:5px;color:#718369}
body #mission:not(.is-hunter) .mission-objective b{color:#69805d}
body #mission:not(.is-hunter) .mission-reward{display:none}
body.touch-directional:is(.playing-portrait,.playing-landscape) #mission.mission:not(.is-hunter){width:min(340px,calc(var(--game-width,100vw) - 64px))!important;max-width:calc(var(--game-width,100vw) - 64px)!important;padding:10px 12px!important;border:1px solid #d7e3d3!important;border-radius:17px!important;max-height:calc(var(--game-height,100dvh) - 160px);overflow:auto}
@media(max-width:360px){body #mission:not(.is-hunter) .mission-header{gap:4px}body #mission:not(.is-hunter) .mission-header #mission-title{font-size:12px!important}body #mission:not(.is-hunter) .runner-mission-summary{gap:4px}body #mission:not(.is-hunter) .runner-mission-summary>span{padding:1px 4px}}

/* Shared portrait/landscape overflow menu, approved light list. */
#portrait-menu{padding:5px 8px 7px;background:#f9fcf6;border:1px solid #cfdfd1;border-radius:14px;box-shadow:0 6px 20px #173e2929;color:#2b513f;min-width:160px}
#portrait-menu .compact-menu-heading{display:flex;align-items:center;justify-content:space-between;padding:1px 2px 5px;border-bottom:1px solid #e0e8dc}
#portrait-menu .compact-menu-heading strong{font-size:11px;font-weight:600;color:#718773}
#portrait-menu #portrait-menu-close{width:28px;height:28px;min-height:28px;padding:5px;justify-content:center;border:0;border-radius:50%;color:#65806d}
#portrait-menu #portrait-menu-close svg{width:15px;height:15px}
#portrait-menu>button{height:44px;min-height:44px;gap:8px;padding:0 4px;border:0;border-bottom:1px solid #e5ebdf;border-radius:0;font-size:12px}
#portrait-menu>button:last-child{border:0}
#portrait-menu>button svg{width:17px;height:17px;flex:none}
#portrait-menu #portrait-leave{color:#b85548;background:#fff2ed;border-radius:8px;margin-top:4px;height:40px;min-height:40px}
#portrait-menu .compact-sound-switch{margin-left:auto;width:26px;height:16px;border-radius:12px;background:#b5c4b5;padding:2px;flex:none}
#portrait-menu .compact-sound-switch:after{content:'';display:block;width:12px;height:12px;background:white;border-radius:50%;box-shadow:0 1px 2px #203c2326}
#portrait-menu [aria-pressed=true] .compact-sound-switch{background:#4d9a6b}
#portrait-menu [aria-pressed=true] .compact-sound-switch:after{transform:translateX(10px)}
#portrait-menu button:focus-visible{outline:2px solid #5d9277;outline-offset:-2px}
body.playing-landscape #map-modal .map-modal{grid-template-columns:minmax(0,1fr) 224px;column-gap:12px;width:min(720px,calc(var(--game-width) - 24px));padding:10px;border-radius:18px}
body.playing-landscape #map-modal .map-sidebar{gap:7px;max-height:calc(var(--game-height) - 94px)}
body.playing-landscape #map-modal #map-canvas{width:min(100%,calc(var(--game-height) - 94px));max-height:calc(var(--game-height) - 94px)}
body.playing-landscape #map-modal .map-sidebar>.map-key-group{padding:8px}
/* Desktop task stays under the location label; the map controls keep their corner. */
body:not(.touch-directional) #mission#mission.mission{position:fixed!important;left:16px!important;right:auto!important;top:var(--desktop-mission-top,158px)!important;bottom:auto!important;transform:none!important;max-height:calc(var(--game-height,100dvh) - 210px)!important;overflow:visible!important;max-width:calc(var(--game-width,100vw) - 32px)!important}
body:not(.touch-directional) #mission#mission.mission.is-collapsed{width:max-content!important}
body:not(.touch-directional) #mission#mission.mission:not(.is-collapsed){width:280px!important}
body:not(.touch-directional) #portrait-stamina:not([hidden]){display:block;position:fixed;z-index:4;width:48px;height:5px;padding:1px;box-sizing:content-box;background:#203b33a8;border:1px solid #efffe0a0;border-radius:5px;transform:translate(-50%,-50%);pointer-events:none}
body:not(.touch-directional) #player-state .stamina{display:none}

body:not(.touch-directional) #inventory-hud.inventory-hud{left:50%!important;right:auto!important;top:auto!important;bottom:88px!important;transform:translateX(-50%);display:flex;flex-direction:row!important;align-items:center!important;flex-wrap:wrap;gap:6px;width:max-content;max-width:calc(100vw - 360px);height:auto!important;min-height:0;max-height:110px;overflow:auto}
body:not(.touch-directional) #inventory-hud>button,body:not(.touch-directional) #inventory-hud>span{height:42px!important;min-height:42px;max-height:42px;flex:0 0 auto}
#player-state #score{white-space:nowrap;flex-shrink:0;font-size:11px;line-height:18px;min-width:40px}

body:not(.touch-directional) #inventory-hud.inventory-hud{left:auto!important;right:14px!important;top:50%!important;bottom:auto!important;transform:translateY(-50%);flex-direction:column!important;max-width:64px;max-height:55dvh}
#context-action.alarm-context{left:auto!important;right:16px!important;bottom:160px!important;transform:none!important;max-width:180px}

/* Context actions remain discoverable without covering the map/team controls. */
#context-action,#context-action.alarm-context{left:50%!important;right:auto!important;bottom:22%!important;transform:translateX(-50%)!important;max-width:70vw!important}
#context-button{min-width:210px;min-height:56px;font-size:18px;font-weight:700;border:2px solid #e2c783;box-shadow:0 4px 18px #18362d55}
@media(max-width:600px){#context-action,#context-action.alarm-context{bottom:29%!important}#context-button{min-width:185px;min-height:50px;font-size:16px}}

#game.hiding-at-corner::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 48%, rgba(15, 30, 23, .38) 100%);
}

#game-help {
  width: min(640px, calc(100vw - 24px));
  max-height: 86dvh;
  padding: 16px;
  border: 1px solid #c6d8cc;
  border-radius: 14px;
  background: #f9fcf5;
  color: #203831;
  overflow: auto;
  overscroll-behavior: contain;
  line-height: 1.55;
}
#game-help::backdrop { background: #142a21a6; }
#game-help header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#game-help details { margin-top: 10px; border: 1px solid #d7e3d8; border-radius: 8px; padding: 8px 12px; }
#game-help summary { cursor: pointer; font-weight: 700; padding: 3px 0; }
#game-help p, #game-help dt { margin-top: 8px; }
#game-help dt { font-weight: 700; }
#game-help dd { margin: 2px 0 8px; }
#game-help-open { font-weight: 800; }

/* Desktop match events sit just below the scoreboard. */
body:not(.touch-directional):has(#mission:not([hidden])) #events.events {
  top: 96px !important;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 24px);
  max-height: none;
  align-items: center;
  gap: 6px;
}

body:not(.touch-directional) #events.events > div {
  padding: 8px 16px;
  max-width: 100%;
  font-size: clamp(14px, 2.25vw, 18px);
  font-weight: 700;
  text-align: center;
}
