/* OPERATION NAPKIN - save files, sync indicator, in-game high scores, save conflicts (play/css/meta-slots-04.css).
   meta-slots-04 (QA fix, 2026-10-16): on a landscape phone the sync indicator (SAVED, SAVING..., OFFLINE ...) of a menu no
   longer sits on the bottom button (the co-op lobby's NICK / THE MONKEY row, the title's last row): it moves to the top centre,
   where a landscape screen has its heading and the run / hub screens already show it (in the top bar). On desktop the same
   happens while a screen is open over a run (the FIELD REPORT's button row sat under it). Portrait keeps its places, and so
   does desktop during play and on the title. Everything else is meta-slots-03.
   meta-slots-03 (2026-10-06): taller folder tab (22px + 2px overlap) with the FILE label centred in it - on some devices the 13px label
   stuck out above the old 16px tab and its top half vanished against the dark background ("file is cut off").
   Owner: GAME-SAVES (v3, AUTH-DESIGN-v02 13.3). Uses the core tokens (core-03.css) and the meta panel styles (meta-04.css).
   Mobile first; no horizontal scroll at 375 px.
   meta-slots-02 (finisher), replaces meta-slots-01.css: in a run or in the hub (class .field, set by meta-slots-02.js)
   the sync indicator never sits on a touch button or a HUD box (desktop: bottom centre of the arena, between the chair
   box and the boons/pause box; phone portrait: just below the arena, toasts move down; phone landscape: centred in the
   top bar over the floor name); on menus it keeps its old corner;
   folder icon for files without a character; HIGH SCORES + CREDITS share a row and the title tightens on short screens. */

/* == sync indicator (#mtn-sync): small, clickable only when it offers an action == */
.mtn-sync {
  position: fixed; left: max(10px, env(safe-area-inset-left)); bottom: max(10px, env(safe-area-inset-bottom)); z-index: 7;
  pointer-events: none; display: none; max-width: calc(100vw - 20px);
}
/* desktop run / hub: bottom centre of the arena (the chair/charge box is bottom-left, boons/dash/pause bottom-right) */
.mtn-sync.field { left: calc(var(--ax) + var(--aw) / 2); top: calc(var(--ay) + var(--ah) - 46px); bottom: auto; transform: translateX(-50%); }
.mtn-sync.on { display: block; }
.mtn-sync > span, .mtn-sync-btn {
  display: inline-block; padding: 5px 10px; border-radius: 8px; border: 1px solid rgba(242, 178, 51, 0.55);
  background: rgba(11, 9, 7, 0.86); color: var(--grease); font: 12px/1.2 var(--f-type); letter-spacing: 0.02em;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); white-space: nowrap;
}
.mtn-sync.act { pointer-events: auto; }
.mtn-sync-btn { cursor: pointer; min-height: 32px; text-decoration: underline dotted; }
.mtn-sync-btn:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.mtn-sync-saved > span { color: var(--teal); border-color: rgba(127, 179, 172, 0.6); }
.mtn-sync-offline > span, .mtn-sync-toobig > span { color: var(--batter); }
.mtn-sync-auth .mtn-sync-btn, .mtn-sync-conflict .mtn-sync-btn { color: var(--cream); background: var(--ketchup); border-color: var(--ink); }
/* touch menus: bottom centre (no touch buttons outside a run or the hub) */
html.mtn-touch .mtn-sync { left: 50%; bottom: max(6px, env(safe-area-inset-bottom)); transform: translateX(-50%); }
html.mtn-touch .mtn-sync > span, html.mtn-touch .mtn-sync-btn {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 11px; padding: 4px 8px;
}
html.mtn-touch .mtn-sync-btn { min-height: 28px; }
/* touch run / hub, landscape: the stick and the buttons own the side margins; centred in the top bar (over the floor name,
   between the map/pause buttons on the left and the sound controls on the right) */
