/* Per-Level App Window Themes (scoped inside .app-window) */
.theme-rose { --paper: #2a1824; --accent: #ff6b9d; --card: #3a2230; }
.theme-pete { --paper: #2a160e; --accent: #ffb703; --card: #3d2214; }
.theme-max { --paper: #10241c; --accent: #3ddc97; --card: #163028; }
.theme-emma { --paper: #10241c; --accent: #7bdff2; --card: #163028; }
.theme-bean { --paper: #2a2110; --accent: #ffd166; --card: #3a2c16; }
.theme-marco { --paper: #2a140e; --accent: #ff8c42; --card: #3a1e14; }
.theme-nova { --paper: #2a1020; --accent: #ff5d8f; --card: #3a1830; }
.theme-richard { --paper: #141c2e; --accent: #8ec5ff; --card: #1c2740; }
.theme-mia { --paper: #2a1024; --accent: #ff4d8d; --card: #3a1830; }
.theme-frank { --paper: #2a220c; --accent: #ffe14a; --card: #3a3014; }
.theme-luna { --paper: #1c1430; --accent: #c084fc; --card: #2a1c44; }
.theme-nia { --paper: #2a1c12; --accent: #f4a261; --card: #3a2818; }
.theme-vince { --paper: #2a160c; --accent: #e85d04; --card: #3a2014; }
.theme-mirror { --paper: #10241c; --accent: #3ee0ff; --card: #143028; }
.theme-null { --paper: #2a1014; --accent: #ff2d3a; --card: #3a141c; }
.theme-friend { --paper: #141c2e; --accent: #7aa2ff; --card: #1c2740; }

.glitch-in .hero-portrait { animation: 0.7s steps(2, end) crimson; }
@keyframes crimson {
  0% { filter: hue-rotate(); }
  40% { filter: hue-rotate(-30deg) saturate(2); transform: translate(-4px); }
  to { filter: none; transform: none; }
}

/* Unified Play Screen */
.play {
  background:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 48%),
    radial-gradient(circle at 85% 20%, rgba(56, 189, 248, 0.08), transparent 45%),
    var(--ui-bg);
  color: var(--ui-text);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Global Top Bar */
.play-topbar {
  flex: none;
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(11, 17, 32, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(10px);
  z-index: 10;
}
.top-left, .top-right { display: flex; align-items: center; gap: 8px; }
.top-back {
  min-height: 32px;
  padding: 5px 12px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.case-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}
.warrant-tag {
  font-size: 10px;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}
.warrant-tag.recovery { background: rgba(34, 197, 94, 0.18); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.35); }
.warrant-tag.warrant { background: rgba(245, 158, 11, 0.18); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.35); }
.icon-btn {
  min-height: 32px;
  min-width: 34px;
  padding: 4px 8px;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn.open { border-color: #38bdf8; background: rgba(56, 189, 248, 0.2); }
.icon-btn.muted-off { opacity: 0.5; border-color: rgba(248, 113, 113, 0.45); }

.help-popover {
  position: absolute;
  top: 54px;
  left: 16px;
  z-index: 30;
  width: min(360px, calc(100vw - 32px));
  background: #162238;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
  font-size: 13.5px;
  line-height: 1.4;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.65);
}
.pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pop-close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  font-size: 15px;
  display: grid;
  place-items: center;
}
.pop-close:hover { background: rgba(239, 68, 68, 0.65); }

/* 2-Column Grid */
.play-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 14px;
  padding: 12px 16px 14px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}
@media (min-width: 1380px) { .play-grid { grid-template-columns: minmax(0, 1fr) 444px; } }

/* Left Target App Window */
.app-window {
  background: var(--paper);
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, rgba(255, 255, 255, 0.14));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.app-chrome {
  flex: none;
  height: 36px;
  padding: 0 12px;
  background: rgba(0, 0, 0, 0.34);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.win-dots { display: flex; gap: 6px; align-items: center; }
.win-dots i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.win-dots i:first-child { background: #f87171; }
.win-dots i:nth-child(2) { background: #fbbf24; }
.win-dots i:nth-child(3) { background: #4ade80; }
.url-bar {
  flex: 1;
  max-width: 340px;
  text-align: center;
  font-size: 12px;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 3px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-chip { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }

.profile-col {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.profile-col::-webkit-scrollbar { width: 6px; }
.profile-col::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 999px; }

/* Profile Hero */
.profile-hero {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  background: color-mix(in srgb, var(--card) 82%, #070b14);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}
.hero-art { width: 136px; }
.hero-portrait {
  width: 136px;
  height: 136px;
  object-fit: cover;
  object-position: top center;
  border-radius: 12px;
  border: 2px solid color-mix(in srgb, var(--accent) 65%, #fff);
  display: block;
}
.profile-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.profile-head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.profile-title-group { display: flex; align-items: center; gap: 6px; min-width: 0; }
.who-name { font-size: clamp(1.3rem, 2.2vw, 1.7rem); line-height: 1.05; }
.vbadge {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #38bdf8;
  color: #082f49;
  font-size: 11px;
  font-weight: 800;
  flex: none;
}
.btn-follow {
  opacity: 0.45;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #e2e8f0;
  border-radius: 999px;
  padding: 3px 11px;
  min-height: 26px;
  font-size: 12px;
  font-weight: 600;
}
.btn-follow:hover { opacity: 0.65; }
.handle-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.handle { font-size: 0.9rem; color: var(--accent); }
.alias-pill { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: #cbd5e1; }
.bio-text { font-size: 0.9rem; line-height: 1.35; color: #e7e5e4; margin-top: 2px; }

.facts-inline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.fact-chip {
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 6px 9px;
  font-size: 13.5px;
  line-height: 1.35;
}
.fact-chip strong { color: #cbd5e1; font-size: 12px; }

.twist-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.28);
  color: #fde68a;
  font-size: 13px;
  line-height: 1.3;
}
.twist-dot { width: 7px; height: 7px; border-radius: 50%; background: #fbbf24; flex: none; }
.notice-bar { padding: 8px 12px; font-size: 14px; }

/* Exploration Tabs */
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  padding: 3px;
}
.tabs button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  transition: background 120ms ease, color 120ms ease;
}
.tabs button:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.tabs button.on {
  background: color-mix(in srgb, var(--accent) 22%, #1e293b);
  color: #fff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent);
}
.tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  flex: none;
}

/* 2-Column Content Grid */
.tab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}
.tab-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 760px) { .tab-grid { grid-template-columns: 1fr; } }

.app-window .card {
  background: color-mix(in srgb, var(--card) 78%, #070b14);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}
.post-card, .diary-card, .photo-card, .msg-card, .trash-card { display: flex; flex-direction: column; gap: 6px; }
.post-head { display: flex; align-items: center; gap: 8px; }
.post-ava { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--accent); object-fit: cover; }
.post-time { font-size: 12px; margin-left: auto; }
.post-body, .diary-body, .photo-cap, .msg-body { font-size: 14.5px; line-height: 1.45; color: #f1f5f9; }
.post-meta { font-size: 12px; }
.diary-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.diary-pg {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
}
.diary-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.diary-nav .mini { min-height: 30px; padding: 4px 10px; font-size: 12.5px; }
.diary-dots { display: flex; gap: 5px; }
.diary-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); display: block; }
.diary-dots i.on { background: var(--accent); }
.pulse-next { border-color: color-mix(in srgb, var(--accent) 55%, rgba(255, 255, 255, 0.2)); }
.photo-shot { width: 100%; height: 132px; object-fit: cover; object-position: top center; border-radius: 9px; display: block; }
.permit-bar, .compare-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.msg-from { font-size: 13px; color: var(--accent); }
.sticky-card, .redact-card { display: grid; gap: 8px; }

/* Juicy Clickable Clues */
.clue, .clue.herring {
  background: rgba(56, 189, 248, 0.16);
  color: #bae6fd;
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 7px;
  padding: 1px 7px;
  min-height: 24px;
  margin: 0 2px;
  font-weight: 600;
  font-size: inherit;
  display: inline-flex;
  align-items: center;
  transition: background 130ms ease, border-color 130ms ease, box-shadow 130ms ease, transform 100ms ease;
}
.clue:hover, .clue.herring:hover {
  background: rgba(56, 189, 248, 0.28);
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
  transform: translateY(-1px);
}
.clue.hot:not(.on) {
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.75);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.35);
}
.clue.on {
  background: rgba(34, 197, 94, 0.22);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.72);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.22);
}
.level-1 .clue:not(.on) { animation: clue-pulse 1.9s ease-in-out infinite; }
@keyframes clue-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.35); }
  50% { box-shadow: 0 0 0 4px rgba(56, 189, 248, 0); }
}

/* Right Hacker Console */
.dock {
  background: var(--ui-panel);
  border: 1px solid var(--ui-border);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
}
body.cos-yarn .dock { box-shadow: inset 0 0 0 3px #e7a0b8, 0 18px 42px rgba(0, 0, 0, 0.45); }
body.cos-slice .dock { box-shadow: inset 0 0 0 3px #ef6a3c, 0 18px 42px rgba(0, 0, 0, 0.45); }
body.cos-sprout .dock { box-shadow: inset 0 0 0 3px #3d9a5b, 0 18px 42px rgba(0, 0, 0, 0.45); }

.coach-card { padding: 8px 10px; font-size: 13.5px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.byte-line { display: flex; align-items: center; gap: 12px; flex: none; }
.byte-frame {
  position: relative;
  flex: none;
  width: 76px;
  height: 76px;
  border-radius: 16px;
  padding: 3px;
  background: #0b1222;
  border: 2px solid #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.28);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.byte-frame.glow-green { border-color: #22c55e; box-shadow: 0 0 20px rgba(34, 197, 94, 0.45); }
.byte-frame.glow-amber { border-color: #f59e0b; box-shadow: 0 0 20px rgba(245, 158, 11, 0.45); }
.byte-frame.glow-red { border-color: #ef4444; box-shadow: 0 0 20px rgba(239, 68, 68, 0.5); }
.byte-frame .byte-face { width: 100%; height: 100%; border-radius: 12px; display: block; object-fit: cover; }
.byte-tag {
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  background: #0b1222;
  color: #7ef9ff;
  border: 1px solid rgba(126, 249, 255, 0.45);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 1px 6px;
  border-radius: 999px;
}
.quip-wrap { flex: 1; min-width: 0; position: relative; }
.quip {
  position: relative;
  background: #192540;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 13px;
  padding: 9px 12px;
  font-size: 14px;
  line-height: 1.35;
  color: #f1f5f9;
}
.quip::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: #192540;
  border-left: 1px solid rgba(148, 163, 184, 0.22);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

/* Password Slots & Input */
.console-input-zone {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(8, 13, 26, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 13px;
  padding: 10px 11px;
}
.pattern-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pattern-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.pattern-meta { font-size: 12.5px; color: #94a3b8; font-weight: 600; }
.len-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}
.len-pill.ok { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.len-pill.over { background: rgba(239, 68, 68, 0.22); color: #fca5a5; }

.radar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px 2px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex: none;
}
.radar svg { width: 22px; height: 22px; }
.ring-bg { fill: none; stroke: #22c55e; stroke-width: 6px; opacity: 0.35; }
.ring {
  fill: none;
  stroke: #ef4444;
  stroke-width: 6px;
  stroke-dasharray: 176;
  stroke-dashoffset: calc(176 * (1 - var(--miss) / 3));
  transform-origin: 36px 36px;
  transition: stroke-dashoffset 0.35s;
  transform: rotate(-90deg);
}
.radar-lbl { font-size: 12px; font-weight: 700; color: #cbd5e1; }
.radar.warn .radar-lbl { color: #fbbf24; }
.radar.danger .radar-lbl { color: #f87171; }

.pattern { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; cursor: text; }
.slot {
  width: 36px;
  height: 44px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: lowercase;
  border: 2px solid rgba(148, 163, 184, 0.34);
  background: rgba(30, 41, 59, 0.58);
  color: #f8fafc;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.slot.D { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.52); color: #fde68a; }
.slot.S { background: rgba(56, 189, 248, 0.12); border-color: rgba(56, 189, 248, 0.52); color: #7dd3fc; }
.slot.filled { background: rgba(56, 189, 248, 0.16); border-color: #38bdf8; color: #fff; }
.slot.D.filled { background: rgba(245, 158, 11, 0.22); border-color: #fbbf24; color: #fef08a; }
.slot.revealed:not(.filled) { border-style: dashed; border-color: #4ade80; color: #86efac; }
.slot.filled.snapped { animation: slot-snap 220ms cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes slot-snap { 0% { transform: scale(0.82); } 60% { transform: scale(1.09); } 100% { transform: none; } }
.pattern.compact .slot { width: 30px; height: 38px; font-size: 1rem; border-radius: 8px; }
.pattern.dense .slot { width: 25px; height: 33px; font-size: 0.88rem; border-radius: 7px; }
.slot-overflow {
  padding: 2px 7px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.22);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #fca5a5;
}
.slot-legend { display: flex; gap: 12px; font-size: 11px; color: #94a3b8; }
.slot-legend span { display: inline-flex; align-items: center; gap: 4px; }
.slot-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.lg-L { background: rgba(148, 163, 184, 0.45); border: 1px solid rgba(148, 163, 184, 0.7); }
.lg-D { background: rgba(245, 158, 11, 0.45); border: 1px solid #fbbf24; }

.guess-row { display: flex; gap: 8px; align-items: stretch; }
.guess-row input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  background: #080d1a;
  color: #f8fafc;
  border: 1.5px solid rgba(148, 163, 184, 0.28);
  border-radius: 11px;
  padding: 0 12px;
  font-size: 16px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.guess-row input:focus { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18); }
.hack-btn { min-height: 46px; padding: 0 18px; font-size: 15px; flex: none; }

/* Clue Builder Tray */
.fusion-tray {
  flex: none;
  background: rgba(8, 13, 26, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 13px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tray-head, .log-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tray-title-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.console-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: #94a3b8; text-transform: uppercase; }
.tray-status { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.tray-status.green { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.tray-status.amber { background: rgba(245, 158, 11, 0.2); color: #fde68a; }
.tray-status.idle { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.tray-actions { display: flex; gap: 6px; }
.tiny-btn { min-height: 24px; padding: 2px 8px; font-size: 11.5px; border-radius: 7px; }
.tiles { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 36px; padding: 2px 0; }
.tray-empty { font-size: 12.5px; color: #64748b; font-style: italic; }
.fusion-plus { font-weight: 800; color: #64748b; font-size: 14px; user-select: none; }
.tile {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 6px 4px 10px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.42);
  color: #e0f2fe;
  font-size: 13.5px;
  font-weight: 600;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.tile.green { background: rgba(34, 197, 94, 0.2); border-color: #22c55e; color: #bbf7d0; box-shadow: 0 0 10px rgba(34, 197, 94, 0.2); }
.tile.amber { background: rgba(245, 158, 11, 0.2); border-color: #f59e0b; color: #fde68a; }
.tile.sel { outline: 2px solid #fbbf24; box-shadow: 0 0 12px rgba(251, 191, 36, 0.4); }
.tile-x {
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  font-size: 14px;
  line-height: 1;
  display: inline-grid;
  place-items: center;
}
.tile-x:hover { background: rgba(239, 68, 68, 0.78); color: #fff; }

/* Instant Hints + Floating Gadgets Popover */
.assist-wrap { position: relative; flex: none; display: flex; flex-direction: column; gap: 6px; }
.tut-dock .assist-wrap { display: none; }
.assist-row { display: flex; align-items: center; gap: 8px; }
.hint-btn, .gadget-btn {
  flex: 1;
  min-height: 36px;
  padding: 5px 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.gadget-btn.open { border-color: #38bdf8; background: rgba(56, 189, 248, 0.18); }
.undo-btn { min-height: 36px; min-width: 38px; padding: 5px 9px; font-size: 14px; }
.hint-pips { display: inline-flex; align-items: center; gap: 3px; }
.pip {
  width: 8px;
  height: 11px;
  border-radius: 2.5px;
  display: inline-block;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.pip.on { background: #4ade80; border-color: #86efac; box-shadow: 0 0 6px rgba(74, 222, 128, 0.55); }

.hint-callouts { display: flex; flex-direction: column; gap: 4px; }
.hint-callout {
  font-size: 12.5px;
  line-height: 1.35;
  padding: 6px 9px;
  border-radius: 9px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.28);
  color: #fde68a;
}

.gadgets-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 25;
  background: #162238;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 14px;
  padding: 11px 12px;
  display: grid;
  gap: 7px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.72);
}
.gadget-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  text-align: left;
  transition: background 120ms ease, border-color 120ms ease;
}
.gadget-item:hover { background: rgba(56, 189, 248, 0.14); border-color: rgba(56, 189, 248, 0.45); }
.gadget-item.empty { opacity: 0.55; }
.gadget-info { display: grid; gap: 1px; }
.gadget-info strong { font-size: 13.5px; }
.gadget-info .muted { font-size: 11.5px; line-height: 1.25; }
.gadget-count {
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: #bae6fd;
  flex: none;
}
.facts-check-list { display: grid; gap: 5px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.fact-btn { text-align: left; font-size: 12.5px; }

/* Past Attempts Log */
.attempts-log {
  flex: 1;
  min-height: 84px;
  background: rgba(8, 13, 26, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 13px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
.log-count { font-size: 11px; color: #64748b; }
.log-empty { font-size: 12.5px; color: #64748b; margin-top: 4px; }
.log-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
.attempt-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.attempt-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.attempt-chars { display: flex; flex-wrap: wrap; gap: 3px; min-width: 0; }
.att-ch {
  width: 21px;
  height: 23px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.att-ch.g { background: rgba(34, 197, 94, 0.28); border: 1px solid #22c55e; color: #bbf7d0; }
.att-ch.y { background: rgba(245, 158, 11, 0.28); border: 1px solid #f59e0b; color: #fde68a; }
.att-ch.b { background: rgba(71, 85, 105, 0.35); border: 1px solid rgba(148, 163, 184, 0.25); color: #cbd5e1; }
.att-plain { font-size: 12.5px; color: #e2e8f0; }
.att-badge { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; padding: 2px 7px; border-radius: 999px; flex: none; }
.att-badge.near, .att-badge.decoy, .att-badge.joke { background: rgba(245, 158, 11, 0.18); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.35); }
.att-badge.miss { background: rgba(239, 68, 68, 0.16); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.32); }
.att-badge.hit { background: rgba(34, 197, 94, 0.2); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.4); }
.attempt-note { font-size: 12px; color: #94a3b8; line-height: 1.3; }

/* Stamp & Guard Modals */
.overlay, .guard {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(5, 8, 16, 0.78);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 16px;
}
.stamp-card, .guard-card {
  width: min(440px, 100%);
  background: #162238;
  color: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 12px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.65);
}
.stamp-head { display: flex; align-items: center; gap: 12px; }
.stamp-ava { width: 60px; height: 60px; border-radius: 14px; object-fit: cover; object-position: top center; border: 2px solid #38bdf8; flex: none; }
.stamp-meta { display: grid; gap: 2px; }
.stamp-kicker { font-family: 'Press Start 2P', monospace; font-size: 10px; line-height: 1.4; }
.warrant .stamp-kicker { color: #fbbf24; }
.recovery .stamp-kicker { color: #4ade80; }
.stamp-mission { font-size: 15.5px; line-height: 1.4; }
.stamp-note { font-size: 13px; }

/* Tutorial Spotlight & Flying Clue */
.tut { z-index: 35; pointer-events: none; position: fixed; inset: 0; }
.tut-hole { pointer-events: none; border-radius: 14px; position: fixed; box-shadow: 0 0 0 9999px rgba(5, 8, 16, 0.62); }
.tut-hand { pointer-events: none; z-index: 36; filter: drop-shadow(2px 3px #0d1117); width: 46px; height: auto; animation: 1s ease-in-out infinite tut-bob; position: fixed; }
.tut-hand.drag { animation: 1.15s ease-in-out infinite tut-drag; }
.tut-bubble {
  z-index: 36;
  color: #f6f3ec;
  pointer-events: none;
  background: #1e293b;
  border: 1px solid rgba(56, 189, 248, 0.55);
  border-radius: 13px;
  max-width: 248px;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.35;
  position: fixed;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}
.tut-skip {
  color: #7dd3fc;
  pointer-events: auto;
  background: transparent;
  border: 0;
  min-height: 0;
  margin-top: 6px;
  margin-left: 8px;
  padding: 0;
  font-size: 13.5px;
  font-weight: 700;
  display: inline-block;
}
.tut-target { z-index: 38; border-radius: 10px; animation: 1.1s ease-in-out infinite tut-pulse; position: relative; }
@keyframes tut-bob { 50% { transform: translateY(6px); } }
@keyframes tut-drag { 0%, 20% { transform: translate(0); } 70%, to { transform: translate(var(--dx), var(--dy)); } }
@keyframes tut-pulse { 50% { box-shadow: 0 0 0 3px #7ef9ff; } }

.fly-clue, .pop-bit { z-index: 50; pointer-events: none; position: fixed; }
.fly-clue { color: #1a120c; background: #fde68a; border-radius: 10px; padding: 4px 8px; font-weight: 700; transition: left 0.4s, top 0.4s; }
.pop-bit { border-radius: 2px; width: 8px; height: 8px; animation: 0.55s ease-out forwards pop; }
@keyframes pop { to { transform: translate(var(--dx), -36px); opacity: 0; } }

/* Mobile & Tablet Fallbacks */
@media (max-width: 999px) {
  .play { height: auto; min-height: 100dvh; overflow: auto; }
  .play-grid { display: flex; flex-direction: column; padding: 10px; gap: 10px; }
  .app-window, .profile-col { overflow: visible; }
  .dock { height: auto; max-height: none; overflow: visible; }
  .attempts-log { max-height: 200px; }
}
@media (max-width: 540px) {
  .profile-hero { grid-template-columns: 1fr; }
  .hero-art, .hero-portrait { width: 110px; height: 110px; }
  .facts-inline { grid-template-columns: 1fr; }
  .play-topbar { padding: 0 10px; }
  .case-pill { font-size: 11.5px; padding: 3px 8px; }
}
