/* ============================================
   lofi_rei - style.css (v3)
   全画面ドット絵背景 + 右30% リキッドグラス(WebGL)
   ピクセルフォント + クールトーン
   ============================================ */

/* === リセット & ベース === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --glass-bg: rgba(10, 10, 30, 0.25);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-inner: rgba(255, 255, 255, 0.12);

  --text-primary: #e8e8f0;
  --text-secondary: #9999bb;
  --text-muted: #55557a;

  --accent-blue: #4a7aff;
  --accent-purple: #8b5cf6;
  --accent-cyan: #22d3ee;
  --accent-green: #34d399;

  --font-pixel: 'DotGothic16', 'Courier New', monospace;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #06060f;
  color: var(--text-primary);
  font-family: var(--font-pixel);
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

/* ============================================
   背景: 全画面
   ============================================ */
#bg-container {
  position: fixed;
  inset: 0;
  z-index: 0;
}

#bg-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  image-rendering: pixelated;
  -ms-interpolation-mode: nearest-neighbor;
}

/* スキャンライン */
#bg-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
  z-index: 1;
  animation: scanline-scroll 10s linear infinite;
}

@keyframes scanline-scroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

/* ============================================
   メインレイアウト
   ============================================ */
#app {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  pointer-events: none;
}

/* ============================================
   リキッドグラスパネル（右30%）
   ============================================ */
#glass-panel {
  width: 30%;
  min-width: 300px;
  max-width: 480px;
  height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  pointer-events: auto;

  /* CSS フォールバック（WebGL 非対応時） */
  background: var(--glass-bg);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);

  border-left: 1px solid var(--glass-border);
  border-radius: 12px 0 0 12px;
  overflow: hidden;
  box-shadow:
    -10px 0 40px rgba(0, 0, 0, 0.3),
    inset 1px 0 0 var(--glass-border-inner);
}

/* WebGL リキッドグラス（CSS フォールバックを上書き） */
#glass-panel.webgl-ready {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* WebGL キャンバス */
#glass-webgl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

#glass-webgl.visible {
  opacity: 1;
}

/* ノイズテクスチャ（WebGL 上のレイヤー） */
#glass-noise {
  position: absolute;
  inset: 0;
  opacity: 0.02;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: overlay;
}

/* ============================================
   ツイートフィード
   ============================================ */
#tweets-feed {
  flex: 9;
  display: flex;
  flex-direction: column;
  padding: 16px;
  position: relative;
  z-index: 2;
  min-height: 0;
}



#tweets-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.05) transparent;
}

#tweets-list::-webkit-scrollbar {
  width: 3px;
}

#tweets-list::-webkit-scrollbar-track {
  background: transparent;
}

#tweets-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
}

/* === ユーティリティ === */
.hidden { display: none !important; }

/* === ターミナル風ツイート行 === */
.terminal-line {
  font-size: 12px;
  line-height: 1.9;
  padding: 1px 0;
  letter-spacing: 0.5px;
  word-break: break-word;
  color: var(--text-primary);
  border: none;
  background: none;
  animation: terminal-fade-in 0.3s ease-out;
  position: relative;
  padding-left: 4px;
}

.terminal-line:last-child::after {
  content: '\258C';
  color: var(--accent-cyan);
  animation: terminal-blink 1s step-end infinite;
  margin-left: 2px;
  font-size: 11px;
}

@keyframes terminal-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes terminal-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

.terminal-prompt {
  color: var(--accent-cyan);
  text-shadow: 0 0 4px rgba(34, 211, 238, 0.3);
}

.terminal-prompt-path {
  color: var(--accent-blue);
}

.terminal-day {
  color: var(--text-muted);
  font-size: 10px;
}

/* === ローディング === */
#tweets-loader {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 16px;
}

#tweets-loader.hidden {
  display: none;
}

.loader-dot {
  width: 5px;
  height: 5px;
  background: var(--accent-cyan);
  border-radius: 50%;
  animation: loader-bounce 1.2s ease-in-out infinite;
  opacity: 0.3;
}

.loader-dot:nth-child(2) { animation-delay: 0.2s; }
.loader-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes loader-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

/* ============================================
   区切り線
   ============================================ */
#glass-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 20%,
    rgba(255, 255, 255, 0.08) 80%,
    transparent 100%
  );
  flex-shrink: 0;
  z-index: 2;
}

/* ============================================
   電光掲示板（下部10%）
   ============================================ */
#bulletin-board {
  flex: 1;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: relative;
  z-index: 2;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

#bb-scroll {
  flex: 1;
  overflow: hidden;
  position: relative;
  min-width: 0;
}

#music-toggle {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: transparent;
  font: inherit;
  cursor: pointer;
  appearance: none;
}

#music-toggle:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.12);
}

#music-toggle:disabled {
  opacity: 0.45;
  cursor: default;
}

#bb-text {
  display: inline-block;
  font-size: 11px;
  color: var(--accent-cyan);
  letter-spacing: 2px;
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.2);
  animation: bb-scroll 24s linear infinite;
}

#bb-track {
  display: inline-block;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1px;
  white-space: nowrap;
  margin-left: 16px;
}

@keyframes bb-scroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

#bb-right {
  flex-shrink: 0;
  margin-left: 12px;
}

#bb-date {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1px;
  white-space: nowrap;
}

/* ============================================
   レスポンシブ
   ============================================ */
@media (max-width: 768px) {
  #glass-panel {
    width: 100vw;
    max-width: 100vw;
    border-left: none;
    border-top: 1px solid var(--glass-border);
    border-radius: 0;
  }

  #glass-webgl {
    border-radius: 0;
  }

  #tweets-feed {
    padding: 10px;
  }

  .terminal-line {
    font-size: 11px;
    line-height: 1.7;
  }
}
