:root {
  /* Riot Games / Codex Desktop Tactical Slate-Teal & Warm Amber-Gold Tokens */
  --bg-deep: #09151a;
  --bg-mid: #0f2027;
  --panel-bg: #132730;
  --panel-inset: #0e1e25;
  --panel-hover: #1c3843;
  --line-slate: rgba(155, 181, 169, 0.28);
  --line-gold: rgba(232, 196, 122, 0.45);
  --accent-orange: #f39a58;
  --accent-orange-hi: #ffb57c;
  --accent-gold: #ffd98e;
  --accent-cyan: #88daf1;
  --ink-main: #fff2d6;
  --ink-body: #d6e4de;
  --ink-muted: #93aba4;
  --lcd-scale: 1;
  --phone-scale: 1.22;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink-main);
  background:
    linear-gradient(rgba(232, 196, 122, 0.025) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(232, 196, 122, 0.025) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(155deg, #0b191f 0%, #10242c 52%, #081318 100%);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

.app-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top, 0px)) max(22px, env(safe-area-inset-right, 0px)) max(14px, env(safe-area-inset-bottom, 0px)) max(22px, env(safe-area-inset-left, 0px));
}

.mobile-topbar,
.mobile-dock,
.drawer-close {
  display: none;
}

.workspace {
  width: 100%;
  max-width: 1120px;
  height: 100%;
  max-height: 760px;
  min-height: 0;
  display: grid;
  grid-template-columns: auto minmax(380px, 1fr);
  gap: 28px;
  align-items: center;
}

/* --- Authentic Brushed-Titanium Nokia N95 Handset (Fixed 268x546 = 1:2.04 Aspect Ratio) --- */
.handset-col {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0 4px;
}

.handset-slot {
  position: relative;
  width: calc(268px * var(--phone-scale));
  height: calc(546px * var(--phone-scale));
  flex-shrink: 0;
}

.nokia-n95 {
  position: absolute;
  top: 0;
  left: 0;
  width: 268px;
  height: 546px;
  transform: scale(var(--phone-scale));
  transform-origin: 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 8px 8px;
  border-radius: 22px 22px 26px 26px;
  background:
    linear-gradient(135deg, #d7dde6 0%, #9aa4b4 22%, #6d7788 55%, #b8c2cf 85%, #848e9f 100%);
  box-shadow:
    0 24px 56px rgba(2, 10, 14, 0.72),
    0 0 0 1px rgba(255, 242, 214, 0.22),
    inset 0 2px 3px rgba(255, 255, 255, 0.72),
    inset 0 -3px 6px rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.42);
}

.n95-side-vol {
  position: absolute;
  right: -3px;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.n95-side-vol span {
  display: block;
  width: 3px;
  height: 18px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, #e2e8f0, #64748b);
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.45);
}

.n95-side-cam {
  position: absolute;
  right: -3px;
  bottom: 132px;
  width: 3px;
  height: 22px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, #cbd5e1, #475569);
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.45);
}

