feat: add SynthQuest game mode with World 1 (Waves) — 8 puzzle levels

Gamified synth learning inspired by Turing Complete. Progressive puzzle
system teaches oscillators, waveforms, frequency, and mixing through
hands-on module patching. Includes world map, level progression with
3-star rating, target audio playback, solution validation, and
localStorage persistence. Sandbox mode still accessible via button.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jose Luis
2026-03-21 02:04:26 +01:00
parent d0755413f3
commit 08206e996e
10 changed files with 1500 additions and 3 deletions

View File

@@ -246,3 +246,266 @@ html, body, #root {
}
.preset-item:hover { background: var(--surface2); }
.preset-item .preset-date { color: var(--text2); font-size: 10px; }
/* ======================================================
GAME MODE — SynthQuest
====================================================== */
/* ===== World Map ===== */
.gm-worldmap {
height: 100vh; overflow-y: auto;
background: linear-gradient(180deg, #08080f 0%, #0a0a1a 50%, #08080f 100%);
padding: 0 24px 40px;
}
.gm-header {
display: flex; align-items: center; justify-content: space-between;
padding: 20px 0; border-bottom: 1px solid var(--border); margin-bottom: 32px;
}
.gm-logo { display: flex; align-items: center; gap: 12px; }
.gm-logo-icon {
font-size: 36px; color: var(--accent);
width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
border: 2px solid var(--accent); border-radius: 12px; background: rgba(0,229,255,0.05);
}
.gm-title { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: 1px; }
.gm-tagline { font-size: 12px; color: var(--text2); margin-top: 2px; }
.gm-header-right { display: flex; align-items: center; gap: 16px; }
.gm-total-stars { font-size: 16px; color: var(--yellow); font-weight: 700; }
.gm-sandbox-btn {
padding: 8px 16px; border: 1px solid var(--border); border-radius: 6px;
background: var(--surface); color: var(--text2); cursor: pointer;
font-size: 12px; font-weight: 600; font-family: inherit; transition: all 0.15s;
}
.gm-sandbox-btn:hover { border-color: var(--accent); color: var(--text); }
/* World sections */
.gm-world-section { margin-bottom: 32px; }
.gm-locked-world { opacity: 0.4; }
.gm-world-header {
display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.gm-world-icon { font-size: 28px; }
.gm-world-name { font-size: 16px; font-weight: 700; color: var(--text); }
.gm-world-sub { font-size: 11px; color: var(--text2); margin-top: 2px; }
/* Level grid */
.gm-level-grid {
display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 12px;
}
.gm-level-card {
display: flex; align-items: center; gap: 12px;
padding: 14px 16px; border-radius: 10px; cursor: pointer;
background: var(--surface); border: 1px solid var(--border);
transition: all 0.2s; position: relative; overflow: hidden;
}
.gm-level-card.unlocked:hover {
border-color: var(--accent); transform: translateY(-2px);
box-shadow: 0 8px 24px rgba(0,229,255,0.1);
}
.gm-level-card.locked { cursor: default; opacity: 0.5; }
.gm-level-card.boss { border-color: var(--yellow); }
.gm-level-card.boss .gm-level-number { background: var(--yellow); color: #000; }
.gm-level-card.perfect { border-color: var(--green); }
.gm-level-number {
width: 36px; height: 36px; border-radius: 50%;
background: var(--surface2); display: flex; align-items: center; justify-content: center;
font-weight: 800; font-size: 14px; color: var(--accent); flex-shrink: 0;
border: 1px solid var(--border);
}
.gm-level-info { flex: 1; min-width: 0; }
.gm-level-title { font-size: 13px; font-weight: 600; color: var(--text); }
.gm-level-subtitle { font-size: 10px; color: var(--text2); margin-top: 2px; }
.gm-stars { display: flex; gap: 2px; }
.gm-stars .star { font-size: 16px; }
.gm-stars .star.filled { color: var(--yellow); }
.gm-stars .star.empty { color: var(--border); }
.gm-lock { font-size: 18px; }
.gm-lock-overlay {
position: absolute; inset: 0; background: rgba(8,8,15,0.3);
pointer-events: none;
}
/* ===== Puzzle View ===== */
.gm-puzzle { display: flex; flex-direction: column; height: 100vh; }
.gm-puzzle-bar {
height: 48px; background: var(--panel); border-bottom: 1px solid var(--border);
display: flex; align-items: center; padding: 0 16px; gap: 12px;
flex-shrink: 0; z-index: 10;
}
.gm-puzzle-title { display: flex; align-items: center; gap: 8px; }
.gm-puzzle-num {
font-size: 10px; color: var(--text2); background: var(--surface);
padding: 2px 8px; border-radius: 4px; font-weight: 600;
}
.gm-puzzle-name { font-size: 14px; font-weight: 700; color: var(--text); }
.gm-puzzle-actions { margin-left: auto; display: flex; gap: 8px; }
/* Buttons */
.gm-btn {
padding: 6px 14px; border: 1px solid var(--border); border-radius: 6px;
background: var(--surface); color: var(--text); cursor: pointer;
font-size: 12px; font-weight: 600; font-family: inherit; transition: all 0.15s;
white-space: nowrap;
}
.gm-btn:hover { border-color: var(--accent); }
.gm-btn.icon { padding: 6px 10px; }
.gm-btn.primary { background: var(--accent); color: #000; border-color: var(--accent); }
.gm-btn.primary:hover { background: #33ecff; }
.gm-btn.secondary { background: var(--surface2); }
.gm-btn.target { border-color: var(--yellow); color: var(--yellow); }
.gm-btn.target:hover { background: rgba(255,204,0,0.1); }
.gm-btn.check { border-color: var(--green); color: var(--green); }
.gm-btn.check:hover { background: rgba(68,255,136,0.1); }
.gm-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }
.gm-btn.danger { border-color: var(--red); color: var(--red); }
.gm-btn.danger:hover { background: rgba(255,68,102,0.1); }
/* Puzzle layout */
.gm-puzzle-content { flex: 1; display: flex; overflow: hidden; }
.gm-puzzle-sidebar {
width: 280px; flex-shrink: 0; background: var(--panel);
border-right: 1px solid var(--border); overflow-y: auto;
padding: 12px; display: flex; flex-direction: column; gap: 12px;
}
.gm-puzzle-canvas-wrap {
flex: 1; position: relative; overflow: hidden;
}
/* Concept panel */
.gm-concept-panel {
background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
overflow: hidden;
}
.gm-concept-header {
padding: 10px 12px; cursor: pointer; display: flex; justify-content: space-between;
align-items: center; font-size: 12px; font-weight: 600; color: var(--yellow);
}
.gm-concept-body { padding: 0 12px 12px; }
.gm-concept-desc { font-size: 11px; color: var(--text); line-height: 1.5; margin-bottom: 8px; }
.gm-concept-tip {
font-size: 10px; color: var(--text2); line-height: 1.5;
padding: 8px; background: var(--bg); border-radius: 4px;
border-left: 3px solid var(--accent);
}
/* Objectives */
.gm-objectives {
background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
padding: 10px 12px;
}
.gm-obj-title {
font-size: 10px; font-weight: 700; color: var(--text2);
text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.gm-obj {
display: flex; align-items: center; gap: 8px; padding: 6px 0;
border-bottom: 1px solid var(--border); font-size: 11px;
}
.gm-obj:last-child { border-bottom: none; }
.gm-obj-star { color: var(--yellow); font-size: 12px; flex-shrink: 0; width: 30px; }
.gm-obj-name { flex: 1; color: var(--text2); }
.gm-obj.passed .gm-obj-name { color: var(--green); }
.gm-obj.failed .gm-obj-name { color: var(--text2); }
.gm-obj-check { color: var(--green); font-weight: 700; }
.gm-obj-x { color: var(--red); font-weight: 700; }
/* Module palette (game) */
.gm-module-palette {
background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
padding: 10px 12px;
}
.gm-palette-title {
font-size: 10px; font-weight: 700; color: var(--text2);
text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.gm-palette-item {
display: flex; align-items: center; gap: 8px;
padding: 8px; border-radius: 6px; cursor: pointer;
transition: all 0.15s; font-size: 12px; color: var(--text);
}
.gm-palette-item:hover { background: var(--surface2); }
.gm-palette-icon { font-size: 16px; width: 24px; text-align: center; }
.gm-palette-name { flex: 1; font-weight: 500; }
.gm-palette-add {
width: 22px; height: 22px; border-radius: 50%;
background: var(--surface2); display: flex; align-items: center; justify-content: center;
font-size: 14px; color: var(--accent); font-weight: 700;
}
/* Canvas hint */
.gm-canvas-hint {
position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
padding: 8px 16px; background: rgba(0,0,0,0.7); border-radius: 8px;
font-size: 11px; color: var(--text2); pointer-events: none;
border: 1px solid var(--border); z-index: 10;
}
/* ===== Level Complete Overlay ===== */
.gm-complete-overlay {
position: fixed; inset: 0; background: rgba(8,8,15,0.85);
display: flex; align-items: center; justify-content: center;
z-index: 200; animation: fadeIn 0.3s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.gm-complete-card {
background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
padding: 32px 40px; text-align: center; min-width: 400px;
box-shadow: 0 32px 64px rgba(0,0,0,0.5);
animation: slideUp 0.4s ease-out;
}
@keyframes slideUp {
from { transform: translateY(40px); opacity: 0; }
to { transform: translateY(0); opacity: 1; }
}
.gm-complete-title { font-size: 20px; font-weight: 800; color: var(--green); margin-bottom: 4px; }
.gm-complete-level { font-size: 13px; color: var(--text2); margin-bottom: 20px; }
.gm-complete-stars { display: flex; justify-content: center; gap: 12px; margin-bottom: 12px; }
.gm-big-star {
font-size: 48px; transition: all 0.4s ease-out;
}
.gm-big-star.empty { color: var(--border); transform: scale(0.8); }
.gm-big-star.earned {
color: var(--yellow); transform: scale(1);
filter: drop-shadow(0 0 12px rgba(255,204,0,0.4));
animation: starPop 0.4s ease-out;
}
@keyframes starPop {
0% { transform: scale(0.3); opacity: 0; }
60% { transform: scale(1.3); }
100% { transform: scale(1); opacity: 1; }
}
.gm-complete-msg { font-size: 13px; color: var(--text2); margin-bottom: 20px; font-style: italic; }
.gm-checks {
margin-bottom: 24px; text-align: left;
background: var(--surface); border-radius: 8px; padding: 12px;
}
.gm-check {
display: flex; align-items: center; gap: 8px; padding: 6px 0;
font-size: 12px; border-bottom: 1px solid var(--border);
}
.gm-check:last-child { border-bottom: none; }
.gm-check-icon { font-size: 14px; width: 20px; text-align: center; }
.gm-check.passed .gm-check-icon { color: var(--green); }
.gm-check.failed .gm-check-icon { color: var(--red); }
.gm-check-name { flex: 1; color: var(--text); }
.gm-check-star { color: var(--yellow); }
.gm-complete-actions { display: flex; gap: 8px; justify-content: center; }