html.mtn-touch .mtn-sync.field {
  left: 50%; top: calc(var(--topbar) / 2); bottom: auto; transform: translate(-50%, -50%); max-width: calc(100vw - 340px);
}
/* touch run / hub, portrait: the top bar is full; just below the arena, above the stick zone and the buttons */
html.mtn-touch.mtn-portrait .mtn-sync.field {
  top: calc(var(--ay) + var(--ah) + 8px); transform: translateX(-50%); max-width: calc(100vw - 32px);
}
html.mtn-touch.mtn-portrait body:has(> #mtn-sync.field.on) .mtn-toasts { top: calc(var(--ay) + var(--ah) + 46px); }
/* meta-slots-04: touch menus in landscape (phones 812x375): the bottom edge holds the screen's last button row (the co-op lobby's
   character pick, the title's HIGH SCORES row, NEW FILE ...): the indicator goes to the top centre instead, above the heading */
html.mtn-touch:not(.mtn-portrait) .mtn-sync:not(.field) { top: max(6px, env(safe-area-inset-top)); bottom: auto; }
/* meta-slots-04: desktop, a screen over the run (FIELD REPORT, death / victory, pause ...): the HUD gap at the arena's bottom
   is where that screen's button row sits (the report's SAME CASE AGAIN / LEAVE): the indicator goes to the top centre too */
html:not(.mtn-touch):has(#ui > .mtn-screen) .mtn-sync.field { top: max(8px, env(safe-area-inset-top)); bottom: auto; left: 50%; transform: translateX(-50%); }

/* == title: the open save file == */
.meta-slotline {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 8px; max-width: 100%;
  font: 400 calc(15px * var(--meta-ts))/1.2 var(--f-display); letter-spacing: 0.06em; color: var(--batter);
}
.meta-slotline-tx { overflow-wrap: anywhere; }
.meta-slotline-btn { min-height: 32px; font-size: calc(13px * var(--meta-ts)); }
.meta-data-file { font: 400 calc(15px * var(--meta-ts))/1.2 var(--f-display); letter-spacing: 0.05em; color: var(--grease); overflow-wrap: anywhere; }

/* == save-file select (meta-slots), import, conflicts: shared bits == */
.mslots { width: min(100%, 980px); }
/* .meta-help has flex-basis 100% (made for wrapping rows); inside these column panels it must size to its text */
.mslots .meta-help, .mboard .meta-help, .mconflict .meta-help, .mslot-namebox .meta-help { flex-basis: auto; }
.mslots > *, .mboard > *, .mconflict > * { flex-shrink: 0; }
.mslots-msg { margin: 0; min-height: 1.2em; text-align: center; font: calc(14px * var(--meta-ts))/1.35 var(--f-type); color: var(--grease); }
.mslots-msg:empty { display: none; }
.mslots-foot { text-align: center; }
.mslots-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 10px; }

/* one save file = one manila folder with a tab */
.mslot {
  position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 14px 12px 12px; margin-top: 26px;
  background: var(--manila); color: var(--manila-ink); border-radius: 4px 10px 10px 10px; border: 2px solid var(--ink);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.55);
}
.mslot::before {
  content: ""; position: absolute; left: -2px; top: -22px; width: 46%; min-width: 96px; height: 22px; background: var(--manila);
  border: 2px solid var(--ink); border-bottom: 0; border-radius: 8px 8px 0 0;
}
.mslot.empty { background: #CDB98A; }
.mslot.empty::before { background: #CDB98A; }
.mslot.active { outline: 3px solid var(--batter); outline-offset: 3px; }
.mslot-top { position: absolute; left: 10px; top: -21px; right: 8px; height: 21px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.mslot-no { font: 400 14px/20px var(--f-display); letter-spacing: 0.1em; color: var(--manila-ink); white-space: nowrap; }
.mslot-tag {
  padding: 2px 8px; transform: rotate(-4deg); font: 400 12px/1.2 var(--f-display); letter-spacing: 0.1em;
  color: var(--ketchup); border: 2px solid var(--ketchup); border-radius: 4px; background: rgba(233, 212, 163, 0.9);
}
.mslot-body { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.mslot.empty .mslot-body { flex-direction: column; gap: 4px; }
.mslot-empty { font: 400 calc(20px * var(--meta-ts))/1.1 var(--f-display); letter-spacing: 0.05em; color: rgba(42, 32, 23, 0.7); }
.mslot-por {
  flex: 0 0 64px; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--ink); border: 2px solid var(--manila-ink);
  display: flex; align-items: center; justify-content: center; color: var(--batter); font: 400 28px/1 var(--f-display);
}
.mslot-por img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
/* no character yet: a small manila folder instead of a black square */
.mslot-por.nochar { background: #CDB98A; border-color: rgba(42, 32, 23, 0.55); }
.mslot-folder { position: relative; display: block; width: 58%; height: 42%; margin-top: 8%; background: var(--manila); border: 2px solid var(--manila-ink); border-radius: 2px 5px 5px 5px; }
.mslot-folder::before { content: ""; position: absolute; left: -2px; top: -9px; width: 46%; height: 8px; background: var(--manila); border: 2px solid var(--manila-ink); border-bottom: 0; border-radius: 4px 4px 0 0; }
.mslot-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mslot-name { font: 400 calc(19px * var(--meta-ts))/1.1 var(--f-display); letter-spacing: 0.03em; color: var(--manila-ink); overflow-wrap: anywhere; }
.mslot-stats { font: 400 calc(13px * var(--meta-ts))/1.25 var(--f-display); letter-spacing: 0.05em; color: #6B4A1E; }
.mslot-line { font: calc(12px * var(--meta-ts))/1.3 var(--f-type); color: rgba(42, 32, 23, 0.85); }
.mslot-line.run { color: #8A2A14; }
.mslot-line.best { color: #2A4A8A; }
.mslot-line.warn { color: var(--ketchup); }
.mslot-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.mslot-go { flex: 1 1 100%; }
.mslot-small { flex: 1 1 0; font-size: calc(14px * var(--meta-ts)); padding: 6px 8px; }
.mslot .meta-btn-2 { background: rgba(42, 32, 23, 0.12); color: var(--manila-ink); border-color: rgba(42, 32, 23, 0.45); }
.mslot-namebox .mslot-input {
  width: 100%; min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 2px solid rgba(247, 236, 216, 0.3);
  background: var(--ink); color: var(--cream); font: calc(17px * var(--meta-ts))/1.2 var(--f-type);
}
.mslot-namebox .mslot-input:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

/* import and conflicts */
.mimport { max-width: 560px; }
.mimport .meta-col > .mtn-btn { white-space: normal; }
.mconflict-cmp { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.mconflict-side {
  display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: rgba(11, 9, 7, 0.45);
  border-left: 4px solid var(--batter); font: calc(13px * var(--meta-ts))/1.35 var(--f-type);
}
.mconflict-side b { font: 400 calc(14px * var(--meta-ts))/1.1 var(--f-display); letter-spacing: 0.08em; color: var(--batter); }
.msaving .meta-confirm-text { animation: mslot-blink 1.1s steps(2, end) infinite; }
@keyframes mslot-blink { 50% { opacity: 0.45; } }

/* == in-game BUREAU HIGH SCORES (meta-board) == */
.mboard { width: min(100%, 760px); }
.mboard-wrap { width: 100%; overflow-x: auto; }
.mboard-t { width: 100%; border-collapse: collapse; font: calc(14px * var(--meta-ts))/1.3 var(--f-type); color: var(--cream); }
.mboard-t th {
  text-align: left; padding: 6px 8px; font: 400 calc(13px * var(--meta-ts))/1.1 var(--f-display); letter-spacing: 0.08em; color: var(--muted);
  border-bottom: 2px solid rgba(242, 178, 51, 0.35);
}
.mboard-t td { padding: 7px 8px; border-bottom: 1px dashed rgba(247, 236, 216, 0.14); vertical-align: top; }
.mboard-t .c-rank { width: 2.5em; text-align: right; color: var(--muted); }
.mboard-t .c-name { font-family: var(--f-display); letter-spacing: 0.04em; color: var(--grease); overflow-wrap: anywhere; }
.mboard-t .c-score { text-align: right; white-space: nowrap; font-family: var(--f-display); color: var(--batter); }
.mboard-t .c-note { color: var(--muted); font-size: calc(12px * var(--meta-ts)); }
.mboard-t tr.you td { background: rgba(242, 178, 51, 0.16); }
.mboard-t tr.you .c-name { color: var(--batter); }
.mboard-t tr.gap td { text-align: center; color: var(--muted); border-bottom: 0; }
.mboard-t tr.empty td { text-align: center; color: var(--muted); padding: 14px 8px; }
.mboard-you { text-align: center; }

@media (max-width: 760px) {
  .mslots-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .mslot { margin-top: 28px; }
}
@media (max-width: 520px) {
  .mboard-t .c-note { display: none; }
  .mboard-t th.c-note { display: none; }
  .mslot-por { flex-basis: 52px; width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .msaving .meta-confirm-text { animation: none; }
}

/* == title (meta-ui-06): HIGH SCORES + CREDITS share one row; short laptop screens get tighter spacing == */
.meta-menu-row2 > .meta-small { flex: 0 1 auto; padding-left: 14px; padding-right: 14px; }
@media (max-height: 820px) and (min-width: 600px) {
  .meta-title .meta-title-box { gap: 8px; padding-bottom: 8px; }
  .meta-title .meta-logo-main { font-size: clamp(40px, min(10vw, 8.4vh), 92px); }
  .meta-title .meta-stamp { margin-top: 4px; font-size: 22px; padding: 0 12px; }
  .meta-title .meta-menu { gap: 8px; }
  .meta-title .meta-menu .meta-big { font-size: 26px; padding: 8px 12px; }
  .meta-title .meta-title-sound { margin-top: 0; }
  .meta-title .meta-title-sound .mtn-sound-hint { display: none; }
}
@media (max-height: 740px) and (min-width: 600px) {
  .meta-title .meta-tag { display: none; }
  .meta-title .meta-menu .meta-mid { min-height: 40px; padding-top: 6px; padding-bottom: 6px; }
}
