/* ==========================================================================
   RUG PATROL — menu.css
   Pause menu and its tabs, the case picker, the tutorial coach, quick chat,
   the case file, progression on the end card, and the Connect menu.
   ========================================================================== */

.hl-violet { color: #C9A0FF; }
.hl-ice { color: var(--ice); }

/* ------------------------------------------------------------- HUD extras */

.hud__btns { display: flex; gap: 4px; pointer-events: auto; margin-top: 2px; }
.hud__btn {
  padding: 4px 7px;
  background: rgba(7, 11, 16, 0.8);
  border: 1px solid rgba(120, 150, 180, 0.3);
  border-radius: 2px;
  color: var(--txt-dim);
  font-family: var(--f-pixel);
  font-size: clamp(7px, 0.85vw, 9px);
  letter-spacing: 0.06em;
  cursor: pointer;
}
.hud__btn:hover { color: var(--txt); border-color: var(--green); }

.g-prompt.is-hot { border-color: var(--red); color: #FFD6DB; animation: bob 0.6s var(--ease) infinite; }
.g-prompt.is-hot b { color: var(--red); }

.gtick__mode {
  padding: 3px 8px;
  border-radius: 3px;
  background: var(--bg-2);
  font-family: var(--f-pixel);
  font-size: 9px;
  color: var(--ice);
}
.gtick i { font-style: normal; }

/* ------------------------------------------------------------ tutorial coach */

.coach {
  position: absolute;
  left: var(--pad);
  bottom: calc(var(--pad) + 36px);
  max-width: min(460px, 70%);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "face body" "face skip";
  gap: 4px 10px;
  padding: 10px 12px;
  background: rgba(7, 11, 16, 0.92);
  border: 1px solid var(--green-dim);
  border-left: 3px solid var(--green);
  border-radius: 4px;
  pointer-events: auto;
  animation: post-in 0.3s var(--ease);
}
.coach[hidden] { display: none !important; }
.coach__face { grid-area: face; width: 34px; height: 34px; image-rendering: pixelated; background: var(--bg-2); border-radius: 3px; }
.coach__body { grid-area: body; min-width: 0; }
.coach__step { font-family: var(--f-pixel); font-size: 8px; letter-spacing: 0.12em; color: var(--green); margin-bottom: 4px; }
.coach__text { margin: 0; font-family: var(--f-mono); font-size: clamp(10.5px, 1.2vw, 12.5px); line-height: 1.5; color: var(--txt); }
.coach__text kbd, .qchat kbd, .mode__key, .binds kbd {
  display: inline-block;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 3px;
  font-family: var(--f-mono);
  font-size: 0.9em;
  color: var(--txt);
  background: var(--bg);
}
.coach__skip {
  grid-area: skip;
  justify-self: start;
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--txt-faint);
  text-decoration: underline;
  cursor: pointer;
}
@media (max-width: 620px) { .coach { max-width: calc(100% - 2 * var(--pad)); bottom: auto; top: 30%; } }

/* --------------------------------------------------------------- quick chat */

.qchat {
  position: absolute;
  right: var(--pad);
  bottom: calc(var(--pad) + 36px);
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 4px;
  padding: 8px;
  background: rgba(7, 11, 16, 0.94);
  border: 1px solid #2A5670;
  border-radius: 4px;
  pointer-events: auto;
}
.qchat[hidden] { display: none !important; }
.qchat button {
  display: flex; gap: 6px; align-items: center;
  padding: 5px 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--f-pixel);
  font-size: 9px;
  color: #9FDFF6;
  cursor: pointer;
  text-align: left;
}
.qchat button:hover { border-color: var(--ice); }

/* ---------------------------------------------------------------- panels */

.g-panel.pause, .g-panel.modesel { width: min(680px, 100%); }
.g-panel.casefile, .g-panel.subway { width: min(560px, 100%); }

/* case picker */
.modes { display: grid; gap: 8px; margin: 14px 0; }
.mode {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "key title" "key body";
  gap: 3px 12px;
  padding: 12px 14px;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--txt);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.mode:hover { border-color: var(--txt-faint); }
