/* =============================================================
   春娇与志明 — Cinematic Interactive Experience
   V4.0 HYPER-SENSORY NARRATIVE EDITION (2026-05-23)

   === CSS ARCHITECTURE ===
   - Variables: --beat-blur, --bass-shake, --edge-glow, --vignette-intensity
   - V4.0: --parallax-x/y, --micro-fog-blur/dim, --thermo-color-bottom/top
   - z-index layers: 0(bg) 1(bg-sharp) 2(doodle/smoke) 3(rain) 4(vignette/edges) 5(danmaku) 10(chat) 15(thermometer) 20(now-playing) 100(micro-overlay) 1000(lockscreen)
   - .bg-layer filter uses calc() for V4.0 micro-scene fog control

   === FULL DOCS: CLAUDE_PROJECT_GUIDE.md ===
   ============================================================= */

/* --- CSS Custom Properties --- */
:root {
  --bg-deep: #08090d;
  --aurora-green: #00F5D4;
  --lost-pink: #FF2A74;
  --text-primary: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.55);
  --bubble-male: rgba(0, 245, 212, 0.12);
  --bubble-female: rgba(255, 42, 116, 0.12);
  --beat-blur: 0;
  --bass-shake: 0;
  --edge-glow: 0;
  --vignette-intensity: 0.65;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #08090d;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang HK", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* Edge lighting — audio-reactive neon frame (left/right borders) */
body::before,
body::after {
  content: '';
  position: fixed;
  top: 0;
  bottom: 0;
  width: 7px;
  z-index: 4;
  pointer-events: none;
  opacity: var(--edge-glow, 0);
}

body::before {
  left: 0;
  background: linear-gradient(to right, rgba(0, 245, 212, 0.7), transparent);
  box-shadow: 0 0 50px rgba(0, 245, 212, 0.9), 6px 0 35px rgba(0, 245, 212, 0.45);
}

body::after {
  right: 0;
  background: linear-gradient(to left, rgba(255, 42, 116, 0.7), transparent);
  box-shadow: 0 0 50px rgba(255, 42, 116, 0.9), -6px 0 35px rgba(255, 42, 116, 0.45);
}

/* --- Background Layer: Rainy Hong Kong Car Window --- */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url('image_1.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(calc(4px + var(--micro-fog-blur, 0px))) brightness(calc(0.7 + var(--micro-fog-dim, 0)));
  transform: scale(1.05); /* Prevent blur edge bleeding */
}

/* Sharp background layer for foggy window wipe (mask reveals clear spots) */
.bg-layer-sharp {
  position: fixed;
  inset: 0;
  z-index: 1;
  background-image: url('image_1.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  --wipe-cx: 50%;
  --wipe-cy: 50%;
  --wipe-r: 0px;
  mask-image: radial-gradient(circle var(--wipe-r) at var(--wipe-cx) var(--wipe-cy), black 0%, black 35%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle var(--wipe-r) at var(--wipe-cx) var(--wipe-cy), black 0%, black 35%, transparent 70%);
}

/* =============================================================
   PHASE 1: Lock Screen
   ============================================================= */

#lockscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: radial-gradient(ellipse at center, #0d0f18 0%, #08090d 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 1s ease, filter 1s ease;
}

#lockscreen.dissolve {
  opacity: 0;
  filter: blur(20px);
  pointer-events: none;
}

