/* Campaign layer: the shifts board, the loadout picker, gadget icons, the report card. Loaded after short-circuit.css. */

.gadget-icon {
  display: inline-block; flex: none; width: var(--gi, 36px); height: var(--gi, 36px);
  background: url('./assets/art/gadget-icons.webp') no-repeat; background-size: 300% 300%;
}
.gadget-icon[data-gadget="decoy"] { background-position: 0% 0%; }
.gadget-icon[data-gadget="foam"] { background-position: 50% 0%; }
.gadget-icon[data-gadget="clamp"] { background-position: 100% 0%; }
.gadget-icon[data-gadget="siren"] { background-position: 0% 50%; }
.gadget-icon[data-gadget="smoke"] { background-position: 50% 50%; }
.gadget-icon[data-gadget="net"] { background-position: 100% 50%; }
.gadget-icon[data-gadget="trap"] { background-position: 0% 100%; }
.gadget-icon[data-gadget="hose"] { background-position: 50% 100%; }
.gadget-icon[data-gadget="override"] { background-position: 100% 100%; }

/* In play: two gadget cards, each with its key, picture, name and charges. */
.hud-tools { grid-template-columns: repeat(2, minmax(124px, 150px)) repeat(2, minmax(100px, 130px)); }
.tool-slots { display: contents; }
.tool-card { padding-right: 46px; }
.tool-card .gadget-icon { --gi: 36px; position: absolute; right: 7px; top: 50%; transform: translateY(-50%); }
.tool-card.is-empty { opacity: .45; }
.tool-card.is-cooling { filter: saturate(.4) brightness(.8); }
.tool-card[hidden] { display: none; }

/* Briefing: one screen at 1280x720, the Begin button always on it. */
.briefing-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 300px); grid-template-rows: minmax(0, 1fr); gap: 22px; align-items: stretch; place-items: stretch; padding: 12px 22px 0; overflow: hidden; }
.briefing-copy { max-width: none; width: 100%; min-height: 0; overflow-y: auto; padding-right: 6px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; }
.briefing-copy h1 { margin: 6px 0 4px; font-size: clamp(28px, 3.6vw, 50px); line-height: .98; }
.briefing-copy > p { margin: 0; font-size: clamp(14px, 1.25vw, 17px); line-height: 1.4; max-width: 880px; }
.dispatch-label { align-self: flex-start; }
.daily-row { margin: 2px 0; }
.daily-row .action-button { min-height: 40px; padding: 8px 14px; font-size: 13px; }
.daily-row .action-button[aria-pressed="true"] { outline: 3px solid var(--yellow); }

