neser 1.2.0

NESER - Nintendo Emulation Systems Engine (Rust). Desktop and WebAssembly frontends.
Documentation
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
@import "tailwindcss";
@plugin "daisyui" {
  themes: night;
}

/* Neon accent color overrides for DaisyUI night theme */
@theme {
  --color-neon-cyan: #00f0ff;
  --color-neon-magenta: #ff00e6;
}

/* ── Base styles ─────────────────────────────────────────── */

body {
  margin: 0;
  background: radial-gradient(circle at top, #1e1f24 0%, #0c0d10 60%, #070708 100%);
  color: #e6e6e6;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
}

/* ── Neon glow effects ───────────────────────────────────── */

.btn:hover:not(:disabled) {
  box-shadow: 0 0 12px #00f0ff40;
}

.btn:active:not(:disabled) {
  box-shadow: 0 0 18px #00f0ff60;
}

/* ── Screen / canvas ─────────────────────────────────────── */

.screen-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  background: #0a0b0f;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 24px #00f0ff18;
}

/* ── Recording overlay ───────────────────────────────────── */

.rec-overlay {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.85rem;
  color: #fff;
  pointer-events: none;
  z-index: 10;
}

.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e11d48;
  animation: rec-blink 1s step-end infinite;
}

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

.screen-wrap:fullscreen {
  padding: 0;
}

canvas {
  image-rendering: pixelated;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.55);
}

/* ── Status / controls ───────────────────────────────────── */

.status {
  font-size: 0.95rem;
  color: #8fe28f;
}

#autorun-status {
  color: #9bc2ff;
}

#controls,
#shortcut-reference {
  color: #c4c4c4;
  text-align: center;
  line-height: 1.4;
}

#controls {
  font-size: 0.9rem;
}

#shortcut-reference {
  font-size: 0.85rem;
}

/* ── Overlays ────────────────────────────────────────────── */

.shortcut-help-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  max-width: min(44%, 460px);
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(90, 90, 90, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  line-height: 1.25;
  white-space: pre-line;
  z-index: 11;
  pointer-events: none;
}

.neser-toast-container {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 10;
}