.phone-frame {
  width: 320px;
  padding: 24px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Status Bar */
.status-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 48px;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.carrier {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Status Bar Icons — Realistic phone signal + battery */
.status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.signal-bars i {
  display: block;
  width: 2.5px;
  border-radius: 1px;
  background: var(--text-primary);
}

.signal-bars i:nth-child(1) { height: 4px; }
.signal-bars i:nth-child(2) { height: 6px; }
.signal-bars i:nth-child(3) { height: 9px; }
.signal-bars i:nth-child(4) { height: 12px; }

.battery-icon {
  width: 20px;
  height: 10px;
  border: 1.5px solid var(--text-primary);
  border-radius: 3px;
  position: relative;
  margin-left: 3px;
}

.battery-icon::before {
  content: '';
  position: absolute;
  right: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 5px;
  border-radius: 0 1px 1px 0;
  background: var(--text-primary);
}

.battery-icon::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  bottom: 2px;
  width: 12px;
  border-radius: 1px;
  background: var(--aurora-green);
  box-shadow: 0 0 4px rgba(0, 245, 212, 0.5);
}

.battery {
  color: var(--aurora-green);
  font-size: 10px;
  letter-spacing: 2px;
}

/* Time */
.time-display {
  font-size: 72px;
  font-weight: 200;
  color: var(--text-primary);
  letter-spacing: 2px;
  line-height: 1;
  margin-bottom: 6px;
  text-shadow: 0 0 60px rgba(255, 255, 255, 0.08);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.date-display {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 1px;
  margin-bottom: 56px;
}

/* Notification Badge — Frosted Glassmorphism */
.notification {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              border-color 0.3s ease,
              box-shadow 0.3s ease;
  animation: notif-float 4s ease-in-out infinite;
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 24px rgba(0, 0, 0, 0.3);
}

.notification:hover {
  transform: scale(1.02);
  border-color: rgba(0, 245, 212, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 4px 24px rgba(0, 0, 0, 0.3),
    0 0 36px rgba(0, 245, 212, 0.1);
}

.notification:active {
  transform: scale(0.97);
}

/* Notification avatar */
.notif-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--lost-pink), #ff6b9d);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-avatar span {
  color: white;
  font-size: 18px;
  font-weight: 600;
}

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.notif-sender {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.notif-time {
  font-size: 11px;
  color: var(--text-secondary);
}

.notif-message {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-text {
  display: inline-block;
  color: var(--aurora-green);
  text-shadow: 0 0 12px rgba(0, 245, 212, 0.5);
  animation: pulse-glow-green 2s ease-in-out infinite;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.message-text.flip {
  animation: flip-3d 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Lock hint */
.lock-hint {
  margin-top: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0.4;
}

.hint-line {
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.hint-text {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 2px;
}

/* Quick Action buttons — flashlight & camera */
.quick-actions {
  margin-top: 56px;
  display: flex;
  justify-content: center;
  gap: 36px;
}

.qa-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.qa-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.qa-btn:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.12);
}

/* --- Animations --- */

@keyframes notif-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes pulse-glow-green {
  0%, 100% {
    text-shadow: 0 0 12px rgba(0, 245, 212, 0.5);
  }
  50% {
    text-shadow: 0 0 24px rgba(0, 245, 212, 0.8), 0 0 48px rgba(0, 245, 212, 0.3);
  }
}

@keyframes flip-3d {
  0% {
    transform: perspective(500px) rotateZ(0deg) scale(1);
  }
  100% {
    transform: perspective(500px) rotateZ(180deg) scale(0.95);
  }
}

/* Particle burst */
#particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1001;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  pointer-events: none;
  animation: particle-burst 0.7s ease-out forwards;
}

@keyframes particle-burst {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0);
  }
}

/* =============================================================
   PHASE 2 & 3: Main Stage
   ============================================================= */

#main-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 1.2s ease 0.3s;
}

#main-stage.visible {
  opacity: 1;
}

/* =============================================================
   Danmaku Layer — Cinematic floating neon memories (z-index: 5)
   ============================================================= */

.danmaku-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.danmaku-item {
  position: absolute;
  white-space: nowrap;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 3px;
  pointer-events: auto;
  cursor: default;
  text-shadow:
    0 0 1px rgba(0, 0, 0, 0.7),
    0 0 4px rgba(0, 0, 0, 0.5),
    0 0 16px currentColor,
    0 0 38px currentColor;
  transition: opacity 0.4s ease, transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), text-shadow 0.3s ease;
  will-change: transform, opacity;
  animation: danmaku-drift var(--danmaku-speed, 18s) linear infinite;
}

/* Alternating neon colors */
.danmaku-item:nth-child(odd) {
  color: rgba(0, 245, 212, 0.55);
}
.danmaku-item:nth-child(even) {
  color: rgba(255, 42, 116, 0.55);
}

/* Hover: pause, glow up, scale up */
.danmaku-item:hover {
  animation-play-state: paused !important;
  opacity: 1 !important;
  transform: scale(1.08) !important;
  text-shadow:
    0 0 1px rgba(0, 0, 0, 0.9),
    0 0 4px rgba(0, 0, 0, 0.6),
    0 0 24px currentColor,
    0 0 60px currentColor,
    0 0 100px currentColor;
  z-index: 6 !important;
}

/* Bass shake — applied via JS as inline transform override */
.danmaku-item.bass-shake {
  animation: danmaku-drift var(--danmaku-speed, 18s) linear infinite,
             danmaku-vibrate 0.08s ease-in-out infinite;
}

@keyframes danmaku-drift {
  0%   { transform: translateX(0); }
  100% { transform: translateX(var(--danmaku-distance, -120vw)); }
}

@keyframes danmaku-vibrate {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(2px); }
}

/* Ash sparks — glowing particles from danmaku hover */
.ash-spark {
  position: fixed;
  pointer-events: none;
  z-index: 7;
  border-radius: 50%;
  animation: ash-fall 0.8s ease-in forwards;
}

