:root {
  --bg-a: #f2efe6;
  --bg-b: #d9e9f7;
  --surface: #fdfdfd;
  --surface-border: #d5dbe5;
  --text: #1c2633;
  --muted: #536171;
  --accent: #0c6e66;
  --accent-strong: #0a5a54;
  --danger-bg: #fce8e6;
  --danger-border: #f3b2aa;
  --danger-text: #8c2117;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-main), sans-serif;
  background:
    radial-gradient(circle at 15% 20%, rgba(75, 145, 209, 0.26), transparent 40%),
    radial-gradient(circle at 85% 0%, rgba(12, 110, 102, 0.2), transparent 34%),
    linear-gradient(145deg, var(--bg-a), var(--bg-b));
}

.page-shell {
  max-width: 1060px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.page-shell.panel-screen {
  max-width: none !important;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  padding: clamp(0.55rem, 1vw, 0.95rem) clamp(0.65rem, 1.4vw, 1.12rem);
  gap: clamp(0.55rem, 0.9vw, 0.8rem);
  overflow: hidden;
}

.game-fullwidth .page-shell {
  max-width: none;
  width: 100%;
  padding: 0.85rem clamp(0.75rem, 1.6vw, 1.5rem) 1.4rem;
}

.game-fullwidth {
  width: 100%;
  min-height: 100vh;
}

.page-shell.game-screen {
  max-width: none;
  width: 100%;
  height: calc(100vh - 1rem);
  min-height: 0;
  margin: 0;
  padding: 0.7rem clamp(0.65rem, 1.25vw, 1.1rem) 0.9rem;
  gap: 0.7rem;
  overflow: hidden;
}

.page-shell.game-screen .hero-card,
.page-shell.game-screen .panel {
  min-width: 0;
}

.page-shell.game-screen .panel-scroll {
  min-height: 0;
  overflow: auto;
}

.page-shell.game-screen .panel--hospital-room {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.page-shell.game-screen .panel--hospital-room .room-scene {
  flex: 1;
  min-height: 0;
}

.game-screen--lobby .game-lobby-layout {
  flex: 1;
  min-height: 0;
  height: 100%;
}

.game-screen--lobby .game-lobby-layout__main,
.game-screen--lobby .game-lobby-layout__side {
  min-height: 0;
}

.game-screen--lobby .game-lobby-layout__main > .panel,
.game-screen--lobby .game-lobby-layout__side > .panel {
  min-height: 0;
}

.game-screen--lobby .game-lobby-layout__main > .panel {
  overflow: auto;
}

.game-screen--lobby .game-lobby-layout__side {
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}

.game-screen--lobby .game-lobby-layout__side > .panel {
  overflow: auto;
}

.game-screen--hub .hub-zone-layout {
  flex: 1;
  min-height: 0;
  height: 100%;
}

.game-screen--hub .hub-zone-layout__main,
.game-screen--hub .hub-zone-layout__simulator,
.game-screen--hub .hub-zone-layout__sidebar {
  min-height: 0;
}

.game-screen--hub .hub-zone-layout__sidebar > .panel {
  min-height: 0;
  overflow: auto;
}

.game-screen--room {
  height: auto;
  min-height: calc(100vh - 1rem);
  overflow: auto;
}

.game-screen--room .panel--hospital-room {
  overflow: visible;
}

.game-screen--room .panel--hospital-room .room-scene {
  min-height: clamp(720px, 88vh, 980px);
}

.game-screen--room .hospital-stage-layout {
  grid-template-rows: minmax(300px, 46vh) minmax(320px, 42vh);
}

.game-screen--room .hospital-mission-panel {
  overflow: auto;
}

.game-screen--room .room-mission-console {
  grid-template-rows: minmax(0, 1fr) auto auto;
  min-height: 0;
}

.game-screen--room .room-mission-objective {
  max-height: none;
  min-height: 0;
  overflow: auto;
}

.game-screen--briefing .briefing-panel {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.game-screen--briefing .briefing-video {
  min-height: clamp(230px, 42vh, 440px);
}

.game-screen--cinematic .hero-card {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.game-screen--practice > .panel:first-of-type {
  flex: 0 0 auto;
}

.game-screen--practice > *:last-child {
  min-height: 0;
  overflow: auto;
}

.game-screen--result > .panel {
  overflow: auto;
}

.game-fullwidth .hero-card,
.game-fullwidth .panel {
  border-radius: 14px;
}

.game-shell {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 0.8rem;
  align-items: start;
}

.game-shell__main {
  min-width: 0;
}

.game-shell__hud {
  min-width: 0;
  position: sticky;
  top: 0.6rem;
  align-self: start;
}

.game-hud-panel {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(170, 201, 221, 0.8);
  background: linear-gradient(180deg, rgba(242, 250, 255, 0.95), rgba(228, 240, 250, 0.93));
  box-shadow: 0 10px 24px rgba(18, 42, 64, 0.2);
  padding: 0.62rem 0.72rem;
  backdrop-filter: blur(6px);
}

.game-hud-panel__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.game-hud-panel__stat {
  border-radius: 10px;
  border: 1px solid #cbdbea;
  background: #f4f9ff;
  padding: 0.35rem;
}

.game-audio-controls {
  margin-top: 0.62rem;
  border-top: 1px solid rgba(167, 196, 216, 0.75);
  padding-top: 0.55rem;
  display: grid;
  gap: 0.4rem;
}

.game-audio-controls__grid {
  display: grid;
  gap: 0.36rem;
}

.game-audio-controls__btn {
  margin-top: 0 !important;
  padding: 0.46rem 0.56rem;
  font-size: 0.84rem;
  border-radius: 9px;
}

.game-audio-controls__btn--on {
  border-color: rgba(98, 167, 158, 0.85) !important;
  background: rgba(220, 244, 238, 0.88) !important;
  color: #0f5b52 !important;
}

.game-audio-controls__hint {
  margin-top: 0.08rem;
  font-size: 0.76rem;
}

.game-audio-controls__voice {
  display: grid;
  gap: 0.22rem;
}

.game-audio-controls__select {
  width: 100%;
  min-height: 36px;
  border-radius: 9px;
  border: 1px solid rgba(129, 167, 191, 0.72);
  background: rgba(240, 250, 255, 0.86);
  color: #1e3552;
  font-size: 0.82rem;
  padding: 0.42rem 0.55rem;
}

.game-lobby-layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 0.9rem;
  align-items: start;
}

.game-lobby-layout__main,
.game-lobby-layout__side {
  min-width: 0;
  display: grid;
  gap: 0.9rem;
}

.panel-dashboard-layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(450px, 1.1fr);
  gap: 0.9rem;
  align-items: start;
}

.panel-dashboard-layout__main,
.panel-dashboard-layout__side {
  min-width: 0;
  display: grid;
  gap: 0.9rem;
}

.panel-screen .panel-dashboard-layout {
  flex: 1;
  min-height: 0;
  height: 100%;
  gap: 0.75rem;
}

.panel-screen .panel-dashboard-layout__main,
.panel-screen .panel-dashboard-layout__side {
  min-height: 0;
  gap: 0.75rem;
}

.panel-screen--users {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.panel-screen--users .panel-dashboard-layout__main {
  grid-template-rows: auto minmax(0, 1fr);
}

.panel-screen--users .panel-dashboard-layout__side {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.panel-screen--users .panel-scroll {
  min-height: 0;
  overflow: auto;
}

.panel-screen--users .user-card-grid {
  margin-bottom: 0;
  align-items: stretch;
}

.panel-screen--users .user-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 0.45rem;
  align-content: start;
  min-height: 0;
}

.panel-screen--users .user-card__content {
  min-height: 0;
}

.panel-screen--users .user-card p {
  overflow-wrap: anywhere;
}

.panel-screen--users .user-card .btn {
  margin-top: 0;
}

.panel-screen--visual {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.panel-screen--visual .panel-screen__content {
  min-height: 0;
  overflow: auto;
}

.panel-screen--visual .panel-screen__content .scenario-btn {
  overflow: hidden;
}

.hub-zone-layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.75fr);
  gap: 0.8rem;
  align-items: start;
}

.hub-zone-layout__main {
  min-width: 0;
  display: grid;
  gap: 0.8rem;
  align-content: start;
}

.hub-zone-layout__simulator,
.hub-zone-layout__sidebar {
  min-width: 0;
}

.hub-zone-layout__sidebar {
  display: grid;
  gap: 0.8rem;
}

.page-shell--immersive {
  max-width: none;
  width: 100%;
  padding: 0.75rem clamp(0.75rem, 1.4vw, 1.4rem) 1.3rem;
}

.page-shell--immersive .hero-card {
  padding: 0.9rem 1rem;
}

.page-shell--immersive .hero-card--compact {
  padding: 0.62rem 0.85rem;
}

.page-shell--immersive .hero-card h1 {
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  margin-top: 0.25rem;
}

.page-shell--immersive .hero-card--compact h1 {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  margin: 0.12rem 0 0.1rem;
}

.page-shell--immersive .hero-card--compact .hint {
  margin-top: 0.22rem;
  font-size: 0.9rem;
}

.panel--hospital-room {
  padding: 0.75rem;
}

.panel--hospital-room .room-scene {
  min-height: calc(100vh - 240px);
}

.hero-card,
.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9));
  border: 1px solid var(--surface-border);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: 0 12px 24px rgba(36, 53, 76, 0.08);
}

