@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=VT323&display=swap');

:root {
  --pink: #ff6eb4;
  --dark-pink: #3b001f;
  --lavender: #c9a0ff;
  --red: #ff2222;
  --bg: #080408;
  --xp-grey: #d4d0c8;
  --xp-white: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--pink);
  font-family: 'Share Tech Mono', monospace;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  cursor: default;
  user-select: none;
}

.phase { position: fixed; inset: 0; transition: opacity 0.6s; }
.phase.hidden { opacity: 0; pointer-events: none; }

/* ── BOOT ── */
#phase-boot {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}
#phase-boot .logo {
  font-family: 'VT323', monospace;
  font-size: clamp(40px, 10vw, 90px);
  color: var(--pink);
  text-shadow: 0 0 20px var(--pink), 0 0 60px #ff6eb466;
  letter-spacing: 8px;
}
#phase-boot .sub { font-size: 14px; color: #555; letter-spacing: 4px; }
.bios-lines {
  position: absolute;
  top: 0; left: 0;
  font-size: 12px;
  color: #666;
  padding: 8px 12px;
  line-height: 1.6;
  white-space: pre;
}
#boot-bar-wrap {
  width: 300px; height: 6px;
  background: #111; border: 1px solid #333;
  margin-top: 20px; overflow: hidden;
}
#boot-bar {
  height: 100%; width: 0%;
  background: var(--pink);
  box-shadow: 0 0 8px var(--pink);
  transition: width 0.1s linear;
}
#boot-status { font-size: 11px; color: #444; margin-top: 6px; letter-spacing: 2px; }

/* ── SCANLINES & CRT ── */
.scanlines {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 9998;
  background: repeating-linear-gradient(to bottom, transparent, transparent 2px, rgba(0,0,0,0.08) 2px, rgba(0,0,0,0.08) 4px);
}
.crt::after {
  content: '';
  position: fixed; inset: 0; z-index: 9997;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.65) 100%);
  pointer-events: none;
}