@keyframes ash-fall {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--ash-dx, 0px), var(--ash-dy, 40px)) scale(0.15);
  }
}

/* Rain Canvas */
#rain-canvas {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* Doodle easter egg canvas — behind rain, for hidden glass doodles */
#doodle-canvas {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* Smoke canvas — cinematic alleyway vapor at bottom */
#smoke-canvas {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30vh;
  z-index: 2;
  pointer-events: none;
}

/* Pupil Dilation Vignette — dark cinematic tunnel vision, bass-driven */
#vignette {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  transition: box-shadow 0.15s ease-out;
  box-shadow: inset 0 0 180px 60px rgba(0, 0, 0, var(--vignette-intensity, 0.65));
}

/* Chat Wrapper */
.chat-wrapper {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  height: 55vh;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 0 12px;
}

.chat-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 4px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;

  /* Fade mask at top and bottom */
  mask-image: linear-gradient(to bottom,
    transparent 0%,
    rgba(0, 0, 0, 1) 12%,
    rgba(0, 0, 0, 1) 80%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(to bottom,
    transparent 0%,
    rgba(0, 0, 0, 1) 12%,
    rgba(0, 0, 0, 1) 80%,
    transparent 100%
  );
}

.chat-container::-webkit-scrollbar {
  display: none;
}

.chat-spacer {
  flex: 1;
  min-height: 20px;
}

/* Chat Bubbles */
.bubble {
  max-width: 78%;
  padding: 10px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.3px;
  word-break: break-word;
  position: relative;
  transition: transform 0.4s ease, opacity 0.4s ease;
  will-change: transform, opacity;
}

