/* ==================================================
   澱みのスープ — OS Shell Style
   ================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

:root {
  --bg-darkest: #04040a;
  --bg-dark: #0a0a12;
  --bg-mid: #111120;
  --wave1: rgba(5, 35, 18, 0.75);
  --wave2: rgba(3, 22, 12, 0.65);
  --wave3: rgba(8, 42, 22, 0.55);
  --text-primary: #dddde8;
  --text-secondary: #6a6a80;
  --accent: #c0392b;
  --accent-bright: #e74c3c;
  --glass: rgba(14, 14, 24, 0.88);
  --glass-border: rgba(255, 255, 255, 0.07);
  --font: 'Noto Sans JP', -apple-system, sans-serif;
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg-darkest);
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ── PRELOADER ── */
#preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: #04040a;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px;
  transition: opacity 0.8s ease;
}
#preloader.hidden { opacity: 0; pointer-events: none; }

.preloader-spinner {
  width: 38px; height: 38px;
  border: 2px solid rgba(255,255,255,0.08);
  border-top-color: rgba(255,255,255,0.35);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.preloader-text {
  font-size: 11px; letter-spacing: 4px;
  color: rgba(255,255,255,0.25);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── WAVE BACKGROUND ── */
#waves-bg {
  position: fixed; bottom: 0; left: 0;
  width: 100%; height: 55%;
  z-index: 0; pointer-events: none; overflow: hidden;
}
.wave {
  position: absolute; bottom: -10px; left: 0;
  width: 200%; height: 100%;
  transform-origin: center bottom;
}
.wave-1 { fill: var(--wave1); animation: w1 14s ease-in-out infinite alternate; }
.wave-2 { fill: var(--wave2); animation: w2 20s ease-in-out infinite alternate; }
.wave-3 { fill: var(--wave3); animation: w3 27s ease-in-out infinite alternate; }

@keyframes w1 {
  0%   { transform: translateX(0%) scaleY(1); }
  30%  { transform: translateX(4%) scaleY(1.06); }
  70%  { transform: translateX(-3%) scaleY(0.95); }
  100% { transform: translateX(7%) scaleY(1.1); }
}
@keyframes w2 {
  0%   { transform: translateX(0%) scaleY(0.93); }
  40%  { transform: translateX(-8%) scaleY(1.12); }
  80%  { transform: translateX(5%) scaleY(1.03); }
  100% { transform: translateX(-4%) scaleY(0.9); }
}
@keyframes w3 {
  0%   { transform: translateX(0%) scaleY(1.08); }
  25%  { transform: translateX(9%) scaleY(0.88); }
  75%  { transform: translateX(-7%) scaleY(1.18); }
  100% { transform: translateX(3%) scaleY(0.97); }
}

/* ── WALLPAPER ── */
#wallpaper {
  position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(ellipse at 40% 30%, #0e1820 0%, #04040a 70%);
}
#wallpaper.has-image {
  background-size: cover;
  background-position: center;
  filter: brightness(0.35) saturate(0.6);
}

/* ── NOTIFICATION TOAST ── */
#notification-toast {
  position: fixed; top: -90px; left: 50%;
  transform: translateX(-50%);
  z-index: 910;
  background: rgba(20, 20, 32, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 12px 18px;
  display: flex; align-items: center; gap: 12px;
  min-width: 270px; max-width: 400px;
  transition: top 0.5s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 10px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
}
#notification-toast.show { top: 55px; }
.toast-icon { font-size: 22px; flex-shrink: 0; }
.toast-body { flex: 1; min-width: 0; }
.toast-app { font-size: 10px; color: var(--text-secondary); margin-bottom: 2px; letter-spacing: 0.5px; }
.toast-msg { font-size: 13px; color: var(--text-primary); font-weight: 500; }

/* ── LOCK SCREEN ── */
#lock-screen {
  position: fixed; inset: 0; z-index: 900; /* Lower than player-phone (950) so player-phone covers it */
  background: rgba(0,0,0,0.94);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 36px;
  transition: opacity 0.9s ease;
}
#lock-screen.fade-out { opacity: 0; pointer-events: none; }