.nokia-n95.nudge-shake {
  animation: n95-shake 0.42s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes n95-shake {
  10%, 90% { transform: scale(var(--phone-scale)) translate3d(-2px, 1px, 0); }
  20%, 80% { transform: scale(var(--phone-scale)) translate3d(3px, -2px, 0); }
  30%, 50%, 70% { transform: scale(var(--phone-scale)) translate3d(-4px, 1px, 0); }
  40%, 60% { transform: scale(var(--phone-scale)) translate3d(4px, -1px, 0); }
}

.n95-top-bezel {
  width: 100%;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 3px;
  position: relative;
  flex-shrink: 0;
}

.n95-sensor {
  width: 12px;
  height: 5px;
  border-radius: 4px;
  background: #1a212e;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
}

.n95-speaker {
  width: 60px;
  height: 6px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, #1b2230 0 3px, #475569 3px 5px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.85);
}

.n95-front-cam {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: linear-gradient(145deg, #334155, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.n95-cam-lens {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #60a5fa, #0b1630 70%);
}

.n95-led {
  position: absolute;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #334155;
  transition: background-color 0.15s, box-shadow 0.15s;
}

.n95-led.tx,
.badge-dot.tx {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.n95-led.rx,
.badge-dot.rx {
  background: #98e89e;
  box-shadow: 0 0 8px #98e89e;
}

.n95-brand-row {
  width: 100%;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px 2px;
  user-select: none;
  flex-shrink: 0;
}

.n95-logo {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: #1e293b;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.n95-model {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #334155;
}

.n95-screen-bezel {
  padding: 5px;
  border-radius: 7px;
  background: linear-gradient(180deg, #101622 0%, #1c2434 100%);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.9),
    0 1px 0 rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}

.lcd-scale-wrap {
  position: relative;
  width: 240px;
  height: 320px;
  overflow: hidden;
  border-radius: 2px;
  background: #0c1420;
}

/* Upper Navigation Deck */
.n95-controls {
  width: 100%;
  margin-top: 5px;
  padding: 5px 6px;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, #273041 0%, #18202c 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.2),
    0 2px 4px rgba(0, 0, 0, 0.4);
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.n95-col-side {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.n95-key {
  height: 29px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, #4b5565 0%, #2c3442 100%);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.08s ease, filter 0.12s ease;
}

.n95-key:active,
.dpad-btn:active,
.n95-t9-key:active {
  transform: translateY(1px) scale(0.97);
  filter: brightness(1.18);
}

.n95-call { color: #4ade80; font-size: 13px; }
.n95-end { color: #fb7185; font-size: 12px; }

.n95-dpad {
  justify-self: center;
  width: 96px;
  height: 70px;
  padding: 4px;
  border-radius: 13px;
  background: linear-gradient(145deg, #cbd5e1, #64748b);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.65), 0 3px 6px rgba(0, 0, 0, 0.45);
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  grid-template-rows: 1fr 1.15fr 1fr;
  gap: 2.5px;
}

.dpad-btn {
  border: 0;
  border-radius: 4px;
  background: linear-gradient(180deg, #2d3646 0%, #19202b 100%);
  color: #cbd5e1;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.dpad-up { grid-column: 2; grid-row: 1; }
.dpad-left { grid-column: 1; grid-row: 2; }
.dpad-ok {
  grid-column: 2;
  grid-row: 2;
  border-radius: 6px;
  background: linear-gradient(180deg, #475569 0%, #1e293b 100%);
  color: #f8fafc;
  font-size: 10px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35);
}
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down { grid-column: 2; grid-row: 3; }

/* Authentic Nokia N95 Classic T9 Keypad */
.n95-t9-pad {
  width: 100%;
  margin-top: 4px;
  padding: 4px 6px 5px;
  border-radius: 4px 4px 12px 12px;
  background: linear-gradient(180deg, #1b2331 0%, #101620 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px 4px;
  flex-shrink: 0;
}

.n95-t9-key {
  height: 15px;
  border-radius: 3px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, #343f52 0%, #202836 100%);
  color: #e2e8f0;
  padding: 0 5px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.n95-t9-key b {
  font-size: 10px;
  font-weight: 800;
  line-height: 14px;
  color: #f8fafc;
}

.n95-t9-key span {
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #7dd3fc;
  opacity: 0.85;
}

.n95-chin { margin-top: 4px; }
.n95-chin-bar {
  display: block;
  width: 44px;
  height: 3px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.42);
}

/* --- Right Panel: Riot Games / Codex Desktop Tactical Chrome --- */
.info-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  max-height: 660px;
  min-height: 0;
  min-width: 0;
}

.panel-card {
  background: var(--panel-bg);
  border: 1px solid var(--line-slate);
  border-top: 2px solid var(--line-gold);
  border-radius: 4px;
  padding: 14px 16px;
  box-shadow: 0 14px 36px rgba(3, 12, 16, 0.45);
}

.hero-card {
  border-top: 3px solid var(--accent-orange);
  padding-right: 112px;
}

.hero-kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.kicker-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent-gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.kicker-tag::before {
  content: "";
  width: 14px;
  height: 3px;
  transform: skew(-20deg);
  background: var(--accent-orange);
}

.status-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
  padding: 2px 8px;
  border: 1px solid var(--line-slate);
  border-radius: 2px;
  background: var(--panel-inset);
}

h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.015em;
  color: var(--ink-main);
}

/* VIP Strip */
.vip-strip {
  padding: 9px 11px;
  border: 1px solid rgba(243, 154, 88, 0.36);
  border-left: 3px solid var(--accent-orange);
  border-radius: 2px;
  background: var(--panel-inset);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vip-strip.is-unlocked {
  border-color: rgba(152, 232, 158, 0.38);
  border-left-color: #98e89e;
}

.vip-strip-text {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-body);
  flex: 1;
}

.vip-strip-text b {
  color: var(--accent-gold);
}

.vip-strip.is-unlocked .vip-strip-text b {
  color: #b7f5bc;
}

.btn-vip-cta {
  border: 1px solid #ffc794;
  border-radius: 3px;
  padding: 7px 12px;
  background: var(--accent-orange);
  color: #0e2026;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.btn-vip-cta:hover {
  background: var(--accent-orange-hi);
}

/* Command Action Row */
.action-card {
  padding: 11px 14px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.btn-primary,
.btn-secondary {
  border-radius: 3px;
  font-size: 12.5px;
  font-weight: 800;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.btn-primary {
  flex: 1.3;
  background: #1d3c47;
  color: var(--ink-main);
  border: 1px solid var(--line-gold);
}

.btn-primary:hover {
  background: #28515f;
  border-color: var(--accent-gold);
}

.btn-secondary {
  background: var(--panel-inset);
  color: var(--ink-body);
  border: 1px solid var(--line-slate);
}

.btn-secondary:hover {
  background: var(--panel-hover);
  border-color: rgba(232, 196, 122, 0.55);
  color: var(--ink-main);
}

/* Detective & 2G Log Card */
.monitor-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.monitor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 9px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line-slate);
}

.panel-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel-tab {
  border: 1px solid var(--line-slate);
  background: var(--panel-inset);
  color: var(--ink-muted);
  border-radius: 3px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.panel-tab.active {
  background: #223836;
  border-color: var(--accent-gold);
  color: var(--ink-main);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #98e89e;
  display: inline-block;
  flex-shrink: 0;
}

.monitor-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pkt-count {
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent-cyan);
  background: rgba(136, 218, 241, 0.12);
  padding: 1px 6px;
  border-radius: 2px;
}

.clue-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 7px;
  scrollbar-width: thin;
}
.clue-list.hidden { display: none; }

.clue-item {
  border-radius: 2px;
  padding: 8px 10px;
  background: var(--panel-inset);
  border: 1px solid rgba(155, 181, 169, 0.18);
  border-left: 2px solid var(--accent-cyan);
}

.clue-item-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--accent-gold);
  margin-bottom: 2px;
}

.clue-item-detail {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-body);
}

.secret-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  scrollbar-width: thin;
}

.secret-grid.hidden,
.monitor-log.hidden {
  display: none;
}

.secret-card {
  text-align: left;
  border-radius: 3px;
  padding: 8px 10px;
  border: 1px solid rgba(155, 181, 169, 0.22);
  border-left: 2px solid rgba(155, 181, 169, 0.35);
  background: var(--panel-inset);
  color: var(--ink-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.14s, background-color 0.14s;
}

.secret-card:hover {
  background: var(--panel-hover);
  border-color: var(--line-gold);
}

.secret-card.unlocked {
  background: #1b3136;
  border-color: var(--line-gold);
  border-left: 3px solid var(--accent-orange);
  color: var(--ink-main);
}

.secret-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.secret-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.secret-card.unlocked .secret-title {
  color: var(--accent-gold);
}

.secret-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 2px;
  background: rgba(155, 181, 169, 0.14);
  color: var(--ink-muted);
  flex-shrink: 0;
}

.secret-card.unlocked .secret-tag {
  background: rgba(243, 154, 88, 0.2);
  color: var(--accent-orange-hi);
}

.secret-hint {
  font-size: 11px;
  line-height: 1.4;
  color: var(--ink-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.secret-card.unlocked .secret-hint {
  color: var(--ink-body);
}

.monitor-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--panel-inset);
  border: 1px solid rgba(155, 181, 169, 0.2);
  border-radius: 2px;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.5;
  scrollbar-width: thin;
}

.log-empty { color: var(--ink-muted); padding: 6px 2px; }

.log-line {
  display: flex;
  gap: 6px;
  padding: 2px 0;
  border-bottom: 1px dashed rgba(155, 181, 169, 0.14);
  word-break: break-word;
}

.log-dir { font-weight: 700; flex-shrink: 0; }
.dir-TX { color: var(--accent-cyan); }
.dir-RX { color: #98e89e; }
.dir-SYS { color: var(--accent-gold); }
.log-cmd { color: var(--ink-main); font-weight: 600; flex-shrink: 0; }
.log-summary { color: var(--ink-muted); }

.hint-footer {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--line-slate);
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex-shrink: 0;
}

.hint-box {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--accent-gold);
  background: var(--panel-inset);
  border: 1px solid var(--line-gold);
  border-left: 3px solid var(--accent-orange);
  border-radius: 2px;
  padding: 7px 10px;
}
.hint-box.hidden { display: none; }

.hint-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.btn-hint {
  border: 1px solid var(--line-gold);
  background: var(--panel-inset);
  color: var(--accent-gold);
  border-radius: 3px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
.btn-hint:hover { background: var(--panel-hover); }

.btn-reset {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
}
.btn-reset:hover { color: var(--ink-main); }

/* ================================================================
   RIOT GAMES / CODEX DESKTOP ENTRY GATE MODAL (ZERO SCROLL ON MOBILE)
   ================================================================ */
.entry-gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(6, 17, 21, 0.86);
  display: grid;
  place-items: center;
  padding: max(10px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  overflow: hidden;
}
.entry-gate.hidden { display: none; }

.entry-gate-card {
  width: min(580px, 100%);
  max-height: 100%;
  overflow: hidden;
  background: #142a32;
  border: 1px solid rgba(155, 181, 169, 0.38);
  border-top: 3px solid var(--accent-orange);
  border-radius: 4px;
  padding: 18px 22px 16px;
  box-shadow: 0 24px 80px rgba(2, 11, 15, 0.85);
  color: var(--ink-main);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gate-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.gate-title-group {
  min-width: 0;
}

.gate-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffda9e;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.gate-eyebrow::before {
  content: "";
  width: 14px;
  height: 3px;
  transform: skew(-20deg);
  background: var(--accent-orange);
}

.entry-gate-card h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0.015em;
  color: var(--ink-main);
}

.gate-skip-top {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-gold);
  border-radius: 3px;
  background: #10242b;
  color: var(--ink-main);
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.gate-skip-top:hover {
  background: #1e3b45;
  border-color: var(--accent-gold);
}

.gate-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(155, 181, 169, 0.24);
  border-bottom: 1px solid rgba(155, 181, 169, 0.24);
}

.gate-task-copy {
  min-width: 0;
}

.gate-task-name {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink-main);
}

.gate-task-sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--ink-muted);
}

