css
/* ═══════════════════════════════════════════
   ONE YEAR AGO — Global Styles
   Tone: melancholic, cinematic, restrained
═══════════════════════════════════════════ */

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

body {
  background: #060608;
  overflow: hidden;
  font-family: 'Courier New', monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#gc {
  position: relative;
  width: 480px;
  height: 640px;
  max-width: 100vw;
  max-height: 100vh;
  overflow: hidden;
}

/* ── TITLE SCREEN ─────────────────────────── */

#title-screen {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: #060608;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.t-eyebrow {
  font-size: 10px;
  color: #ffffff; /* Changed to bright white */
  letter-spacing: 5px;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.t-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 52px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 6px;
  margin-bottom: 12px;
}

.t-one  { color: #d8d5d0; }
.t-year {
  color: #b02020;
  text-shadow: 0 0 60px rgba(176, 32, 32, 0.45);
}
.t-ago  { color: #d8d5d0; }

.t-tagline {
  font-size: 10px;
  color: #cccccc; /* Changed to a visible light gray */
  letter-spacing: 3px;
  margin-bottom: 56px;
  margin-top: 8px;
}

#start-btn {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #3a3a3a;
  letter-spacing: 4px;
  border: 1px solid #1e1e1e;
  padding: 12px 36px;
  background: transparent;
  cursor: pointer;
  text-transform: lowercase;
  transition: all 0.3s ease;
  animation: pulse 2.4s infinite;
}

#start-btn:hover {
  color: #d8d5d0;
  border-color: #444;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* ── CHAPTER CARD ─────────────────────────── */

#chapter-card {
  position: absolute;
  inset: 0;
  background: #060608;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 90;
  gap: 12px;
}

.cc-eyebrow {
  font-size: 10px;
  color: #b02020;
  letter-spacing: 5px;
  text-transform: uppercase;
}

.cc-rule {
  width: 44px;
  height: 1px;
  background: #b02020;
  opacity: 0.6;
}

.cc-title {
  font-size: 24px;
  color: #d8d5d0;
  letter-spacing: 4px;
  font-weight: 700;
}

/* ── NARRATION OVERLAY ────────────────────── */
/* San's inner monologue — plain text on black */

#narration {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
  pointer-events: none;
  transition: background 0.4s ease;
}

#narration.active {
  background: rgba(0, 0, 0, 0.92);
}

#narration-text {
  font-size: 12px;
  color: #999;
  text-align: center;
  line-height: 2.2;
  letter-spacing: 1px;
  opacity: 0;
  max-width: 320px;
  white-space: pre-line;
  transition: opacity 0.7s ease;
}

#narration-text.visible {
  opacity: 1;
}

/* ── DIALOGUE BOX — Blasphemous style ────── */

#dialogue-box {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #070709;
  border-top: 2px solid #b02020;
  display: none;
  z-index: 80;
  min-height: 148px;
}

#dlg-inner {
  display: flex;
  min-height: 148px;
}

/* Portrait column */
#dlg-portrait-wrap {
  width: 108px;
  min-height: 148px;
  background: #0c0c11;
  border-right: 1px solid #161618;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

#speaker-name {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: #b02020;
  font-size: 8px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  text-align: center;
  padding: 4px 2px;
  font-weight: 700;
}

#dlg-portrait {
  width: 108px;
  height: 124px;
  display: block;
  image-rendering: pixelated;
}

/* Text column */
#dlg-content {
  flex: 1;
  padding: 16px 18px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#dialogue-text {
  font-size: 12px;
  color: #c8c8c8;
  line-height: 1.85;
  letter-spacing: 0.3px;
  min-height: 68px;
}

/* Choices */
#dlg-choices {
  display: none;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.dlg-choice {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #484848;
  cursor: pointer;
  padding: 3px 0 3px 18px;
  position: relative;
  transition: color 0.15s ease;
  border: none;
  background: none;
  text-align: left;
  width: 100%;
  letter-spacing: 0.5px;
}

.dlg-choice::before {
  content: '▶';
  position: absolute;
  left: 2px;
  color: #b02020;
  font-size: 8px;
  top: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.dlg-choice:hover {
  color: #d8d5d0;
}

.dlg-choice:hover::before {
  opacity: 1;
}

/* Continue prompt */
#continue {
  font-size: 9px;
  color: #2e2e2e;
  text-align: right;
  margin-top: 8px;
  letter-spacing: 1px;
  animation: pulse 1.8s infinite;
}

/* ── PHONE UI ─────────────────────────────── */

#phone-ui {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.hidden {
  display: none !important;
}

#phone-frame {
  width: 264px;
  height: 500px;
  background: #080810;
  border: 1.5px solid #1a1a22;
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
}

#phone-header {
  height: 48px;
  background: #0e0e16;
  border-bottom: 1px solid #16161e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  flex-shrink: 0;
}

#phone-back {
  color: #444;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s;
}

#phone-back:hover {
  color: #888;
}

#phone-contact {
  font-size: 18px;
  letter-spacing: 1px;
}

#chat-window {
  flex:           1;
  width:          100%;
  padding:        12px 14px;
  overflow-y:     auto; /* Change from hidden to auto to allow scrolling */
  display:        flex;
  flex-direction: column;
  gap:            8px;
  background:     #0c0c11;
  
  /* Critical touch scroll optimization for mobile browsers */
  -webkit-overflow-scrolling: touch; 
  touch-action: pan-y; 
}

