/* Gameplay chrome floats above the full-size table. Empty overlay space passes through. */
#game { position: relative; height: calc(100dvh - 72px); min-height: 540px; }
#game .scene-stage, #game #scene { width: 100%; height: 100%; }
#game .game-bar { position: absolute; inset: 0; z-index: 4; margin: 0; padding: 0; border: 0; pointer-events: none; }
.game-hud { position: absolute; inset: 0 auto 0 0; width: clamp(168px, 15vw, 232px); padding: 12px 0 12px 12px; display:flex; flex-direction:column; pointer-events: none; }
.hud-side { position: absolute; left: 12px; width: calc(100% - 12px); display: flex; flex-direction: column; gap: 7px;
  padding: 12px 13px; border: 1px solid #42586a; border-radius: 9px;
  background: linear-gradient(135deg,#142338ec,#0a1522e5 72%);
  box-shadow: 0 10px 25px #0009, inset 0 1px #d8e8f01c; color: #d9e4ec; font-size: 11px; }
.hud-side::before { content:''; position:absolute; left:10px; right:10px; top:0; height:1px; background:linear-gradient(90deg,transparent,currentColor,transparent); opacity:.55; }
.hud-opponent { position:relative; top:auto; }
.hud-own { bottom: 12px; }
.faction-rebel { color:#df898c; border-color: #a34e54; box-shadow: 0 10px 25px #0009,0 0 13px #c6504d28,inset 2px 0 #bd545a; }
.faction-empire { color:#87b8ea; border-color: #4a83bf; box-shadow: 0 10px 25px #0009,0 0 13px #317bce30,inset 2px 0 #538bc5; }
.hud-identity { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hud-faction-mark { flex: none; display: grid; place-items: center; width: 40px; height: 40px; line-height: 1; }
.hud-faction-mark img { display:block; width:100%; height:100%; object-fit:contain; filter:drop-shadow(0 0 4px currentColor); }
.hud-player-name { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hud-player-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: #f3eee2; }
.hud-player-name small { font-size: 10px; letter-spacing: .06em; color: #a8bac7; }
.hud-victories { align-self: flex-start; margin: 0; padding: 2px 0; border: 0; border-radius: 0;
  background: transparent; font-size: 11px; letter-spacing: .04em; color: #e9cd93; pointer-events: auto; }
.hud-victories::before { content:'✦'; margin-right:6px; color:currentColor; }
.hud-victories:hover { background: transparent; color: #fff0bb; text-decoration: underline; }
.hud-values { display: flex; flex-direction:column; gap: 3px; color: #f2dcaa; font-size: 11px; font-weight: 700; }
.hud-values span { padding:3px 6px; border-left:2px solid #a9946b; background:#d8e6f00c; }
.hud-force { color: #9ac8dd; font-size: 9px; letter-spacing: .04em; line-height: 1.25; }
.hud-base { display: flex; flex-direction: column; gap: 5px; padding-top:7px; border-top:1px solid #b6cddd2c; color: #cad9e2; font-size: 10px; }
.hud-base-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.hud-base strong { color: #f0e1b4; font-size: 11px; font-weight: 700; }
.hud-health { height: 10px; overflow: hidden; border-radius: 3px; background: #283540; border: 1px solid #63717b; }
.hud-health-fill { display: block; height: 100%; background: #8bb9bc; transition: width .24s ease; box-shadow:0 0 8px currentColor; }
.hud-health::after { content:''; display:block; position:relative; top:-100%; width:100%; height:100%; background:repeating-linear-gradient(90deg,transparent 0,transparent calc(12.5% - 2px),#08111d9c calc(12.5% - 2px),#08111d9c 12.5%); pointer-events:none; }
.faction-rebel .hud-health-fill { background: #c76d70; }
.faction-empire .hud-health-fill { background: #6da6d6; }
.hud-card-count { padding-top:5px; border-top:1px solid #b6cddd24; color: #aebfce; font-size: 10px; }
.hud-turn { position: relative; left: 12px; top:auto; margin-top:14px; width: calc(100% - 12px); display: flex;
  flex-direction: column; gap: 3px; padding: 8px 10px; border: 1px solid #746852;
  border-radius: 7px; background: #101d29d4; box-shadow: 0 6px 20px #0007; }
.hud-turn strong { color: #f3d89c; font-size: 15px; line-height: 1.2; letter-spacing: .05em; }
.hud-instruction { color: #dbe8f1; font-size: 10px; line-height: 1.25; }
.hud-turn p { color: #c3d1dc; font-size: 10px; line-height: 1.35; overflow-wrap: anywhere; }
.hud-turn small { color: #8da3b4; font-size: 9px; }
.hud-turn-flash { position: absolute; left: 50vw; top: 44%; transform: translate(-50%, -50%); z-index: 7;
  padding: 10px 24px; border: 1px solid #dac184; border-radius: 7px; background: #111e2bef;
  box-shadow: 0 8px 22px #000b; color: #ffe6aa; font-size: 18px; font-weight: 700;
  letter-spacing: 2px; white-space: nowrap; pointer-events: none; }
.game-actions { position: absolute; right: 12px; top: 12px; width: clamp(130px, 11vw, 168px);
  display: flex; flex-direction: column; align-items: stretch; gap: 6px; pointer-events: none; }
.game-actions button { margin: 0 !important; pointer-events: auto; background: #101d29df; }
.game-actions #end-turn { min-height: 54px; border-color: #ae9564; color: #f4dca4; font-size: 12px; font-weight: 700; box-shadow:0 0 14px #bb98552c; }
.game-actions #open-controls { font-size: 9px; color: #9db1bd; border-color: #42566a; }
#game #scene-status { position: absolute; bottom: 3px; left: 50%; z-index: 2; transform: translateX(-50%);
  max-width: 44vw; margin: 0; color: #718493; font-size: 9px; pointer-events: none; }
.technical-controls { top: 72px; right: 12px; max-height: calc(100dvh - 82px); z-index: 8; }
.technical-controls:not([open]) { display: none; }
.scene-stage>#pending:empty { display: none; }
.scene-stage>#pending.damage-allocation { width:min(380px,calc(100% - 24px)); max-height:60%; }
.allocation-ship { width:100%; display:flex; align-items:center; gap:10px; padding:7px;
  background:#2233469c; border:1px solid #6585a1; border-radius:6px; }
.allocation-ship .card-face { width:43px; flex:none; }
.allocation-details { flex:1; min-width:0; display:flex; flex-direction:column; gap:4px; }
.allocation-details strong { color:#ebdfbd; font-size:11px; }
.allocation-details span { color:#bdd3e1; font-size:10px; }
.allocation-amounts { display:flex; flex-wrap:wrap; gap:4px; }
.allocation-amounts button { min-width:29px; padding:4px 7px; margin:0; border-color:#769cb8; color:#e5f3ff; }
.scene-labels .scene-label-hp { padding: 2px 4px; background: #101b27c9; color: #d7caa8;
  border: 0; border-radius: 3px; font-size: 9px; font-weight: 600; letter-spacing: .1px; }
.scene-labels .scene-label-count { padding: 2px 5px; border-radius: 4px; background: #101a25d9;
  color: #b9c9d4; font-size: 10px; letter-spacing: .3px; }
.game-over { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 7;
  min-width: min(360px,calc(100% - 28px)); padding: 26px 34px; text-align: center;
  border: 1px solid #d3b773; border-radius: 10px; background: #101b28ed;
  box-shadow: 0 18px 46px #000d; pointer-events: none; }
.game-over h2 { color: #ffdd98; font-size: 32px; letter-spacing: 3px; margin-bottom: 8px; }
.game-over p { color: #d7e3ec; font-size: 13px; }
.victory-inspection { width: min(760px,92vw); max-height: 82vh; padding: 20px; border: 1px solid #9e875d;
  border-radius: 8px; background: #101d29; color: #dce6ed; }
.victory-inspection::backdrop { background: #02070bc7; }
.victory-inspection h2 { font-size: 15px; color: #f1dba5; margin-bottom: 15px; }
.victory-inspection .hud-victory-cards { display: flex; gap: 14px; flex-wrap: wrap; max-height: 65vh; overflow: auto; }
.victory-inspection figure { width: 150px; margin: 0; }
.victory-inspection figure .card-face { width: 100%; }
.victory-inspection figcaption { margin: 5px 0 12px; font-size: 11px; }
.victory-inspection>button { margin-top: 12px; }
@media (max-width: 1360px) {
  .game-hud { width: 150px; padding-left: 0; }
  .hud-side { left: 0; width: calc(100% - 5px); padding-left: 9px; padding-right: 9px; }
  .hud-turn { left: -4px; width: 116px; padding-left: 7px; padding-right: 7px; }
  .hud-own { padding-top: 6px; padding-bottom: 6px; gap: 4px; }
  .hud-faction-mark { width: 34px; height: 34px; }
  .hud-identity { gap: 5px; }
  .hud-player-name strong { font-size: 12px; }
  .hud-player-name small { font-size: 8px; letter-spacing: .02em; }
  .hud-values { font-size: 10px; }
  .game-actions { right: 5px; width: 126px; }
}
@media (max-width: 1050px) {
  .game-hud { width: 132px; }
  .hud-side { padding: 7px 6px; gap: 4px; }
  .hud-turn { padding: 6px; }
  .hud-turn strong { font-size: 10px; }
  .hud-player-name small { font-size: 8px; }
  .hud-force { font-size: 8px; }
  .game-actions { width: 111px; }
  .game-actions #end-turn { font-size: 9px; }
}

/* Stage 5.6.4: screen-space panels use the reference's illuminated, cut-corner language. */
.game-hud { width:clamp(190px,16.6vw,275px); }
.hud-side {
  --hud-accent:#8ca5bb; --hud-glow:#7099ba55; --hud-bar:#9eb3c7;
  width:calc(100% - 12px); padding:13px 14px 12px; gap:8px;
  border:1px solid var(--hud-accent); border-radius:0;
  clip-path:polygon(0 15px,15px 0,calc(100% - 14px) 0,100% 14px,100% calc(100% - 14px),calc(100% - 14px) 100%,14px 100%,0 calc(100% - 14px));
  background:linear-gradient(120deg,#142032f2 0%,#060c16eb 50%,#050810e8 100%);
  box-shadow:inset 0 0 22px var(--hud-glow),0 0 14px var(--hud-glow),0 12px 30px #000b;
  color:#e9eef4; font-size:14px;
}
.hud-side::before { left:14px;right:14px;top:0;background:linear-gradient(90deg,transparent,var(--hud-accent),transparent);opacity:.8; }
.faction-rebel { --hud-accent:#ed424c; --hud-glow:#d21d305c; --hud-bar:#ff5963; }
.faction-empire { --hud-accent:#36a6f3; --hud-glow:#138cf25e; --hud-bar:#4db5ff; }
.hud-opponent { position:relative; }
.hud-own { bottom:12px; }
.hud-identity { gap:10px; padding-bottom:7px; border-bottom:1px solid #d5e5f02a; }
.hud-faction-mark { width:50px;height:50px; }
.hud-faction-mark img { filter:drop-shadow(0 0 8px var(--hud-accent)); }
.hud-player-name { gap:1px; }
.hud-player-name strong { font-size:16px;line-height:1.05;letter-spacing:.02em;color:#fff; }
.hud-opponent .hud-player-name strong { font-size:clamp(12px,1.1vw,16px); }
.hud-player-name small { font-size:10px;line-height:1.1;color:#d4e0e9;max-width:145px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.hud-player-name em { font-size:10px;font-style:normal;color:#a9bcca; }
.hud-victories { display:flex;align-items:center;gap:7px;color:#f2f3f5;font-size:12px;font-weight:500;letter-spacing:0;padding:1px 0; }
.hud-victories::before { display:none; }
.hud-victories:hover { color:#fff;text-decoration:none;text-shadow:0 0 8px var(--hud-accent); }
.hud-icon { display:inline-block;min-width:19px;color:#dcefff;text-align:center;font-size:19px;line-height:1; }
.hud-values { gap:3px;color:#f0f4f7;font-size:13px;font-weight:500; }
.hud-values .hud-value { display:flex;align-items:center;gap:8px;padding:0;background:none;border:0; }
.hud-force { display:flex;align-items:center;gap:7px;padding:4px 6px 4px 1px;border-radius:5px;
  background:linear-gradient(90deg,var(--hud-glow),transparent);color:#fff;font-size:10px;font-weight:700;letter-spacing:.02em;
  text-shadow:0 0 8px var(--hud-accent); }
.hud-force .hud-icon { color:var(--hud-accent); }
.hud-base { gap:6px;padding-top:2px;border-top:0;color:#eff3f6;font-size:12px; }
.hud-base-heading { justify-content:flex-start;gap:7px; }
.hud-base strong { color:#fff;font-size:13px; }
.hud-health { display:grid;width:100%;height:13px;overflow:visible;padding:0;border:0;border-radius:0;background:transparent; }
.hud-health::after { display:none; }
.hud-health-segment { display:block;min-width:0;height:100%;border:1px solid #52616f;background:#26303e;box-shadow:inset 0 1px 2px #000a; }
.hud-health-segment.filled { border-color:var(--hud-bar);background:var(--hud-bar);box-shadow:0 0 6px var(--hud-accent),inset 0 1px 2px #fff8; }
.hud-card-count { display:flex;align-items:center;gap:7px;padding-top:7px;border-top:1px solid #d5e5f02a;
  color:#e6eef4;font-size:12px; }
.hud-card-count .hud-icon { font-size:18px; }
.hud-turn { position:absolute;left:12px;top:min(42%,calc(100% - 360px));width:calc(100% - 12px);min-height:104px;margin-top:0;padding:16px 14px 12px 61px;
  border:1px solid #378fe6;border-radius:0;
  clip-path:polygon(0 13px,13px 0,calc(100% - 13px) 0,100% 13px,100% calc(100% - 13px),calc(100% - 13px) 100%,13px 100%,0 calc(100% - 13px));
  background:linear-gradient(120deg,#09182aec,#050c15eb);box-shadow:inset 0 0 19px #167de342,0 8px 22px #000a; }
.hud-turn-icon { position:absolute;left:17px;top:20px;color:#44b8ff;font-size:33px;line-height:1;text-shadow:0 0 10px #168aff; }
.hud-turn-icon::after { content:'▼';display:block;text-align:center;font-size:11px;line-height:1;color:#44b8ff; }
.hud-turn strong { color:#fff;font-size:18px;letter-spacing:.02em; }
.hud-instruction { color:#c5d4df;font-size:12px;line-height:1.3; }
.hud-turn small { color:#8199ac;font-size:9px; }
.hud-turn-flash { --hud-accent:#6aa9db;--hud-glow:#167de342;
  padding:15px 23px;border:1px solid var(--hud-accent);border-radius:0;
  clip-path:polygon(0 13px,13px 0,calc(100% - 13px) 0,100% 13px,100% calc(100% - 13px),calc(100% - 13px) 100%,13px 100%,0 calc(100% - 13px));
  background:linear-gradient(120deg,#142032f2,#050b15f2);box-shadow:inset 0 0 18px var(--hud-glow),0 0 14px var(--hud-glow),0 12px 30px #000b;
  color:#f7fbff;font-size:17px;letter-spacing:.05em;text-shadow:0 0 9px var(--hud-accent); }
.hud-turn-flash.faction-rebel { --hud-accent:#ed424c;--hud-glow:#d21d305c; }
.hud-turn-flash.faction-empire { --hud-accent:#36a6f3;--hud-glow:#138cf25e; }
.game-actions { width:clamp(104px,10vw,136px);gap:6px; }
.game-actions #end-turn { min-height:88px;margin-top:8px!important;border:1px solid #249aff;border-radius:9px;
  background:linear-gradient(180deg,#167adb,#064388);box-shadow:0 0 15px #1789f6a3,inset 0 1px 4px #a9e0ff8a;
  color:#fff;font-size:12px;font-weight:700;text-shadow:0 1px 3px #06315a; }
.game-actions #end-turn::before { content:'➜';display:block;font-size:36px;line-height:1.1;margin-bottom:2px; }
.game-actions #open-controls { min-height:40px;border-color:#55749b;background:#091521e8;color:#c4d5e1;font-size:10px; }
.zone-inspection-toolbar,.choice-inspection-toolbar { border-radius:7px;box-shadow:0 8px 22px #000b; }
.zone-inspection-toolbar button,.choice-inspection-toolbar button { opacity:.65;padding:3px 6px; }
@media (max-width:1050px) {
  .game-hud { width:175px; }
  .hud-side { padding:10px 11px;gap:6px; }
  .hud-faction-mark { width:43px;height:43px; }
  .hud-player-name strong { font-size:15px; }
  .hud-player-name small,.hud-player-name em { font-size:9px; }
  .hud-values,.hud-victories,.hud-card-count { font-size:11px; }
  .hud-turn { padding:11px 8px 8px 46px;min-height:75px; }
  .hud-turn-icon { left:10px;top:15px;font-size:25px; }
  .hud-turn strong { font-size:14px; }
  .hud-instruction { font-size:10px; }
  .game-actions #end-turn { min-height:70px;font-size:10px; }
}

/* Stage 5.6.5: object-bound HP and a single compact right-side turn indicator. */
.object-hp-layer { position:absolute;inset:0;z-index:2;pointer-events:none;overflow:hidden; }
.object-hp { --hp-accent:#7ebde9;position:absolute;transform:translate(-50%,-100%);padding:3px 5px 4px;
  border:1px solid var(--hp-accent);border-radius:5px;background:linear-gradient(120deg,#081520f0,#050b12e8);
  box-shadow:0 0 8px color-mix(in srgb,var(--hp-accent) 45%,transparent),0 4px 10px #000b;
  color:#edf7ff;font-size:10px;line-height:1.1; }
.object-hp.faction-rebel { --hp-accent:#ef5661; }
.object-hp.faction-empire { --hp-accent:#53baff; }
.object-hp-heading { display:flex;align-items:center;justify-content:space-between;gap:4px;min-width:0;margin-bottom:4px; }
.object-hp-name { overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px; }
.object-hp-heading strong { flex:none;font-size:10px;color:#fff; }
.object-hp-bar { display:grid;gap:2px;height:7px; }
.object-hp-segment { min-width:0;border:1px solid #526274;border-radius:2px;background:#182635; }
.object-hp-segment.filled { border-color:var(--hp-accent);background:var(--hp-accent);box-shadow:0 0 4px var(--hp-accent); }
.turn-indicator { --hud-accent:#69addf;--hud-glow:#1484e047;align-self:flex-end;min-width:160px;
  padding:10px 12px;border:1px solid var(--hud-accent);color:#f7fbff;
  clip-path:polygon(0 9px,9px 0,calc(100% - 9px) 0,100% 9px,100% calc(100% - 9px),calc(100% - 9px) 100%,9px 100%,0 calc(100% - 9px));
  background:linear-gradient(120deg,#142032ed,#050b15ee);box-shadow:inset 0 0 12px var(--hud-glow),0 0 10px var(--hud-glow);
  font-size:13px;font-weight:700;letter-spacing:.04em;text-align:center;white-space:nowrap; }
.turn-indicator.faction-rebel { --hud-accent:#ed424c;--hud-glow:#d21d305c; }
.turn-indicator.faction-empire { --hud-accent:#36a6f3;--hud-glow:#138cf25e; }
.turn-indicator[hidden] { display:none; }
.game-actions #end-turn { margin-top:0!important; }
.game-actions #undo-action { min-height:34px;padding:5px 7px;border:1px solid #8099ad;border-radius:6px;
  background:#102437e8;color:#d8e9f4;font-size:10px;font-weight:700;line-height:1.2; }
.game-actions #undo-action:disabled { opacity:.45;cursor:not-allowed; }
.victory-inspection .hud-victory-carousel { display:block;position:relative;height:min(48vh,360px);max-height:none;overflow:hidden; }
.victory-inspection .hud-victory-carousel figure { position:absolute;left:50%;top:50%;width:150px;margin:0;
  transform-origin:center;will-change:transform;filter:drop-shadow(0 6px 10px #000a); }
.victory-inspection .hud-victory-carousel figcaption { max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center; }
.victory-inspection .hud-victory-carousel p { padding:22px;text-align:center; }
.victory-inspection .hud-victory-arrow { display:inline-block;margin:0 8px 0 0;padding:5px 13px; }
.victory-inspection .hud-victory-arrow[hidden] { display:none; }
.face-button { border:0; }
.face-button:hover { outline:none;transform:none; }

/* Both player panels stay in their corners without covering the hand fan. */
.game-hud { width:232px;padding:0; }
.hud-side {
  top:auto;bottom:auto;left:12px;width:208px;max-width:calc(100% - 18px);min-height:0;
  display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto;align-items:center;row-gap:3px;padding:6px 8px;
  clip-path:polygon(0 10px,10px 0,calc(100% - 10px) 0,100% 10px,100% calc(100% - 10px),calc(100% - 10px) 100%,10px 100%,0 calc(100% - 10px));
  font-size:12px;
}
.hud-opponent { position:absolute;top:12px; }
.hud-own { bottom:12px; }
/* Uniform visual scale preserves the approved compact composition. */
.hud-opponent { left:3px;top:9px;transform:scale(1.22);transform-origin:top left; }
.hud-own { left:3px;bottom:9px;transform:scale(1.22);transform-origin:bottom left; }
.hud-identity { grid-column:1;grid-row:1;gap:5px;padding:0;border:0; }
.hud-faction-mark { width:30px;height:30px; }
.hud-player-name { min-width:0;max-width:152px; }
.hud-player-name strong,.hud-opponent .hud-player-name strong { font-size:10px;line-height:1.05; }
.hud-player-name small { max-width:152px;font-size:9px; }
.hud-player-name em { font-size:8px; }
.hud-metrics { grid-column:1;grid-row:2;display:flex;align-items:center;justify-content:space-between;gap:2px;flex-wrap:wrap;min-width:0; }
.hud-metric { display:flex;align-items:center;gap:2px;min-height:20px;white-space:nowrap;color:#f1f5fa; }
.hud-metric strong { font-size:10px;font-weight:700;color:#fff; }
.hud-resource-pulse{animation:hud-resource-pulse .38s ease-out}
@keyframes hud-resource-pulse{30%{transform:scale(1.16)}100%{transform:scale(1)}}
.hud-victories { align-self:center;gap:2px;padding:0;margin:0;border:0;background:none;line-height:1; }
.hud-victory-mark { flex:none;width:12px;height:13px;background:var(--hud-bar);
  clip-path:polygon(50% 0,88% 14%,88% 52%,71% 79%,50% 100%,29% 79%,12% 52%,12% 14%); }
.hud-values { display:flex;flex-direction:row;align-items:center;gap:2px; }
.hud-values .hud-value { display:flex;align-items:center;gap:1px;padding:0; }
.hud-stat-image { display:block;width:20px;height:20px;object-fit:contain; }
.hud-card-count .hud-stat-image { width:21px;height:20px; }
.hud-base { grid-column:1;grid-row:3;display:flex;flex-direction:row;align-items:center;width:100%;gap:5px;padding:0;border:0; }
.hud-base-heading { flex:none;gap:5px;justify-content:space-between;white-space:nowrap;font-size:9px; }
.hud-base strong { font-size:10px; }
.hud-health { flex:1;width:auto;height:6px;gap:2px; }
.hud-health-segment { border-radius:2px; }
.hud-card-count { gap:1px;padding:0;border:0;font-size:10px; }
.hud-force { display:inline-flex;align-items:center;min-height:18px;padding:1px 3px;border:1px solid var(--hud-accent);
  border-radius:3px;background:var(--hud-glow);font-size:8px;line-height:1;white-space:nowrap; }
@media (max-width:800px) {
  .game-hud { width:212px; }
  .hud-side { width:190px;row-gap:2px;padding:5px 7px; }
  .hud-faction-mark { width:27px;height:27px; }
  .hud-player-name small { font-size:8px; }
  .hud-stat-image { width:18px;height:18px; }
  .hud-card-count .hud-stat-image { width:19px;height:18px; }
}

/* Gameplay choices share the compact HUD language and stay in screen space. */
.scene-stage>#pending.choice-panel {
  left:50%;right:auto;top:10px;width:min(360px,calc(100% - 24px));max-width:none;
  max-height:min(52dvh,460px);overflow:auto;transform:translateX(-50%);margin:0;
  display:flex;flex-direction:column;align-items:stretch;gap:8px;padding:13px 15px;
  border:1px solid var(--hud-accent);border-radius:0;
  clip-path:polygon(0 10px,10px 0,calc(100% - 10px) 0,100% 10px,100% calc(100% - 10px),calc(100% - 10px) 100%,10px 100%,0 calc(100% - 10px));
  background:linear-gradient(135deg,#142338f2,#07121fee 76%);
  box-shadow:inset 2px 0 var(--hud-accent),inset 0 0 18px var(--hud-glow),0 12px 30px #000b;
  color:#deebf4;font-size:12px;animation:choice-hud-enter .16s ease-out both;
}
.scene-stage>#pending.choice-panel.damage-allocation { width:min(400px,calc(100% - 24px));max-height:min(64dvh,550px); }
.scene-stage>#pending.choice-panel:empty { display:none; }
.scene-stage>#pending.choice-panel h2 { color:#f7fbff; }
.scene-stage>#pending.choice-panel .choice-source .card-face { width:32px; }
.scene-stage>#pending.choice-panel .choice-option button { width:100%; }
.choice-panel-header { display:flex;flex-direction:column;gap:4px;padding-bottom:8px;border-bottom:1px solid #c9e2f02a; }
.choice-panel-header .choice-source { display:flex;align-items:center;gap:7px;color:var(--hud-accent);font-size:11px;letter-spacing:.04em; }
.choice-panel-header .choice-source .card-face { width:32px;flex:none; }
.choice-panel-header h2 { color:#f7fbff;font-size:15px;line-height:1.2;letter-spacing:.06em; }
.choice-panel-header p,.choice-panel .choice-direct { color:#c2d4e0;line-height:1.35; }
.choice-panel .choice-progress { padding:5px 7px;border-left:2px solid var(--hud-accent);background:var(--hud-glow);font-size:11px; }
.choice-panel .choice-actions { display:flex;flex-direction:column;gap:5px; }
.choice-panel .choice-option { display:flex;align-items:center;gap:8px;margin:0; }
.choice-panel .choice-option button,.table-action-chooser button {
  min-height:31px;margin:0;width:100%;padding:6px 9px;text-align:left;
  border:1px solid color-mix(in srgb,var(--hud-accent) 58%,#34495c);
  border-radius:3px;background:linear-gradient(115deg,var(--hud-glow),#182b3bbd 72%);
  color:#f3f8fc;font-size:11px;font-weight:600;letter-spacing:.02em;
}
.choice-panel .choice-option button:hover,.table-action-chooser button:hover {
  border-color:var(--hud-accent);background:linear-gradient(115deg,var(--hud-glow),#29485ce6);
}
.choice-panel .choice-option button.choice-secondary { border-color:#526474;background:#172532bd;color:#cbd9e3; }
.choice-panel .choice-private-card { width:37px;flex:none; }
.choice-panel .choice-look { padding-top:7px;border-top:1px solid #c9e2f02a; }
.choice-panel .allocation-ship { background:#1b2b3dce;border-color:color-mix(in srgb,var(--hud-accent) 55%,#42546a); }
.choice-panel .allocation-details strong { color:#f4f9fc; }
.choice-panel .allocation-amounts button { width:auto;min-width:30px;text-align:center; }
.choice-panel .choice-waiting { color:#c2d4e0; }
.table-action-chooser {
  --hud-accent:#69addf;--hud-glow:#1484e047;
  width:248px;max-width:min(280px,calc(100vw - 20px));max-height:min(300px,65dvh);
  padding:10px 11px;border:1px solid var(--hud-accent);border-radius:0;
  clip-path:polygon(0 8px,8px 0,calc(100% - 8px) 0,100% 8px,100% calc(100% - 8px),calc(100% - 8px) 100%,8px 100%,0 calc(100% - 8px));
  background:linear-gradient(130deg,#142338f2,#07121ff2);
  box-shadow:inset 0 0 13px var(--hud-glow),0 12px 26px #000b;
  animation:choice-hud-enter .16s ease-out both;
}
.table-action-chooser.faction-rebel { --hud-accent:#ed424c;--hud-glow:#d21d305c; }
.table-action-chooser.faction-empire { --hud-accent:#36a6f3;--hud-glow:#138cf25e; }
.table-action-chooser strong { display:block;margin:0 0 7px;color:#f7fbff;font-size:12px;letter-spacing:.04em; }
.table-action-chooser span { display:block;margin:0 0 8px;color:#c5d7e3;font-size:11px;line-height:1.35; }
.table-action-chooser button { display:block;margin:5px 0; }
.zone-inspection-toolbar,.choice-inspection-toolbar {
  --hud-accent:#69addf;--hud-glow:#1484e047;
  border:1px solid var(--hud-accent);border-radius:3px;
  background:linear-gradient(120deg,#142338ed,#07121fed);box-shadow:inset 0 0 12px var(--hud-glow),0 8px 22px #000b;
  color:#e8f4fb;
}
@keyframes choice-hud-enter { from { opacity:0;translate:0 -5px; } to { opacity:1;translate:0 0; } }
.scene-stage>#pending.choice-panel.choice-panel-exit { animation:choice-hud-exit .14s ease-in both; }
@keyframes choice-hud-exit { from { opacity:1;translate:0 0; } to { opacity:0;translate:0 -4px; } }
@media (prefers-reduced-motion:reduce) { .scene-stage>#pending.choice-panel,.table-action-chooser { animation:none; } }
@media (max-width:600px) { .scene-stage>#pending.choice-panel { top:6px;width:calc(100% - 12px);max-height:40dvh;padding:10px 11px; } }

/* Padawan's end-turn reminder uses the same screen-space frame as game choices. */
.end-turn-confirmation {
  --hud-accent:#69addf;--hud-glow:#1484e047;
  width:min(440px,calc(100vw - 28px));max-height:calc(100dvh - 28px);overflow:auto;
  padding:22px 24px;color:#deebf4;
  border:1px solid var(--hud-accent);border-radius:0;
  clip-path:polygon(0 12px,12px 0,calc(100% - 12px) 0,100% 12px,100% calc(100% - 12px),calc(100% - 12px) 100%,12px 100%,0 calc(100% - 12px));
  background:linear-gradient(135deg,#142338f7,#07121ff8 76%);
  box-shadow:inset 2px 0 var(--hud-accent),inset 0 0 18px var(--hud-glow),0 18px 48px #000d;
}
.end-turn-confirmation.faction-rebel { --hud-accent:#ed424c;--hud-glow:#d21d305c; }
.end-turn-confirmation.faction-empire { --hud-accent:#36a6f3;--hud-glow:#138cf25e; }
.end-turn-confirmation::backdrop { background:#020810bd; }
.end-turn-confirmation-kicker { margin-bottom:8px;color:var(--hud-accent);font-size:10px;font-weight:700;letter-spacing:.16em; }
.end-turn-confirmation h2 { padding-bottom:10px;border-bottom:1px solid #c9e2f02a;color:#f7fbff;font-size:17px;font-weight:700;letter-spacing:.07em; }
#end-turn-warning { margin:16px 0 20px;white-space:pre-line;color:#c9dbe7;font-size:13px;line-height:1.55; }
.end-turn-confirmation-actions { display:flex;justify-content:flex-end;gap:9px; }
.end-turn-confirmation-actions button { min-height:38px;margin:0;padding:8px 12px;font-size:11px;font-weight:700;letter-spacing:.04em; }
#end-turn-cancel { border-color:#526474;background:#172532;color:#cbd9e3; }
#end-turn-accept { border-color:var(--hud-accent);background:linear-gradient(115deg,var(--hud-glow),#182b3b);color:#f3f8fc; }
#end-turn-cancel:hover,#end-turn-accept:hover { border-color:#d4e9f5;background:#29485c; }
@media (max-width:480px) { .end-turn-confirmation { padding:18px; }.end-turn-confirmation-actions { flex-direction:column; }.end-turn-confirmation-actions button { width:100%; } }

/* An invalid game action is a brief HUD notice, not a document-flow error banner. */
#error[data-kind="action"] {
  position:fixed;left:50%;top:50%;z-index:20;
  transform:translate(-50%,-50%);width:min(390px,calc(100vw - 32px));
  margin:0;padding:23px 26px 25px;text-align:center;pointer-events:none;
  border:1px solid #e3a176;color:#dce9f2;
  clip-path:polygon(0 12px,12px 0,calc(100% - 12px) 0,100% 12px,100% calc(100% - 12px),calc(100% - 12px) 100%,12px 100%,0 calc(100% - 12px));
  background:linear-gradient(135deg,#223044f7,#0a1523f8 75%);
  box-shadow:inset 2px 0 #e3a176,inset 0 0 20px #d3774854,0 18px 48px #000d;
  font-size:13px;line-height:1.5;animation:action-error-enter .18s ease-out both;
}
#error[data-kind="action"]::before {
  content:"ДЕЙСТВИЕ НЕДОСТУПНО";display:block;margin-bottom:10px;padding-bottom:10px;
  border-bottom:1px solid #c9e2f02a;color:#f4bf91;font-size:15px;font-weight:800;letter-spacing:.09em;
}
@keyframes action-error-enter { from { opacity:0;translate:0 8px; } to { opacity:1;translate:0 0; } }
@media (prefers-reduced-motion:reduce) { #error[data-kind="action"] { animation:none; } }