.btn-vip-primary {
  flex-shrink: 0;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid #ffc996;
  border-radius: 3px;
  background: var(--accent-orange);
  color: #10242b;
  font-size: 13.5px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}
.btn-vip-primary:hover {
  background: var(--accent-orange-hi);
}

.gate-compare {
  display: grid;
  grid-template-columns: 0.88fr 1.25fr;
  gap: 10px;
}

.gate-col {
  border-radius: 3px;
  padding: 10px 11px;
  border: 1px solid rgba(155, 181, 169, 0.22);
  background: #0f2229;
}

.gate-col.is-vip {
  border-color: rgba(232, 196, 122, 0.52);
  border-left: 3px solid var(--accent-orange);
  background: #1a3239;
}

.gate-col-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 800;
  margin-bottom: 6px;
}

.gate-col-head span {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 1px 5px;
  border-radius: 2px;
}

.gate-col.is-guest .gate-col-head { color: var(--ink-muted); }
.gate-col.is-guest .gate-col-head span {
  background: rgba(155, 181, 169, 0.14);
  color: var(--ink-muted);
}

.gate-col.is-vip .gate-col-head { color: var(--accent-gold); }
.gate-col.is-vip .gate-col-head span {
  background: rgba(243, 154, 88, 0.22);
  color: var(--accent-orange-hi);
}