/* Message bubbles */
.msg-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.msg-wrap.sent {
  align-items: flex-end;
}

.msg-wrap.received {
  align-items: flex-start;
}

.msg-bubble {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  padding: 10px 13px;
  border-radius: 16px;
  max-width: 200px;
}

.msg-wrap.sent .msg-bubble {
  background: #1a1a28;
  color: #c0bdb8;
  border-bottom-right-radius: 4px;
}

.msg-wrap.received .msg-bubble {
  background: #14141c;
  color: #d8d5d0;
  border-bottom-left-radius: 4px;
}

.msg-time {
  font-size: 9px;
  color: #333;
  letter-spacing: 1px;
  padding: 0 4px;
}

/* The last message — "see ya :)" */
.msg-final .msg-bubble {
  color: #c8a8a8;
}

#phone-footer {
  height: 36px;
  background: #0e0e16;
  border-top: 1px solid #16161e;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#phone-close-hint {
  font-size: 9px;
  color: #282828;
  letter-spacing: 2px;
  animation: pulse 2s infinite;
}

/* ── MEMORY FLASH ─────────────────────────── */
/* Warm white — not cold, not blue */

#memory-flash {
  position: absolute;
  inset: 0;
  background: #f0ede8;
  opacity: 0;
  pointer-events: none;
  z-index: 180;
}

/* ── INTERACT HINT ────────────────────────── */

#interact-hint {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.88);
  border: 1px solid #1e1e1e;
  font-size: 9px;
  color: #444;
  letter-spacing: 2px;
  padding: 5px 12px;
  display: none;
  z-index: 60;
  text-transform: uppercase;
  white-space: nowrap;
  animation: pulse 2s infinite;
}

/* ── HUD ──────────────────────────────────── */

#hud {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 60;
}

.hidden { display: none !important; }

#btn-journal,
#btn-phone {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #1e1e1e;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: border-color 0.2s;
}

#btn-journal:hover,
#btn-phone:hover {
  border-color: #444;
}

/* ── MOBILE DPAD ──────────────────────────── */

#dpad {
  position: absolute;
  bottom: 58px;
  left: 14px;
  z-index: 60;
}

#dpad-grid {
  display: grid;
  grid-template-columns: 44px 44px 44px;
  grid-template-rows: 44px 44px 44px;
  gap: 3px;
}

.dp-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.35);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: background 0.1s, border-color 0.1s;
}

.dp-btn.on,
.dp-btn:active {
  background: rgba(176, 32, 32, 0.25);
  border-color: rgba(176, 32, 32, 0.45);
}

.dp-empty {
  background: transparent;
  pointer-events: none;
}

#dp-act {
  position: absolute;
  bottom: 58px;
  right: 14px;
  width: 56px;
  height: 56px;
  background: rgba(176, 32, 32, 0.12);
  border: 1px solid rgba(176, 32, 32, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(176, 32, 32, 0.7);
  font-size: 11px;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
  cursor: pointer;
  z-index: 60;
  touch-action: none;
}


/* ── PHONE: RETRIEVING / CORRUPTED STATE ─────────────── */

.msg-retrieving {
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  gap:             10px;
  padding:         40px 20px;
  flex:            1;
}

.ret-icon {
  font-size:   22px;
  color:       #b02020;
  opacity:     0.7;
  animation:   pulse 1.2s infinite;
}

.ret-title {
  font-size:      10px;
  color:          #444;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.ret-sub {
  font-size:      9px;
  color:          #2a2a2a;
  letter-spacing: 2px;
  animation:      pulse 1.8s infinite;
}

.ret-bar {
  width:         180px;
  height:        2px;
  background:    #141414;
  border:        1px solid #222;
  margin-top:    8px;
  overflow:      hidden;
}

.ret-fill {
  height:     100%;
  width:      0%;
  background: #b02020;
  transition: width 0.036s linear;
}

/* ── PHONE: RECOVERED NOTICE ─────────────────────────── */

.msg-recovered {
  font-size:      9px;
  color:          #b02020;
  letter-spacing: 2px;
  text-align:     center;
  padding:        10px 0 14px;
  opacity:        0.7;
  animation:      pulse 2s infinite;
}

/* ── PHONE: HUD BADGE ────────────────────────────────── */

#btn-phone {
  position: relative;
}

#phone-badge {
  position:      absolute;
  top:           -4px;
  right:         -4px;
  width:         8px;
  height:        8px;
  border-radius: 50%;
  background:    #b02020;
  display:       block;
}

#phone-badge.badge-pulse {
  animation: badge-ping 1.4s ease-in-out infinite;
}

@keyframes badge-ping {
  0%,100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.5); opacity: 0.6; }
}

/* ── PHONE: TOAST NOTIFICATION ───────────────────────── */

#phone-toast {
  position:       absolute;
  top:            12px;
  left:           50%;
  transform:      translateX(-50%);
  background:     rgba(6, 6, 8, 0.94);
  border:         1px solid #b02020;
  color:          #b02020;
  font-size:      9px;
  letter-spacing: 2px;
  padding:        7px 18px;
  white-space:    nowrap;
  z-index:        250;
  pointer-events: none;
  opacity:        0;
  transition:     opacity 0.4s ease;
}

#phone-toast.toast-show { opacity: 1; }
#phone-toast.toast-hide { opacity: 0; }