/* ── TERMINAL ── */
#phase-terminal { background: #0d080d; display: flex; flex-direction: column; }
.term-header {
  background: #110811;
  border-bottom: 1px solid #1a0a1a;
  padding: 6px 14px; font-size: 11px; color: #555;
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.term-dot { width: 10px; height: 10px; border-radius: 50%; }
.term-dot.red    { background: #ff5f57; }
.term-dot.yellow { background: #febc2e; }
.term-dot.green  { background: #28c840; }
#term-output {
  flex: 1; overflow-y: auto;
  padding: 14px 18px;
  font-size: clamp(12px, 1.5vw, 14px);
  line-height: 1.65; scroll-behavior: smooth;
}
#term-output::-webkit-scrollbar { width: 4px; }
#term-output::-webkit-scrollbar-track { background: #0d080d; }
#term-output::-webkit-scrollbar-thumb { background: #2a1020; }
.term-line { display: block; margin-bottom: 2px; }
.term-line.prompt  { color: #555; }
.term-line.info    { color: var(--pink); }
.term-line.warn    { color: var(--lavender); }
.term-line.error   { color: var(--red); }
.term-line.success { color: #ff9ed2; }
.term-line.system  { color: #888; }
.term-line.troll   { color: #ffb3e6; }
.term-line.art     { color: var(--pink); white-space: pre; font-family: 'VT323', monospace; font-size: clamp(10px, 1.3vw, 13px); }
.term-line.user-input { color: #ffb3e6; }
.blink { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.term-input-row {
  display: flex; align-items: center;
  padding: 8px 18px 12px;
  border-top: 1px solid #1a0a1a; gap: 8px;
  flex-shrink: 0;
}
.term-prompt-label { color: var(--pink); font-size: 14px; flex-shrink: 0; }
#term-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: #ffb3e6; font-family: 'Share Tech Mono', monospace;
  font-size: 14px; caret-color: var(--pink);
}

#puzzle-hud {
  position: fixed; top: 10px; right: 14px;
  font-size: 11px; color: #333; text-align: right; z-index: 10; line-height: 1.8;
}
.hud-item { transition: color 0.3s; }
.hud-item.done   { color: #ff9ed2; }
.hud-item.active { color: var(--lavender); }

/* ── XP DESKTOP ── */
#phase-xp { font-family: 'Tahoma', 'Segoe UI', sans-serif; font-size: 11px; }
#xp-wallpaper {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 60%, #5a0a3a 0%, transparent 55%),
    radial-gradient(ellipse at 75% 30%, #2a0a3a 0%, transparent 50%),
    linear-gradient(160deg, #1a0818 0%, #2a0828 40%, #0a0410 100%);
  z-index: 0;
}
#xp-wallpaper .wp-text {
  position: absolute; bottom: 80px; left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: rgba(255,255,255,0.04);
  font-family: 'VT323', monospace;
  font-size: clamp(60px, 12vw, 140px);
  letter-spacing: 16px; pointer-events: none; white-space: nowrap;
}

#xp-desktop {
  position: absolute; inset: 0 0 40px 0; z-index: 1;
  padding: 10px; display: flex; flex-direction: column;
  flex-wrap: wrap; align-content: flex-start; gap: 6px;
}
.desktop-icon {
  display: flex; flex-direction: column; align-items: center;
  width: 72px; padding: 6px 4px; border-radius: 3px;
  cursor: pointer; transition: background 0.1s;
  color: #fff; text-shadow: 1px 1px 2px #000;
}
.desktop-icon:hover  { background: rgba(255,255,255,0.15); }
.desktop-icon:active { background: rgba(255,255,255,0.25); }
.desktop-icon .icon-img   { font-size: 36px; line-height: 1; margin-bottom: 4px; }
.desktop-icon .icon-label { font-size: 11px; text-align: center; line-height: 1.3; font-family: 'Tahoma', sans-serif; word-break: break-word; }

#xp-taskbar {
  position: absolute; bottom: 0; left: 0; right: 0; height: 40px;
  background: linear-gradient(180deg, #8e2a5a 0%, #6b1040 50%, #5a0a35 51%, #3a0820 100%);
  display: flex; align-items: center; z-index: 100;
  box-shadow: 0 -1px 0 #ff6eb4;
}
#start-btn {
  height: 36px;
  background: linear-gradient(180deg, #c45a8a 0%, #a03060 50%, #8a2050 51%, #6a1040 100%);
  border: 1px solid #c45a8a; border-radius: 0 12px 12px 0;
  color: #fff; font-weight: bold; font-family: 'Tahoma', sans-serif;
  font-size: 13px; padding: 0 14px 0 8px;
  display: flex; align-items: center; gap: 5px;
  cursor: pointer; flex-shrink: 0; margin-left: 2px;
}
#start-btn:hover { filter: brightness(1.2); }
.taskbar-windows { flex: 1; display: flex; gap: 3px; padding: 0 6px; overflow: hidden; }
.taskbar-win-btn {
  height: 28px; min-width: 100px; max-width: 160px;
  background: linear-gradient(180deg, #b04a7a 0%, #7a2050 100%);
  border: 1px solid #6a1a4a; border-radius: 3px;
  color: #fff; font-size: 11px; font-family: 'Tahoma', sans-serif;
  padding: 0 8px; cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.taskbar-win-btn.active { background: linear-gradient(180deg, #4a1030 0%, #7a2050 100%); border-color: #2a0820; }
#taskbar-clock {
  background: rgba(30,0,15,0.3); border-left: 1px solid rgba(255,255,255,0.2);
  color: #fff; font-family: 'Tahoma', sans-serif; font-size: 11px;
  padding: 0 10px; height: 100%; display: flex; align-items: center; flex-shrink: 0;
}

/* ── START MENU ── */
#start-menu {
  position: absolute; bottom: 40px; left: 0; width: 340px;
  background: #fff; border: 1px solid #300020;
  box-shadow: 3px 3px 8px rgba(0,0,0,0.5); z-index: 200; display: none;
}
#start-menu.open { display: block; }
.sm-header {
  background: linear-gradient(90deg, #8e1a4a 0%, #c45a8a 100%);
  color: #fff; padding: 12px 14px; display: flex; align-items: center; gap: 10px;
}
.sm-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #ff6eb4, #c9a0ff);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; border: 2px solid rgba(255,255,255,0.4); overflow: hidden;
}
.sm-username { font-weight: bold; font-size: 14px; font-family: 'Tahoma', sans-serif; }
.sm-body { display: flex; min-height: 200px; }
.sm-left { flex: 1; border-right: 2px solid #aaa; padding: 6px 0; }
.sm-right { width: 160px; background: #fce4f0; padding: 6px 0; }
.sm-item {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px;
  cursor: pointer; font-family: 'Tahoma', sans-serif; font-size: 12px; color: #000;
}
.sm-item:hover { background: #c45a8a; color: #fff; }
.sm-item .sm-icon { font-size: 20px; }
.sm-sep { border: none; border-top: 1px solid #aaa; margin: 4px 6px; }
.sm-footer {
  background: linear-gradient(90deg, #8e1a4a 0%, #c45a8a 100%);
  display: flex; justify-content: flex-end; gap: 6px; padding: 4px 8px;
}
.sm-footer-btn {
  display: flex; align-items: center; gap: 5px;
  color: #fff; font-family: 'Tahoma', sans-serif; font-size: 11px;
  cursor: pointer; padding: 3px 8px; border-radius: 3px;
}
.sm-footer-btn:hover { background: rgba(255,255,255,0.2); }

/* ── XP WINDOWS ── */
.xp-window {
  position: absolute; min-width: 280px;
  background: var(--xp-grey);
  border: 2px solid #888; border-top-color: #fff; border-left-color: #fff;
  box-shadow: 3px 3px 8px rgba(0,0,0,0.5);
  z-index: 50; display: none; flex-direction: column; resize: both; overflow: hidden;
}
.xp-window.open { display: flex; }
.xp-window.active { z-index: 60; }
.xp-titlebar {
  background: linear-gradient(180deg, #e87ab0 0%, #b03070 50%, #8e1a55 51%, #6a0840 100%);
  color: #fff; padding: 3px 6px; display: flex; align-items: center; gap: 6px;
  cursor: move; flex-shrink: 0; user-select: none;
}
.xp-titlebar .win-icon  { font-size: 14px; }
.xp-titlebar .win-title { flex: 1; font-family: 'Tahoma', sans-serif; font-size: 12px; font-weight: bold; }
.xp-win-btns { display: flex; gap: 2px; }
.xp-win-btn {
  width: 20px; height: 18px; border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.3); font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-family: 'Tahoma', sans-serif; font-weight: bold; color: #fff;
}
.xp-win-btn.min-btn   { background: linear-gradient(180deg, #e87ab0 0%, #b03070 100%); }
.xp-win-btn.max-btn   { background: linear-gradient(180deg, #e87ab0 0%, #b03070 100%); }
.xp-win-btn.close-btn { background: linear-gradient(180deg, #e8504a 0%, #b81010 100%); }
.xp-win-btn:hover { filter: brightness(1.3); }
.xp-menubar {
  background: var(--xp-grey); border-bottom: 1px solid #999;
  padding: 2px 6px; display: flex; gap: 2px; flex-shrink: 0;
}
.xp-menu-item { padding: 2px 8px; font-family: 'Tahoma', sans-serif; font-size: 11px; cursor: pointer; border-radius: 2px; }
.xp-menu-item:hover { background: #c45a8a; color: #fff; }
.xp-content {
  flex: 1; overflow: auto; background: #fff;
  padding: 12px 14px; font-family: 'Tahoma', sans-serif;
  font-size: 12px; line-height: 1.7; color: #000;
}
.xp-content::-webkit-scrollbar { width: 16px; }
.xp-content::-webkit-scrollbar-track { background: #d4d0c8; border-left: 1px solid #999; }
.xp-content::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #e8e0d0 0%, #c0b8a8 100%);
  border: 1px solid #888; border-radius: 1px;
}
.xp-statusbar {
  background: var(--xp-grey); border-top: 1px solid #999;
  padding: 2px 8px; font-size: 11px; color: #444;
  font-family: 'Tahoma', sans-serif; display: flex; gap: 12px; flex-shrink: 0;
}
.xp-statusbar span { border-right: 1px solid #999; padding-right: 12px; }
.xp-terminal-content {
  background: #000; color: #ff6eb4;
  font-family: 'Share Tech Mono', monospace; font-size: 12px;
  padding: 8px; flex: 1; overflow: auto; line-height: 1.5;
}

/* ── WINDOW CONTENT HELPERS ── */
.win-h1 { font-size: 18px; font-weight: bold; color: #8e1a55; margin-bottom: 8px; border-bottom: 2px solid #e87ab0; padding-bottom: 4px; }
.win-h2 { font-size: 14px; font-weight: bold; color: #c45a8a; margin: 12px 0 4px; }
.win-p  { margin-bottom: 8px; }
.win-tag {
  display: inline-block; background: #fce4f0; border: 1px solid #e87ab0;
  border-radius: 3px; padding: 1px 7px; font-size: 11px; margin: 2px; color: #5a0a35;
}
.stack-card { border: 1px solid #e8c0d8; background: #fef0f8; padding: 8px 10px; margin-bottom: 6px; border-radius: 3px; }
.stack-name { font-weight: bold; color: #8e1a55; }
.stack-spec { color: #666; font-size: 11px; }
.troll-box { background: #fff8fd; border: 1px solid #e8c0d8; padding: 8px 10px; border-radius: 3px; margin-bottom: 8px; }
.err-dialog { display: flex; gap: 10px; align-items: flex-start; }
.err-icon { font-size: 30px; flex-shrink: 0; }
.err-text { font-family: 'Tahoma', sans-serif; font-size: 12px; }
.err-btn-row { margin-top: 12px; display: flex; gap: 6px; justify-content: center; }
.err-btn {
  padding: 4px 18px; background: var(--xp-grey);
  border: 2px solid #888; border-top-color: #fff; border-left-color: #fff;
  font-family: 'Tahoma', sans-serif; font-size: 12px; cursor: pointer;
}
.err-btn:hover { background: #fce4f0; }
.err-btn:active { border-top-color: #888; border-left-color: #888; border-bottom-color: #fff; border-right-color: #fff; }

/* ── EFFECTS ── */
@keyframes glitch {
  0%   { clip-path: inset(30% 0 60% 0); transform: translate(-4px); }
  20%  { clip-path: inset(80% 0 10% 0); transform: translate(4px); }
  40%  { clip-path: inset(10% 0 80% 0); transform: translate(-2px); }
  60%  { clip-path: inset(50% 0 40% 0); transform: translate(2px); }
  80%  { clip-path: inset(5%  0 90% 0); transform: translate(-3px); }
  100% { clip-path: inset(30% 0 60% 0); transform: translate(0); }
}
.glitch-text { position: relative; }
.glitch-text::before, .glitch-text::after {
  content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%;
}
.glitch-text::before { color: #ff0044; animation: glitch 0.4s infinite; opacity: 0.7; }
.glitch-text::after  { color: #ffb3e6; animation: glitch 0.4s 0.2s infinite; opacity: 0.7; }

#access-flash {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--pink);
  display: flex; align-items: center; justify-content: center;
  font-family: 'VT323', monospace; font-size: clamp(50px, 12vw, 120px);
  color: #000; letter-spacing: 10px;
  pointer-events: none; opacity: 0; transition: opacity 0.15s;
}
#access-flash.show { opacity: 1; }
#matrix-canvas {
  position: fixed; inset: 0; z-index: 9990;
  pointer-events: none; opacity: 0; transition: opacity 0.5s;
}
#matrix-canvas.show { opacity: 0.85; pointer-events: auto; }
#tooltip {
  position: fixed; background: #fff8fd; border: 1px solid #e87ab0;
  padding: 3px 8px; font-family: 'Tahoma', sans-serif; font-size: 11px;
  pointer-events: none; z-index: 9999; display: none;
}

/* ── MOBILE HIDDEN BY DEFAULT ── */
#mob-term-statusbar { display: none; }
#mob-term-appbar    { display: none; }
#mob-home-indicator-term { display: none; }
#mob-send-btn       { display: none; }
#mobile-phone       { display: none; }
#mobile-overlay     { display: none; }
#phone-hero         { display: none; }

/* ════════════════════════════════════════
   MOBILE STYLES
════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Terminal: phone look ── */
  .term-header { display: none; }

  #mob-term-statusbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 22px 6px;
    background: #0d080d;
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    font-family: 'Share Tech Mono', monospace;
    flex-shrink: 0;
  }
  .mob-status-icons {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
  }

  #mob-term-appbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 16px 10px;
    background: rgba(255, 110, 180, 0.06);
    border-bottom: 1px solid rgba(255, 110, 180, 0.14);
    color: var(--pink);
    font-size: 13px;
    letter-spacing: 3px;
    font-family: 'Share Tech Mono', monospace;
    flex-shrink: 0;
  }
  #mob-term-appbar i { font-size: 17px; }

  #mob-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pink);
    border: none;
    color: #000;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 17px;
    flex-shrink: 0;
    transition: opacity 0.15s;
  }
  #mob-send-btn:active { opacity: 0.75; }

  #mob-home-indicator-term {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    background: #0d080d;
    flex-shrink: 0;
  }
  #mob-home-indicator-term::after {
    content: '';
    width: 120px;
    height: 4px;
    background: rgba(255, 110, 180, 0.28);
    border-radius: 2px;
  }

  #term-input     { font-size: 16px; }
  .term-input-row { padding: 10px 14px 14px; }
  #puzzle-hud     { top: 66px; right: 8px; font-size: 9px; line-height: 1.6; }

  /* ── XP phase: hide desktop, show phone ── */
  #xp-desktop, #xp-taskbar, #start-menu { display: none !important; }
  .xp-window { display: none !important; }

  /* ── Mobile phone home screen ── */
  #mobile-phone {
    display: flex;
    flex-direction: column;
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
      radial-gradient(ellipse at 30% 60%, #5a0a3a 0%, transparent 55%),
      radial-gradient(ellipse at 75% 30%, #2a0a3a 0%, transparent 50%),
      linear-gradient(160deg, #1a0818 0%, #2a0828 40%, #0a0410 100%);
    overflow: hidden;
  }

  #phone-statusbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 22px 4px;
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    font-family: 'Share Tech Mono', monospace;
    flex-shrink: 0;
  }
  .phone-status-icons {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
  }

  #phone-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0 18px;
    flex-shrink: 0;
  }
  .phone-time-large {
    font-family: 'VT323', monospace;
    font-size: clamp(52px, 18vw, 78px);
    color: rgba(255,255,255,0.92);
    letter-spacing: 4px;
    line-height: 1;
  }
  .phone-date-label {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    font-family: 'Share Tech Mono', monospace;
    margin-top: 4px;
    letter-spacing: 1px;
  }

  #phone-app-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px 6px;
    padding: 0 14px;
    align-content: start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .phone-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .phone-app-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    transition: transform 0.1s, opacity 0.1s;
  }
  .phone-app-icon i { font-size: 28px; }
  .phone-app:active .phone-app-icon {
    transform: scale(0.86);
    opacity: 0.8;
  }
  .phone-app-label {
    font-size: 10px;
    color: rgba(255,255,255,0.82);
    text-align: center;
    font-family: 'Share Tech Mono', monospace;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9);
    line-height: 1.2;
    max-width: 60px;
  }

  /* ── Dock ── */
  #phone-dock {
    margin: 10px 16px 6px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 26px;
    border: 1px solid rgba(255,255,255,0.12);
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-shrink: 0;
  }
  .phone-dock-app {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .dock-icon {
    width: 50px !important;
    height: 50px !important;
    border-radius: 14px !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3) !important;
  }
  .dock-icon i { font-size: 24px !important; }
  .phone-dock-app:active .dock-icon {
    transform: scale(0.86);
    opacity: 0.8;
  }

  #phone-home-bar {
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  #phone-home-bar::after {
    content: '';
    width: 120px;
    height: 4px;
    background: rgba(255,255,255,0.25);
    border-radius: 2px;
  }

  /* ── Mobile overlay (app open) ── */
  #mobile-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 9000;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  #mobile-overlay.mob-open { transform: translateY(0); }

  #mob-ov-header {
    background: linear-gradient(180deg, #e87ab0 0%, #8e1a55 100%);
    padding: 14px 14px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding-top: max(14px, env(safe-area-inset-top, 14px));
  }
  #mob-back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }
  #mob-back-btn i { font-size: 14px; }
  #mob-ov-title {
    flex: 1;
    text-align: center;
    font-family: 'Tahoma', sans-serif;
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 70px;
  }
  #mob-ov-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
  }
  #mob-ov-body .xp-content          { font-size: 13px; min-height: 100%; }
  #mob-ov-body .xp-terminal-content { min-height: 100%; font-size: 12px; }
}

/* ════════════════════════════════════════
   PHONE UNLOCK (mobile chat experience)
════════════════════════════════════════ */

/* Hidden by default — only used on mobile */
#phase-phone-unlock { display: none; }

@media (max-width: 768px) {
  /* Hide desktop terminal on mobile */
  #phase-terminal { display: none !important; }

  #phase-phone-unlock {
    display: flex;
    flex-direction: column;
    background: #080410;
  }

  /* Status bar */
  #pterm-statusbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 22px 6px;
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    font-family: 'Share Tech Mono', monospace;
    flex-shrink: 0;
    background: #080410;
  }
  .pterm-status-icons {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
  }

  /* App bar */
  #pterm-appbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 10px;
    background: rgba(255,110,180,0.06);
    border-bottom: 1px solid rgba(255,110,180,0.14);
    flex-shrink: 0;
  }
  .pterm-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6eb4, #c9a0ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
  }
  .pterm-app-info { flex: 1; }
  .pterm-app-name {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    color: var(--pink);
    letter-spacing: 1px;
  }
  .pterm-app-status {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    color: #50e3c2;
    margin-top: 1px;
  }

  /* Progress dots */
  .pterm-dots {
    display: flex;
    gap: 5px;
    align-items: center;
  }
  .pdot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,110,180,0.2);
    border: 1px solid rgba(255,110,180,0.3);
    transition: background 0.3s, box-shadow 0.3s;
  }
  .pdot.active {
    background: var(--pink);
    box-shadow: 0 0 6px var(--pink);
    animation: pulse-dot 1.2s ease-in-out infinite;
  }
  .pdot.done {
    background: var(--pink);
    border-color: var(--pink);
    animation: none;
  }
  @keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 4px var(--pink); }
    50%       { box-shadow: 0 0 10px var(--pink), 0 0 18px #ff6eb455; }
  }

  /* Chat output area */
  #phone-chat-output {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
  #phone-chat-output::-webkit-scrollbar { display: none; }

  /* Chat rows */
  .chat-row { display: flex; }
  .chat-row-bot  { justify-content: flex-start; }
  .chat-row-user { justify-content: flex-end; }

  /* Bubbles */
  .chat-bubble {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 18px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
  }
  .chat-bot {
    background: rgba(255,110,180,0.1);
    border: 1px solid rgba(255,110,180,0.22);
    color: #ffb3e6;
    border-bottom-left-radius: 4px;
  }
  .chat-user {
    background: var(--pink);
    color: #1a0010;
    border-bottom-right-radius: 4px;
    font-weight: 500;
  }
  .chat-error {
    background: rgba(255,30,30,0.1);
    border: 1px solid rgba(255,50,50,0.28);
    color: #ff6666;
    border-bottom-left-radius: 4px;
  }
  .chat-success {
    background: rgba(255,158,210,0.1);
    border: 1px solid rgba(255,158,210,0.28);
    color: #ff9ed2;
    border-bottom-left-radius: 4px;
  }
  .chat-troll {
    background: rgba(201,160,255,0.1);
    border: 1px solid rgba(201,160,255,0.25);
    color: var(--lavender);
    border-bottom-left-radius: 4px;
  }
  .chat-system {
    align-self: center;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    color: rgba(255,255,255,0.3);
    letter-spacing: 1px;
    text-align: center;
    padding: 2px 0;
  }

  /* Typing indicator */
  .chat-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: rgba(255,110,180,0.08);
    border: 1px solid rgba(255,110,180,0.18);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
  }
  .chat-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pink);
    opacity: 0.4;
    animation: typing-dot 1.2s ease-in-out infinite;
  }
  .chat-typing span:nth-child(2) { animation-delay: 0.2s; }
  .chat-typing span:nth-child(3) { animation-delay: 0.4s; }
  @keyframes typing-dot {
    0%, 60%, 100% { opacity: 0.4; transform: translateY(0); }
    30%           { opacity: 1;   transform: translateY(-4px); }
  }

  /* Input row */
  #pterm-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 12px;
    background: #080410;
    border-top: 1px solid rgba(255,110,180,0.1);
    flex-shrink: 0;
  }
  #pterm-input {
    flex: 1;
    background: rgba(255,110,180,0.07);
    border: 1px solid rgba(255,110,180,0.2);
    border-radius: 22px;
    padding: 10px 16px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: #ffb3e6;
    outline: none;
    caret-color: var(--pink);
  }
  #pterm-input::placeholder { color: rgba(255,110,180,0.35); }
  #pterm-input:focus { border-color: rgba(255,110,180,0.5); }

  #pterm-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--pink);
    border: none;
    color: #1a0010;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.15s, transform 0.1s;
  }
  #pterm-send-btn:active { opacity: 0.75; transform: scale(0.92); }

  /* Home bar */
  #pterm-home-bar {
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #080410;
    flex-shrink: 0;
  }
  #pterm-home-bar::after {
    content: '';
    width: 120px;
    height: 4px;
    background: rgba(255,110,180,0.25);
    border-radius: 2px;
  }
}