.hero-card h1,
.panel h2 {
  margin: 0;
}

.hero-card p {
  margin-bottom: 0;
}

.hero-card .badge {
  display: inline-block;
  margin: 0 0 0.55rem;
  font: 600 0.78rem/1.2 var(--font-mono), monospace;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  color: #0f584f;
  border: 1px solid #a6cec8;
  background: #dbeeea;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  font: 500 0.8rem/1.2 var(--font-mono), monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

label {
  display: block;
  margin: 0.75rem 0 0.35rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
}

textarea {
  resize: vertical;
  min-height: 104px;
}

.btn {
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  font: 600 0.95rem/1.2 var(--font-main), sans-serif;
  padding: 0.72rem 0.95rem;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary {
  margin-top: 1rem;
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.btn-option {
  width: 100%;
  text-align: left;
  border: 1px solid #bfd5d3;
  background: #f5f9f9;
  color: var(--text);
}

.btn-option:hover:not(:disabled) {
  background: #eaf4f3;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.stats div {
  background: #f1f5fa;
  border: 1px solid #dce5ef;
  border-radius: 12px;
  padding: 0.65rem;
}

.stats span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.stats strong {
  font-size: 1rem;
}

.hint {
  margin-top: 0.7rem;
  color: var(--muted);
}

.hint code {
  font-family: var(--font-mono), monospace;
  font-size: 0.9em;
}

.feedback {
  margin: 0.75rem 0 0;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: #e8f5f2;
  border: 1px solid #b2ddd2;
}

.feedback--neutral {
  background: #e8f5f2;
  border-color: #b2ddd2;
  color: #21584f;
}

.feedback--success {
  background: #dcf3ea;
  border-color: #8fd1b6;
  color: #165f4f;
}

.feedback--warn {
  background: #fff1e8;
  border-color: #f0c4aa;
  color: #8c3f17;
}

.error-box {
  margin: 0;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger-text);
  border-radius: 12px;
}

.scene-panel p {
  margin-top: 0.6rem;
}

.option-list {
  margin-top: 1rem;
  display: grid;
  gap: 0.55rem;
}

.note-box {
  margin-top: 0.85rem;
}

.result-panel .badge {
  display: inline-block;
  margin: 0.45rem 0 1rem;
  font-family: var(--font-mono), monospace;
  border-radius: 999px;
  background: #dbeeea;
  color: #0f584f;
  border: 1px solid #a6cec8;
  padding: 0.25rem 0.7rem;
}

.reco-list {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
}

.reco-list li {
  margin-bottom: 0.45rem;
}

.mode-switch {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mode-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.scenario-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.scenario-btn {
  border: 1px solid #c6d7e8;
  border-radius: 12px;
  background: #f3f8fd;
  padding: 0.58rem 0.7rem;
  text-align: left;
  color: #2c4360;
}

.scenario-btn span {
  display: block;
  font: 600 0.7rem/1 var(--font-mono), monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  color: #507093;
}

.scenario-btn strong {
  font-size: 0.95rem;
}

.teacher-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  border: 1px solid #bfd2e4;
  border-radius: 10px;
  overflow: hidden;
}

.teacher-table th,
.teacher-table td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid #d2e1ee;
  border-right: 1px solid #dbe7f2;
  vertical-align: top;
  font-size: 0.9rem;
  color: #24405d;
}

.teacher-table th:last-child,
.teacher-table td:last-child {
  border-right: 0;
}

.teacher-table thead th {
  font: 700 0.7rem/1 var(--font-mono), monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #335a7d;
  background: #e7f1fa;
}

.teacher-table tbody tr:nth-child(even) {
  background: rgba(234, 243, 251, 0.56);
}

.risk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font: 700 0.66rem/1 var(--font-mono), monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.risk-badge--high {
  color: #7a1f14;
  background: rgba(252, 226, 223, 0.95);
  border-color: #efb8b2;
}

.risk-badge--medium {
  color: #705109;
  background: rgba(252, 243, 214, 0.95);
  border-color: #ecd487;
}

.risk-badge--low {
  color: #0d5c45;
  background: rgba(221, 244, 234, 0.95);
  border-color: #9fd7bf;
}

.teacher-alert-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.teacher-alert-column {
  border: 1px solid #c9d8e7;
  border-radius: 12px;
  background: rgba(248, 252, 255, 0.92);
  padding: 0.6rem 0.65rem;
  display: grid;
  gap: 0.52rem;
}

.teacher-alert-column h3 {
  margin: 0;
  font-size: 1rem;
  color: #1f3956;
}

.teacher-alert-list {
  display: grid;
  gap: 0.55rem;
}

.teacher-alert-card {
  border: 1px solid #d4e0ed;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.56rem 0.62rem;
  display: grid;
  gap: 0.3rem;
}

.teacher-alert-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.teacher-alert-card__head strong {
  color: #203a57;
}

.teacher-alert-list-items {
  margin: 0.1rem 0 0;
  padding-left: 1.05rem;
  color: #304b66;
}

.teacher-alert-list-items li {
  margin: 0.2rem 0;
}

.scenario-btn--active {
  border-color: #0c6e66;
  background: #dcf2ee;
  box-shadow: 0 0 0 2px rgba(12, 110, 102, 0.15);
}

.visual-lab {
  padding: 1rem;
}

.visual-header {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.visual-header-main {
  width: 100%;
  display: grid;
  gap: 0.55rem;
}

.visual-title-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.62rem;
  flex-wrap: wrap;
}

.visual-title-actions h2 {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
}

.visual-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
  flex: 1;
  gap: 0.45rem;
}

.visual-actions .btn {
  width: auto;
  margin-top: 0;
  white-space: nowrap;
  padding: 0.62rem 0.78rem;
}

.visual-actions .hint {
  width: 100%;
  margin: 0.15rem 0 0;
  text-align: right;
}

.visual-layout {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.room-scene {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #cfdce8;
  border-radius: 16px;
  min-height: clamp(360px, 46vh, 500px);
  height: clamp(360px, 46vh, 500px);
  background: linear-gradient(180deg, #ecf3fc 0%, #e8eef7 58%, #dde6f0 100%);
}

.hospital-stage {
  min-height: 560px;
  padding: 0.7rem;
}

.hospital-stage--compact {
  min-height: 430px;
}

.hospital-stage-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.35fr);
  grid-template-rows: minmax(360px, 52vh) minmax(220px, 30vh);
  gap: 0.75rem;
  align-items: stretch;
  min-height: 0;
  min-width: 0;
  margin-top: 0.62rem;
}

.hospital-game-hud {
  position: sticky;
  top: 0;
  z-index: 8;
  border: 1px solid rgba(93, 146, 177, 0.62);
  border-radius: 12px;
  background: rgba(12, 39, 63, 0.86);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 16px rgba(10, 30, 46, 0.3);
  padding: 0.45rem 0.6rem 0.5rem;
}

.hospital-game-hud-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(20, 60, 89, 0.86);
  overflow: hidden;
}

.hospital-game-hud-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #16d6c0, #35e69a);
  transition: width 220ms ease;
}