.neser-toast {
  max-width: min(420px, calc(100vw - 32px));
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(10, 11, 15, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e6e6e6;
  font-size: 0.9rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

/* ── Touch controls (hidden by default, shown on touch devices) ── */

.touch-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.touch-dpad-area,
.touch-action-area {
  display: none;
}

.touch-hide {}

/* Show touch controls only when emulator is running on a touch device */
body.touch-running .touch-dpad-area,
body.touch-running .touch-action-area {
  display: flex;
  align-items: center;
  justify-content: center;
}

body.touch-running .touch-action-area {
  flex-direction: column;
  gap: 8px;
}

body.touch-running .touch-hide {
  display: none;
}

/* ── Joystick styling ───────────────────────────────── */

.touch-joystick {
  position: relative;
  width: 132px;
  height: 132px;
  --touch-stick-x: 0px;
  --touch-stick-y: 0px;
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
}

.touch-joystick-base,
.touch-joystick-knob {
  position: absolute;
  pointer-events: none;
}

.touch-joystick-base {
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #5c5c5c 0%, #3a3a3a 58%, #262626 100%);
  border: 2px solid #5b5b5b;
  box-shadow: inset 0 8px 16px rgba(255, 255, 255, 0.08), inset 0 -10px 16px rgba(0, 0, 0, 0.35), 0 4px 14px rgba(0, 0, 0, 0.28);
}

.touch-joystick-knob {
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  margin-left: -29px;
  margin-top: -29px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #f7f7f7 0%, #cbcbcb 22%, #8a8a8a 62%, #5c5c5c 100%);
  border: 2px solid #4c4c4c;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.38), inset 0 2px 4px rgba(255, 255, 255, 0.18);
  transform: translate(var(--touch-stick-x), var(--touch-stick-y));
  transition: transform 60ms linear, box-shadow 80ms ease, background 80ms ease;
}

.touch-joystick.pressed .touch-joystick-base {
  border-color: #707070;
  box-shadow: inset 0 10px 18px rgba(255, 255, 255, 0.1), inset 0 -12px 18px rgba(0, 0, 0, 0.45), 0 4px 16px rgba(0, 0, 0, 0.32);
}

.touch-joystick.pressed .touch-joystick-knob {
  background: radial-gradient(circle at 32% 28%, #ffffff 0%, #dadada 20%, #989898 60%, #666666 100%);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.34), inset 0 2px 4px rgba(255, 255, 255, 0.22);
}

/* ── Action buttons (A/B) ──────────────────────────── */

.touch-action-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.touch-meta-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.touch-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Courier New", monospace;
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
}

.touch-btn-a,
.touch-btn-b {
  background: #cc0000;
  border: 3px solid #990000;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.touch-btn-a.pressed,
.touch-btn-b.pressed {
  background: #990000;
  border-color: #770000;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
  transform: scale(0.95);
}

/* B is slightly lower than A on a real NES controller */
.touch-btn-b {
  margin-top: 20px;
}

/* ── Start / Select meta buttons ───────────────────── */

.touch-meta-btn {
  width: 72px;
  height: 28px;
  border-radius: 14px;
  background: #4a4a4a;
  border: 2px solid #666;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Courier New", monospace;
  font-size: 0.55rem;
  font-weight: bold;
  color: #ccc;
  letter-spacing: 0.05em;
  transform: rotate(-15deg);
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
}

.touch-meta-btn.pressed {
  background: #333;
  border-color: #555;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ── Touch device header override (only while running, non-handheld) ── */

body.touch-running:not(.handheld) header {
  display: none !important;
}

/* ── Handheld: always hide zoom buttons ── */

/* Primary: JS class (works in both portrait and landscape) */
body.handheld #screen-minus,
body.handheld #screen-plus {
  display: none !important;
}

/* CSS fallback for portrait mode (hides buttons before JS class is applied) */
@media (pointer: coarse) and (max-width: 768px) {
  #screen-minus,
  #screen-plus {
    display: none !important;
  }
}

/* ── Handheld: constrain layout height and strip padding when running ── */

body.handheld.touch-running .drawer-content {
  height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden;
}

body.handheld.touch-running main {
  min-height: 0;
  padding: 0 !important;
  overflow: hidden;
}

/* ── Handheld portrait layout (Game Boy-style) ── */

body.handheld.handheld-portrait.touch-running main {
  justify-content: flex-start;
}

body.handheld.handheld-portrait.touch-running .touch-controls {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr;
  grid-template-rows: auto auto;
  grid-template-areas:
    "screen screen screen"
    "dpad   meta   actions";
  width: 100%;
  gap: 8px;
  align-items: center;
  justify-items: center;
  padding: 0;
}

body.handheld.handheld-portrait.touch-running .screen-wrap {
  grid-area: screen;
  width: 100%;
  padding: 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

body.handheld.handheld-portrait.touch-running .screen-wrap canvas {
  width: 100% !important;
  height: auto !important;
  border-radius: 0;
}

body.handheld.handheld-portrait.touch-running .touch-dpad-area {
  grid-area: dpad;
  justify-content: center;
}

/* Dissolve touch-action-area box so meta and action-buttons join the grid directly */
body.handheld.handheld-portrait.touch-running .touch-action-area {
  display: contents;
}

body.handheld.handheld-portrait.touch-running .touch-meta-buttons {
  grid-area: meta;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

body.handheld.handheld-portrait.touch-running .touch-action-buttons {
  grid-area: actions;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* In handheld portrait, B should be at the same height as A (no offset) */
body.handheld.handheld-portrait.touch-running .touch-btn-b {
  margin-top: 0;
}

/* ── Handheld landscape: fill available height ── */

body.handheld:not(.handheld-portrait).touch-running .touch-controls {
  height: 100%;
  align-items: stretch;
}

body.handheld:not(.handheld-portrait).touch-running .screen-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

body.handheld:not(.handheld-portrait).touch-running .screen-wrap canvas {
  height: 100% !important;
  width: auto !important;
}