.gate-col ul {
  margin: 0;
  padding-left: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ink-muted);
}

.gate-col.is-vip ul {
  color: var(--ink-body);
}
.gate-col.is-vip ul b {
  color: var(--ink-main);
}

.gate-subtitle {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #ffdb9b;
}

.gate-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-verify {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-gold);
  border-radius: 3px;
  background: #203d46;
  color: var(--ink-main);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.btn-verify:hover {
  background: #2b505b;
  border-color: var(--accent-gold);
}

.btn-guest-skip {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-slate);
  border-radius: 3px;
  background: #10242b;
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.btn-guest-skip:hover {
  background: #1a353e;
  color: var(--ink-main);
}

/* ================================================================
   COMPACT / MOBILE SINGLE-PAGE ZERO-SCROLL LAYOUT (<= 920px)
   ================================================================ */
@media (max-width: 920px) {
  .app-stage {
    padding: max(6px, env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) max(6px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    justify-content: space-between;
    gap: 5px;
  }

  .mobile-topbar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 92px 5px 10px;
    background: var(--panel-bg);
    border: 1px solid var(--line-slate);
    border-top: 2px solid var(--accent-orange);
    border-radius: 3px;
    flex-shrink: 0;
  }

  .mobile-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }

  .mobile-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--ink-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-status {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-gold);
    white-space: nowrap;
    flex-shrink: 0;
  }

  .workspace {
    display: flex;
    flex: 1;
    width: 100%;
    max-width: none;
    max-height: none;
    min-height: 0;
    align-items: center;
    justify-content: center;
    gap: 0;
    overflow: hidden;
  }

  .info-col { display: none; }

  .info-col.drawer-open {
    display: flex;
    position: fixed;
    inset: max(10px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
    max-height: none;
    height: auto;
    z-index: 60;
    background: #12252d;
    border-radius: 4px;
    padding: 10px;
    border: 1px solid var(--line-gold);
    border-top: 3px solid var(--accent-orange);
  }

  .info-col.drawer-open .hero-card,
  .info-col.drawer-open .action-card {
    display: none;
  }

  .info-col.drawer-open .monitor-card {
    border: 0;
    padding: 2px;
    box-shadow: none;
    background: transparent;
  }

  .info-col.drawer-open .panel-tabs {
    flex-wrap: nowrap;
    gap: 5px;
    min-width: 0;
  }

  .info-col.drawer-open .panel-tab {
    padding: 5px 8px;
    font-size: 11.5px;
    white-space: nowrap;
  }

  .info-col.drawer-open .drawer-close {
    display: inline-block;
    border: 1px solid var(--line-gold);
    background: #10242b;
    color: var(--ink-main);
    border-radius: 3px;
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
  }

  .secret-grid { grid-template-columns: 1fr; }

  .mobile-dock {
    width: 100%;
    max-width: 420px;
    display: grid;
    grid-template-columns: 1.15fr 1.1fr 0.7fr 1.05fr;
    gap: 5px;
    flex-shrink: 0;
  }

  .mobile-dock button {
    min-width: 0;
    padding: 8px 4px;
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
  }

  /* Compact Zero-Scroll Entry Gate on Mobile */
  .entry-gate-card {
    padding: 13px 14px 12px;
    gap: 9px;
  }

  .entry-gate-card h2 {
    font-size: 18px;
  }

  .gate-eyebrow {
    font-size: 10.5px;
    margin-bottom: 2px;
  }

  .gate-skip-top {
    min-height: 30px;
    padding: 0 9px;
    font-size: 11px;
  }

  .gate-task-row {
    padding: 8px 0;
    gap: 8px;
  }

  .gate-task-name { font-size: 13px; }
  .gate-task-sub { font-size: 10.5px; }

  .btn-vip-primary {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
  }

  .gate-compare {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .gate-col {
    padding: 8px 10px;
  }

  .gate-col-head {
    font-size: 11.5px;
    margin-bottom: 4px;
  }

  .gate-col ul {
    gap: 2.5px;
    font-size: 11px;
    line-height: 1.35;
  }

  .gate-subtitle {
    font-size: 11px;
    line-height: 1.38;
  }

  .gate-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .btn-verify,
  .btn-guest-skip {
    min-height: 36px;
    padding: 0 8px;
    font-size: 12px;
  }
}

/* Extra-short mobile screens (<= 600px height): ultra-tight single-screen Entry Gate */
@media (max-width: 920px) and (max-height: 600px) {
  .entry-gate-card {
    padding: 10px 12px;
    gap: 7px;
  }
  .entry-gate-card h2 { font-size: 16px; }
  .gate-col.is-guest { display: none; }
  .gate-col { padding: 7px 9px; }
  .gate-col ul { font-size: 10.5px; gap: 2px; }
  .gate-task-row { padding: 6px 0; }
  .btn-verify, .btn-guest-skip { min-height: 32px; font-size: 11.5px; }
}

/* Landscape mobile phones (short & wide, e.g. 667x375 or 844x390) */
@media (max-height: 500px) and (min-width: 520px) {
  .app-stage {
    padding: 6px 12px;
  }
  .mobile-topbar,
  .mobile-dock {
    display: none;
  }
  .workspace {
    display: grid;
    grid-template-columns: auto minmax(260px, 1fr);
    gap: 14px;
    max-height: 100%;
  }
  .info-col {
    display: flex;
    max-height: 100%;
    gap: 7px;
  }
  .hero-card { padding: 8px 10px; }
  .hero-card h1 { font-size: 15px; margin-bottom: 4px; }
  .vip-strip { padding: 5px 8px; gap: 8px; }
  .vip-strip-text { font-size: 10.5px; }
  .action-card { padding: 6px 8px; }
  .btn-primary, .btn-secondary { padding: 5px 8px; font-size: 11px; }
  .monitor-card { padding: 8px 10px; }
  .entry-gate-card {
    padding: 11px 14px;
    gap: 7px;
  }
  .entry-gate-card h2 { font-size: 17px; }
  .gate-compare { grid-template-columns: 0.9fr 1.2fr; gap: 8px; }
  .gate-col { padding: 6px 8px; }
  .gate-col ul { font-size: 10.5px; gap: 2px; }
}

.entry-gate-card { overflow-y: auto; overscroll-behavior: contain; }
.gate-task-row, .gate-actions { flex-shrink: 0; }
.gate-task-row button:disabled { opacity: .72; }
@media (max-height: 500px) and (orientation: landscape) {
  .entry-gate-card { gap: 4px; padding-block: 6px; }
  .gate-task-row { padding-block: 4px; }
}

/* The notebook sits beside the handset on desktop and opens as a sheet on mobile. */
.info-col .monitor-card {
  background: #faf5e6; color: #352f29; border: 1px solid #a99c83; border-radius: 8px;
  padding: 14px 16px; box-shadow: 0 6px 20px #09141955;
}
.journal-heading {display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.journal-heading h2 {margin:0;font:700 23px/1.35 "Songti SC","STSong",serif;letter-spacing:.08em;color:#3b352c}
.monitor-header {border-bottom:1px solid #cfc5af;padding:0;margin:0 0 8px}
.panel-tabs {gap:4px}
.monitor-card .panel-tab {background:transparent;color:#635d50;border:0;border-bottom:3px solid transparent;border-radius:0;padding:9px 6px;font-size:13px}
.monitor-card .panel-tab.active {color:#185c5c;border-color:#25726d;background:transparent}
.monitor-card .pkt-count {color:inherit;background:#e7e2d2;border-radius:8px;font-size:10px}
.clue-list {gap:0;background:repeating-linear-gradient(transparent 0 25px,#99846718 25px 26px);padding:0 3px}
.clue-item {border:0;border-bottom:1px solid #cfc4ad;border-radius:0;background:#faf5e6;padding:12px 7px}
.clue-item-title {font-size:16px;color:#293e3d;margin-bottom:5px}
.clue-item-detail {font-size:14px;line-height:1.75;color:#504e44}
.secret-grid {align-content:start;grid-auto-rows:max-content}
.secret-grid .secret-card {background:#f0ead9;border:1px dashed #b7ad98;color:#615c50;padding:12px;min-height:46px}
.secret-grid .secret-card.unlocked {background:#e6eee3;border:1px solid #92ad9d}
.secret-grid .secret-title,.secret-grid .secret-hint {color:#48493e}
.secret-grid .secret-tag {color:#3c615d;background:#e0e6d9}
.secret-hint:empty {display:none}
.monitor-log {background:#eff0e7;border-color:#cec9b7}
.monitor-log :is(.log-dir,.log-cmd,.log-empty) {color:#285b58}
.monitor-log .log-summary {color:#4f564e}
.hint-footer {border-color:#cfc5af}
.hint-box {background:#fff3ca;border-color:#d6ba78;color:#564524;font-size:13px}
.btn-hint,.btn-hint:hover {background:#245e5b;color:white;border:0;border-radius:5px;min-height:38px;padding:6px 14px}
.btn-reset,.btn-reset:hover {color:#686050;min-height:38px}
@media (max-width:920px) and (min-height:501px) {
 .info-col.drawer-open {inset:auto 0 0;height:min(72dvh,620px);border:0;border-radius:18px 18px 0 0;background:#faf5e6;padding:17px 16px max(12px,env(safe-area-inset-bottom));box-shadow:0 0 0 100vmax #06101499}
 .info-col.drawer-open .monitor-card {color:#352f29}
 .info-col.drawer-open .drawer-close {background:transparent;color:#365854;border:0;min-height:40px;font-size:13px}
 .info-col.drawer-open .panel-tab {font-size:13px;padding:10px 7px}
 .mobile-dock button {border-radius:6px;min-height:38px}
}

#detectiveRanks { min-height:0; flex:1; overflow:auto; color:#34483e; font-size:13px; }
#detectiveRanks[hidden], .hint-footer[hidden], #detectiveRanks button[hidden] { display:none; }
.rank-controls,.rank-local { display:flex; align-items:center; justify-content:space-between; gap:6px; }
#detectiveRanks button { border:1px solid #97a995; border-radius:4px; color:#285850; background:#fffdf3; padding:5px 10px; font:inherit; cursor:pointer; }
.rank-controls [role=group] { display:flex; gap:3px; }
#detectiveRanks [aria-pressed=true] { background:#245e5b; color:white; }
#detectiveRanks button:disabled { opacity:.55; }
.rank-rules,.rank-sync { font-size:12px; line-height:1.5; color:#5c6254; }
.rank-rules,.rank-own,#detectiveRanks [role=status] { margin:7px 0; }
.rank-own { font-weight:bold; }
.rank-colheads,#detectiveRanks li { display:grid; grid-template-columns:32px minmax(40px,1fr) 43px minmax(66px,auto); gap:5px; align-items:center; padding:7px 3px; border-bottom:1px solid #cfc4ad; }
.rank-colheads { margin-top:8px; background:#ebe6d6; color:#5a6054; font-size:12px; }
#detectiveRanks ol { margin:0; padding:0; }
#detectiveRanks li span:nth-child(2) { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