.mode.is-sel { border-color: var(--green); background: rgba(0, 224, 90, 0.07); }
.mode__key { grid-area: key; align-self: start; margin-top: 2px; }
.mode__title { grid-area: title; font-family: var(--f-head); font-size: 16px; font-weight: 700; }
.mode__title em { font-style: normal; font-family: var(--f-pixel); font-size: 9px; letter-spacing: 0.08em; color: var(--amber); margin-left: 6px; font-weight: 400; }
.mode__body { grid-area: body; font-family: var(--f-mono); font-size: 12px; line-height: 1.5; color: var(--txt-dim); }
.mode__body b { color: var(--txt); font-weight: 500; }
.g-card .mode__note, .mode__note { margin: 8px 0 0; font-family: var(--f-mono); font-size: 11.5px; line-height: 1.55; color: var(--txt-faint); }

/* toggles */
.toggle { display: flex; align-items: center; gap: 10px; margin: 8px 0; cursor: pointer; font-family: var(--f-head); font-size: 14px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle span {
  position: relative; flex: none;
  width: 32px; height: 18px;
  border-radius: 99px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  transition: background 0.15s var(--ease);
}
.toggle span::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--txt-dim);
  transition: transform 0.15s var(--ease), background 0.15s var(--ease);
}
.toggle input:checked + span { background: rgba(0, 224, 90, 0.25); border-color: var(--green-dim); }
.toggle input:checked + span::after { transform: translateX(14px); background: var(--green); }
.toggle input:focus-visible + span { outline: 2px solid var(--ice); outline-offset: 2px; }
.toggle b { font-weight: 500; }
.toggle em { font-style: normal; margin-left: auto; font-family: var(--f-mono); font-size: 11px; color: var(--txt-faint); }

.online { margin-top: 14px; padding: 10px 14px; border: 1px dashed var(--line); border-radius: 5px; }
.online.is-on { border-style: solid; border-color: #2A5670; }
.online__state { font-family: var(--f-pixel); font-size: 9px; letter-spacing: 0.08em; color: var(--txt-faint); }
.online__state.is-live { color: var(--ice); }
.online__state.is-error { color: var(--amber); }
.online .cc__field { margin-top: 10px; }

/* pause tabs */
.ptabs { display: flex; flex-wrap: wrap; gap: 4px; margin: -4px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.ptab {
  padding: 6px 10px;
  background: none;
  border: 1px solid transparent;
  border-radius: 3px;
  font-family: var(--f-pixel);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--txt-faint);
  cursor: pointer;
}
.ptab:hover { color: var(--txt); }
.ptab.is-sel { color: var(--green); border-color: var(--green-dim); background: rgba(0, 224, 90, 0.06); }
.pmenu { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 16px 0; }
.pmenu .btn { justify-content: center; }

.rankbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin: 12px 0 4px; font-family: var(--f-mono); font-size: 11.5px; color: var(--txt-dim); }
.rankbar > span:first-child { font-family: var(--f-pixel); font-size: 10px; color: var(--amber); letter-spacing: 0.06em; }
.rankbar i { height: 8px; background: var(--bg-3); border-radius: 99px; overflow: hidden; }
.rankbar b { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), var(--green)); border-radius: 99px; transition: width 1.2s var(--ease); }
.rankbar.is-up b { background: linear-gradient(90deg, var(--green), var(--ice)); }

/* settings */
.sgroup { padding: 10px 0 12px; border-bottom: 1px solid var(--line-soft); }
.sgroup:last-child { border-bottom: 0; }
.srow { display: grid; grid-template-columns: 110px 1fr 44px; align-items: center; gap: 12px; margin: 8px 0; font-family: var(--f-head); font-size: 14px; }
.srow select { grid-column: 2 / 4; padding: 6px 10px; font-size: 13px; }
.srow input[type="range"] { width: 100%; accent-color: var(--green); }
.srow output { font-family: var(--f-mono); font-size: 12px; color: var(--txt-dim); text-align: right; }

