/* Study Quest — lodging.css (V7.4 lane H, builder v74-rest H2): beds and rest at inns (js/ui-lodging.js).
 * Ember & Iron (docs/DESIGN.md §14): the bedtime panel is composed from .codex-window / .codex-banner / .ei-socket / .codex-btn /
 * .codex-kbd in the markup; this sheet only places, sizes and spaces it (prefix .lodge-*), plus the inn card's Night row
 * (.inn-night), the Game Menu's bed button and its quiet line (.gm-bed, .gm-rest), the camp card's Logor row and the sleeping
 * hero on the character screen (.glue-select.is-asleep, .glue-select__sleep). Centred at every size, never taller than the
 * screen (the body scrolls); no high tones, no flashing: the candle going out is one slow fade to dark. */

.lodge-layer {
  position: fixed;
  inset: 0;
  z-index: 125;                      /* over the inn card (120); under the Letopis (950), the Game Menu (940), dialogs (1000) */
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(6, 8, 14, 0.38);
  transition: background 600ms ease;
}
.lodge-layer.hidden { display: none; }
.lodge-layer.is-dark { background: rgba(2, 3, 8, 0.94); }
.lodge-layer.is-dark .lodge-window { opacity: 0.25; transition: opacity 600ms ease; }
.lodge-window {
  box-sizing: border-box;
  width: 460px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  animation: cx-rise var(--cx-dur-calm, 480ms) var(--cx-ease, ease-out) both;
}
.lodge-title { min-width: 220px; text-align: center; }
.lodge-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 20px 10px; overflow-y: auto; }
.lodge-body .hidden { display: none !important; }
.lodge-where { margin: 0; font: 400 16px/1.4 var(--cx-font-body); color: var(--cx-text); text-align: center; }
.lodge-where b { color: #f6ead6; font-weight: 600; }
.lodge-rate { margin: -2px 0 2px; font: 400 13px/1.35 var(--cx-font-body); color: #a99d8b; text-align: center; }
.lodge-sec { padding: 7px 10px 8px; border: 1px solid rgba(170, 130, 80, 0.32); border-radius: 4px; }
.lodge-k { display: inline-block; margin-right: 6px; font: 700 12px/1.3 var(--cx-font-label); letter-spacing: 0.08em; text-transform: uppercase; color: #e9c27a; }
.lodge-today .lodge-v { font: 400 14px/1.4 var(--cx-font-body); color: #ebe4d6; }
.lodge-plates { display: flex; gap: 6px; margin-top: 6px; }
.lodge-plate {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 58px;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 6px 2px 5px;
  font: inherit;
  color: var(--cx-text);
  cursor: pointer;
  outline: none;
}
.lodge-plate:hover { color: var(--cx-gold-leaf); }
.lodge-plate:focus-visible { box-shadow: 0 0 0 1px rgba(255, 170, 90, 0.75), 0 0 12px rgba(255, 130, 40, 0.45); }
.lodge-plate__key { position: absolute; top: 3px; right: 5px; font-size: 11px; }
.lodge-plate__n { font: 700 20px/1 var(--cx-font-num); font-variant-numeric: lining-nums; }
.lodge-plate__l { font: 700 11px/1.3 var(--cx-font-label); letter-spacing: 0.05em; text-transform: uppercase; }
.lodge-plate--rest { flex: 1.3 1 0; }
.lodge-plan, .lodge-notes { margin: 0; font: 400 13px/1.4 var(--cx-font-body); color: #bfb3a0; }
.lodge-msg { margin: 0; min-height: 0; font: 600 13px/1.35 var(--cx-font-body); color: #ff8a6a; }
.lodge-msg:empty { display: none; }
.lodge-foot { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.lodge-foot .codex-btn { flex: 0 0 auto; white-space: nowrap; }
.lodge-hint { flex: 1 1 auto; min-width: 0; font: 400 12px/1.3 var(--cx-font-body); color: var(--cx-text-dim); }
@media (max-width: 520px) { .lodge-hint { display: none; } .lodge-plates { flex-wrap: wrap; } .lodge-plate { flex: 1 1 40%; } }

/* the inn card's Night row (js/ui-inn.js), under the phone; gold after 18:00 */
.inn-night { margin: 8px 0 2px; padding: 7px 10px 8px; border: 1px solid rgba(110, 130, 190, 0.32); border-radius: 4px; }
.inn-night.hidden { display: none; }
.inn-night__line { margin: 0; font: 400 14px/1.4 var(--cx-font-body); color: #ebe4d6; }
.inn-night .lodge-k { color: #a9b8e6; }
.inn-night.is-evening { border-color: rgba(233, 194, 122, 0.55); box-shadow: inset 0 0 14px rgba(233, 180, 90, 0.12); }
.inn-night.is-evening .lodge-k { color: #e9c27a; }
.inn-night__btn { margin-top: 6px; }

/* the Game Menu: the bed button sits above Log Out; a quiet line under it where there is no rest */
.gm-rest { margin: 6px 2px 0; font: 400 12px/1.35 var(--cx-font-body); color: var(--cx-text-dim); text-align: center; }

/* the camp card's third row, the Logor */
.camp-opt--logor .camp-opt__icon { color: #ffb466; }
.camp-opt--logor .camp-opt__icon svg { width: 26px; height: 26px; }

/* the character screen: the hero asleep (a night over the stage, the hero's z z z, a moon and the place); no flashing: a slow drift */
.glue-select__night { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 700ms ease;
  background: radial-gradient(ellipse 60% 70% at var(--glue-hero-x, 32%) 58%, rgba(18, 28, 70, 0.30), rgba(4, 7, 22, 0.70)); }
.glue-select__night.is-on { opacity: 1; }
.glue-select__zzz { position: absolute; left: calc(var(--glue-hero-x, 32%) + 34px); top: 34%; font: italic 600 24px/1 var(--cx-font-flavor);
  color: rgba(222, 230, 255, 0.85); text-shadow: 0 0 10px rgba(110, 140, 255, 0.45); white-space: nowrap; }
.glue-select__zzz i { display: inline-block; margin-right: 2px; animation: glue-zzz 4.2s ease-in-out infinite; }
.glue-select__zzz i:nth-child(2) { font-size: 0.8em; animation-delay: 1.4s; }
.glue-select__zzz i:nth-child(3) { font-size: 0.64em; animation-delay: 2.8s; }
@keyframes glue-zzz { 0% { transform: translate(0, 6px); opacity: 0; } 30% { opacity: 0.9; } 100% { transform: translate(12px, -26px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .glue-select__zzz i { animation: none; opacity: 0.8; } }
body.reduced-motion .glue-select__zzz i { animation: none; opacity: 0.8; }
.glue-select__sleep {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 5px;
  border: 1px solid rgba(150, 170, 230, 0.4);
  border-radius: 14px;
  background: rgba(10, 14, 30, 0.72);
  font: italic 500 15px/1.2 var(--cx-font-flavor);
  color: #d8def4;
  text-shadow: 0 1px 0 #000;
}
.glue-sleep__moon { display: inline-flex; width: 16px; height: 16px; color: #e9dcae; }
.glue-sleep__moon svg { width: 100%; height: 100%; }
.glue-sleep__z { font: 600 12px/1 var(--cx-font-label); letter-spacing: 0.2em; color: rgba(216, 222, 244, 0.6); }