/* Male bubble (志明) - Aurora Green */
.bubble-male {
  align-self: flex-start;
  background: var(--bubble-male);
  color: rgba(0, 245, 212, 0.9);
  border: 1px solid rgba(0, 245, 212, 0.15);
  border-bottom-left-radius: 6px;
  text-shadow: 0 0 8px rgba(0, 245, 212, 0.2);
  animation: slide-in-left 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* Female bubble (春娇) - Lost Pink */
.bubble-female {
  align-self: flex-end;
  background: var(--bubble-female);
  color: rgba(255, 130, 160, 0.95);
  border: 1px solid rgba(255, 42, 116, 0.18);
  border-bottom-right-radius: 6px;
  text-shadow: 0 0 10px rgba(255, 42, 116, 0.25);
  box-shadow: 0 0 20px rgba(255, 42, 116, 0.06);
  animation: fade-in-right 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* Chat bubble scroll depth */
.bubble.dimmed {
  opacity: 0.25;
  transform: scale(0.92);
}

/* Bubble entrance animations */
@keyframes slide-in-left {
  0% {
    opacity: 0;
    transform: translateX(-24px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fade-in-right {
  0% {
    opacity: 0;
    transform: translateX(24px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Now Playing bar */
.now-playing {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.6s ease;
  max-width: 280px;
}

.now-playing.visible {
  opacity: 1;
}

.np-art {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--lost-pink), var(--aurora-green));
  flex-shrink: 0;
}

.np-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.np-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-artist {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mini visualizer bars */
.np-visualizer {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 24px;
  flex-shrink: 0;
}

.np-visualizer span {
  width: 3px;
  background: var(--aurora-green);
  border-radius: 1px;
  transition: height 0.08s ease;
}

.np-visualizer span:nth-child(1) { height: 8px; }
.np-visualizer span:nth-child(2) { height: 14px; }
.np-visualizer span:nth-child(3) { height: 6px; }

/* =============================================================
   Responsive
   ============================================================= */

@media (max-width: 480px) {
  .phone-frame {
    width: 280px;
    padding: 20px 16px 32px;
  }

  .time-display {
    font-size: 60px;
  }

  .notification {
    padding: 12px 14px;
  }

  .quick-actions {
    margin-top: 42px;
    gap: 28px;
  }

  .qa-btn {
    width: 42px;
    height: 42px;
  }

  .danmaku-item {
    font-size: 18px;
    letter-spacing: 2px;
  }

  .chat-wrapper {
    height: 58vh;
    padding: 0 6px;
  }

  .bubble {
    max-width: 85%;
    font-size: 13px;
    padding: 8px 14px;
  }
}

@media (min-width: 768px) {
  .chat-wrapper {
    max-width: 520px;
  }

  .bubble {
    max-width: 72%;
  }

  .danmaku-item {
    font-size: 28px;
  }
}

/* V4.0: Parallax depth layer transforms */
.bg-layer,
.bg-layer-sharp,
#rain-canvas {
  will-change: transform;
}

/* V4.0: Chat container receives parallax offset (container-level avoids bubble animation conflicts) */
.chat-wrapper {
  transform: translateX(-50%) translate(var(--parallax-x, 0px), var(--parallax-y, 0px));
}

/* V4.0: Emotional Thermometer — right-edge vertical progress bar */
#emotional-thermometer {
  position: fixed;
  top: 0;
  right: 0;
  width: 4px;
  height: 100vh;
  z-index: 15;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.03);
}

.thermo-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(
    to top,
    var(--thermo-color-bottom, #FF2A74),
    var(--thermo-color-top, #00F5D4)
  );
  box-shadow: 0 0 8px var(--thermo-color-bottom, #FF2A74);
  transition: height 0.15s ease-out;
}

/* V4.0: Micro-scene overlay text (shatter message) */
#micro-overlay-text {
  will-change: opacity;
  animation: micro-glow-pulse 1.5s ease-in-out infinite;
}

@keyframes micro-glow-pulse {
  0%, 100% { text-shadow: 0 0 20px #00F5D4, 0 0 60px #00F5D4, 0 0 120px #00F5D4; }
  50% { text-shadow: 0 0 40px #00F5D4, 0 0 100px #00F5D4, 0 0 200px #00F5D4; }
}

/* V4.0: Micro-scene body transition for cold flashback */
body {
  transition: filter 0.8s ease;
}

/* =============================================================
   V4.1 MOBILE-FIRST ADAPTATION (2026-05-23)
   ============================================================= */

/* --- V4.1: Strict mobile viewport sizing --- */
html, body {
  height: 100vh;
  height: -webkit-fill-available;
  overflow: hidden;
  /* Prevent pull-to-refresh / rubber-banding during fog wipe */
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
}

/* --- V4.1: Mobile Danmaku diagonal drift --- */
body.mobile .danmaku-item {
  font-size: 16px;
  letter-spacing: 2px;
  writing-mode: horizontal-tb;
  animation: danmaku-diagonal var(--danmaku-speed, 14s) linear infinite;
}

@keyframes danmaku-diagonal {
  0%   { transform: translate(0, 0); opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translate(var(--danmaku-dx, -55vw), var(--danmaku-dy, 65vh)); opacity: 0; }
}

/* --- V4.1: Chat bubble mobile sizing --- */
body.mobile .bubble {
  max-width: 75vw;
  font-size: clamp(14px, 4vw, 18px);
  padding: 10px 14px;
  line-height: 1.6;
}

body.mobile .chat-wrapper {
  height: 60vh;
  bottom: 70px;
  max-width: 100%;
  padding: 0 10px;
}

/* --- V4.1: Touch action for fog wipe --- */
.bg-layer-sharp,
#rain-canvas,
#doodle-canvas {
  touch-action: none;
}

/* --- V4.1: Lock screen 3D flip transition --- */
#lockscreen.flip-out {
  animation: screen-flip-3d 0.9s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
  transform-origin: center center;
}

@keyframes screen-flip-3d {
  0% {
    transform: perspective(1200px) rotateY(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: perspective(1200px) rotateY(-75deg) scale(0.7);
    opacity: 0;
  }
}

/* --- V4.1: Mobile lock screen notification enlargement --- */
@media (max-width: 480px) {
  .phone-frame {
    width: 92vw;
    max-width: 360px;
    padding: 28px 18px 40px;
  }

  .notification {
    padding: 16px 18px;
    border-radius: 22px;
    min-height: 68px;
  }

  .notif-avatar {
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }

  .notif-avatar span {
    font-size: 20px;
  }

  .notif-sender {
    font-size: 16px;
  }

  .notif-message {
    font-size: 15px;
  }

  .message-text {
    font-size: 16px;
  }

  .lock-hint {
    margin-top: 48px;
  }

  .hint-text {
    font-size: 13px;
  }

  .chat-wrapper {
    height: 62vh;
    bottom: 72px;
  }

  .bubble {
    max-width: 78vw;
    font-size: clamp(13px, 3.8vw, 16px);
  }

  /* Larger danmaku on mobile for readability */
  .danmaku-item {
    font-size: 17px;
  }

  /* V4.1: Now-playing bar mobile positioning */
  .now-playing {
    bottom: 12px;
    max-width: 92vw;
    padding: 8px 14px;
  }

  /* V4.1: Thermometer thinner on mobile */
  #emotional-thermometer {
    width: 3px;
  }
}

/* --- V4.1: Mobile landscape adjustments --- */
@media (max-width: 480px) and (orientation: landscape) {
  .chat-wrapper {
    height: 50vh;
    bottom: 60px;
  }

  .bubble {
    max-width: 65vw;
    font-size: 13px;
  }

  .danmaku-item {
    font-size: 15px;
  }
}