/* controls */
.binds { display: grid; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: 4px; overflow: hidden; }
.binds__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 12px; background: var(--bg); font-family: var(--f-head); font-size: 14px; }
.keycap { min-width: 120px; padding: 5px 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 3px; color: var(--txt); cursor: pointer; text-align: right; font-family: var(--f-mono); font-size: 12px; }
.keycap:hover { border-color: var(--green); }
.keycap.is-cap { border-color: var(--amber); color: var(--amber); animation: pulse 0.9s infinite; }

/* profile */
.pstats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; margin: 14px 0 0; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: 4px; overflow: hidden; }
.pstats div { background: var(--bg); padding: 8px 12px; }
.pstats dt { margin: 0; font-family: var(--f-pixel); font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--txt-faint); }
.pstats dd { margin: 3px 0 0; font-family: var(--f-mono); font-size: 14px; color: var(--txt); }
.unlocks { display: flex; flex-wrap: wrap; gap: 6px; }
.unlock { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px dashed var(--line); border-radius: 99px; font-family: var(--f-mono); font-size: 12px; color: var(--txt-faint); }
.unlock i { width: 10px; height: 10px; border-radius: 2px; }
.unlock em { font-style: normal; font-size: 10.5px; }
.unlock.is-open { border-style: solid; border-color: var(--green-dim); color: var(--txt); }
.unlock.is-open em { color: var(--green); }
.achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.ach { display: grid; gap: 2px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 4px; opacity: 0.5; }
.ach b { font-family: var(--f-head); font-size: 13px; }
.ach span { font-family: var(--f-mono); font-size: 11px; line-height: 1.4; color: var(--txt-dim); }
.ach em { font-style: normal; font-family: var(--f-pixel); font-size: 8.5px; color: var(--txt-faint); }
.ach.is-got { opacity: 1; border-color: var(--amber-dim); }
.ach.is-got em { color: var(--amber); }

/* daily board */
.board { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: 4px; overflow: hidden; }
.board li { display: grid; grid-template-columns: 28px 1fr auto 56px; gap: 10px; align-items: center; padding: 6px 12px; background: var(--bg); font-family: var(--f-mono); font-size: 12.5px; }
.board li.is-me { background: rgba(0, 224, 90, 0.07); }
.board__n { color: var(--txt-faint); }
.board__who em { font-style: normal; font-size: 10.5px; color: var(--txt-faint); margin-left: 4px; }
.board__t { color: var(--txt-dim); text-align: right; }

/* case file */
.case dd { display: flex; align-items: center; gap: 8px; }
.case dd b { font-weight: 500; font-family: var(--f-head); text-transform: capitalize; }
.case__sw { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, 0.5); flex: none; }

/* ------------------------------------------------------- creator unlocks */

