/* Illustration und echte Spielinformationen bleiben getrennte Ebenen. */
:root { --comic-paper: #fff0d4; --comic-ink: #152336; }
.comic-portrait {
  display: block; width: 60px; height: 60px; flex: 0 0 auto;
  background: url('../img/comic/team.png') var(--portrait-x, 0%) 0% / 800% 300% no-repeat;
}
[data-person="1"] { --portrait-x: 14.285714%; }
[data-person="2"] { --portrait-x: 28.571429%; }
[data-person="3"] { --portrait-x: 42.857143%; }
[data-person="4"] { --portrait-x: 57.142857%; }
[data-person="5"] { --portrait-x: 71.428571%; }
[data-person="6"] { --portrait-x: 85.714286%; }
[data-person="7"] { --portrait-x: 100%; }
.lobby-scene, .report-scene {
  position: relative; overflow: hidden; border: 2px solid #23364b; border-radius: 12px;
  background: #233f50 url('../img/comic/lobby.png') center / cover no-repeat;
}
.lobby-scene { height: 150px; margin: 12px 0; }
.lobby-sign {
  position: absolute; left: 12px; top: 12px; padding: 3px 10px; border: 2px solid var(--comic-ink);
  background: var(--comic-paper); color: var(--comic-ink); font-weight: 800; font-size: 14px;
  border-radius: 3px 7px 3px 7px; transform: rotate(-2deg); box-shadow: 2px 3px 0 #15233680;
}
#lobby-team, #report-team { display: flex; justify-content: center; gap: 2px; position: absolute; bottom: 0; left: 6px; right: 6px; }
#lobby-team .comic-portrait { width: min(44px, 10vw); height: min(44px, 10vw); filter: drop-shadow(0 2px 1px #10151d); }
#roster-preview { grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); }
.roster-chip { padding: 5px 2px; border-radius: 6px 10px 6px 10px; background-image: linear-gradient(160deg,#294252,transparent 70%); }
.roster-chip .tier-tag { padding-inline: 2px; letter-spacing: 0; }
.roster-chip > .comic-portrait { margin: 0 auto; width: min(60px, 100%); height: 60px; }
.roster-chip .roster-avatar-row { margin: 1px 0 6px; }
.roster-chip .roster-name { font-weight: 700; }
.add-chip .add-verb { white-space: normal; overflow-wrap: anywhere; }
.continue-card, .contract-card { border-radius: 6px 14px 6px 14px; box-shadow: 0 3px 0 #080f1b; }
.continue-card { background-image: radial-gradient(ellipse at top left, #f8af3615, transparent 70%); }
.section-head h1, #lbl-contracts-title, #lbl-store-tech-title { color: #cddcec; }
.tech-badge { border-radius: 5px 10px 5px 10px; }

/* Das Raster und seine Mindesthöhen bleiben die feste Bühne der Runde. */
#agents .agent-card { padding: 4px; gap: 2px; border-radius: 8px; container-type: size; }
.workplace-scene {
  position: relative; display: block; flex: 1 1 auto; min-height: 18px; width: 100%;
  border-radius: 4px 4px 0 0; background: #4f7585 url('../img/comic/workstation.png') center / 100% 100% no-repeat;
}
.workplace-scene .agent-state[data-portrait] {
  --portrait-size: clamp(24px, calc(100cqh - 43px), 66px);
  position: absolute; left: 10%; bottom: 0; width: var(--portrait-size); height: var(--portrait-size); margin: 0;
}
.workplace-scene .agent-state[data-portrait="busy"] { background-position-x: calc(var(--portrait-x, 0%) - var(--portrait-size) / 16); }
#agents .agent-top { flex: 0 0 auto; gap: 5px; padding-right: 2px; min-width: 0; }
#agents .agent-avatar { width: 24px; height: 24px; margin-left: 1px; }
#agents .av-icon.primary[data-comic] { width: 22px; height: 22px; }
#agents .av-second { width: 16px; height: 16px; right: -3px; bottom: -2px; }
#agents .agent-name-row { padding: 0 3px; background: var(--comic-paper); border-radius: 2px; }
#agents .agent-name { color: var(--comic-ink); font-size: 13px; }
#agents .agent-status-row { padding-right: 44px; min-height: 12px; }
#agents .stress-row { position: relative; flex: 0 0 auto; width: calc(100% - 44px); gap: 4px; min-height: 12px; }
#agents .card-points { font-size: 15px; }
#agents .tier-tag.in-agent-card { position: absolute; top: 5px; right: 5px; z-index: 1; background-color: #152336e8; font-size: 10px; max-width: 65%; }
#agents .agent-load { flex: 0 0 auto; }
#agents .agent-bar-track { height: 4px; }
.agent-card.busy .workplace-scene .agent-state[data-portrait="stressed"]::before { top: 40%; right: -2px; }
.agent-card.busy .workplace-scene .agent-state[data-portrait="stressed"]::after { top: calc(40% + 9px); }

.equipment-art {
  --equipment-x: 0%; --equipment-y: 0%; display: block; flex: 0 0 auto; width: 48px; height: 48px;
  background: url('../img/comic/equipment.png') var(--equipment-x) var(--equipment-y) / 300% 300% no-repeat;
}
[data-equipment="iva"] { --equipment-x: 50%; }
[data-equipment="trainer"] { --equipment-x: 100%; }
[data-equipment="agentAssist"] { --equipment-y: 50%; }
[data-equipment="selfService"] { --equipment-x: 50%; --equipment-y: 50%; }
[data-equipment="callback"] { --equipment-x: 100%; --equipment-y: 50%; }
[data-equipment="routingHint"] { --equipment-y: 100%; }
[data-equipment="planner"] { --equipment-x: 50%; --equipment-y: 100%; }
[data-equipment="seatPlan"], [data-equipment="seatPlanPack"] { --equipment-x: 100%; --equipment-y: 100%; }
.store-scene { display: flex; align-items: flex-end; justify-content: center; gap: 16px; height: 104px; margin: 12px 0 18px; padding-bottom: 8px; border-bottom: 6px solid #b68c55; border-radius: 8px; background: linear-gradient(#17253655,#172536ee),url('../img/comic/lobby.png') center / cover; }
.store-scene .equipment-art { width: 68px; height: 68px; }
.store-scene img { width: 66px; height: 66px; object-fit: contain; }
.store-item { border: 2px solid #31465c; border-radius: 6px 14px 6px 14px; background-image: linear-gradient(130deg,#26394c,transparent 75%); box-shadow: 0 3px 0 #080f1b; }
.store-item-top > div { min-width: 0; flex: 1 1 auto; }
.store-item-title-row { align-items: center; flex-wrap: wrap; gap: 5px; }
.store-item-title-row .store-item-title { flex: 1 1 105px; min-width: 0; overflow-wrap: anywhere; }
.store-item-desc { margin-top: 8px; }
.store-item-effect { font-style: normal; padding-left: 7px; border-left: 2px solid #b69758; }
.buy-btn { border: 1px solid #382600; box-shadow: 0 3px 0 #100e08; }
.buy-btn:disabled { box-shadow: none; }
.store-item-level { margin-top: 6px; }

.report-scene { height: 118px; margin: 12px 0 0; border-radius: 12px 12px 0 0; }
#report-team { right: 65px; left: 3px; }
#report-team .comic-portrait { width: min(44px, 8vw); height: min(44px, 8vw); }
.report-mascot { position: absolute; right: 5px; bottom: 0; width: 70px; height: 70px; object-fit: contain; }
#screen-dashboard[data-outcome="neutral"] .report-mascot { display: none; }
#screen-dashboard[data-outcome="neutral"] .report-scene { filter: saturate(.65); }
#screen-dashboard #dash-result { margin: 0 0 10px; padding: 12px; background: var(--comic-paper); border: 2px solid #23364b; border-top: none; border-radius: 0 0 8px 8px; color: var(--comic-ink); font-weight: 800; }
#screen-dashboard #dash-result.good { color: #116745; }
#screen-dashboard #dash-result.bad { color: #a52e39; }
.dash-stars { margin: 10px 0; filter: drop-shadow(1px 3px 0 #50380c); }
.dash-kpi-tile, .dash-insight { border-radius: 5px 12px 5px 12px; background-image: linear-gradient(150deg,#27415a,transparent 80%); }
.dash-kpi-tile { border: 2px solid #31465c; }
.dash-kpi-tile[data-kpi-key="score"] { border-top: 3px solid #f8af36; }
.dash-kpi-tile[data-kpi-key="budget"] { border-top: 3px solid #6ccf9b; }
.primary-btn, .secondary-btn { border-radius: 6px 12px 6px 12px; }
#pause-card { border: 2px solid #587289; border-radius: 8px 16px 8px 16px; background-image: radial-gradient(ellipse at top,#284359,transparent 60%); }

/* Erfolgseffekt ausschließlich innerhalb der gewählten Karte. */
.flex-rescue { position: absolute; bottom: 5px; right: 4px; z-index: 4; width: 32px; height: 32px; pointer-events: none; animation: flex-arrival .8s ease-out both; }
.flex-rescue img { width: 100%; height: 100%; object-fit: contain; }
#agents .agent-card.joker-rescued { animation: none; box-shadow: inset 0 0 0 2px #72dfba; }
@keyframes flex-arrival { 0% { opacity: 0; transform: translateY(18px) scale(.6); } 22% { opacity: 1; transform: translateY(-3px) scale(1.05); } 35%,75% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-5px); } }
@media (max-width: 480px) { #roster-preview { grid-template-columns: repeat(5,minmax(0,1fr)); } }
@media (max-width: 374px) { .roster-chip > .comic-portrait { height: 52px; width: 52px; } .store-scene { gap: 8px; } .store-scene .equipment-art { width: 62px; height: 62px; } }
@media (max-height: 700px) { .lobby-scene { height: 110px; } .store-scene { height: 84px; } .report-scene { height: 88px; } }
@media (prefers-reduced-motion: reduce) { .flex-rescue { animation: none; } }