/* Lock notification */
#lock-notification {
  position: absolute; top: 52px; left: 50%;
  transform: translateX(-50%) translateY(-24px);
  background: rgba(28,28,40,0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  min-width: 290px; max-width: 360px;
  opacity: 0;
  transition: all 0.65s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
#lock-notification.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.lock-notif-icon { font-size: 30px; }
.lock-notif-app { font-size: 10px; color: var(--text-secondary); margin-bottom: 3px; letter-spacing: 0.5px; }
.lock-notif-msg { font-size: 13px; color: var(--text-primary); font-weight: 500; line-height: 1.4; }

/* Time */
#lock-time-block { text-align: center; }
#lock-time {
  font-size: 82px; font-weight: 200;
  color: #ffffff; letter-spacing: -3px; line-height: 1;
}
#lock-date {
  font-size: 16px; font-weight: 300;
  color: rgba(255,255,255,0.65);
  margin-top: 8px; letter-spacing: 1px;
}

/* Passcode */
#passcode-area { display: flex; flex-direction: column; align-items: center; gap: 22px; }
#passcode-hint { font-size: 13px; color: rgba(255,255,255,0.4); letter-spacing: 3px; }
#passcode-display { display: flex; gap: 18px; }
.passcode-dot {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  transition: all 0.18s ease;
}
.passcode-dot.filled { background: white; border-color: white; transform: scale(1.25); }

#passcode-display.shake { animation: shake 0.5s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-10px); }
  40%      { transform: translateX(10px); }
  60%      { transform: translateX(-7px); }
  80%      { transform: translateX(7px); }
}

#number-pad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; width: 252px;
}
.passcode-btn {
  width: 74px; height: 74px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.07);
  color: white; font-size: 26px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex; align-items: center; justify-content: center;
}
.passcode-btn:hover:not(:disabled) { background: rgba(255,255,255,0.16); }
.passcode-btn:active:not(:disabled) { background: rgba(255,255,255,0.28); transform: scale(0.9); }
.passcode-btn.empty { background: transparent; border: none; cursor: default; }
.passcode-btn.del-btn { font-size: 18px; }

#passcode-error {
  color: #e74c3c; font-size: 12px;
  opacity: 0; transition: opacity 0.3s;
  letter-spacing: 1px;
}
#passcode-error.show { opacity: 1; }

/* ── DESKTOP ── */
#desktop {
  position: fixed; inset: 0; z-index: 1;
  display: flex; flex-direction: column;
}

/* Top bar */
#desktop-bar {
  height: 38px; flex-shrink: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 14px; position: relative; z-index: 10;
}
#desktop-clock { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.8); }
#settings-btn {
  background: none; border: none;
  color: rgba(255,255,255,0.5); font-size: 16px;
  cursor: pointer; padding: 4px 8px;
  border-radius: 6px; transition: color 0.2s;
}
#settings-btn:hover { color: rgba(255,255,255,0.9); }

/* App icons grid */
#app-icons {
  display: flex; flex-wrap: wrap;
  gap: 24px; padding: 36px 28px;
  position: relative; z-index: 2;
}
.app-icon {
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  cursor: pointer; position: relative;
  transition: transform 0.2s;
}
.app-icon:hover { transform: translateY(-2px); }
.app-icon:active { transform: scale(0.94); }

