File size: 10,564 Bytes
7868561
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5df04e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
785d391
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5df04e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7868561
 
5df04e1
 
 
7868561
 
5df04e1
 
 
 
 
 
 
7868561
5df04e1
 
7868561
5df04e1
 
7868561
 
5df04e1
 
 
db36ebc
5df04e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
db36ebc
5df04e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
db36ebc
5df04e1
 
 
 
785d391
5df04e1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
:root {
  --bg: #0a0b10;
  --bg-elev: #13151c;
  --bg-elev-2: #1b1e29;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f6fa;
  --text-dim: rgba(245, 246, 250, 0.65);
  --text-faint: rgba(245, 246, 250, 0.42);
  --error: #ff6a75;
  --live: #22d3ee;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius-sm: 8px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, sans-serif; overflow: hidden; }
#app { position: relative; height: 100dvh; }
#stage { position: absolute; inset: 0; }
#stage canvas { display: block; }
[hidden] { display: none !important; }
#loading { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); background: var(--bg); transition: opacity 0.6s ease; pointer-events: none; }
#loading.done { opacity: 0; }

#topbar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 20px; pointer-events: none; }
#topbar > * { pointer-events: auto; }
#identity h1 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0.01em; }
#identity p { margin: 4px 0 0; max-width: 340px; font-size: 12px; line-height: 1.45; color: var(--text-faint); }
#identity strong { color: var(--text-dim); font-weight: 500; }

.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev); color: var(--text-dim); cursor: pointer; touch-action: manipulation; transition: color 0.15s ease, border-color 0.15s ease; }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn.active { color: var(--live); border-color: var(--border-strong); }
.icon-btn.small { width: 28px; height: 28px; }

#main-btn { min-width: 190px; height: 46px; padding: 0 26px; border: none; border-radius: 23px; background: var(--text); color: var(--bg); font-family: Inter, system-ui, sans-serif; font-size: 14px; font-weight: 600; cursor: pointer; touch-action: manipulation; transition: transform 0.12s ease, opacity 0.15s ease; }
#main-btn:hover:not(:disabled) { transform: translateY(-1px); }
#main-btn:disabled { opacity: 0.45; cursor: default; }
#main-btn.live { background: var(--bg-elev); color: var(--text); border: 1px solid var(--border-strong); }

#controls { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 0 20px calc(22px + env(safe-area-inset-bottom)); z-index: 100; }
#buttons { display: flex; align-items: center; gap: 10px; }
#caption { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); transition: color 0.2s ease; }
#caption.live { color: var(--live); }
#caption.error { color: var(--error); }

#subtitles { position: absolute; left: 50%; bottom: 118px; transform: translateX(-50%); max-width: min(640px, calc(100vw - 48px)); padding: 10px 16px; border-radius: var(--radius-md); background: rgba(10, 11, 16, 0.72); backdrop-filter: blur(6px); border: 1px solid var(--border); font-size: 15px; line-height: 1.5; text-align: center; text-wrap: balance; color: var(--text); opacity: 0; transition: opacity 0.25s ease; pointer-events: none; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
#subtitles.visible { opacity: 1; }

/* ── News Cards ─────────────────────────────────────────────────────── */
#news-cards {
  position: fixed;
  z-index: 9998;
  top: 60px;
  right: 20px;
  width: min(320px, calc(100vw - 40px));
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  background: rgba(10, 11, 16, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
#news-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  flex-shrink: 0;
}
#news-header span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
#news-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
#news-scroll::-webkit-scrollbar { width: 6px; }
#news-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
#news-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.news-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.news-card:hover {
  border-color: var(--live);
  background: rgba(34, 211, 238, 0.06);
}
.news-card-source {
  font-size: 10px;
  font-weight: 600;
  color: var(--live);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.news-card-title {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#settings { width: min(440px, calc(100vw - 40px)); padding: 22px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-elev); color: var(--text); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.32); }
#settings::backdrop { background: rgba(5, 6, 9, 0.6); backdrop-filter: blur(2px); }
#settings h2 { margin: 0 0 16px; font-size: 15px; font-weight: 600; }
#settings label { display: block; margin-bottom: 14px; font-size: 12px; color: var(--text-dim); }
#settings select, #settings textarea, #settings input { display: block; width: 100%; margin-top: 6px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev-2); color: var(--text); font-family: inherit; font-size: 13px; }
#settings select:focus-visible, #settings textarea:focus-visible, #settings input:focus-visible { outline: 1px solid var(--text-dim); outline-offset: 1px; }
#settings textarea { resize: vertical; }
#settings .check-row { display: flex; align-items: center; gap: 9px; }
#settings .check-row input { display: inline-block; width: auto; margin: 0; accent-color: var(--text); }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.dialog-actions .primary { padding: 9px 20px; border: none; border-radius: var(--radius-sm); background: var(--text); color: var(--bg); font-weight: 600; font-size: 13px; cursor: pointer; }

/* ── Draggable / Resizable Chat ───────────────────────────────────────────── */
#text-chat {
  position: fixed;
  z-index: 9999;
  top: 100px;
  left: 20px;
  width: min(380px, calc(100vw - 40px));
  height: 50vh;
  display: flex;
  flex-direction: column;
  background: rgba(10, 11, 16, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 2.5rem;
  max-height: 80vh;
  cursor: default;
  resize: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  touch-action: none;
}
#text-chat.dragging { cursor: grabbing !important; user-select: none !important; }
#text-chat.resizing { user-select: none !important; }

/* Chat header bar β€” drag handle */
#chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  cursor: grab;
  flex-shrink: 0;
  touch-action: none;
}
#text-chat.dragging #chat-header { cursor: grabbing !important; }
#chat-title { font-size: 12px; font-weight: 600; color: var(--text-dim); letter-spacing: 0.04em; }
#chat-header-actions { display: flex; align-items: center; gap: 6px; pointer-events: auto; }
#chat-avatar-select { font-size: 11px; padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-elev-2); color: var(--text); cursor: pointer; max-width: 100px; pointer-events: auto; }

#chat-messages { flex: 1; padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
#chat-messages::-webkit-scrollbar { width: 6px; }
#chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.chat-message { max-width: 85%; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5; word-wrap: break-word; }
.chat-message.user { align-self: flex-end; background: var(--live); color: var(--bg); }
.chat-message.assistant { align-self: flex-start; background: var(--bg-elev-2); color: var(--text); border: 1px solid var(--border); }

#chat-input-container { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: var(--bg-elev); flex-shrink: 0; }
#chat-input { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-family: inherit; font-size: 13px; }
#chat-input:focus { outline: 1px solid var(--text-dim); outline-offset: 1px; }

/* Resize handle at bottom-right corner β€” bigger, better contrast */
#chat-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px;
  height: 24px;
  cursor: nwse-resize;
  background: transparent;
  z-index: 1;
  touch-action: none;
}
#chat-resize-handle::after {
  content: '';
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 14px;
  height: 14px;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  opacity: 0.4;
  transition: opacity 0.15s;
}
#chat-resize-handle:hover::after { opacity: 1; }
#text-chat.resizing #chat-resize-handle::after { opacity: 1; }

@media (max-width: 600px) {
  #identity p { display: none; }
  #subtitles { bottom: 128px; font-size: 14px; }
  #text-chat { top: 60px; left: 10px; width: calc(100vw - 20px); height: 40vh; }
  #news-cards { top: 60px; right: 10px; width: calc(100vw - 20px); }
}