/* cold-survival.css — the cold survival card (js/cold-survival.js). A small panel at the top centre: heat bar, lantern and fuel,
   the low and empty warnings, the two server actions, and the reason a button is off. It sits under the menus (z 40) and never
   covers the joystick, attack or skill ring (they stand at the bottom). Thai text: Noto Sans Thai. */
#csv {
  position: fixed; left: 50%; top: 8px; transform: translateX(-50%); z-index: 40;
  width: min(300px, calc(100vw - 24px)); box-sizing: border-box; padding: 8px 10px 9px;
  background: #10283b; color: #e8f7ff; border: 2px solid #183c54; border-radius: 10px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12), 0 3px 0 rgba(13, 22, 48, 0.35);
  font-family: 'Noto Sans Thai', 'Baloo 2', sans-serif; font-size: 13px; line-height: 1.4;
  pointer-events: auto; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
#csv[hidden], #csv .csv-warn[hidden], #csv .csv-note[hidden], #csv .csv-why[hidden] { display: none !important; }
#csv .csv-head { position: relative; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 26px; padding-left: 34px; }
#csv .csv-title { font-size: 14px; font-weight: 700; margin-right: auto; }
#csv .csv-chip { padding: 1px 7px; border-radius: 999px; background: #185776; border: 1px solid #183c54; font-size: 12px; white-space: nowrap; }
#csv .csv-chip.csv-off { background: #6b2a36; border-color: #8f3a48; color: #ffd9de; }
#csv .csv-bar { position: relative; margin-top: 7px; height: 16px; border-radius: 8px; background: #0a1b29; box-shadow: inset 0 0 0 2px #183c54; overflow: hidden; }
#csv .csv-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(#ffe27a, #ff9d3c); transition: width 0.25s linear; }
#csv .csv-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; text-shadow: 0 1px 2px rgba(6, 8, 28, 0.95); }
#csv.csv-low .csv-bar i { background: linear-gradient(#ffb3b3, #e0525e); }
#csv.csv-empty .csv-bar i { width: 0 !important; }
#csv .csv-warn { margin-top: 6px; padding: 4px 7px; border-radius: 6px; background: rgba(224, 82, 94, 0.22); border: 1px solid #e0525e; color: #ffd9de; font-weight: 700; font-size: 12.5px; }
#csv.csv-empty .csv-warn { animation: csv-blink 1.2s steps(2, start) infinite; }
@keyframes csv-blink { to { visibility: hidden; } }
#csv .csv-note { margin-top: 5px; font-size: 12px; color: #a7c5d9; }
#csv .csv-acts { display: flex; gap: 6px; margin-top: 7px; }
#csv .csv-btn {
  flex: 1 1 0; min-height: 36px; padding: 0 8px; border-radius: 8px; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 700; color: #e8f7ff;
  background: linear-gradient(#102b40, #0a1b29); border: 2px solid #183c54;
  box-shadow: 0 3px 0 rgba(13, 22, 48, 0.35);
}
#csv .csv-btn.csv-primary { background: #ffc93c; color: #10283b; border-color: #183c54; }
#csv .csv-btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
#csv .csv-btn:focus-visible { outline: 2px solid #8ee0ac; outline-offset: 2px; }
#csv .csv-why { margin-top: 5px; font-size: 12px; color: #ffd9de; }

/* a phone held upright: a compact strip in the free band left of the quest line (below the minimap, above the mail icons);
   folded by default. The old top-right card is gone: it covered the minimap, the clock and the top HUD. */
html.mob-port #csv { top: 200px; left: 64px; right: auto; transform: none; width: min(240px, calc(100vw - 72px)); min-width: 0; padding: 5px 7px 6px; font-size: 12px; }
html.mob-port #csv.csv-open { z-index: 9001; } /* (open: above the Classic Menus iframe #nc-dc, z 9000, whose Gacha/Mail chips hid Refuel and Supplies) */
html.mob-port #csv .csv-title { font-size: 12px; }
html.mob-port #csv .csv-bar { height: 12px; margin-top: 5px; }
html.mob-port #csv .csv-btn { min-height: 30px; font-size: 12px; }
html.mob-port #csv .csv-why, html.mob-port #csv .csv-note { font-size: 11px; }

/* a phone on its side: the card goes between the chat column (left) and the minimap (right), at the top centre */
html.mob-land #csv { top: 6px; width: min(280px, calc(100vw - 300px)); min-width: 200px; padding: 5px 8px 6px; font-size: 12px; }
html.mob-land #csv .csv-title { font-size: 12px; }
html.mob-land #csv .csv-btn { min-height: 30px; font-size: 12px; }
html.mob-land #csv .csv-why, html.mob-land #csv .csv-note { font-size: 11px; }
html.mob-land #csv .csv-warn { margin-top: 4px; font-size: 11.5px; }
/* (very short landscape screens: a thinner bar; the warning and the reasons still show) */
@media (max-height: 380px) { html.mob-land #csv .csv-bar { height: 13px; } }
#csv .csv-help { margin-top: 5px; font-size: 11.5px; color: #a7c5d9; }

/* the toggle (▾ folded, ▴ open; js/cold-survival.js) in every layout, pinned to the head's top left: it stays put when the chips
   wrap the head, and the top HUD's menu buttons (z 45), which reach over the card's right end on 915-1024 px wide screens, never cover it.
   Folded: the title, the heat bar and the warning stay (heat is survival-critical); the rest goes. */
#csv .csv-tog { position: absolute; top: 0; left: 0; min-width: 28px; min-height: 26px; padding: 0 6px; border-radius: 6px; cursor: pointer; font: inherit; color: #e8f7ff; background: #0a1b29; border: 1px solid #183c54; }
#csv:not(.csv-open) .csv-chip, #csv:not(.csv-open) .csv-acts, #csv:not(.csv-open) .csv-why,
#csv:not(.csv-open) .csv-help, #csv:not(.csv-open) .csv-note { display: none; }

/* a landscape window or phone that is short or narrow (wider than tall): a compact strip at left 180, top 70, clear of the hero HP
   (bottom 63), the quest line, the mail icons, the top HUD (x 402+) and the minimap; folded by default. html.mob-land is
   written out so its own top/width rules do not win. The desktop above 900px keeps the top centre card, open by default. */
@media (max-width: 900px) and (min-aspect-ratio: 1/1) {
  #csv, html.mob-land #csv { left: 180px; right: auto; top: 70px; transform: none; width: min(260px, calc(100vw - 196px)); min-width: 0; }
  #csv.csv-open { z-index: 9001; } /* (open: above #nc-dc's Gacha/Mail chips, as for html.mob-port) */
  #csv .csv-bar { height: 12px; margin-top: 5px; }
}