.cc__note { margin-top: 10px; padding: 7px 10px; border: 1px solid var(--amber-dim); border-radius: 3px; font-family: var(--f-mono); font-size: 12px; color: var(--amber); }
.cc__note[hidden] { display: none !important; }
.sw.is-locked, .chip.is-locked { position: relative; opacity: 0.45; cursor: not-allowed; }
.sw.is-locked::after { content: "×"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 12px; text-shadow: 0 0 3px #000; }
.chip.is-locked::after { content: " ·locked"; color: var(--txt-faint); }

/* ------------------------------------------------------- end-card progress */

.prog:empty { display: none; }
.prog { margin: 14px 0 0; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 6px; }
.prog__tag { font-family: var(--f-pixel); font-size: 9px; letter-spacing: 0.1em; color: var(--ice); text-transform: uppercase; }
.prog__xp { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.prog__xp b { font-family: var(--f-head); font-size: 22px; color: var(--amber); }
.prog__xp span { font-family: var(--f-mono); font-size: 11.5px; color: var(--txt-faint); }
.prog__up { margin-top: 8px; font-family: var(--f-head); font-size: 15px; color: var(--green); animation: post-in 0.5s var(--ease); }
.prog__unlocks, .prog__streak { margin-top: 6px; font-family: var(--f-mono); font-size: 12px; color: var(--txt-dim); }
.prog__unlocks b { color: var(--txt); font-weight: 500; }
.achs--new { margin-top: 10px; }
.prog__daily { margin-top: 10px; }

/* ------------------------------------------------------------ connect menu */

.acct-modal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(3, 5, 8, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.acct-modal[hidden] { display: none !important; }
.acct {
  width: min(460px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.acct__top { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 6px; }
.acct__top h2 { font-family: var(--f-pixel); font-size: 15px; letter-spacing: 0.06em; margin: 0; }
.acct__x { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--txt-dim); font-size: 18px; cursor: pointer; }
.acct__body { padding: 4px 18px 18px; }
.acct__sec { margin-top: 12px; }
.acct__head { display: grid; gap: 2px; margin-bottom: 8px; }
.acct__head b { font-family: var(--f-pixel); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--txt-dim); }
.acct__head span { font-family: var(--f-mono); font-size: 11.5px; color: var(--txt-faint); line-height: 1.45; }
.acct__opt {
  display: grid;
  grid-template-columns: 26px 1fr;
  grid-template-areas: "ico name" "ico sub";
  column-gap: 12px;
  width: 100%;
  margin-bottom: 6px;
  padding: 10px 12px;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--txt);
  cursor: pointer;
  transition: border-color 0.15s var(--ease);
}
.acct__opt:hover:not([disabled]) { border-color: var(--green); }
.acct__opt[disabled] { opacity: 0.5; cursor: not-allowed; }
.acct__opt img, .acct__ico { grid-area: ico; align-self: center; width: 22px; height: 22px; border-radius: 5px; }
.acct__ico { display: grid; place-items: center; font-style: normal; background: var(--bg-3); color: var(--txt); font-size: 13px; }
.acct__ico--wc { background: #3B99FC; color: #fff; }
.acct__opt b { grid-area: name; font-family: var(--f-head); font-size: 14px; }
.acct__opt span { grid-area: sub; font-family: var(--f-mono); font-size: 11px; color: var(--txt-faint); }
.acct__row { margin-bottom: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 6px; }
.acct__row.is-on { border-color: var(--green-dim); }
.acct__row .btn { margin-left: auto; padding: 6px 10px; }
.acct__row .btn + .btn { margin-left: 0; }
.acct__id { font-family: var(--f-mono); font-size: 13px; color: var(--txt); }
.acct__meta { font-family: var(--f-mono); font-size: 11.5px; color: var(--txt-faint); }
.acct__av { border-radius: 50%; }
.acct__foot { margin: 14px 0 0; font-family: var(--f-mono); font-size: 11px; line-height: 1.5; color: var(--txt-faint); }
.acct__foot b { color: var(--green); font-weight: 500; }

/* ------------------------------------------------------------ touch layout
   On a phone the 16:9 canvas only fills the top of the stage; the space
   under it is where the pad lives. Overlays belong in that space, not over
   the picture. 56.25cqw is exactly the canvas height (9/16 of the width). */

.game-stage { container-type: inline-size; }

.game-stage.is-touch .coach {
  top: min(calc(56.25cqw + 6px), calc(100% - 160px));
  bottom: auto;
  right: var(--pad);
  max-width: none;
}
.game-stage.is-touch .qchat {
  top: min(calc(56.25cqw + 6px), 30%);
  bottom: auto;
  left: var(--pad);
  right: var(--pad);
  grid-template-columns: repeat(2, 1fr);
}
.game-stage.is-touch .qchat button { padding: 9px 8px; }

/* dialogue: under the picture, left of ACT / ESC, and the d-pad steps aside */
.game-stage.is-touch.is-dlg-open .dlg {
  top: min(calc(56.25cqw + 6px), 45%);
  right: calc(var(--pad) + 72px);
  max-height: none;
  overflow-y: auto;
}
.game-stage.is-touch.is-dlg-open .pad__dpad { visibility: hidden; }
.game-stage.is-touch .dlg__choice { padding: 11px 12px; }

.game-stage.is-touch .hud__btn { min-width: 38px; min-height: 32px; padding: 6px 9px; font-size: 9px; }
.game-stage.is-touch .g-prompt { bottom: auto; top: min(calc(56.25cqw - 34px), 60%); }
.g-panel.pause .acct__sec:first-of-type { margin-top: 4px; }
