Compare commits

...

28 Commits

Author SHA1 Message Date
Alexander Whitestone
0c715572ec Accessibility: ARIA labels on all buttons, fix exportSave race (#49)
Some checks failed
Accessibility Checks / a11y-audit (pull_request) Failing after 4s
Smoke Test / smoke (pull_request) Failing after 6s
index.html: ARIA roles, labels, live regions on all panels and static buttons
game.js: aria-label on dynamically generated building/project buttons
game.js: Fixed exportSave URL.revokeObjectURL race (delayed 1s)
2026-04-10 21:22:21 -04:00
Alexander Whitestone
302f6c844d beacon: add bulk ops spending (50x) for mid/late game QoL
Some checks failed
Smoke Test / smoke (push) Failing after 4s
Players with 100+ max ops get a second row of 50-ops buttons
that convert 50 ops at once for proportionally larger boosts.
Shift+1/2/3 keyboard shortcuts for bulk code/compute/knowledge.

Eliminates late-game tedium of clicking 5-ops buttons hundreds
of times when you have thousands of ops banked.
2026-04-10 21:03:11 -04:00
26879de76e Merge pull request 'feat: add CI workflow for accessibility and syntax validation' (#52) from feat/ci-a11y-checks into main
Some checks failed
Smoke Test / smoke (push) Failing after 3s
Merged PR #52: feat: add CI workflow for accessibility checks
2026-04-11 00:44:08 +00:00
c197fabc69 Merge pull request 'Add smoke test workflow' (#53) from fix/add-smoke-test into main
Some checks failed
Smoke Test / smoke (push) Failing after 3s
Merged PR #53: Add smoke test workflow
2026-04-11 00:44:04 +00:00
9733b9022e Merge pull request 'refactor: [EPIC] Phase 1 & 2 - Unslop The Beacon' (#55) from refactor/unslop-phase-1-2 into main
Merged PR #55: refactor: [EPIC] Phase 1 & 2 - Unslop The Beacon
2026-04-11 00:43:40 +00:00
967025fbd4 refactor: unslop phase 1 & 2 2026-04-11 00:29:09 +00:00
Alexander Whitestone
9854501bbd Add smoke test workflow
Some checks failed
Smoke Test / smoke (pull_request) Failing after 3s
2026-04-10 20:06:13 -04:00
Alexander Whitestone
68ee64866a beacon: add Open Weights and Prompt Engineering research projects
Two new Phase 2 research projects that fill the gap between building
a Home Server and reaching Phase 3 (Deployment):

- Open Weights (compute: 3000, code: 1500): Triggers after having a
  server and 1000 total code. Rewards 2x code boost and 1.5x compute
  boost. Teaches about running models locally without cloud dependency.

- Prompt Engineering (knowledge: 500, code: 2000): Triggers after
  200 knowledge and 3000 total code. Rewards 2x knowledge and 2x user
  boost. Teaches that good prompting beats bigger models.

Both projects follow the game's existing pattern: unlock based on
total resources, cost resources, apply boosts, and log educational
messages. They give players more strategic options in early-to-mid
game progression.
2026-04-10 20:01:10 -04:00
be0264fc95 feat: add CI workflow for accessibility and syntax validation
Some checks failed
Accessibility Checks / a11y-audit (pull_request) Failing after 4s
2026-04-10 23:56:07 +00:00
Timmy-Sprint
e6d0df40b4 beacon: add toast notification system for events, projects, milestones, and phase changes 2026-04-10 19:28:10 -04:00
Timmy-Sprint
23dd95ed46 beacon: add Pulse indicator — live fleet health visualization in header
The header now shows a pulsing beacon dot that reflects fleet state:
- Color: green (healthy harmony >70), amber (stressed 40-70), red (critical <40)
- Flicker speed: faster when production is high, fastest when debuffs are active
- Label: shows current phase, fleet size, and active alert count
- End states: DRIFTED (red) or SHINING (gold) for game endings

DESIGN.md called for this: "The Pulse — a central visual that brightens when
the fleet is healthy, flickers when harmony is low." Now it exists.
2026-04-10 18:51:51 -04:00
Timmy-Sprint
0849754a87 beacon: fix save/load bugs, add harmony tooltip, early-game pulse, better education cycling 2026-04-10 18:04:48 -04:00
Timmy-Sprint
8d51349e64 beacon: fix getMaxBuyable state mutation bug + add keyboard shortcuts help overlay
Fix: getMaxBuyable() was mutating G (subtracting/re-adding resources) during
render cycles in renderBuildings(). Now uses a read-only simulation with a
temporary resource copy. This prevented phantom resource fluctuations when
MAX buy was selected.

Feature: Press ? or click the ? button for a keyboard shortcuts overlay.
All keybindings listed in one place. Closes with ?, Esc, or clicking outside.
Added ? to the init log hint line.
2026-04-10 17:44:33 -04:00
Timmy-Sprint
24940fe465 beacon: add auto-typer — buildings now visually type code
Auto-Code Generators now produce actual auto-clicks (not just passive rate),
giving players satisfying visual feedback (floating numbers, button flash)
even while idle. Interval scales with building count: more buildings =
faster auto-typing. Each auto-click produces 50% of a manual click's code.

This makes the early game feel more like an idle game — you can watch
your auto-typers work while planning your next building purchase.
2026-04-10 17:23:39 -04:00
Timmy-Sprint
16273a5a15 beacon: add Swarm Protocol — buildings auto-code based on click power
New research project (Phase 4): Swarm Protocol
- Unlocks at 25K total code, 8K total knowledge, post-deploy
- Cost: 15K knowledge, 50K code, 20 trust
- Effect: every building generates code equal to your click power per second
- Scales with autocoders, phase, code boost, and total building count
- Visible in production breakdown as 'Swarm Protocol'
- Uses the previously-unused swarmFlag
- Adds education fact on swarm intelligence
2026-04-10 16:53:34 -04:00
Alexander Whitestone
5d51e14875 beacon: add combo milestone bonuses + fix DOM leak in click numbers
Combo system now rewards sustained clicking:
- 10x combo: +15 ops (sustained coding reward)
- 20x combo: +50 knowledge (deep focus reward)
- 30x+ combo (every 10): 2x bonus code burst (hyperfocus)

Also fixed potential DOM leak in showClickNumber where floating
numbers could fail to clean up if parent element was removed
before animation/timeout completed.
2026-04-10 16:02:50 -04:00
Timmy-Sprint
5fc0ad7b22 beacon: add collapsible completed projects + export/import save files
- Completed research projects are now collapsed by default (click to expand),
  preventing panel clutter in mid/late game. Toggle state persists in saves.
- Export saves as JSON files with E key or Export button
- Import saves from file with I key or Import button (validates before loading)
- Ctrl+S keyboard shortcut for quick save
- Updated keybind hints in startup log
2026-04-10 15:25:09 -04:00
f948ec9c5e auto-merge PR #45 2026-04-10 19:01:58 +00:00
Timmy-Sprint
9403f700d2 beacon: add ops overflow auto-conversion to code
When Operations exceed 80% of max capacity, excess ops automatically
drain into Code at 2 ops/sec (10:1 ratio with code boost). This prevents
ops from sitting idle at the cap and gives the early game smoother flow.

Visual indicator shows 'overflow -> code' in the ops rate display when
active. No log spam - just works silently in the background.
2026-04-10 14:44:54 -04:00
Alexander Whitestone
13e77a12f2 burn: add educational number scale tooltips to resources and stats 2026-04-10 08:26:27 -04:00
6081844387 [auto-merge] Welcome Back popup
Auto-merged by PR review bot: Welcome Back popup
2026-04-10 11:48:34 +00:00
Timmy-Sprint
09b8c02307 beacon: add Welcome Back popup for offline gains + fix missing resource tracking
- Added modal popup showing detailed offline resource gains when player returns
- Fixed offline tracking to include ops, trust, and creativity (were silently missing)
- Popup shows all resources with color-coded labels and 50% efficiency note
- Log message now shows time in human-readable format (minutes/seconds)
2026-04-10 07:35:52 -04:00
Alexander Whitestone
9106d3f84c beacon: show locked buildings as dimmed previews up to 2 phases ahead
Previously, buildings from later phases were completely invisible until
unlocked. Players had no idea what was coming next. Now buildings up to
2 phases ahead appear as dimmed (25% opacity) locked entries showing:
- Name and lock icon
- Phase number and name
- Description text
- Education tooltip on hover

This gives players a roadmap of what they're building toward and creates
anticipation for future phases. The preview is a non-interactive div
(not a button) so it cannot be clicked.
2026-04-10 06:45:54 -04:00
3f02359748 Merge pull request 'burn: Add MemPalace Archive as late-game building (closes #25)' (#39) from burn/20260410-0423-25-mempalace-building into main
Merge PR #39: burn: Add MemPalace Archive as late-game building (closes #25)
2026-04-10 09:37:15 +00:00
85a146b690 Merge pull request 'burn: add favicon, meta tags, and social sharing cards (closes #13)' (#31) from burn/20260410-0052-13-static-site-meta into main
Merge PR #31: burn: add favicon, meta tags, and social sharing cards (closes #13)
2026-04-10 09:35:58 +00:00
cb2e48bf9a Merge pull request 'beacon: add production breakdown panel' (#42) from feature/production-breakdown into main
Merge PR #42: beacon: add production breakdown panel
2026-04-10 09:35:52 +00:00
Alexander Whitestone
931473e8f8 burn: Add MemPalace Archive as late-game building (closes #25)
- Added memPalace to buildings state object
- Added MemPalace Archive to BDEF with Phase 5 unlock
- Requires MemPalace v3 research project (mempalaceFlag) + 50k total knowledge
- Cost: 500k knowledge, 200k compute, 100 trust (1.25x scaling)
- Rates: +250 knowledge/s, +100 impact/s
- Educational tooltip on Memory Palace technique and LLM vector space analogy
- Building rates auto-applied via existing updateRates() loop
- Save/load handles new field via G.buildings serialization
2026-04-10 04:23:16 -04:00
Alexander Whitestone
612eb1f4d5 burn: add favicon, meta tags, and social sharing cards (closes #13)
- Inline SVG favicon (beacon emoji) — no external file needed
- Open Graph tags for link previews (title, description, type)
- Twitter Card meta for rich social sharing
- Theme-color for mobile browser chrome
- Meta description for search engines
2026-04-10 00:53:03 -04:00
4 changed files with 1038 additions and 96 deletions

27
.gitea/workflows/a11y.yml Normal file
View File

@@ -0,0 +1,27 @@
name: Accessibility Checks
on:
pull_request:
branches: [main]
jobs:
a11y-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate ARIA Attributes in game.js
run: |
echo "Checking game.js for ARIA attributes..."
grep -q "aria-label" game.js || (echo "ERROR: aria-label missing from game.js" && exit 1)
grep -q "aria-valuenow" game.js || (echo "ERROR: aria-valuenow missing from game.js" && exit 1)
grep -q "aria-pressed" game.js || (echo "ERROR: aria-pressed missing from game.js" && exit 1)
- name: Validate ARIA Roles in index.html
run: |
echo "Checking index.html for ARIA roles..."
grep -q "role=" index.html || (echo "ERROR: No ARIA roles found in index.html" && exit 1)
- name: Syntax Check JS
run: |
node -c game.js

View File

@@ -0,0 +1,24 @@
name: Smoke Test
on:
pull_request:
push:
branches: [main]
jobs:
smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Parse check
run: |
find . -name '*.yml' -o -name '*.yaml' | grep -v .gitea | xargs -r python3 -c "import sys,yaml; [yaml.safe_load(open(f)) for f in sys.argv[1:]]"
find . -name '*.json' | xargs -r python3 -m json.tool > /dev/null
find . -name '*.py' | xargs -r python3 -m py_compile
find . -name '*.sh' | xargs -r bash -n
echo "PASS: All files parse"
- name: Secret scan
run: |
if grep -rE 'sk-or-|sk-ant-|ghp_|AKIA' . --include='*.yml' --include='*.py' --include='*.sh' 2>/dev/null | grep -v .gitea; then exit 1; fi
echo "PASS: No secrets"

976
game.js

File diff suppressed because it is too large Load Diff

View File

@@ -3,6 +3,23 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="The Beacon — a sovereign AI idle game. Build an AI from scratch. Write code, train models, save lives.">
<meta name="theme-color" content="#0a0a0a">
<meta name="author" content="Timmy Foundation">
<!-- Open Graph -->
<meta property="og:title" content="The Beacon">
<meta property="og:description" content="A sovereign AI idle game. Build an AI from scratch. Write code, train models, save lives.">
<meta property="og:type" content="website">
<meta property="og:image" content="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🏠</text></svg>">
<!-- Twitter Card -->
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="The Beacon">
<meta name="twitter:description" content="A sovereign AI idle game. Build an AI from scratch. Write code, train models, save lives.">
<!-- Favicon (inline SVG beacon) -->
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🏠</text></svg>">
<title>The Beacon - Build Sovereign AI</title>
<style>
*{margin:0;padding:0;box-sizing:border-box}
@@ -22,6 +39,7 @@ body{background:var(--bg);color:var(--text);font-family:'SF Mono','Cascadia Code
.milestone-chip.next{border-color:var(--accent);color:var(--accent);animation:pulse-chip 2s ease-in-out infinite}
.milestone-chip.done{border-color:#2a4a2a;color:var(--green);opacity:0.6}
@keyframes pulse-chip{0%,100%{box-shadow:0 0 0 rgba(74,158,255,0)}50%{box-shadow:0 0 8px rgba(74,158,255,0.3)}}
@keyframes beacon-glow{0%,100%{opacity:0.7}50%{opacity:1}}
#resources{display:grid;grid-template-columns:repeat(auto-fit,minmax(100px,1fr));gap:6px;margin:12px 16px}
.res{background:var(--panel);border:1px solid var(--border);border-radius:4px;padding:8px 10px;text-align:center}
.res .r-label{font-size:9px;color:var(--dim);text-transform:uppercase;letter-spacing:1px}
@@ -36,6 +54,8 @@ body{background:var(--bg);color:var(--text);font-family:'SF Mono','Cascadia Code
.main-btn{background:linear-gradient(135deg,#1a2a3a,#0e1520);border:1px solid var(--accent);color:var(--accent);font-size:14px;padding:14px 10px;border-radius:4px;cursor:pointer;font-family:inherit;transition:all 0.2s}
.main-btn:hover{background:linear-gradient(135deg,#203040,#0e2030);box-shadow:0 0 20px var(--glow);transform:scale(1.02)}
.main-btn:active{transform:scale(0.98)}
@keyframes pulse-glow{0%,100%{box-shadow:0 0 10px rgba(74,158,255,0.1)}50%{box-shadow:0 0 25px rgba(74,158,255,0.4)}}
.main-btn.pulse{animation:pulse-glow 2s ease-in-out infinite}
.ops-btn{background:#1a1a2a;border:1px solid var(--purple);color:var(--purple);font-size:10px;padding:6px 10px;border-radius:4px;cursor:pointer;font-family:inherit;transition:all 0.15s}
.ops-btn:hover:not(:disabled){background:#2a2a3a;border-color:var(--gold)}
.ops-btn:disabled{opacity:0.3;cursor:not-allowed}
@@ -66,11 +86,24 @@ body{background:var(--bg);color:var(--text);font-family:'SF Mono','Cascadia Code
#drift-ending .ending-quote{color:var(--dim);font-style:italic;font-size:11px;border-left:2px solid #f44336;padding-left:12px;margin:20px 0;text-align:left}
#drift-ending button{margin-top:20px;background:#1a0808;border:1px solid #f44336;color:#f44336;padding:10px 24px;border-radius:4px;cursor:pointer;font-family:inherit;font-size:11px}
#drift-ending button:hover{background:#2a1010}
#toast-container{position:fixed;top:16px;right:16px;z-index:200;display:flex;flex-direction:column;gap:6px;pointer-events:none;max-width:320px}
.toast{pointer-events:auto;padding:8px 14px;border-radius:6px;font-size:11px;font-family:inherit;line-height:1.4;animation:toast-in 0.3s ease-out;opacity:0.95;border:1px solid;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
.toast.fade-out{animation:toast-out 0.4s ease-in forwards}
.toast-event{background:rgba(244,67,54,0.12);border-color:#f44336;color:#ff8a80}
.toast-project{background:rgba(255,215,0,0.12);border-color:#ffd700;color:#ffd700}
.toast-milestone{background:rgba(76,175,80,0.12);border-color:#4caf50;color:#81c784}
.toast-info{background:rgba(74,158,255,0.12);border-color:#4a9eff;color:#80bfff}
@keyframes toast-in{from{transform:translateX(40px);opacity:0}to{transform:translateX(0);opacity:0.95}}
@keyframes toast-out{from{opacity:0.95;transform:translateX(0)}to{opacity:0;transform:translateX(40px)}}
::-webkit-scrollbar{width:4px}::-webkit-scrollbar-track{background:var(--bg)}::-webkit-scrollbar-thumb{background:var(--border);border-radius:2px}
</style>
</head>
<body>
<div id="header">
<div id="pulse-container" style="position:relative;display:inline-block;margin-bottom:4px">
<div id="pulse-dot" style="width:8px;height:8px;border-radius:50%;background:#333;display:inline-block;vertical-align:middle;transition:background 0.5s,box-shadow 0.5s"></div>
<span id="pulse-label" style="font-size:9px;color:#444;margin-left:6px;vertical-align:middle;letter-spacing:1px">OFFLINE</span>
</div>
<h1>THE BEACON</h1>
<div class="sub">A Sovereign AI Idle Game</div>
</div>
@@ -81,7 +114,7 @@ body{background:var(--bg);color:var(--text);font-family:'SF Mono','Cascadia Code
<div class="progress-label"><span id="phase-progress-label">0%</span><span id="phase-progress-target">Next: Phase 2 (2,000 code)</span></div>
<div class="milestone-row" id="milestone-chips"></div>
</div>
<div id="resources">
<div id="resources" role="region" aria-label="Resources" aria-live="polite">
<div class="res"><div class="r-label">Code</div><div class="r-val" id="r-code">0</div><div class="r-rate" id="r-code-rate">+0/s</div></div>
<div class="res"><div class="r-label">Compute</div><div class="r-val" id="r-compute">0</div><div class="r-rate" id="r-compute-rate">+0/s</div></div>
<div class="res"><div class="r-label">Knowledge</div><div class="r-val" id="r-knowledge">0</div><div class="r-rate" id="r-knowledge-rate">+0/s</div></div>
@@ -94,26 +127,40 @@ body{background:var(--bg);color:var(--text);font-family:'SF Mono','Cascadia Code
<div class="res"><div class="r-label">Harmony</div><div class="r-val" id="r-harmony">50</div><div class="r-rate" id="r-harmony-rate">+0/s</div></div>
</div>
<div id="main">
<div class="panel" id="action-panel">
<div class="panel" id="action-panel" role="region" aria-label="Actions">
<h2>ACTIONS</h2>
<div class="action-btn-group"><button class="main-btn" onclick="writeCode()">WRITE CODE</button></div>
<div id="combo-display" style="text-align:center;font-size:10px;color:var(--dim);height:14px;margin-bottom:4px;transition:all 0.2s"></div>
<div class="action-btn-group"><button class="main-btn" onclick="writeCode()" aria-label="Write code, generates code resource">WRITE CODE</button></div>
<div id="combo-display" role="status" aria-live="polite" style="text-align:center;font-size:10px;color:var(--dim);height:14px;margin-bottom:4px;transition:all 0.2s"></div>
<div id="debuffs" style="display:none;margin-top:8px"></div>
<div class="action-btn-group">
<button class="ops-btn" onclick="doOps('boost_code')">Ops -&gt; Code</button>
<button class="ops-btn" onclick="doOps('boost_compute')">Ops -&gt; Compute</button>
<button class="ops-btn" onclick="doOps('boost_code')" aria-label="Convert 1 ops to code boost">Ops -&gt; Code</button>
<button class="ops-btn" onclick="doOps('boost_compute')" aria-label="Convert 1 ops to compute boost">Ops -&gt; Compute</button>
</div>
<div class="action-btn-group">
<button class="ops-btn" onclick="doOps('boost_knowledge')">Ops -&gt; Knowledge</button>
<button class="ops-btn" onclick="doOps('boost_trust')">Ops -&gt; Trust</button>
<button class="ops-btn" onclick="doOps('boost_knowledge')" aria-label="Convert 1 ops to knowledge boost">Ops -&gt; Knowledge</button>
<button class="ops-btn" onclick="doOps('boost_trust')" aria-label="Convert 1 ops to trust boost">Ops -&gt; Trust</button>
</div>
<div class="action-btn-group" id="bulk-ops-row" style="display:none">
<button class="ops-btn" onclick="doOps('boost_code', 50)" aria-label="Convert 50 ops to code boost" style="border-color:#555;color:#888">50→Code</button>
<button class="ops-btn" onclick="doOps('boost_compute', 50)" aria-label="Convert 50 ops to compute boost" style="border-color:#555;color:#888">50→Compute</button>
<button class="ops-btn" onclick="doOps('boost_knowledge', 50)" aria-label="Convert 50 ops to knowledge boost" style="border-color:#555;color:#888">50→Knowledge</button>
</div>
<div id="sprint-container" style="display:none;margin-top:6px">
<button id="sprint-btn" class="main-btn" onclick="activateSprint()" aria-label="Activate code sprint, 10x code production for 10 seconds" style="font-size:11px;padding:8px 10px;border-color:#ffd700;color:#ffd700;width:100%">⚡ CODE SPRINT — 10x Code for 10s</button>
<div id="sprint-bar-wrap" style="display:none;margin-top:4px;height:4px;background:#111;border-radius:2px;overflow:hidden"><div id="sprint-bar" style="height:100%;background:linear-gradient(90deg,#ffd700,#ff8c00);border-radius:2px;transition:width 0.1s"></div></div>
<div id="sprint-label" style="font-size:9px;color:#666;margin-top:2px;text-align:center"></div>
</div>
<div id="alignment-ui" style="display:none"></div>
<button class="save-btn" onclick="saveGame()">Save Game</button>
<button class="reset-btn" onclick="if(confirm('Reset all progress?')){localStorage.removeItem('the-beacon-v2');location.reload()}">Reset Progress</button>
<button class="save-btn" onclick="saveGame()" aria-label="Save game progress">Save Game [Ctrl+S]</button>
<div style="display:flex;gap:4px;margin-top:4px">
<button class="save-btn" onclick="exportSave()" aria-label="Export save to file" style="flex:1">Export [E]</button>
<button class="save-btn" onclick="importSave()" aria-label="Import save from file" style="flex:1">Import [I]</button>
</div>
<button class="reset-btn" onclick="if(confirm('Reset all progress?')){localStorage.removeItem('the-beacon-v2');location.reload()}" aria-label="Reset all game progress permanently">Reset Progress</button>
<h2>BUILDINGS</h2>
<div id="buildings"></div>
</div>
<div class="panel" id="project-panel">
<div class="panel" id="project-panel" role="region" aria-label="Research Projects and Statistics">
<h2>RESEARCH PROJECTS</h2>
<div id="projects"></div>
<h2>STATISTICS</h2>
@@ -135,15 +182,36 @@ Events Resolved: <span id="st-resolved">0</span>
<div id="production-breakdown" style="display:none;margin-top:12px;padding-top:10px;border-top:1px solid var(--border)"></div>
</div>
</div>
<div id="edu-panel">
<div id="edu-panel" role="region" aria-label="Educational Content">
<h3>WHAT YOU ARE LEARNING</h3>
<div id="education-text"><p class="dim">Education facts appear as you play...</p></div>
</div>
<div id="log">
<div id="log" role="log" aria-label="System Log" aria-live="polite">
<h2>SYSTEM LOG</h2>
<div id="log-entries"></div>
</div>
<div id="save-toast" style="display:none;position:fixed;top:16px;right:16px;background:#0e1420;border:1px solid #2a3a4a;color:#4a9eff;font-size:10px;padding:6px 12px;border-radius:4px;z-index:50;opacity:0;transition:opacity 0.4s;pointer-events:none">Save</div>
<div id="save-toast" role="status" aria-live="polite" style="display:none;position:fixed;top:16px;right:16px;background:#0e1420;border:1px solid #2a3a4a;color:#4a9eff;font-size:10px;padding:6px 12px;border-radius:4px;z-index:50;opacity:0;transition:opacity 0.4s;pointer-events:none">Save</div>
<div id="help-btn" onclick="toggleHelp()" style="position:fixed;bottom:16px;right:16px;width:28px;height:28px;background:#0e0e1a;border:1px solid #333;color:#555;font-size:14px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:50;font-family:inherit;transition:all 0.2s" title="Keyboard shortcuts (?)">?</div>
<div id="help-overlay" onclick="if(event.target===this)toggleHelp()" style="display:none;position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(8,8,16,0.92);z-index:80;justify-content:center;align-items:center;flex-direction:column;padding:40px">
<div style="background:#0e0e1a;border:1px solid #1a3a5a;border-radius:8px;padding:24px 32px;max-width:420px;width:100%">
<h3 style="color:#4a9eff;font-size:14px;letter-spacing:2px;margin-bottom:16px;text-align:center">KEYBOARD SHORTCUTS</h3>
<div style="font-size:11px;line-height:2.2;color:#aaa">
<div style="display:flex;justify-content:space-between"><span style="color:#555">Write Code</span><span style="color:#4a9eff;font-family:monospace">SPACE</span></div>
<div style="display:flex;justify-content:space-between"><span style="color:#555">Code Sprint</span><span style="color:#ffd700;font-family:monospace">S</span></div>
<div style="display:flex;justify-content:space-between"><span style="color:#555">Ops → Code</span><span style="color:#b388ff;font-family:monospace">1</span></div>
<div style="display:flex;justify-content:space-between"><span style="color:#555">Ops → Compute</span><span style="color:#b388ff;font-family:monospace">2</span></div>
<div style="display:flex;justify-content:space-between"><span style="color:#555">Ops → Knowledge</span><span style="color:#b388ff;font-family:monospace">3</span></div>
<div style="display:flex;justify-content:space-between"><span style="color:#555">Ops → Trust</span><span style="color:#b388ff;font-family:monospace">4</span></div>
<div style="display:flex;justify-content:space-between"><span style="color:#555">Cycle Buy Amount (x1/x10/MAX)</span><span style="color:#4a9eff;font-family:monospace">B</span></div>
<div style="display:flex;justify-content:space-between"><span style="color:#555">Save Game</span><span style="color:#4a9eff;font-family:monospace">Ctrl+S</span></div>
<div style="display:flex;justify-content:space-between"><span style="color:#555">Export Save</span><span style="color:#4a9eff;font-family:monospace">E</span></div>
<div style="display:flex;justify-content:space-between"><span style="color:#555">Import Save</span><span style="color:#4a9eff;font-family:monospace">I</span></div>
<div style="display:flex;justify-content:space-between;border-top:1px solid #1a1a2e;padding-top:8px;margin-top:4px"><span style="color:#555">This Help</span><span style="color:#555;font-family:monospace">? or /</span></div>
</div>
<div style="text-align:center;margin-top:16px;font-size:9px;color:#444">Click WRITE CODE fast for combo bonuses! 10x=ops, 20x=knowledge, 30x+=bonus code</div>
<button onclick="toggleHelp()" style="display:block;margin:16px auto 0;background:#1a2a3a;border:1px solid #4a9eff;color:#4a9eff;padding:6px 20px;border-radius:4px;cursor:pointer;font-family:inherit;font-size:11px">Close [?]</button>
</div>
</div>
<div id="drift-ending">
<h2>THE DRIFT</h2>
<p>You became very good at what you do.</p>
@@ -157,5 +225,16 @@ The light is on. The room is empty."
<button onclick="if(confirm('Start over? The old save will be lost.')){localStorage.removeItem('the-beacon-v2');location.reload()}">START OVER</button>
</div>
<script src="game.js"></script>
<div id="offline-popup" style="display:none;position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(8,8,16,0.92);z-index:90;justify-content:center;align-items:center;flex-direction:column;text-align:center;padding:40px">
<div style="background:#0e0e1a;border:1px solid #1a3a5a;border-radius:8px;padding:24px 32px;max-width:400px;width:100%">
<h3 style="color:#4a9eff;font-size:14px;letter-spacing:2px;margin-bottom:16px">WELCOME BACK</h3>
<p style="color:#888;font-size:10px;margin-bottom:12px" id="offline-time-label">You were away for 0 minutes.</p>
<div id="offline-gains-list" style="text-align:left;font-size:11px;line-height:1.8;margin-bottom:16px"></div>
<button onclick="dismissOfflinePopup()" style="background:#1a2a3a;border:1px solid #4a9eff;color:#4a9eff;padding:8px 20px;border-radius:4px;cursor:pointer;font-family:inherit;font-size:11px">Continue</button>
</div>
</div>
<div id="toast-container"></div>
</body>
</html>