.app-icon-img {
  width: 72px; height: 72px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  transition: box-shadow 0.2s, transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
}
.app-icon:hover .app-icon-img {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}
.icon-sns     { background: linear-gradient(145deg, #1a1a2e 0%, #0f1b3d 100%); border: 1px solid rgba(29,161,242,0.25); }
.icon-browser { background: linear-gradient(145deg, #1a2a1a 0%, #102210 100%); border: 1px solid rgba(50,180,70,0.25); }
.icon-gallery { background: linear-gradient(145deg, #2a1218 0%, #1e0c10 100%); border: 1px solid rgba(220,60,70,0.25); }
.icon-chat    { background: linear-gradient(145deg, #132413 0%, #0c1e0c 100%); border: 1px solid rgba(50,200,90,0.35); }

.app-icon-label {
  font-size: 11px; font-weight: 500;
  color: white; text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}
.app-badge {
  position: absolute; top: -5px; right: -5px;
  background: #e74c3c; color: white;
  font-size: 10px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid #04040a;
  animation: badgePulse 1.8s ease-in-out infinite;
}
@keyframes badgePulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.25); box-shadow: 0 0 8px rgba(231,76,60,0.6); }
}

/* ── PC WINDOWS ── */
#windows-container {
  position: absolute; inset: 38px 0 48px 0;
  pointer-events: none; z-index: 5;
}
.os-window {
  position: absolute;
  display: flex; flex-direction: column;
  background: rgba(12,12,20,0.97);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.03);
  overflow: hidden;
  pointer-events: all;
  animation: winOpen 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes winOpen {
  from { opacity: 0; transform: scale(0.82) translateY(24px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.win-titlebar {
  height: 34px; flex-shrink: 0;
  background: rgba(28,28,42,0.98);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  cursor: move; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.win-title { font-size: 12px; color: rgba(255,255,255,0.65); font-weight: 500; }
.win-controls { display: flex; gap: 6px; }
.win-btn {
  width: 13px; height: 13px; border-radius: 50%;
  border: none; cursor: pointer; font-size: 0;
  transition: opacity 0.2s;
}
.win-btn:hover { opacity: 0.75; }
.win-close { background: #e74c3c; }
.win-min   { background: #f39c12; }
.win-max   { background: #2ecc71; }
.win-iframe { flex: 1; width: 100%; border: none; background: #0a0a12; }

/* PC Taskbar */
#taskbar {
  height: 48px; flex-shrink: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center;
  padding: 0 10px; gap: 6px; position: relative; z-index: 10;
}
.taskbar-btn {
  padding: 5px 14px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: rgba(255,255,255,0.7); font-size: 12px;
  font-family: var(--font); cursor: pointer;
  transition: background 0.2s;
  max-width: 170px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.taskbar-btn:hover  { background: rgba(255,255,255,0.13); }
.taskbar-btn.active { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.2); }
.taskbar-btn.minimized { opacity: 0.45; }

/* ── MOBILE OVERLAY ── */
#mobile-app-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: #08080f;
  transform: translateY(102%);
  transition: transform 0.38s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
}
#mobile-app-overlay.visible { transform: translateY(0); }
#mobile-iframe { flex: 1; width: 100%; border: none; background: #08080f; }

/* Home bar */
#home-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 48px; z-index: 60;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.05);
  display: none; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
#home-bar:hover { background: rgba(255,255,255,0.06); }
#home-bar-line {
  width: 110px; height: 4px;
  background: rgba(255,255,255,0.28);
  border-radius: 2px; pointer-events: none;
}

/* ── SETTINGS MENU ── */
#settings-overlay {
  position: fixed; inset: 0; z-index: 6000;
  background: rgba(0,0,0,0.7);
  display: none; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
#settings-overlay.open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.settings-panel {
  background: rgba(18,18,28,0.99);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px; padding: 28px;
  min-width: 290px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  animation: panelIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes panelIn {
  from { opacity: 0; transform: scale(0.88) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.settings-panel h3 { font-size: 17px; color: var(--text-primary); margin-bottom: 4px; }
.settings-btn {
  padding: 11px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px;
  color: var(--text-primary); font-family: var(--font); font-size: 14px;
  cursor: pointer; text-align: left;
  transition: background 0.2s;
}
.settings-btn:hover { background: rgba(255,255,255,0.11); }
.settings-btn.danger { border-color: rgba(231,76,60,0.3); color: #e74c3c; }
.settings-btn.danger:hover { background: rgba(231,76,60,0.1); }
.settings-btn.close-btn { background: none; border: none; color: var(--text-secondary); text-align: center; }

/* ── EPILOGUE OVERLAY ── */
#epilogue-overlay, #bad-end-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 2s ease;
}
#epilogue-overlay.visible, #bad-end-overlay.visible {
  opacity: 1; pointer-events: all;
}
.end-content {
  text-align: center; color: white; padding: 40px;
  max-width: 640px; width: 90%;
  animation: endFadeUp 1.2s ease 0.8s both;
}
@keyframes endFadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
.end-label {
  font-size: 11px; letter-spacing: 8px;
  color: rgba(255,255,255,0.3); margin-bottom: 36px;
}

/* Epilogue video mock */
.epil-player {
  background: #0d0d0d;
  border: 1px solid #222;
  border-radius: 12px; overflow: hidden;
  margin-bottom: 28px;
}
.epil-player-bar {
  background: #1a1a1a;
  padding: 8px 14px;
  font-size: 11px; color: rgba(255,255,255,0.4);
  display: flex; gap: 10px; align-items: center;
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #e74c3c; display: inline-block; }
.epil-player-body { padding: 28px; }
.epil-player-body p {
  font-size: 14px; color: rgba(255,255,255,0.7);
  line-height: 2.2; margin: 0;
}
.epil-credit { color: rgba(255,255,255,0.3); font-size: 12px; letter-spacing: 4px; margin-bottom: 22px; }
.end-btn {
  padding: 12px 32px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px; color: white;
  font-family: var(--font); font-size: 14px;
  cursor: pointer; transition: background 0.2s;
}
.end-btn:hover { background: rgba(255,255,255,0.16); }

/* Bad end */
.bad-end-box { padding: 60px 30px; }
.bad-text {
  font-size: 58px; font-weight: 900;
  color: #cc0000;
  text-shadow: 0 0 40px rgba(200,0,0,0.9);
  animation: glitch 0.2s steps(1) infinite;
  margin-bottom: 16px;
  letter-spacing: -2px;
}
@keyframes glitch {
  0%,86%,100% { text-shadow: 0 0 40px rgba(200,0,0,0.9); clip-path: none; }
  88% { text-shadow: -4px 0 #ff0000, 4px 0 #00cccc; clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%); }
  92% { text-shadow: 3px 0 #ff0000, -3px 0 #cc00ff; clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%); }
  96% { text-shadow: 0 0 40px rgba(200,0,0,0.9); clip-path: none; transform: skewX(-3deg); }
}
.bad-sub { color: rgba(255,0,0,0.5); font-size: 13px; letter-spacing: 2px; margin-bottom: 36px; }

/* ── PLAYER'S OWN PHONE UI ── */
#player-phone {
  position: fixed; inset: 0; z-index: 950;
  background-image: url('../images/player_wallpaper.png');
  background-size: cover; /* Back to cover since the image itself is now clean wallpaper */
  background-position: center;
  display: flex; flex-direction: column;
  transition: transform 0.5s ease;
}
#player-phone-bar {
  height: 44px; background: rgba(0,0,0,0.3);
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 16px; border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 12px; color: rgba(255,255,255,0.7);
}
.phone-bar-left, .phone-bar-right {
  display: flex; align-items: center; gap: 6px;
}
.phone-bar-carrier {
  font-size: 11px; opacity: 0.8;
}
#player-phone-content {
  flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative;
}
.app-list {
  flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto;
}
.player-app-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px; padding: 16px;
  display: flex; align-items: center; gap: 16px;
  cursor: pointer; transition: background 0.2s, transform 0.1s;
}
.player-app-item:hover { background: rgba(255,255,255,0.07); }
.player-app-item:active { transform: scale(0.98); }
.app-icon-large { font-size: 32px; }
.app-details { display: flex; flex-direction: column; gap: 4px; }
.app-name { font-size: 15px; color: #fff; font-weight: 500; }
.app-snippet { font-size: 12px; color: #8a99a6; }

/* Thread Detail View */
.chat-thread {
  position: absolute; inset: 0; background: #0f171e;
  z-index: 10; display: none; flex-direction: column;
}
.chat-thread.open { display: flex; }
.thread-header {
  padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 14px;
}
.thread-back { font-size: 20px; cursor: pointer; color: rgba(255,255,255,0.6); }
.thread-title { font-size: 16px; font-weight: 700; color: #fff; }
.thread-messages {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.chat-thread .msg { display: flex; gap: 8px; }
.chat-thread .msg.sent { flex-direction: row-reverse; }
.chat-thread .msg-bubble {
  background: rgba(255,255,255,0.06);
  border-radius: 18px; padding: 10px 14px;
  font-size: 14px; max-width: 80%; line-height: 1.5; color: #e1e8ed;
}
.chat-thread .msg.sent .msg-bubble {
  background: #1d9bf0; color: white;
}

/* Player SNS Overlay */
#player-sns-overlay {
  position: absolute; inset: 0; background: #000;
  z-index: 20; display: none; flex-direction: column;
}
#player-sns-overlay.open { display: flex; }
.sns-overlay-header {
  padding: 12px 16px; border-bottom: 1px solid #2f3336;
  display: flex; justify-content: space-between; font-size: 14px; color: #1d9bf0;
  cursor: pointer; font-weight: bold;
}
#player-sns-iframe { flex: 1; width: 100%; height: 100%; }

#device-flip-btn {
  margin-top: 14px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}
#device-flip-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ── PLAYER PHONE HOME GRID ── */
.player-home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 40px 24px;
  justify-items: center;
}
.player-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}
.player-grid-item:hover {
  transform: scale(1.05);
}
.player-app-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.chat-icon {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
}
.sns-icon {
  background: linear-gradient(135deg, #3498db, #2980b9);
}
.picked-phone-icon {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}
.player-app-label {
  font-size: 12px;
  color: #e1e8ed;
  font-weight: 500;
  text-align: center;
}

/* ── NOVEL INTRO SCREEN ── */
#novel-intro {
  position: fixed; inset: 0; z-index: 9990; /* Right below preloader (9999) */
  background: #000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  transition: opacity 0.8s ease;
  
  /* 表示スピード（1行ごとのフェードイン間隔。さらに半分にするため 0.5s に設定） */
  --novel-tempo: 0.5s;
}
#novel-intro.hidden { opacity: 0; pointer-events: none; }
.novel-box {
  max-width: 600px; width: 100%; display: flex; flex-direction: column; gap: 32px;
}
.novel-text-container {
  display: flex; flex-direction: column; gap: 18px;
}
.novel-line {
  font-size: 15px; line-height: 1.8; color: rgba(255,255,255,0.85);
  opacity: 0;
  animation: fadeInLine 1s forwards;
}
.novel-line:nth-child(1) { animation-delay: 0.2s; }
.novel-line:nth-child(2) { animation-delay: calc(var(--novel-tempo) * 1 + 0.2s); }
.novel-line:nth-child(3) { animation-delay: calc(var(--novel-tempo) * 2 + 0.2s); }
.novel-line:nth-child(4) { animation-delay: calc(var(--novel-tempo) * 3 + 0.2s); }
.novel-line:nth-child(5) { animation-delay: calc(var(--novel-tempo) * 4 + 0.2s); }
.novel-line:nth-child(6) { animation-delay: calc(var(--novel-tempo) * 5 + 0.2s); }
.novel-line:nth-child(7) { animation-delay: calc(var(--novel-tempo) * 6 + 0.2s); }

@keyframes fadeInLine {
  to { opacity: 1; }
}

.novel-next-btn {
  align-self: flex-end;
  padding: 10px 28px;
  background: none; border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px; color: #fff; font-size: 14px;
  cursor: pointer; font-family: var(--font);
  transition: all 0.3s;
  opacity: 0;
  animation: fadeInBtn 0.5s forwards;
  animation-delay: calc(var(--novel-tempo) * 7 + 0.2s);
}
.novel-next-btn:hover { background: #fff; color: #000; }
@keyframes fadeInBtn {
  to { opacity: 1; }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  #app-icons { padding: 22px 16px; gap: 18px; }
  .app-icon-img { width: 66px; height: 66px; font-size: 30px; border-radius: 16px; }
  #windows-container { display: none; }
  #taskbar { display: none; }
  #home-bar { display: flex; }
  #lock-time { font-size: 64px; }
  .passcode-btn { width: 68px; height: 68px; font-size: 22px; }
  #number-pad { width: 232px; gap: 12px; }
}
@media (min-width: 769px) {
  #home-bar { display: none !important; }
  #mobile-app-overlay { display: none !important; }
}