.incident-board { display: flex; flex-direction: column; gap: 8px; margin: 2px 0; }
.shift-group h3 { margin: 0 0 5px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); }
.shift-group[data-locked="true"] { opacity: .62; }
.shift-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.incident-card { min-height: 0; padding: 8px 10px 8px 14px; gap: 2px; align-content: start; }
.incident-card > strong { font-size: 14px; line-height: 1.15; text-transform: uppercase; }
.incident-card > small { font-size: 11px; font-weight: 900; letter-spacing: .06em; color: #bfe4e7; }
.incident-card > span { font-size: 10px; }
/* The whole card is the button; its words stay for screen readers. */
.incident-card > button { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 12px; background: transparent; color: transparent; font-size: 0; cursor: pointer; }
.incident-card > button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.incident-card > button:disabled { cursor: not-allowed; }

.loadout-panel { display: grid; gap: 7px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.16); background: rgba(4,22,29,.62); }
.loadout-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.loadout-head span { color: var(--cyan); font-size: 11px; font-weight: 950; letter-spacing: .14em; }
.loadout-head small { color: #bfe4e7; font-size: 12px; }
.loadout-picker { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; }
.loadout-chip { display: grid; justify-items: center; gap: 1px; padding: 6px 2px 5px; min-height: 76px; border: 2px solid rgba(255,255,255,.2); border-radius: 10px; background: rgba(255,255,255,.05); color: var(--white); font: inherit; cursor: pointer; }
.loadout-chip .gadget-icon { --gi: 38px; }
.loadout-chip b { font-size: 10px; letter-spacing: .06em; }
.loadout-chip small { font-size: 10px; color: #bfe4e7; }
.loadout-chip[aria-pressed="true"] { border-color: var(--yellow); background: rgba(255,212,71,.14); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--yellow); }
.loadout-chip:disabled { cursor: not-allowed; opacity: .5; }
.loadout-chip:disabled .gadget-icon { filter: grayscale(1) brightness(.6); }
.loadout-chip:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.difficulty-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.difficulty-button { min-height: 36px; padding: 6px 14px; border-radius: 9px; border: 2px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06); color: var(--white); font: inherit; font-weight: 900; cursor: pointer; }
.difficulty-button[aria-pressed="true"] { border-color: var(--yellow); background: rgba(255,212,71,.16); }
.difficulty-row small { color: #bfe4e7; font-size: 12px; flex: 1 1 220px; }

.mission-grid { margin: 2px 0; gap: 8px; }
.mission-grid article { min-height: 0; padding: 9px 11px; }
.mission-grid strong { margin-top: 4px; font-size: 13px; }
.briefing-copy > .briefing-actions { position: sticky; bottom: 0; z-index: 2; margin-top: auto; padding: 14px 0 12px; background: linear-gradient(180deg, rgba(3,10,14,0), rgba(3,10,14,.94) 34%); }
.results-card .briefing-actions { position: static; background: none; padding: 12px 0 0; }
.results-card { max-height: calc(100% - 8px); overflow-y: auto; }
.result-unlocks { font-size: 13px; line-height: 1.45; max-width: 640px; }
.dispatch-card { align-self: center; max-width: 300px; transform: none; padding: 14px; }
.dispatch-card h2 { margin: 10px 0 6px; font-size: 18px; }
.dispatch-card li { grid-template-columns: 96px 1fr; font-size: 13px; padding: 5px 0; }
.dispatch-map { max-height: 150px; }

/* The report card. */
.result-rating { margin: 6px 0 0; font-weight: 900; letter-spacing: .04em; color: var(--yellow); }
.result-tip { margin: 4px 0 0; max-width: 560px; color: #ffd9c9; line-height: 1.4; }
.result-unlocks { margin: 6px 0 0; color: var(--green, #58e18b); font-weight: 900; }
.result-tip[hidden], .result-unlocks[hidden] { display: none; }

@media (max-width: 1100px) {
  .briefing-panel { grid-template-columns: minmax(0, 1fr); }
  .dispatch-card { display: none; }
  .loadout-picker { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 760px), (max-height: 520px) {
  .briefing-panel { padding: 8px 12px 0; }
  .briefing-copy h1 { font-size: clamp(24px, 6vw, 34px); }
  .briefing-copy > p { display: none; }
  .shift-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mission-grid { grid-template-columns: 1fr; }
  .mission-grid article:nth-child(n+2) { display: none; }
  .loadout-chip { min-height: 64px; }
  .loadout-chip .gadget-icon { --gi: 30px; }
}

/* The selected card keeps its look: the old selected-card button style must not paint over it. */
.incident-card > button, .incident-card.is-selected > button, .incident-card:hover > button { background: transparent !important; color: transparent !important; box-shadow: none !important; border: 0 !important; }
.incident-card:not([data-locked]) > button:hover { background: rgba(255,255,255,.06) !important; }

/* The objective card only needs the width of its sentence, so the top of the arena stays visible. */
.hud-primary { grid-template-columns: minmax(200px, 560px) repeat(3, minmax(112px, 150px)); justify-content: space-between; }
@media (max-width: 760px), (max-height: 520px) { .hud-primary { grid-template-columns: minmax(150px, 1fr) repeat(3, minmax(74px, 96px)); } }

/* Small windows: the briefing copy scrolls inside the panel, with Begin pinned at its bottom edge. */
.briefing-panel:not([hidden]) { display: grid !important; overflow: hidden !important; }
.briefing-copy { max-height: 100%; }
.game-shell { min-height: 0; }

/* The report card fits a 720-pixel window with its buttons on screen. */
.results-card { padding: 18px 26px 0; }
.results-card h2 { font-size: clamp(28px, 4.4vw, 52px); margin: 6px 0 4px; }
.results-card .score-grid { gap: 8px; margin: 10px 0; }
.results-card .score-grid article { padding: 8px 6px; }
.results-card .score-grid strong { font-size: clamp(22px, 2.6vw, 32px); }
.results-card .total-score { padding: 10px 16px; margin-top: 4px; }
.results-card .total-score strong { font-size: clamp(24px, 3vw, 36px); }
.results-card .best-result { margin: 4px 0; font-size: 13px; }
.results-card .briefing-actions { position: sticky; bottom: 0; padding: 12px 0 14px; background: linear-gradient(180deg, rgba(8,30,38,0), rgba(8,30,38,.97) 30%); }
.result-rating { margin: 2px 0 0; }

/* Landscape phones: the 16:9 floor leaves a strip down each side of the screen. The action buttons stand in one column in the
   right-hand strip, so the evacuation exit in the bottom-right corner of every floor is never under a button. */
@media (max-height: 520px) and (min-aspect-ratio: 7/4) {
  .touch-dpad { left: 6px; bottom: 8px; width: 112px; height: 112px; }
  .touch-dpad button { width: 38px; height: 38px; border-radius: 11px; }
  .touch-dpad [data-touch-move="up"] { left: 37px; top: 0; }
  .touch-dpad [data-touch-move="left"] { left: 0; top: 37px; }
  .touch-dpad [data-touch-move="down"] { left: 37px; top: 74px; }
  .touch-dpad [data-touch-move="right"] { left: 74px; top: 37px; }
  .touch-actions { right: 5px; bottom: 6px; grid-template-columns: 48px; gap: 4px; }
  .touch-actions button { height: 38px; padding: 0 1px; font-size: 9px; letter-spacing: 0; border-radius: 10px; }
  .touch-actions .pulse-touch { grid-column: span 1; height: 50px; font-size: 10px; }
}

/* Studio shell: the Credits buttons (shown once the Fire Dragon kit is on the page) and the copyright notice. */
.action-button[hidden] { display: none !important; }
.shell-legal { margin: 0 0 0 auto; align-self: center; max-width: 210px; text-align: right; font-size: 10.5px; line-height: 1.35; letter-spacing: .02em; color: #a9cbd0; }
.shell-legal .shell-copyright { white-space: nowrap; }
@media (max-width: 960px), (max-height: 520px) { .shell-legal { max-width: 170px; font-size: 10px; } }
/* On a short window (a phone on its side) the pause card's secondary actions stand in one row so Credits stays on screen. */
@media (max-height: 520px) {
  .pause-more { display: flex; gap: 8px; }
  .pause-more .action-button { flex: 1 1 0; width: auto; min-width: 0; min-height: 44px; padding: 8px 6px; font-size: 13px; text-align: center; }
}

/* A 1280x720 window: the whole briefing, the three mission lines included, stands on screen without a scroll. Smaller
   windows keep the scrolling copy with Begin pinned under it. */
@media (min-width: 1101px) and (max-height: 820px) {
  .briefing-copy { gap: 6px; }
  .briefing-copy h1 { margin: 2px 0 0; font-size: clamp(26px, 2.9vw, 38px); }
  .briefing-copy > p { font-size: 14px; line-height: 1.3; }
  .daily-row { margin: 0; }
  .daily-row .action-button { min-height: 34px; padding: 5px 12px; }
  .incident-board { gap: 5px; margin: 0; }
  .shift-group h3 { margin-bottom: 3px; }
  .loadout-panel { gap: 5px; padding: 8px 10px; }
  .loadout-chip { min-height: 62px; padding: 4px 2px; }
  .loadout-chip .gadget-icon { --gi: 30px; }
  .mission-grid { margin: 0; gap: 6px; }
  .mission-grid article { padding: 7px 10px; }
  .briefing-copy > .briefing-actions { padding: 8px 0; }
}