.hospital-game-hud-meta {
  margin-top: 0.35rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.hospital-game-hud-meta strong {
  color: #dbf5ff;
  font: 700 0.73rem/1.1 var(--font-mono), monospace;
  letter-spacing: 0.03em;
}

.hospital-mobile-stack {
  display: none;
}

.hospital-stage-zone {
  min-width: 0;
  min-height: 0;
  display: grid;
  align-items: stretch;
}

.hospital-stage-zone--nurse {
  grid-column: 1;
  grid-row: 1;
}

.hospital-stage-zone--patient {
  grid-column: 2;
  grid-row: 1;
}

.hospital-stage-zone--monitor {
  grid-column: 3;
  grid-row: 1;
  display: grid;
  align-items: stretch;
}

.hospital-stage-zone--mission {
  grid-column: 1 / 3;
  grid-row: 2;
}

.hospital-stage-zone--tools {
  grid-column: 3;
  grid-row: 2;
}

.hospital-stage .nurse-card,
.hospital-stage .patient-card,
.hospital-stage .instrument.monitor,
.hospital-stage .instrument.tool,
.hospital-stage .hospital-equipped-strip {
  position: relative;
  inset: auto;
  width: 100%;
  min-width: 0;
  max-width: none;
}

.scene-clickable {
  cursor: pointer;
  transition: box-shadow 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.scene-clickable:hover {
  box-shadow: 0 0 0 2px rgba(95, 177, 221, 0.36), 0 12px 22px rgba(16, 46, 71, 0.24);
}

.scene-clickable:focus-visible {
  outline: 2px solid #54b0d8;
  outline-offset: 2px;
}

.scene-clickable--active {
  box-shadow: 0 0 0 3px rgba(12, 110, 102, 0.28), 0 14px 22px rgba(13, 45, 69, 0.28);
}

.scene-clickable--monitor {
  border-radius: 14px;
}

.scene-tool--active {
  border-color: #0a6d66 !important;
  box-shadow: 0 0 0 3px rgba(12, 110, 102, 0.18), 0 10px 20px rgba(18, 76, 92, 0.22);
}

.hospital-stage .nurse-card,
.hospital-stage .patient-card {
  z-index: 3;
  border: 1px solid rgba(136, 166, 193, 0.68);
  border-radius: 16px;
  background: rgba(243, 249, 255, 0.62);
  box-shadow: 0 8px 18px rgba(15, 39, 61, 0.2);
  backdrop-filter: blur(4px);
  padding: 0.7rem;
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: stretch;
  gap: 0.5rem;
  height: 100%;
  min-height: 0;
}

.hospital-stage .character-row {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 0.6rem;
  align-content: stretch;
  min-height: 0;
}

.hospital-stage .nurse-avatar,
.hospital-stage .patient-avatar {
  width: min(92%, 280px);
  height: clamp(210px, 26vh, 330px);
  margin: 0 auto 0.2rem;
  flex: 0 0 auto;
}

.hospital-stage .nurse-dialogue,
.hospital-stage .patient-dialogue {
  max-height: 100%;
  overflow: visible;
  font-size: 0.98rem;
  line-height: 1.35;
  min-height: 70px;
}

.hospital-stage-zone--monitor .instrument.monitor {
  z-index: 4;
  top: auto;
  right: auto;
  left: auto;
  bottom: auto;
  justify-self: stretch;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  min-height: 100%;
  max-height: none;
  max-width: none;
  text-align: center;
  display: grid;
}

.hospital-stage-bottom-tools {
  display: grid;
  gap: 0.5rem;
  align-content: stretch;
  min-height: 0;
  grid-template-rows: 1fr auto;
}

.hospital-stage .hospital-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

.hospital-stage .hospital-tool-grid .instrument.tool {
  z-index: 3;
  top: auto;
  right: auto;
  left: auto;
  bottom: auto;
  text-align: center;
  min-height: 94px;
  padding: 0.54rem 0.48rem;
}

.hospital-equipped-strip {
  position: relative;
  width: 100%;
  border: 1px solid rgba(133, 164, 191, 0.72);
  border-radius: 12px;
  background: rgba(248, 252, 255, 0.68);
  padding: 0.42rem 0.55rem;
  box-shadow: 0 6px 14px rgba(23, 48, 71, 0.14);
  z-index: 2;
  backdrop-filter: blur(6px);
  align-self: stretch;
}

.hospital-mission-panel {
  border: 1px solid rgba(133, 165, 192, 0.74);
  border-radius: 14px;
  background: rgba(248, 252, 255, 0.68);
  padding: 0.7rem;
  box-shadow: 0 8px 16px rgba(23, 48, 71, 0.12);
  backdrop-filter: blur(6px);
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
}

.hospital-mission-panel .hint {
  margin-top: 0.35rem;
}

.hospital-mission-actions {
  margin-top: 0.42rem;
  display: grid;
  gap: 0.35rem;
}

.hospital-mission-actions .btn {
  margin-top: 0;
  padding: 0.56rem 0.68rem;
  font-size: 0.9rem;
}

.hospital-equipped-strip span {
  display: block;
  color: #1f4a6d;
  font: 600 0.56rem/1 var(--font-mono), monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.08rem;
}

.hospital-equipped-strip strong {
  color: #163852;
  font-size: 0.72rem;
  line-height: 1.2;
  display: block;
}

.hospital-interaction-line {
  margin: 0.38rem 0 0;
  color: #215071;
  font-size: 0.68rem;
  line-height: 1.3;
}

.room-mission-console {
  display: grid;
  gap: 0.42rem;
}

.room-mission-objective {
  max-height: 260px;
  overflow: auto;
  padding-right: 0.2rem;
}

.room-mission-objective .hint {
  margin-top: 0.3rem;
  font-size: 0.88rem;
}

.room-mission-objective .chip {
  padding: 0.48rem 0.56rem;
  font-size: 0.88rem;
}

.room-mission-objective textarea {
  min-height: 110px;
}

.room-mission-console .feedback {
  margin-top: 0.2rem;
  padding: 0.52rem 0.66rem;
  font-size: 0.88rem;
}

.cinematic-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
  background: radial-gradient(circle at 20% 0, rgba(6, 20, 38, 0.38), rgba(8, 16, 24, 0.58));
}

.cinematic-card {
  width: min(560px, 100%);
  border-radius: 16px;
  border: 1px solid rgba(188, 227, 222, 0.55);
  background: linear-gradient(180deg, rgba(16, 35, 54, 0.94), rgba(11, 26, 40, 0.96));
  color: #d8e9f6;
  box-shadow: 0 12px 28px rgba(2, 9, 18, 0.45);
  padding: 1rem;
}

.cinematic-card h3 {
  margin: 0.2rem 0 0.45rem;
}

.cinematic-card p {
  margin: 0;
  color: #c6dae8;
}

.cinematic-card ul {
  margin: 0.8rem 0 0;
  padding-left: 1.2rem;
}

.cinematic-card li {
  margin-bottom: 0.35rem;
}

.cinematic-objective {
  opacity: 0;
  transform: translateY(6px);
  animation: objectiveReveal 420ms ease forwards;
}

@keyframes objectiveReveal {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.cinematic-actions {
  margin-top: 0.9rem;
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.scene-wall {
  position: absolute;
  inset: 0 0 38% 0;
  background:
    radial-gradient(circle at 18% 30%, rgba(255, 255, 255, 0.9), transparent 30%),
    linear-gradient(180deg, rgba(240, 246, 253, 0.95), rgba(226, 236, 247, 0.95));
}

.scene-floor {
  position: absolute;
  inset: 62% 0 0 0;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(174, 193, 213, 0.35) 0,
      rgba(174, 193, 213, 0.35) 2px,
      rgba(230, 238, 247, 0.8) 2px,
      rgba(230, 238, 247, 0.8) 22px
    );
}

.nurse-card {
  position: absolute;
  left: 6%;
  top: 10%;
  width: min(44%, 260px);
  min-width: 220px;
  border: 0;
  border-radius: 14px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  z-index: 2;
}

.nurse-label {
  display: block;
  margin-bottom: 0.28rem;
  font-size: 0.72rem;
  color: #f0f7ff;
  text-shadow: 0 2px 8px rgba(10, 30, 46, 0.55);
}

.character-row {
  display: flex;
  gap: 0.58rem;
  align-items: center;
}

.character-row--patient {
  align-items: center;
}

.nurse-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 98px;
  width: 98px;
  height: 112px;
  border-radius: 14px;
  border: 1px solid rgba(127, 162, 191, 0.75);
  background: rgba(230, 245, 255, 0.78);
  padding: 0.2rem;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(15, 36, 58, 0.28);
}

.nurse-head {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(160deg, #f0c8a6, #d5a180);
  border: 1px solid #b98262;
}

.nurse-body {
  width: 46px;
  height: 56px;
  border-radius: 14px 14px 10px 10px;
  background: linear-gradient(165deg, #e8f5ff, #c6dff2);
  border: 1px solid #8eabc6;
}

.nurse-dialogue {
  margin: 0;
  border-radius: 16px;
  border: 2px solid rgba(114, 147, 177, 0.86);
  background: rgba(255, 255, 255, 0.9);
  color: #16364f;
  font-size: 0.86rem;
  line-height: 1.35;
  padding: 0.5rem 0.65rem;
  text-shadow: none;
  box-shadow: 0 8px 18px rgba(12, 35, 56, 0.22);
}

.patient-card {
  position: absolute;
  left: 6%;
  bottom: 12%;
  width: 42%;
  min-width: 200px;
  border: 0;
  border-radius: 14px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.patient-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  color: #f0f7ff;
  text-shadow: 0 2px 8px rgba(10, 30, 46, 0.55);
}

.patient-status {
  display: inline-block;
  margin-bottom: 0.42rem;
  border-radius: 999px;
  border: 1px solid #96cdbd;
  background: #def4ec;
  color: #1e624f;
  font: 600 0.7rem/1 var(--font-mono), monospace;
  letter-spacing: 0.03em;
  padding: 0.24rem 0.5rem;
}

.patient-status--risk {
  border-color: #e8b59b;
  background: #ffece1;
  color: #8e3f1a;
}

.patient-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  margin-bottom: 0;
  flex: 0 0 102px;
  width: 102px;
  height: 116px;
  border-radius: 14px;
  border: 1px solid rgba(127, 162, 191, 0.75);
  background: rgba(230, 245, 255, 0.78);
  padding: 0.18rem;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(15, 36, 58, 0.28);
}

.patient-dialogue {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.35;
  color: #16364f;
}

.dialog-bubble {
  position: relative;
  flex: 1;
  border-radius: 16px;
  border: 2px solid rgba(114, 147, 177, 0.86);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.5rem 0.65rem;
  text-shadow: none;
  box-shadow: 0 8px 18px rgba(12, 35, 56, 0.22);
}

.dialog-bubble::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 16px;
  width: 12px;
  height: 12px;
  border-left: 2px solid rgba(114, 147, 177, 0.86);
  border-bottom: 2px solid rgba(114, 147, 177, 0.86);
  background: rgba(255, 255, 255, 0.9);
  transform: rotate(45deg);
}

.patient-head {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(160deg, #f0c7a5, #d8a687);
  border: 1px solid #be886a;
}

.patient-body {
  width: 74px;
  height: 86px;
  border-radius: 20px 20px 16px 16px;
  background: linear-gradient(160deg, #1a7994, #13647e);
  border: 1px solid #0f4e63;
}

.arm-zone {
  width: 100%;
  border-radius: 10px;
  border: 1px dashed rgba(169, 207, 236, 0.84);
  background: rgba(11, 42, 66, 0.48);
  color: #eaf5ff;
  padding: 0.5rem 0.6rem;
  font-weight: 600;
}

.arm-zone--target {
  border-color: #0c6e66;
  background: #e7f5f3;
}

.arm-zone--ok {
  border-style: solid;
  border-color: #1f8f7f;
  background: rgba(218, 242, 238, 0.74);
}

.instrument {
  position: absolute;
  border-radius: 12px;
  border: 1px solid rgba(128, 161, 189, 0.72);
  background: rgba(244, 250, 255, 0.72);
  color: #173852;
  padding: 0.5rem;
  box-shadow: 0 8px 16px rgba(19, 43, 67, 0.15);
  backdrop-filter: blur(5px);
}

.instrument.monitor {
  top: 8%;
  right: 7%;
  min-width: 148px;
  width: min(42%, 280px);
  max-width: 280px;
  text-align: center;
  z-index: 4;
}

.instrument.monitor p {
  margin: 0;
  font-size: 0.76rem;
  color: #214463;
}

.instrument.monitor strong {
  display: block;
  font: 700 1.1rem/1.2 var(--font-mono), monospace;
  white-space: pre-line;
  word-break: break-word;
}

.monitor-phase {
  display: inline-block;
  margin: 0.12rem 0 0.35rem;
  font: 600 0.7rem/1 var(--font-mono), monospace;
  letter-spacing: 0.08em;
  color: #24557a;
}

.monitor-wave {
  height: 6px;
  border-radius: 999px;
  margin-top: 0.42rem;
  background: linear-gradient(90deg, #d2e2f3, #d2e2f3);
}

.monitor-wave--active {
  background: repeating-linear-gradient(
    110deg,
    #4ea0c5 0,
    #4ea0c5 8px,
    #d8ecf8 8px,
    #d8ecf8 16px
  );
  animation: waveRun 700ms linear infinite;
}

@keyframes waveRun {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 36px 0;
  }
}

.instrument.tool {
  min-width: 122px;
  text-align: left;
  font-weight: 600;
}

.instrument.tool-bp {
  right: 7%;
  top: 36%;
}

.instrument.tool-cuff {
  right: 7%;
  top: 50%;
  cursor: grab;
}

.instrument.tool-cuff:active {
  cursor: grabbing;
}

.instrument.tool-steth {
  right: 7%;
  top: 64%;
}

.inventory-rack {
  position: absolute;
  left: 6%;
  top: 39%;
  width: 56%;
  border: 1px solid #b9cde1;
  border-radius: 14px;
  background: rgba(244, 250, 255, 0.96);
  box-shadow: 0 10px 20px rgba(52, 71, 92, 0.15);
  padding: 0.55rem;
  z-index: 2;
}

.inventory-rack--over {
  border-color: #0b7a72;
  box-shadow: 0 0 0 2px rgba(12, 110, 102, 0.16), 0 10px 20px rgba(52, 71, 92, 0.15);
}

.inventory-title {
  margin: 0;
  font: 600 0.72rem/1 var(--font-mono), monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3b5f7f;
}

.inventory-tools {
  margin-top: 0.48rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.inventory-tool {
  border: 1px solid #b9d0e6;
  border-radius: 10px;
  background: #edf5fd;
  color: #24415f;
  font: 600 0.8rem/1.1 var(--font-main), sans-serif;
  padding: 0.34rem 0.5rem;
  cursor: grab;
}

.inventory-tool:active {
  cursor: grabbing;
}

.inventory-tool--ready {
  border-color: #0f8b77;
  background: #dcf4ee;
  color: #0f5d50;
}

.inventory-dropzone {
  margin-top: 0.5rem;
  border: 1px dashed #97afc7;
  border-radius: 10px;
  min-height: 44px;
  background: #f7fbff;
  padding: 0.38rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  align-items: center;
}

.inventory-dropzone--over {
  border-color: #0b7a72;
  background: #eaf7f4;
}

.inventory-badge {
  border: 1px solid #8cc8b7;
  border-radius: 999px;
  background: #e1f6ef;
  color: #155f4f;
  font: 600 0.68rem/1 var(--font-mono), monospace;
  letter-spacing: 0.03em;
  padding: 0.22rem 0.46rem;
}

.inventory-status {
  margin: 0.48rem 0 0;
  color: #42617d;
  font-size: 0.79rem;
}

/* ===== Visual lab: área de práctica más grande y limpia ===== */
.visual-lab .room-scene {
  min-height: clamp(520px, 64vh, 760px);
  height: clamp(520px, 64vh, 760px);
  border-radius: 18px;
}

.visual-lab .nurse-card {
  left: 5%;
  top: 6%;
  width: min(26%, 320px);
  min-width: 240px;
}

.visual-lab .patient-card {
  left: 32%;
  top: 14%;
  bottom: auto;
  width: min(30%, 380px);
  min-width: 260px;
}

.visual-lab .nurse-avatar {
  width: 116px;
  height: 132px;
}

.visual-lab .patient-avatar {
  width: 122px;
  height: 138px;
}

.visual-lab .nurse-dialogue,
.visual-lab .patient-dialogue {
  font-size: 0.92rem;
  line-height: 1.38;
}

.visual-lab .dialog-bubble {
  border-radius: 14px;
  border-width: 1px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 14px rgba(12, 35, 56, 0.18);
}

.visual-lab .instrument.monitor {
  right: 5%;
  top: 6%;
  width: min(34%, 390px);
  max-width: 390px;
}

.visual-lab .instrument.tool {
  right: 5%;
  min-width: 132px;
  text-align: center;
  padding: 0.56rem 0.6rem;
}

.visual-lab .instrument.tool-bp {
  top: 36%;
}

.visual-lab .instrument.tool-cuff {
  top: 49%;
}

.visual-lab .instrument.tool-steth {
  top: 62%;
}

.visual-lab .inventory-rack {
  left: 5%;
  right: auto;
  top: auto;
  bottom: 4%;
  width: min(62%, 860px);
  border-radius: 14px;
  border: 1px solid rgba(160, 187, 210, 0.85);
  background: rgba(246, 251, 255, 0.95);
  box-shadow: 0 8px 18px rgba(32, 56, 82, 0.16);
  padding: 0.62rem;
}

.visual-lab .inventory-title {
  font-size: 0.74rem;
  color: #2f5374;
}

.visual-lab .inventory-tools {
  gap: 0.42rem;
}

.visual-lab .inventory-tool {
  border-radius: 9px;
  font-size: 0.83rem;
  padding: 0.36rem 0.54rem;
}

.visual-lab .inventory-dropzone {
  min-height: 58px;
  border-radius: 10px;
  background: rgba(252, 254, 255, 0.95);
}

.visual-lab .inventory-status {
  margin-top: 0.44rem;
  font-size: 0.84rem;
}

.vital-game-card {
  border: 1px solid #b9d1e4;
  border-radius: 14px;
  background: linear-gradient(180deg, #f4faff, #ecf5fe);
  padding: 0.72rem;
}

.vital-game-card h3 {
  margin: 0.2rem 0 0.4rem;
}

.vital-readings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.42rem;
  margin-top: 0.5rem;
}

.vital-readings span {
  border: 1px solid #d0dceb;
  border-radius: 10px;
  background: #f8fcff;
  color: #2a4a67;
  font: 700 0.84rem/1.1 var(--font-mono), monospace;
  padding: 0.42rem 0.5rem;
}

.vital-game-actions {
  margin-top: 0.55rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.48rem;
}

.feedback-fx {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  z-index: 13;
  border-radius: 999px;
  border: 1px solid #bad8cf;
  background: rgba(220, 243, 234, 0.96);
  color: #0f5f50;
  box-shadow: 0 8px 20px rgba(12, 42, 36, 0.24);
  font: 700 0.84rem/1 var(--font-mono), monospace;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.78rem;
  animation: feedbackPop 940ms ease forwards;
}

.feedback-fx--warn {
  border-color: #eab69d;
  background: rgba(255, 238, 225, 0.97);
  color: #7f3812;
}

@keyframes feedbackPop {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.92);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  75% {
    opacity: 1;
    transform: translate(-50%, -4px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -12px) scale(0.98);
  }
}

.instrument--active {
  border-color: #0a6d66;
  box-shadow: 0 0 0 3px rgba(12, 110, 102, 0.14), 0 10px 20px rgba(18, 76, 92, 0.22);
  animation: softPulse 1.3s ease-in-out infinite;
}

@keyframes softPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

.procedure-console {
  border: 1px solid #cfdce8;
  border-radius: 16px;
  background: #f9fcff;
  padding: 0.78rem;
  display: grid;
  gap: 0.8rem;
}

.console-top-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.58rem;
  align-items: start;
}

.hud-board {
  border: 1px solid #c1d8e8;
  border-radius: 14px;
  background: linear-gradient(180deg, #eef5fd, #e7f1fa);
  padding: 0.72rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.resume-card {
  border: 1px solid #c6d5e2;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff, #eef5fc);
  padding: 0.72rem;
}

.resume-card h3 {
  margin: 0.2rem 0 0.3rem;
  font-size: 1rem;
}

.resume-card p {
  margin: 0;
}

.resume-actions {
  margin-top: 0.65rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.resume-actions .btn {
  margin-top: 0;
}

.stats--console {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.hud-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.hud-chip {
  border-radius: 999px;
  border: 1px solid #9ec6dd;
  background: #d8ebf9;
  color: #255a79;
  font: 600 0.72rem/1 var(--font-mono), monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.52rem;
}

.hud-title {
  margin: 0.2rem 0 0.12rem;
  font-size: 1rem;
}

.hud-subtitle {
  margin: 0;
  color: #415f7a;
  font-size: 0.92rem;
}

.objective-track {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.42rem;
}

.objective-item {
  border-radius: 11px;
  border: 1px solid #c8d9e8;
  background: #f8fbff;
  color: #405a73;
  padding: 0.45rem 0.56rem;
}

.objective-item span {
  display: block;
  font: 600 0.65rem/1 var(--font-mono), monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.18rem;
}

.objective-item strong {
  font-size: 0.88rem;
}

.objective-item--done {
  border-color: #93d0be;
  background: #e6f7f1;
  color: #1f5f51;
}

.objective-item--active {
  border-color: #6ab2d9;
  background: #e6f3fc;
  color: #1e4b69;
  box-shadow: 0 0 0 2px rgba(106, 178, 217, 0.18);
}

.progress-shell {
  width: 100%;
  height: 10px;
  background: #d9e5f1;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f9186, #4ea0c5);
  transition: width 220ms ease;
}

.step-card {
  border: 1px solid #d1deea;
  border-radius: 14px;
  padding: 0.8rem;
  background: #fff;
}

.step-card h3 {
  margin: 0.2rem 0 0.45rem;
}

.step-card p {
  margin: 0;
}

.control-block {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.55rem;
}

.chip-grid {
  display: grid;
  gap: 0.5rem;
}

.chip {
  width: 100%;
  border: 1px solid #bfcfdf;
  background: #eff5fb;
  border-radius: 11px;
  padding: 0.55rem 0.65rem;
  text-align: left;
  color: #21344a;
  font: 600 0.92rem/1.2 var(--font-main), sans-serif;
}

.chip--selected {
  border-color: #0b746b;
  background: #dcf2ee;
}

.event-log {
  margin: 0;
  padding-left: 1.05rem;
  color: #294157;
}

.event-log li {
  margin-bottom: 0.35rem;
}

.result-callout {
  border: 1px solid #bdd9d2;
  border-radius: 14px;
  background: #ecfaf5;
  padding: 0.8rem;
}

.result-callout h3 {
  margin: 0.1rem 0 0.4rem;
}

.medal-line {
  margin: 0.35rem 0;
}

.badge-grid {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.achievement-badge {
  border-radius: 999px;
  border: 1px solid #9cd0bf;
  background: #e7f8f1;
  color: #18584a;
  font: 600 0.74rem/1 var(--font-mono), monospace;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.62rem;
}

.briefing-panel h2 {
  margin: 0.15rem 0 0.55rem;
}

.briefing-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 0.9rem;
  align-items: start;
}

.briefing-video {
  width: 100%;
  border-radius: 14px;
  border: 1px solid #c4d5e6;
  background: #111923;
  min-height: 360px;
  aspect-ratio: 16 / 9;
  box-shadow: 0 10px 20px rgba(32, 49, 69, 0.2);
}

.mission-map-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.mission-path {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  margin-top: 0.7rem;
}

.mission-node-wrap {
  display: flex;
  align-items: center;
  flex: 1;
}

.mission-node {
  flex: 1;
  border-radius: 14px;
  border: 1px solid #c6d7e8;
  background: #f4f8fd;
  color: #21384f;
  padding: 0.7rem;
  text-align: left;
  min-height: 140px;
}

.mission-node strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.mission-node p {
  margin: 0;
  color: #445d78;
  font-size: 0.9rem;
}

.mission-node-code {
  display: inline-block;
  border-radius: 999px;
  border: 1px solid #9db7d3;
  background: #e3edf9;
  color: #2b4f75;
  font: 600 0.7rem/1 var(--font-mono), monospace;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.45rem;
  margin-bottom: 0.35rem;
}

.mission-node-medal {
  display: block;
  margin-top: 0.55rem;
  color: #315470;
  font: 600 0.74rem/1 var(--font-mono), monospace;
}

.mission-node--active {
  border-color: #76a9ce;
}

.mission-node--completed {
  border-color: #0f8b77;
  background: #e3f5f1;
}

.mission-node--locked {
  border-style: dashed;
  border-color: #c6cdd7;
  background: #f4f5f7;
  color: #7b8796;
}

.mission-node--selected {
  box-shadow: 0 0 0 3px rgba(12, 110, 102, 0.18);
}

.mission-link {
  width: 38px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #88a9c9, #5f89b1);
  margin: 0 0.35rem;
}

.student-progress-board h2 {
  margin: 0.2rem 0 0.55rem;
}

.unlock-list {
  margin: 0.75rem 0 0;
  padding-left: 1.05rem;
  color: #2f4a64;
}

.unlock-list li {
  margin-bottom: 0.32rem;
}

.student-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
}

.student-toolbar h2 {
  margin: 0.2rem 0 0.35rem;
}

.student-toolbar-actions {
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.student-toolbar-actions .btn-primary {
  margin-top: 0;
}

.student-report h2 {
  margin: 0.2rem 0 0.7rem;
  font-size: 1.1rem;
}

.student-report-grid {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.student-report-column {
  border: 1px solid #cfdeeb;
  border-radius: 14px;
  background: #fbfdff;
  padding: 0.72rem;
}

.student-list {
  margin: 0.45rem 0 0;
  padding-left: 1rem;
  color: #2f4b66;
}

.student-list li {
  margin-bottom: 0.35rem;
}

.teacher-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.teacher-case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.teacher-case-card {
  border: 1px solid #cddceb;
  border-radius: 14px;
  background: #f8fbff;
  padding: 0.74rem;
}

.teacher-case-card h3 {
  margin: 0;
}

.teacher-case-card .hint {
  margin: 0.35rem 0 0.55rem;
}

.teacher-student-list {
  display: grid;
  gap: 0.65rem;
}

.teacher-student-card {
  border: 1px solid #cfdeeb;
  border-radius: 14px;
  background: #fcfeff;
  padding: 0.72rem;
}

.teacher-student-card h3 {
  margin: 0;
}

.teacher-student-card .hint {
  margin-bottom: 0;
}

@media (max-width: 1160px) {
  .game-lobby-layout,
  .panel-dashboard-layout,
  .hub-zone-layout {
    grid-template-columns: 1fr;
  }

  .hospital-stage-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto auto;
  }

  .hospital-stage-zone--nurse {
    grid-column: 1;
    grid-row: 1;
  }

  .hospital-stage-zone--patient {
    grid-column: 2;
    grid-row: 1;
  }

  .hospital-stage-zone--monitor {
    grid-column: 1 / 3;
    grid-row: 2;
  }

  .hospital-stage-zone--mission {
    grid-column: 1;
    grid-row: 3;
  }

  .hospital-stage-zone--tools {
    grid-column: 2;
    grid-row: 3;
  }

  .hospital-stage-zone--monitor .instrument.monitor {
    min-height: 300px;
  }

  .panel-screen--users .panel-dashboard-layout__main,
  .panel-screen--users .panel-dashboard-layout__side {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .panel-screen--users .user-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teacher-alert-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Stable fullscreen + anti-overlap overrides (final) ===== */
.game-fullwidth .game-shell {
  grid-template-columns: minmax(0, 1fr) 290px;
  min-height: 100vh;
  align-items: stretch;
}

.game-fullwidth .game-shell__main {
  min-width: 0;
  min-height: 100vh;
}

.game-fullwidth .game-shell__hud {
  min-height: 100vh;
}

.page-shell.panel-screen {
  max-width: none;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
}

.panel-screen .panel-dashboard-layout {
  height: 100%;
  min-height: 0;
}

.panel-screen .panel-dashboard-layout__main,
.panel-screen .panel-dashboard-layout__side {
  min-height: 0;
}

.panel-screen--users .panel-scroll,
.panel-screen--visual .panel-screen__content {
  min-height: 0;
  overflow: auto;
}

.page-shell.game-screen {
  max-width: none;
  width: 100%;
  height: calc(100vh - 1rem);
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

.game-screen--lobby .game-lobby-layout,
.game-screen--hub .hub-zone-layout {
  height: 100%;
  min-height: 0;
}

.game-screen--lobby .game-lobby-layout__main,
.game-screen--lobby .game-lobby-layout__side,
.game-screen--hub .hub-zone-layout__main,
.game-screen--hub .hub-zone-layout__simulator,
.game-screen--hub .hub-zone-layout__sidebar {
  min-height: 0;
}

.game-screen--lobby .game-lobby-layout__main > .panel,
.game-screen--lobby .game-lobby-layout__side > .panel,
.game-screen--hub .hub-zone-layout__sidebar > .panel {
  min-height: 0;
  overflow: auto;
}

.hospital-game-hud-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.hospital-game-hud-main {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.hospital-hud-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(140, 220, 196, 0.8);
  background: rgba(8, 104, 95, 0.28);
  color: #d8fff2;
  font: 700 0.66rem/1 var(--font-mono), monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.24rem 0.52rem;
  white-space: nowrap;
}

.game-screen--room {
  height: calc(100vh - 1rem);
  min-height: 0;
  overflow: hidden;
}

.game-screen--room .panel--hospital-room {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: clamp(0.5rem, 0.85vw, 0.75rem);
}

.game-screen--room .panel--hospital-room .room-scene {
  flex: 1;
  min-height: 0;
  height: 100%;
}

.game-screen--room .hospital-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 0.9fr) minmax(300px, 0.9fr);
  gap: 0.58rem;
  min-height: 0;
  padding: clamp(0.52rem, 0.9vw, 0.82rem);
}

.game-screen--room .hospital-stage-layout {
  margin-top: 0;
  gap: clamp(0.55rem, 0.95vw, 0.92rem);
  grid-template-columns: minmax(190px, 0.64fr) minmax(300px, 1.14fr) minmax(300px, 1fr);
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
}

.game-screen--room .hospital-stage-zone--nurse {
  grid-column: 1;
  grid-row: 1;
}

.game-screen--room .hospital-stage-zone--patient {
  grid-column: 2;
  grid-row: 1;
}

.game-screen--room .hospital-stage-zone--monitor {
  grid-column: 3;
  grid-row: 1;
}

.game-screen--room .hospital-stage .nurse-card,
.game-screen--room .hospital-stage .patient-card {
  border: 1px solid rgba(133, 171, 199, 0.35);
  background: linear-gradient(180deg, rgba(230, 242, 252, 0.26), rgba(228, 241, 253, 0.12));
  box-shadow: 0 6px 16px rgba(15, 46, 70, 0.12);
  backdrop-filter: blur(2px);
  padding: 0.44rem 0.5rem 0.5rem;
  height: 100%;
  min-height: 0;
}

.game-screen--room .hospital-stage .character-row {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 0.56rem;
  min-height: 0;
  height: 100%;
}

.game-screen--room .hospital-stage .nurse-avatar {
  width: min(92%, 230px);
  height: clamp(180px, 24vh, 300px);
  margin: 0 auto;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.game-screen--room .hospital-stage .patient-avatar {
  width: min(94%, 310px);
  height: clamp(220px, 30vh, 360px);
  margin: 0 auto;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.game-screen--room .hospital-stage .nurse-avatar img,
.game-screen--room .hospital-stage .patient-avatar img {
  object-position: center top;
}

.game-screen--room .hospital-stage .dialog-bubble {
  width: 100%;
  margin: 0;
  border: 1px solid rgba(128, 167, 197, 0.82);
  background: rgba(247, 252, 255, 0.9);
  box-shadow: 0 6px 14px rgba(16, 45, 67, 0.16);
  font-size: 0.97rem;
  line-height: 1.34;
  padding: 0.56rem 0.7rem;
}

.game-screen--room .hospital-stage .dialog-bubble::before {
  top: 15px;
}

.game-screen--room .hospital-stage-zone--monitor .scene-clickable--monitor {
  display: grid;
  height: 100%;
  min-height: 0;
}

.game-screen--room .hospital-stage-zone--monitor .instrument.monitor {
  min-height: 0;
  height: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  box-shadow: 0 12px 26px rgba(5, 20, 36, 0.3);
  padding: 0.26rem;
}

.game-screen--room .hospital-stage-footer {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 0.62rem;
  min-height: 300px;
}

.game-screen--room .hospital-stage-footer__mission,
.game-screen--room .hospital-stage-footer__tools {
  min-width: 0;
  min-height: 0;
}

.game-screen--room .hospital-stage-footer .hospital-mission-panel {
  height: 100%;
  overflow: auto;
  border: 1px solid rgba(131, 164, 190, 0.62);
  border-radius: 13px;
  background: rgba(244, 251, 255, 0.66);
  padding: 0.62rem 0.68rem;
  box-shadow: 0 8px 14px rgba(19, 46, 66, 0.13);
}

.game-screen--room .room-mission-console {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
}

.game-screen--room .room-mission-objective {
  min-height: 180px;
  flex: 1 1 auto;
  overflow: auto;
  padding-right: 0.25rem;
}

.game-screen--room .hospital-stage-footer .hospital-stage-bottom-tools {
  height: 100%;
  grid-template-rows: auto auto;
  gap: 0.48rem;
  align-content: start;
  overflow: hidden;
}

.game-screen--room .hospital-stage-footer .hospital-tool-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.46rem;
}

.game-screen--room .hospital-stage-footer .hospital-tool-grid .instrument.tool {
  min-height: 74px;
  border-radius: 12px;
  padding: 0.45rem 0.42rem;
  font-size: 0.85rem;
}

.game-screen--room .hospital-stage .hospital-tool-grid .instrument.tool img {
  height: 34px !important;
}

.game-screen--room .hospital-equipped-strip {
  border: 1px solid rgba(132, 167, 194, 0.62);
  border-radius: 11px;
  background: rgba(244, 250, 255, 0.64);
  box-shadow: 0 6px 12px rgba(16, 45, 64, 0.12);
  padding: 0.42rem 0.52rem;
}

.game-screen--room .hospital-equipped-strip span {
  font-size: 0.55rem;
}

.game-screen--room .hospital-equipped-strip strong {
  font-size: 0.74rem;
  line-height: 1.25;
}

.game-screen--room .hospital-interaction-line {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  line-height: 1.28;
}

@media (max-width: 1180px) {
  .game-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .game-shell__hud {
    position: relative;
    top: auto;
    min-height: auto;
  }

  .game-lobby-layout,
  .panel-dashboard-layout,
  .hub-zone-layout {
    grid-template-columns: 1fr;
  }

  .game-screen--room {
    height: auto;
    min-height: calc(100vh - 1rem);
    overflow: auto;
  }

  .game-screen--room .panel--hospital-room {
    overflow: visible;
  }

  .game-screen--room .panel--hospital-room .room-scene {
    min-height: 920px;
  }

  .game-screen--room .hospital-stage {
    grid-template-rows: auto auto auto;
  }

  .game-screen--room .hospital-stage-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(300px, auto) minmax(300px, auto);
  }

  .game-screen--room .hospital-stage-zone--nurse {
    grid-column: 1;
    grid-row: 1;
  }

  .game-screen--room .hospital-stage-zone--patient {
    grid-column: 2;
    grid-row: 1;
  }

  .game-screen--room .hospital-stage-zone--monitor {
    grid-column: 1 / 3;
    grid-row: 2;
  }

  .game-screen--room .hospital-stage-footer {
    grid-template-columns: 1fr;
  }

  .panel-screen--users .panel-dashboard-layout__main,
  .panel-screen--users .panel-dashboard-layout__side {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .panel-screen--users .user-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .page-shell.game-screen {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .page-shell.panel-screen {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .panel-screen .panel-dashboard-layout {
    height: auto;
  }

  .panel-screen--users .panel-dashboard-layout__main,
  .panel-screen--users .panel-dashboard-layout__side {
    grid-template-rows: auto;
  }

  .panel-screen .panel-scroll,
  .panel-screen--visual .panel-screen__content,
  .game-screen--lobby .game-lobby-layout__main > .panel,
  .game-screen--lobby .game-lobby-layout__side > .panel,
  .game-screen--hub .hub-zone-layout__sidebar > .panel {
    overflow: visible;
  }

  .panel-screen--users .user-card-grid {
    grid-template-columns: 1fr;
  }

  .visual-title-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .visual-title-actions h2 {
    min-width: 0;
  }

  .visual-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .visual-actions .btn {
    width: 100%;
    white-space: normal;
  }

  .visual-actions .hint {
    text-align: left;
  }

  .console-top-panels {
    grid-template-columns: 1fr;
  }

  .stats--console {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hospital-game-hud-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .hospital-game-hud-main {
    grid-template-columns: 1fr;
    gap: 0.28rem;
  }

  .hospital-hud-badge {
    justify-self: flex-start;
    width: fit-content;
  }

  .game-screen--room .hospital-stage-layout {
    display: none;
  }

  .game-screen--room .hospital-stage-footer {
    display: none;
  }

  .hospital-mobile-stack {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 0.6rem;
  }

  .hospital-mobile-stack .hospital-tool-grid {
    display: grid;
    gap: 0.45rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hospital-mobile-stack .hospital-tool-grid .instrument.tool {
    min-height: 116px;
  }
}

/* ===== Room layout stabilization (HUD + sala) ===== */
.game-fullwidth .game-shell {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.game-shell__hud {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-height: calc(100vh - 1.2rem);
  overflow-y: auto;
  padding-right: 0.1rem;
}

.game-shell__hud-extension {
  min-height: 0;
  display: grid;
  gap: 0.6rem;
}

.game-shell__hud-extension:empty {
  display: none;
}

.game-shell__hud .room-side-mission-panel {
  border-radius: 14px;
  border: 1px solid rgba(166, 198, 220, 0.86);
  background: linear-gradient(180deg, rgba(246, 252, 255, 0.96), rgba(233, 244, 252, 0.94));
  box-shadow: 0 10px 22px rgba(18, 42, 64, 0.2);
  padding: 0.7rem 0.72rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.game-shell__hud .room-side-mission-panel__objective {
  margin-top: 0.6rem;
  min-height: 0;
  max-height: min(46vh, 460px);
  overflow: auto;
  padding-right: 0.2rem;
}

.game-shell__hud .room-side-mission-panel__actions {
  margin-top: 0.68rem !important;
}

.game-shell__hud .room-side-mission-panel__actions--nav {
  margin-top: 0.7rem !important;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(144, 176, 199, 0.6);
  display: grid;
  gap: 0.35rem;
}

.room-side-nav-title {
  margin: 0 0 0.12rem;
  color: #507092;
}

.game-shell__hud .room-side-nav-panel {
  border-radius: 12px;
  border: 1px solid rgba(166, 198, 220, 0.82);
  background: linear-gradient(180deg, rgba(244, 251, 255, 0.9), rgba(235, 245, 252, 0.86));
  box-shadow: 0 8px 16px rgba(18, 42, 64, 0.14);
  padding: 0.56rem 0.62rem;
}

.room-side-nav-panel__links {
  display: grid;
  gap: 0.35rem;
}

.room-side-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.42rem 0.58rem;
  font-size: 0.84rem;
  line-height: 1.2;
  text-align: left;
  white-space: normal;
  border-radius: 9px;
  border: 1px solid rgba(137, 170, 194, 0.45);
  background: rgba(236, 246, 253, 0.24);
  color: #244965;
  box-shadow: none;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease;
}

.room-side-nav-link::after {
  content: "›";
  font-size: 0.95rem;
  color: #4f7fa1;
  margin-left: 0.42rem;
}

.room-side-nav-link:hover {
  background: rgba(224, 239, 250, 0.52);
  border-color: rgba(114, 155, 184, 0.68);
}

.room-side-nav-link:focus-visible {
  outline: 2px solid rgba(73, 137, 176, 0.55);
  outline-offset: 1px;
}

.room-side-nav-link[href*="/cinematic"] {
  background: rgba(215, 240, 235, 0.78);
  border-color: rgba(122, 181, 171, 0.78);
  color: #14554d;
}

.game-shell__hud .room-side-mission-panel .feedback {
  margin-top: 0.58rem !important;
}

.room-side-mission-panel__question-summary {
  min-height: 0;
}

.room-side-question-list {
  margin: 0.2rem 0 0;
  padding-left: 0;
  list-style: none;
  max-height: 198px;
  overflow: auto;
  color: #2c4861;
  font-size: 0.9rem;
  line-height: 1.3;
}

.room-side-question-list li {
  margin-bottom: 0.3rem;
  padding: 0.25rem 0.35rem;
  border-radius: 8px;
  background: rgba(240, 248, 255, 0.55);
}

.game-screen--room .hospital-stage {
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.62rem;
}

.game-screen--room .hospital-stage-layout {
  grid-template-columns: minmax(210px, 0.7fr) minmax(330px, 1.12fr) minmax(320px, 0.92fr);
  grid-template-rows: minmax(0, 1fr);
  gap: clamp(0.55rem, 0.95vw, 0.95rem);
}

.game-screen--room .hospital-stage .nurse-card,
.game-screen--room .hospital-stage .patient-card {
  background: linear-gradient(180deg, rgba(226, 241, 253, 0.2), rgba(220, 238, 252, 0.08));
  border: 1px solid rgba(139, 174, 201, 0.34);
  box-shadow: 0 7px 16px rgba(14, 43, 64, 0.14);
  backdrop-filter: blur(2px);
}

.game-screen--room .hospital-stage .character-row {
  align-items: center;
  justify-content: flex-start;
  gap: 0.42rem;
}

.game-screen--room .hospital-stage .nurse-avatar {
  width: min(96%, 260px);
  height: clamp(210px, 28vh, 340px);
}

.game-screen--room .hospital-stage .patient-avatar {
  width: min(98%, 320px);
  height: clamp(240px, 31vh, 390px);
}

.game-screen--room .hospital-stage-inline-dialogue {
  display: block;
  width: 100%;
  max-width: none;
  align-self: stretch;
}

.game-screen--room .hospital-stage-zone--monitor .instrument.monitor {
  aspect-ratio: 1 / 1 !important;
  width: 100%;
  max-width: 460px;
  min-height: 0;
  height: auto;
  justify-self: end;
  align-self: start;
}

.game-screen--room .hospital-stage-footer {
  grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr);
  min-height: 250px;
  align-items: stretch;
}

.game-screen--room .hospital-stage-footer--tools-only {
  min-height: 250px;
}

.game-screen--room .hospital-stage-footer--tools-only .hospital-stage-footer__tools {
  grid-column: 2;
  align-self: end;
  padding-top: 0.95rem;
}

.game-screen--room .hospital-stage-footer--tools-only .hospital-stage-bottom-tools {
  margin-top: 0.95rem;
  gap: 0.65rem;
  grid-template-rows: auto auto;
  align-content: end;
  height: auto;
}

.game-screen--room .hospital-stage-footer--tools-only .hospital-tool-grid {
  margin-top: 0.35rem;
}

.game-screen--room .hospital-stage-footer--tools-only .hospital-equipped-strip {
  margin-top: 0.25rem;
}

.game-screen--room .hospital-tools-navigation {
  margin-top: 0.15rem;
}

.game-screen--room .room-tools-nav {
  border-radius: 11px;
  border: 1px solid rgba(145, 178, 201, 0.62);
  background: rgba(244, 251, 255, 0.5);
  padding: 0.4rem 0.45rem;
}

.game-screen--room .room-tools-nav__links {
  display: grid;
  gap: 0.28rem;
}

.game-screen--room .room-tools-nav .room-side-nav-title {
  margin-bottom: 0.2rem;
  font-size: 0.67rem;
}

.game-screen--room .hospital-stage-footer--tools-only .hospital-stage-footer__mission {
  display: block;
  align-self: stretch;
}

.game-screen--room .hospital-stage-footer--tools-only .hospital-question-panel {
  height: auto;
  min-height: 260px;
  max-height: none;
  overflow: visible;
  display: block;
  gap: 0.5rem;
}

.game-screen--room .room-question-panel__body {
  display: grid;
  gap: 0.6rem;
}

.game-screen--room .room-question-panel__body .eyebrow {
  margin-bottom: 0.05rem;
}

.game-screen--room .room-question-panel__objective {
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.game-screen--room .room-question-panel__actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.game-screen--room .room-question-panel__actions .btn {
  margin-top: 0;
}

.game-screen--room .room-question-panel__feedback {
  margin-top: 0 !important;
}

.game-screen--room .hospital-dialogue-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem;
  align-items: end;
}

.game-screen--room .hospital-dialogue-strip__item {
  margin: 0;
  min-height: 98px;
  padding: 0.72rem 0.86rem;
  border: 1px solid rgba(126, 166, 197, 0.84);
  background: rgba(247, 252, 255, 0.92);
  box-shadow: 0 8px 16px rgba(14, 44, 66, 0.18);
  color: #1f4769;
}

.game-screen--room .hospital-dialogue-strip__speaker {
  display: block;
  margin-bottom: 0.25rem;
  color: #2c5e80;
  font: 700 0.7rem/1 var(--font-mono), monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@media (max-width: 1180px) {
  .game-fullwidth .game-shell {
    grid-template-columns: 1fr;
  }

  .game-shell__hud {
    max-height: none;
    overflow: visible;
  }

  .game-shell__hud .room-side-mission-panel__objective {
    max-height: none;
  }

  .game-screen--room .hospital-stage-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(280px, auto) minmax(280px, auto);
  }

  .game-screen--room .hospital-stage-zone--monitor {
    grid-column: 1 / 3;
  }

  .game-screen--room .hospital-stage-zone--monitor .instrument.monitor {
    aspect-ratio: 16 / 10 !important;
    max-width: none;
    justify-self: stretch;
  }

  .game-screen--room .hospital-dialogue-strip {
    grid-template-columns: 1fr;
  }

  .game-screen--room .hospital-stage-footer--tools-only .hospital-stage-footer__mission,
  .game-screen--room .hospital-stage-footer--tools-only .hospital-stage-footer__tools {
    grid-column: 1;
  }

  .briefing-grid {
    grid-template-columns: 1fr;
  }

  .briefing-video {
    min-height: 280px;
  }
}

/* ===== Scroll recovery: evita bloqueo vertical en game/panel ===== */
.page-shell.game-screen,
.page-shell.panel-screen {
  height: auto !important;
  min-height: 100vh !important;
  overflow: visible !important;
}

.game-screen--lobby .game-lobby-layout,
.game-screen--hub .hub-zone-layout {
  height: auto !important;
  min-height: 0 !important;
}

.game-screen--lobby .game-lobby-layout__main > .panel,
.game-screen--lobby .game-lobby-layout__side > .panel,
.game-screen--hub .hub-zone-layout__sidebar > .panel {
  overflow: visible !important;
}

.game-screen--room {
  height: auto !important;
  min-height: calc(100vh - 1rem) !important;
  overflow: visible !important;
}

.game-screen--room .panel--hospital-room {
  overflow: visible !important;
}

/* ===== Stabilization lock: hub + sala + panel users ===== */
.game-screen--hub .hub-zone-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.82fr);
  gap: 0.8rem;
  align-items: start;
}

.game-screen--hub .hub-zone-layout__main,
.game-screen--hub .hub-zone-layout__sidebar {
  min-width: 0;
  display: grid;
  gap: 0.8rem;
  align-content: start;
}

.game-screen--hub .hub-zone-layout__main > .panel,
.game-screen--hub .hub-zone-layout__sidebar > .panel {
  overflow: visible !important;
}

.game-screen--room .hospital-stage-footer--tools-only {
  grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr);
  gap: 0.62rem;
  align-items: start;
}

.game-screen--room .hospital-stage-footer--tools-only .hospital-stage-footer__mission {
  grid-column: 1;
  align-self: stretch;
}

.game-screen--room .hospital-stage-footer--tools-only .hospital-stage-footer__tools {
  grid-column: 2;
  align-self: start;
  padding-top: 0.1rem;
}

.game-screen--room .hospital-stage-footer--tools-only .hospital-stage-bottom-tools {
  margin-top: 0;
  align-content: start;
}

.game-screen--room .hospital-stage-footer--tools-only .hospital-question-panel {
  min-height: 260px;
  max-height: none !important;
  overflow: visible !important;
}

.game-screen--room .room-question-panel__body {
  display: grid;
  gap: 0.6rem;
}

.game-screen--room .room-question-panel__objective {
  max-height: none !important;
  overflow: visible !important;
  padding-right: 0;
}

.panel-screen--users .scenario-switch.user-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

@media (max-width: 1180px) {
  .game-screen--hub .hub-zone-layout {
    grid-template-columns: 1fr;
  }

  .game-screen--room .hospital-stage-footer--tools-only {
    grid-template-columns: 1fr;
  }

  .game-screen--room .hospital-stage-footer--tools-only .hospital-stage-footer__tools {
    grid-column: 1;
  }

  .visual-lab .room-scene {
    min-height: 700px;
    height: 700px;
  }

  .visual-lab .nurse-card {
    width: min(32%, 320px);
    min-width: 220px;
  }

  .visual-lab .patient-card {
    left: 36%;
    width: min(34%, 360px);
    min-width: 220px;
  }

  .visual-lab .instrument.monitor {
    width: min(38%, 350px);
  }

  .visual-lab .inventory-rack {
    width: min(68%, 760px);
  }
}

@media (max-width: 860px) {
  .visual-lab .room-scene {
    min-height: 820px;
    height: 820px;
  }

  .visual-lab .nurse-card,
  .visual-lab .patient-card,
  .visual-lab .inventory-rack,
  .visual-lab .instrument.monitor,
  .visual-lab .instrument.tool {
    position: static;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .visual-lab .nurse-card,
  .visual-lab .patient-card,
  .visual-lab .inventory-rack {
    margin-bottom: 0.55rem;
  }

  .visual-lab .instrument.tool {
    margin-top: 0.42rem;
  }
}
