/* THE DECKS (static/js/sys/decks.js): the tab bar's five keys and their launchers. HOLO look (hub.css tokens);
   no backdrop-filter, nothing loops: one short rise and sweep when a launcher opens. app.css forces every nav
   button's font, border and opacity with !important, so the keys and rows say theirs the same way. */

nav { display: block; overflow: visible; }
nav .nav-sub { display: none !important; }                 /* the tab buttons: still there, clicked by everything */

/* ---- the bar ---------------------------------------------------------------------------------------- */
/* OPS sits in the middle: TODAY · PLAY · WORLDS | ◈ OPS | SQUAD · YOU (· ⌬ ADMIN for hosts), two equal halves */
.deck-bar { display: grid; grid-template-columns: minmax(0, 1fr) 74px minmax(0, 1fr); align-items: stretch; max-width: 720px; margin: 0 auto; height: 58px; }
.dk-half { display: flex; align-items: stretch; min-width: 0; }
nav .deck-bar .dk-key.dk-hostkey { display: none; }
body.dk-host nav .deck-bar .dk-key.dk-hostkey { display: flex; }
nav .deck-bar .dk-key { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 2px 9px !important; background: transparent !important; border: 0 !important; border-radius: 0 !important; opacity: 1;
  color: #6c8494; font: 700 9px/1 var(--mono) !important; letter-spacing: .18em !important; text-transform: uppercase; position: relative; }
nav .deck-bar .dk-key:hover { color: #cfe9ff; background: rgba(79, 227, 255, .04) !important; }
nav .deck-bar .dk-key:focus-visible { outline: 1px solid var(--holo); outline-offset: -3px; }
.dk-key .dk-i { font-size: 17px; line-height: 1; font-weight: 400; color: #8fa6b6; transition: color .15s, text-shadow .15s; }
.dk-key .dk-l { white-space: nowrap; }
nav .deck-bar .dk-key.dk-cur { color: var(--amber); }
.dk-key.dk-cur .dk-i { color: var(--amber); text-shadow: 0 0 10px var(--glow); }
.dk-key.dk-cur:not(.dk-ops)::after { content: ""; position: absolute; left: 26%; right: 26%; top: 0; height: 2px; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
nav .deck-bar .dk-key.dk-open { color: var(--holo); background: linear-gradient(0deg, rgba(79, 227, 255, .12), transparent) !important; }
.dk-key.dk-open .dk-i { color: var(--holo); text-shadow: 0 0 12px rgba(79, 227, 255, .6); }
.dk-key.dk-open:not(.dk-ops)::after { content: ""; position: absolute; left: 26%; right: 26%; top: 0; height: 2px; background: var(--holo); box-shadow: 0 0 10px var(--holo); }
.dk-n { position: absolute; top: 5px; left: calc(50% + 9px); min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; box-sizing: border-box;
  background: var(--amber); color: #140e04; font: 800 9px/15px var(--mono); font-style: normal; letter-spacing: 0; text-align: center; box-shadow: 0 0 8px var(--glow); }
.dk-n:empty { display: none; }
.dk-key[data-deck="today"] .dk-n { background: rgba(5, 7, 12, .9); color: var(--amber); border: 1px solid rgba(255, 176, 32, .6); line-height: 13px; box-shadow: none; }
.dk-key[data-deck="today"].dk-all .dk-n { color: #7cffb2; border-color: rgba(124, 255, 178, .6); }

/* OPS: the raised centre home key */
nav .deck-bar .dk-key.dk-ops { justify-content: flex-end; }
.dk-ops .dk-i { width: 48px; height: 48px; margin-top: -22px; display: grid; place-items: center; border-radius: 50%; font-size: 22px; color: var(--holo);
  background: radial-gradient(circle at 50% 38%, rgba(79, 227, 255, .22), rgba(5, 9, 15, .98) 68%); border: 1px solid rgba(79, 227, 255, .55);
  box-shadow: 0 0 0 4px rgba(5, 7, 12, .97), 0 0 18px rgba(79, 227, 255, .28), inset 0 0 12px rgba(79, 227, 255, .2); }
.dk-ops.dk-cur .dk-i { color: var(--amber); border-color: var(--amber); text-shadow: 0 0 12px var(--glow);
  background: radial-gradient(circle at 50% 38%, rgba(255, 176, 32, .24), rgba(5, 9, 15, .98) 68%);
  box-shadow: 0 0 0 4px rgba(5, 7, 12, .97), 0 0 20px var(--glow), inset 0 0 12px rgba(255, 176, 32, .22); }
nav .deck-bar .dk-ops:hover { background: transparent !important; }
.dk-ops:hover .dk-i { border-color: var(--holo); }

/* YOU is the level badge */
.lv-chip.dk-cur { box-shadow: 0 0 0 1px var(--amber), 0 0 12px var(--glow) !important; }
.lv-chip.dk-open { box-shadow: 0 0 0 1px var(--holo), 0 0 14px rgba(79, 227, 255, .5) !important; }

/* ---- the launcher ----------------------------------------------------------------------------------- */
.dk-scrim { position: fixed; left: 0; right: 0; top: 0; bottom: var(--nav-h, 58px); z-index: 43; background: rgba(2, 4, 8, .58); }
.dk-sheet { --dk: var(--holo); position: fixed; z-index: 44; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h, 58px) + 10px);
  width: min(780px, calc(100vw - 32px)); max-height: calc(100vh - var(--nav-h, 58px) - 84px); display: flex; flex-direction: column; overflow: hidden;
  background: rgba(6, 9, 16, .985); }
.dk-scrim.hidden, .dk-sheet.hidden { display: none; }
.dk-head { position: relative; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 12px 14px 9px; }
.dk-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--dk), transparent); opacity: .35; }
.dk-title { flex: 1 1 auto; min-width: 0; font: 800 12px/1.25 var(--mono); letter-spacing: .26em; color: #e8f4ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-title b { font-weight: 400; margin-right: 2px; }
.dk-title em { font-style: normal; font-weight: 600; font-size: 9px; letter-spacing: .2em; color: var(--holo); opacity: .85; }
.dk-head .dk-next { flex: 0 1 auto; max-width: 52%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 7px 11px !important;
  background: rgba(255, 176, 32, .1) !important; border: 1px solid rgba(255, 176, 32, .55) !important; border-radius: 4px !important;
  color: var(--amber) !important; font: 700 10px/1 var(--mono) !important; letter-spacing: .14em !important; }
.dk-head .dk-next b { color: #fff3d6; font-weight: 800; }
.dk-head .dk-next:hover { background: rgba(255, 176, 32, .2) !important; filter: none; }
.dk-head .dk-next.hidden { display: none; }
.dk-head .dk-x { flex: 0 0 auto; width: 32px; height: 32px; padding: 0 !important; background: transparent !important; color: #8fa6b6 !important;
  border: 1px solid rgba(79, 227, 255, .22) !important; border-radius: 4px !important; font: 400 13px/1 var(--mono) !important; }
.dk-head .dk-x:hover { color: var(--holo) !important; border-color: var(--holo) !important; filter: none; }
.dk-meter { position: relative; z-index: 3; display: flex; gap: 3px; padding: 8px 14px 2px; }
.dk-meter.hidden { display: none; }
.dk-meter i { flex: 1 1 0; height: 3px; border-radius: 1px; background: rgba(79, 227, 255, .14); }
.dk-meter i.on { background: var(--amber); box-shadow: 0 0 6px var(--glow); }
.dk-body { position: relative; z-index: 3; overflow-y: auto; overscroll-behavior: contain; padding: 2px 10px 12px; scrollbar-width: thin; }
.dk-gh { font: 700 9px/1 var(--mono); letter-spacing: .26em; color: var(--dk); padding: 11px 4px 6px; }
.dk-gh span { color: #5d7383; letter-spacing: .12em; font-weight: 400; }
.dk-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }

nav ~ .dk-sheet .dk-row, .dk-sheet .dk-row { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; min-height: 44px; padding: 5px 8px !important;
  background: rgba(79, 227, 255, .025) !important; border: 1px solid rgba(79, 227, 255, .1) !important; border-radius: 4px !important;
  color: #cfe9ff; text-align: left; font-family: var(--mono) !important; font-weight: 400; letter-spacing: 0; box-shadow: none !important; }
.dk-sheet .dk-row:hover, .dk-sheet .dk-row:focus-visible { background: rgba(79, 227, 255, .07) !important; border-color: var(--dk) !important; outline: none; filter: none; }
.dk-sheet .dk-row.dk-here { border-color: rgba(255, 176, 32, .5) !important; box-shadow: inset 2px 0 0 var(--amber) !important; }
.dk-ico { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; }
.dk-ico svg { display: block; }
.dk-tx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dk-tx b { font: 700 11px/1.15 var(--mono); letter-spacing: .14em; color: #e8f4ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-tx small { font: 400 10px/1.2 var(--mono); color: #8fa6b6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-tx small.dk-alert { color: var(--amber); }
.dk-tag { flex: 0 0 auto; font: 800 9px/1 var(--mono); letter-spacing: .12em; }
.dk-new { color: var(--holo); opacity: .8; font-size: 8px; letter-spacing: .18em; padding: 2px 0 2px 6px; border-left: 1px solid rgba(79, 227, 255, .35); }
.dk-ok { color: #7cffb2; font-size: 13px; }
.dk-badge { min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 8px; background: var(--amber); color: #140e04; line-height: 16px; text-align: center; letter-spacing: 0; }
.dk-out { color: #5d7383; font-size: 12px; font-weight: 400; }
.dk-sheet .dk-row.dk-done .dk-tx b { color: #9fdcbc; }
.dk-sheet .dk-row.dk-done .dk-ico { opacity: .6; }
.dk-sheet .dk-row.dk-quiet { opacity: .5; }
.dk-sheet .dk-row.dk-quiet:hover, .dk-sheet .dk-row.dk-quiet:focus-visible { opacity: 1; }

/* one rise and one sweep when a launcher opens (never a loop) */
.dk-sheet.dk-anim { animation: dk-rise .22s cubic-bezier(.2, .8, .2, 1) both; }
.dk-sheet.dk-anim .dk-head::after { animation: dk-sweep .6s ease-out both; }
.dk-sheet.dk-anim .dk-row { animation: dk-in .26s ease-out both; animation-delay: calc(var(--i, 0) * 12ms); }
@keyframes dk-rise { from { opacity: 0; translate: 0 14px; } }
@keyframes dk-sweep { from { transform: scaleX(0); opacity: 1; } 60% { opacity: 1; } }
@keyframes dk-in { from { opacity: 0; translate: -6px 0; } }

/* ---- phones: a bottom sheet, one column, the 16px gutter ------------------------------------------- */
@media (max-width: 720px) {
  .dk-sheet { left: 0; right: 0; transform: none; width: auto; bottom: var(--nav-h, 58px); max-height: 76vh; border-radius: 12px 12px 0 0 !important; }
  .dk-head { padding: 14px 16px 9px; flex-wrap: wrap; row-gap: 9px; }
  .dk-head .dk-next { order: 3; flex: 1 1 100%; max-width: none; text-align: left; padding: 9px 11px !important; }
  .dk-meter { padding: 8px 16px 2px; }
  .dk-body { padding: 2px 16px 24px; }
  .dk-rows { grid-template-columns: 1fr; }
  body.dk-on nav { z-index: 46; }                           /* the raised OPS key stays on top of the sheet's edge */
  .dk-sheet:not([data-deck="today"]) .dk-title em { display: none; }
}
@media (max-width: 420px) {
  nav .deck-bar .dk-key { letter-spacing: .08em !important; font-size: 8px !important; }
  .dk-n { left: calc(50% + 5px); }
}
@media (max-width: 360px) {
  .deck-bar { grid-template-columns: minmax(0, 1fr) 62px minmax(0, 1fr); }
  nav .deck-bar .dk-key { letter-spacing: .02em !important; }
  .dk-ops .dk-i { width: 44px; height: 44px; }
}

/* ---- WARP (static/js/sys/warp.js): the command palette ------------------------------------------------ */
.dk-head .dk-warp { flex: 0 0 auto; width: 32px; height: 32px; padding: 0 !important; background: transparent !important; color: var(--holo) !important;
  border: 1px solid rgba(79, 227, 255, .22) !important; border-radius: 4px !important; font: 400 15px/1 var(--mono) !important; }
.dk-head .dk-warp:hover { border-color: var(--holo) !important; filter: none; }
nav .dk-findkey { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); padding: 7px 11px !important; background: transparent !important;
  border: 1px solid rgba(79, 227, 255, .25) !important; border-radius: 4px !important; color: #8fa6b6; opacity: 1;
  font: 700 9px/1 var(--mono) !important; letter-spacing: .2em !important; }
nav .dk-findkey:hover { color: var(--holo); border-color: var(--holo) !important; background: rgba(79, 227, 255, .05) !important; }
@media (max-width: 1000px) { nav .dk-findkey { display: none; } }
.wp-veil { position: fixed; inset: 0; z-index: 70; background: rgba(2, 4, 8, .62); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.wp-veil.hidden { display: none; }
.wp-box { width: min(620px, 100%); max-height: 70vh; display: flex; flex-direction: column; overflow: hidden; background: rgba(6, 9, 16, .985); animation: dk-rise .18s ease-out both; }
.reduced-motion .wp-box { animation: none; }
.wp-top { position: relative; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid rgba(79, 227, 255, .18); }
.wp-k { font: 800 10px/1 var(--mono); letter-spacing: .26em; color: var(--amber); white-space: nowrap; }
.wp-top input { flex: 1 1 auto; min-width: 0; background: transparent; border: 0; box-shadow: none; padding: 6px 2px; font: 400 15px var(--mono); color: #e8f4ff; }
.wp-top input:focus { box-shadow: none; }
.wp-ans { position: relative; z-index: 3; margin: 0; padding: 10px 14px; max-height: 30vh; overflow: auto; white-space: pre-wrap; font: 400 11px/1.45 var(--mono);
  color: #cfe9ff; background: rgba(79, 227, 255, .04); border-bottom: 1px solid rgba(79, 227, 255, .12); }
.wp-ans.hidden { display: none; }
.wp-list { position: relative; z-index: 3; overflow-y: auto; overscroll-behavior: contain; padding: 4px 8px 8px; }
.wp-h { font: 700 9px/1 var(--mono); letter-spacing: .26em; color: var(--holo); padding: 10px 6px 5px; }
.wp-veil .wp-row { display: flex; align-items: baseline; gap: 10px; width: 100%; min-height: 36px; padding: 6px 8px !important; text-align: left;
  background: transparent !important; border: 1px solid transparent !important; border-radius: 4px !important; color: #e8f4ff; font-family: var(--mono) !important; }
.wp-row b { flex: 0 0 auto; max-width: 72%; min-width: 0; font: 700 11px/1.2 var(--mono); letter-spacing: .12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wp-row small { flex: 1 1 auto; min-width: 0; font: 400 10px/1.2 var(--mono); color: #8fa6b6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wp-row em { flex: 0 0 auto; font: 700 8px/1 var(--mono); font-style: normal; letter-spacing: .18em; color: #5d7383; }
.wp-veil .wp-row.on, .wp-veil .wp-row:hover { background: rgba(79, 227, 255, .08) !important; border-color: rgba(79, 227, 255, .4) !important; filter: none; }
.wp-veil .wp-row.on b { color: var(--amber); }
.wp-none { padding: 18px 8px; font: 400 11px var(--mono); color: #8fa6b6; }
.wp-foot { position: relative; z-index: 3; padding: 8px 14px; border-top: 1px solid rgba(79, 227, 255, .12); font: 400 9px/1 var(--mono); letter-spacing: .16em; color: #5d7383; }
@media (max-width: 720px) {
  .wp-veil { padding: 10px 16px 16px; }
  .wp-box { max-height: calc(100vh - var(--nav-h, 58px) - 30px); }
  .wp-foot { display: none; }
  .wp-veil .wp-row { flex-wrap: wrap; row-gap: 3px; }
  .wp-row b { flex: 1 1 auto; max-width: none; }
  .wp-row small { order: 3; flex-basis: 100%; }
}

/* ---- pins and recents beside the decks (desktop) -------------------------------------------------------- */
.dk-quick { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); display: flex; gap: 6px; max-width: calc(50% - 360px); overflow: hidden; }
.dk-quick:empty { display: none; }
nav .dk-quick .dk-qk { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 150px; padding: 4px 9px 4px 5px !important; opacity: 1;
  background: rgba(79, 227, 255, .03) !important; border: 1px solid rgba(79, 227, 255, .16) !important; border-radius: 4px !important;
  color: #8fa6b6; font: 700 9px/1 var(--mono) !important; letter-spacing: .14em !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
nav .dk-quick .dk-qk:hover { color: #e8f4ff; border-color: var(--holo) !important; background: rgba(79, 227, 255, .07) !important; }
nav .dk-quick .dk-qk.dk-pin { border-color: rgba(255, 176, 32, .35) !important; }
.dk-qk .dk-ico { flex: 0 0 18px; width: 18px; height: 18px; }
.dk-qk .dk-ico svg { width: 18px; height: 18px; }
@media (max-width: 1000px) { .dk-quick { display: none; } }

/* ---- a tab's sections under its row: one-tap chips read from its SubTabs rail ----------------------------- */
.dk-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dk-subs { display: flex; flex-wrap: wrap; gap: 3px; padding: 0 0 2px 48px; }
.dk-sheet .dk-sub { padding: 3px 7px !important; min-height: 22px; background: transparent !important; border: 1px solid rgba(79, 227, 255, .14) !important; border-radius: 3px !important;
  color: #8fa6b6; font: 700 8px/1 var(--mono) !important; letter-spacing: .14em !important; box-shadow: none !important; }
.dk-sheet .dk-sub:hover, .dk-sheet .dk-sub:focus-visible { color: #e8f4ff; border-color: var(--dk) !important; outline: none; filter: none; }
.dk-sheet .dk-sub.on { color: var(--amber); border-color: rgba(255, 176, 32, .5) !important; }
.dk-cell.dk-quiet { opacity: .5; }
.dk-cell.dk-quiet .dk-row.dk-quiet, .dk-cell.dk-quiet:hover { opacity: 1; }

/* A GAME APP (games/apps.py, decks.js APP): the game alone. No tab bar, launchers, quick keys, WARP or level chip;
   inside PUZZLE only the app's own mode, inside QUESTS no section rail (LEKKERDLE) */
.bn-app #nav, .bn-app #deck-sheet, .bn-app #deck-scrim, .bn-app [data-warp], .bn-app #lv-chip, .bn-app #install-btn,
.bn-app #puz-modes, .bn-app .bn-sub[data-sub="quests"], .bn-app #app > header, .bn-app #tab-quests .q-hero { display: none !important; }
/* the top-right buttons (sys.css .sys-bar) get a slim strip of their own above the game, now the header is gone */
.bn-app #app { padding-top: 46px; }
/* the app's own heading names the game when it lives inside a bigger tab (decks.js appHead) */
.bn-app .tab-head.ap-retitled .th-note { display: none; }
/* touch: every button and select in an app at least a fingertip tall */
@media (pointer: coarse) { .bn-app #app section button, .bn-app #app section select { min-height: 34px; } }
