/* Canary Nuclear Medicine · Atlántico al anochecer */
:root {
  --ink: #fff1dd;
  --muted: #d9c8de;
  --green: #64ead7;
  --green-dark: #9af6e8;
  --line: #55405d;
  --cream: #181121;
  --gold: #ffce78;
  --sea: #77e9de;
  --coral: #ff977f;
  --panel: #291e32;
  --violet: #3c2950;
  --night: #201727;
  --shadow: 0 12px 35px #150d2538;
  color-scheme: dark;
}
@font-face {
  font-family: "Canary Display";
  src: url("barlow-condensed-extrabold-italic.ttf") format("truetype");
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}
body { background: radial-gradient(ellipse at 75% 0, #442443, transparent 52rem), var(--cream); }
.rail { background: #1e1626; border-color: var(--line); }
.brand-mark { border-radius: 11px; color: #241629; background: linear-gradient(145deg,#ffdc89,#ff8c8c 56%,#ca79b1); }
.brand-mark circle { fill: #68e0d5; stroke: #241629; }
.rail-button, .section-heading, .stat small, .scene-caption, .patient-info small,
.goal-denom, .patient-key, .patient-status, .room-tab, .selected-room .room-staff,
.selected-room p, .control-hint, .page-footer, .page-footer a, .control-bar,
.objective p, .objective-foot, .goal-numbers>span, .empty-state,
.upgrade-banner small, .mission p, .mission-steps li, .mission-bottom>span,
.welcome p, .welcome-note, dialog p, dialog .modal-intro, .upgrade-card small,
.staff-group li small, .result-stats span, .webgl-error p { color: var(--muted); }
.rail-button:hover, .rail-button.active { color: var(--sea); background: #393047; }
.eyebrow, .brand-copy .eyebrow, .panel-kicker, .welcome .eyebrow { color: var(--sea); }
.brand-copy h1, .welcome h2, .scene-caption b, .objective h2, dialog h2 {
  font-family: "Arial Black", "Segoe UI", sans-serif;
  font-weight: 900; letter-spacing: -.055em; line-height: 1.02;
}
.brand-copy h1, .welcome h2 {
  font-family: "Canary Display", "Arial Black", sans-serif;
  font-style: italic; font-weight: 800; text-transform: uppercase; letter-spacing: -.035em;
}
.brand-copy h1 { font-size: clamp(1.55rem,2.5vw,2.65rem); }
.brand-copy h1>span:not(.edition) { color: var(--coral); font-weight: 900; }
.edition { color: var(--sea); border-color: #7c626f; }
.mint, .selected-icon, .upgrade-symbol { color: var(--sea); background: #264147; }
.peach { color: #ffb59a; background: #573242; }
.lavender { color: #dbbcff; background: #423253; }
.live-dot, .save-dot, .progress-track>span, .patient-progress>span { background: var(--sea); }
.viewport { border-color: #8c667e; background: #774969; border-radius: 12px; }
.scene-top .mode-switch, .scene-tag, .camera-controls, .fps-guide, .compact-hud,
.scene-legend, .touch-controls button, .toast {
  background: #21172ced; color: var(--ink); border: 1px solid #765d79;
}
.scene-tag, #compact-time, .text-button, .patient-key .live-dot, .selected-icon, .fps-guide b { color: var(--sea); }
.scene-caption { color: #fff4e3; text-shadow: 0 1px 4px #291432; }
.scene-caption b { font-size: clamp(1.1rem,2vw,1.7rem); }
.scene-legend { padding: 5px 9px; border-radius: 5px; }
.teal { background: var(--sea); } .purple { background: #ca99fb; } .gold { background: var(--gold); }
.mode-switch button, .camera-controls button, .fps-guide span, #compact-objective { color: var(--ink); }
.mode-switch .selected, #scene-pause, .speed-switch button.selected,
.room-tab.selected, .room-tab:hover, .touch-controls button:active { background: var(--sea); color: #17242c; border-color: var(--sea); }
.camera-controls button:hover, .playback>button, .speed-switch, .room-tab, .help-item,
.staff-initials, .staff-group h3>span, .day-pill, .result-stats div { background: var(--violet); color: var(--ink); border-color: #64506d; }
.speed-switch button { color: var(--muted); }
.welcome, .panel, .selected-room, dialog, .upgrade-card, .upgrade-banner { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; }
.welcome { border-top: 4px solid var(--coral); background: linear-gradient(110deg,#271927 5%,#281a2ae8 65%,#2b1931ad),url("costa.webp") 70% center/cover; box-shadow: 0 8px 30px #21132755; }
.welcome h2 { font-size: clamp(1.55rem,2.4vw,2.05rem); }
.primary, .primary:hover, .webgl-error a { color: #271a27; font-weight: 750; background: var(--coral); border-radius: 5px; }
.primary:hover { background: #ffb49d; }
.control-bar, .topbar, .page-footer, .objective-foot, .mission-bottom, .patient-row, .patient-key { border-color: var(--line); }
.secondary, .room-actions #staff-button { color: var(--sea); background: #352a40; border-color: #766078; }
.secondary:hover { background: #483953; }
.objective { border-top: 3px solid var(--sea); }
.progress-track, .patient-progress { background: #483b50; }
.goal-numbers>b { color: var(--ink); }
.objective-foot>span:first-child, .result-stars, .tiny-sun, .toast.warn { color: var(--gold); }
.mission { background: linear-gradient(120deg,#442639,#342238); border-top: 3px solid var(--coral); }
.mission h3, .selected-room h3, .upgrade-banner b { color: var(--ink); }
.mission .panel-kicker, .mission-bottom .text-button, .mission-steps .current { color: #ffb59d; }
.reward, .mission-steps .current .step-dot { background: var(--gold); color: #33213b; }
.mission-steps .done { color: var(--sea); }
.mission-steps .done .step-dot { background: #345250; }
.day-pill, .count-pill, .staff-group h3 { color: var(--sea); }
.patient-avatar { background: #5c405c; }
.patient-avatar.portrait {
  width: 34px; height: 34px; flex: none; border-radius: 6px;
  background: #584956 url('assets/people/retratos.webp') no-repeat;
  background-size: 600% 600%;
}
.patient-avatar.portrait::before, .patient-avatar.portrait::after { display: none; }
.page-footer a { text-decoration: underline; text-underline-offset: .2em; }
.interact-prompt, .interact-prompt:disabled { background: #422b35; color: #ffe0a2; border-color: #ba9874; }
.interact-prompt.at-counter { left: var(--interact-x); top: var(--interact-y); bottom: auto; transform: translate(-50%, -50%); }
.is-fps .scene-top .scene-tag { display: flex; min-width: 0; max-width: min(46%, 19rem); }
.is-fps .scene-tag .live-dot { flex: none; }
.is-fps #scene-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pause-cover { background: #201629bd; }
dialog::backdrop { background: #171120b5; }
.modal-close { color: var(--ink); }
.modal-note { color: var(--muted)!important; }
.webgl-error, .noscript { color: var(--ink); background: var(--night); }
button:focus-visible, a:focus-visible { outline-color: var(--gold); }
@media(max-width:520px) {
  .brand-copy h1 { font-size: 1.48rem; }
  .welcome h2 { font-size: 1.55rem; }
}

.is-welcome.is-fps .viewport .welcome {
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  width: auto;
  padding: clamp(22px, 4vw, 64px);
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
  background: linear-gradient(90deg, #231328f5 0%, #2b182cba 31%, #34203520 68%),
    linear-gradient(0deg, #24142aba, transparent 54%),
    url("assets/primera-guardia.webp") 61% center / cover no-repeat;
}
.is-welcome.is-fps .viewport :is(.scene-top, .camera-controls, .compact-hud, .canary-minimap) { visibility: hidden; }
.welcome-copy { max-width: min(46%, 440px); }
.welcome-time { display: inline-flex; align-items: center; gap: 7px; color: var(--sea); font-weight: 650; font-size: 12px; }
.welcome-time i { width: 16px; height: 16px; }
.is-fps .welcome h2 { font-size: clamp(42px, 6vw, 91px); line-height: .91; margin: 14px 0; }
.welcome h2 em { color: var(--coral); }
.welcome p { color: var(--ink); max-width: 34ch; }
.welcome-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.welcome-actions button { min-height: 42px; }
.welcome-actions .primary { width: auto; }
body:not(.is-fps) .welcome-copy { max-width: none; }
#welcome-tours, .scene-tour {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid #947594;
  border-radius: 6px;
  background: #2c1d35;
  color: var(--sea);
  font-size: 12px;
  font-weight: 650;
}
#welcome-tours i, .scene-tour i { width: 16px; height: 16px; }
#welcome-tours:hover, .scene-tour:hover { background: #49314e; }
.scene-tour { position: absolute; z-index: 3; top: 18px; left: 18px; min-height: 40px; max-width: 46%; }
.scene-tour kbd { font: inherit; border: 1px solid #947594; padding: 1px 4px; border-radius: 3px; }
.viewport:has(.scene-tour:not([hidden])) .scene-tag { visibility: hidden; }

#tour-dialog { background: #291e32; color: var(--ink); border-color: #765d79; }
#tour-dialog :is(.tour-head, .tour-task) { border-color: #765d79; }
#tour-dialog #tour-title { color: var(--ink); }
#tour-dialog :is(.tour-eyebrow, .tour-card-info small, .tour-task small, .tour-count) { color: var(--sea); }
#tour-dialog .tour-summary p { color: var(--muted); }
#tour-dialog :is(.tour-card, .tour-close, .tour-back, .tour-task button, .tour-fallback button) {
  color: var(--ink);
  background: #392743;
  border-color: #765d79;
}
#tour-dialog :is(.tour-card, .tour-close, .tour-back, .tour-task button, .tour-fallback button):hover { background: #4c3254; border-color: var(--sea); }
#tour-dialog :is(.tour-task, .tour-screen, .tour-loading) { background: #22192d; color: var(--ink); }
#tour-dialog .tour-marks i { background: #745a7a; }
#tour-dialog :is(.tour-marks i.stamped, .tour-seal.checked, .tour-card-link) { background: var(--sea); color: #202034; }
#tour-dialog .tour-seal { color: var(--sea); border-color: var(--sea); }
#tour-dialog .tour-seal.checked { color: #202034; }
#tour-dialog.tour-embedded {
  --tour-visible-height: calc(100dvh - var(--tour-clip-top) - var(--tour-clip-bottom));
  inset: var(--tour-clip-top) 0 var(--tour-clip-bottom);
  max-height: var(--tour-visible-height);
}
#tour-dialog.tour-embedded.tour-playing { height: var(--tour-visible-height); }

@media(max-width:520px) {
  .app-shell .rail { padding-inline: 8px; gap: 4px; }
  .rail .rail-group { flex: 1; gap: 0; justify-content: space-evenly; }
  .rail .rail-button { width: clamp(36px, 12vw, 54px); }
  .rail .rail-bottom .rail-button { width: 33px; }
  .is-welcome.is-fps .viewport .welcome {
    padding: 20px 16px;
    background: linear-gradient(0deg, #231427 0%, #24162ed9 28%, #24142a30 60%, transparent 86%),
      url("assets/primera-guardia.webp") 63% 35% / cover no-repeat;
  }
  .welcome-copy { max-width: 100%; }
  .is-fps .welcome h2 { font-size: clamp(34px, 11vw, 54px); }
  .is-fps .welcome h2 br { display: none; }
  .is-fps .welcome h2 em::before { content: " "; }
  .scene-tour { top: 12px; left: 10px; padding: 6px 8px; font-size: 11px; }
  .scene-tour kbd { display: none; }
}
