← Aethelgard results

Aethelgard

GPT 5.6 Luna Pro · typescript

Initial view of Aethelgard

Browser check: Artifact runtime error. This is a technical check, not a quality review.

Reviews & generation details

Reviews

No human review yet. Unreviewed does not mean unsuccessful.

Generation context

Imported historical artifact. Its exact original instructions and lineage are not known.

Generation prompt · exact text unavailable

See the current prompt for reference. It may differ from the instructions used to generate this artifact.

Inspect original source 24,780 bytes · SHA-256 17b3410d5ee6
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Aethelgard • Resonance Protocol</title>
<script src="https://cdn.tailwindcss.com/"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&amp;family=Space+Mono:wght@400;700&amp;display=swap">
<style>
/* ── css: main ── */
*{box-sizing:border-box} :root{font-family:Inter,system-ui,sans-serif;color:#edf2ff;background:#090b16;--violet:#9d7cff;--cyan:#61e7ff;--muted:#8992ad;--panel:rgba(22,25,45,.72)}body{margin:0;min-width:320px;background:radial-gradient(circle at 75% 10%,#251a4b 0,transparent 34%),radial-gradient(circle at 5% 90%,#102e43 0,transparent 30%),#090b16}button{font:inherit;color:inherit;cursor:pointer}#game{min-height:100vh;overflow:hidden}.topbar{height:76px;border-bottom:1px solid #2a2e4a;background:rgba(9,11,22,.7);backdrop-filter:blur(16px);display:flex;align-items:center;justify-content:space-between;padding:0 clamp(18px,5vw,70px);position:relative;z-index:5}.brand{display:flex;gap:12px;align-items:center;letter-spacing:2px}.brand-mark{color:var(--cyan);font-size:25px;text-shadow:0 0 18px var(--cyan)}.brand b{font-size:13px;display:block}.brand small{font:10px 'Space Mono';color:#777f9d;letter-spacing:1px}.header-right{display:flex;gap:22px;align-items:center;font:12px 'Space Mono';color:#abb4d5}.save-dot{color:#72e1ad}.icon-btn{background:none;border:0;color:#8e96b7;font-size:20px}.screen{display:none;min-height:calc(100vh - 76px);padding:clamp(28px,6vw,72px) clamp(18px,7vw,100px);animation:rise .45s ease both}.screen.active{display:block}@keyframes rise{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}.hero-grid{max-width:1180px;margin:auto;display:grid;grid-template-columns:1fr 1fr;min-height:610px;align-items:center}.eyebrow{font:11px 'Space Mono';letter-spacing:2px;color:var(--cyan);margin:0 0 18px}.hero-copy h1{font-size:clamp(48px,7vw,86px);line-height:.95;letter-spacing:-5px;margin:0 0 28px;font-weight:800}.hero-copy h1 em{font-style:normal;color:var(--violet);text-shadow:0 0 30px #9d7cff55}.lede{max-width:470px;color:#a6aec8;line-height:1.75;font-size:15px}.menu-actions{display:flex;gap:12px;margin-top:34px;flex-wrap:wrap}.primary-btn,.ghost-btn{border:1px solid #6e57c9;border-radius:8px;padding:14px 19px;background:linear-gradient(110deg,#7659df,#4b46a7);box-shadow:0 10px 30px #5649bb33;font-weight:700;font-size:12px;letter-spacing:1px}.primary-btn span{margin-left:28px;font-size:18px}.ghost-btn{background:#14172a;border-color:#363b5d;color:#b5bdd9;box-shadow:none}.ghost-btn:hover,.icon-btn:hover{border-color:var(--cyan);color:white}.ghost-btn.small{padding:10px 13px;font-size:10px}.hint{font:10px 'Space Mono';color:#656d8b;margin-top:28px}.hint span{color:#4eafaa;margin:0 7px}.hero-art{height:430px;position:relative;display:grid;place-items:center}.core{width:160px;height:160px;border-radius:35px;transform:rotate(45deg);border:1px solid #8de9ff99;background:linear-gradient(135deg,#69e8ff22,#8066ff44);box-shadow:0 0 100px #6154ed66,inset 0 0 30px #61e7ff44;display:grid;place-items:center;font-size:65px;color:#d7fbff}.core span{position:absolute;transform:rotate(-45deg);font:11px 'Space Mono';bottom:30px;color:var(--cyan)}.orbit{position:absolute;border:1px solid #6360aa66;border-radius:50%;transform:rotate(-25deg)}.orbit-a{width:340px;height:150px}.orbit-b{width:430px;height:250px;transform:rotate(35deg);border-color:#5de0e944}.signal{position:absolute;font:10px 'Space Mono';color:#8c96b8;background:#151a30;border:1px solid #343a60;padding:8px 10px;border-radius:4px}.s1{top:54px;right:28px;color:#ff9c70}.s2{bottom:75px;left:5px;color:#70dbff}.s3{top:170px;left:0;color:#d8ee73}.section-head{display:flex;justify-content:space-between;gap:20px;align-items:end;max-width:1180px;margin:0 auto 28px}.section-head h2{font-size:38px;letter-spacing:-2px;margin:0 0 7px}.muted{color:var(--muted);margin:0}.head-actions{display:flex;gap:8px}.zone-tabs{max-width:1180px;margin:auto;display:flex;gap:8px;overflow:auto;padding-bottom:20px}.zone-tab{min-width:190px;text-align:left;padding:16px;border:1px solid #2d3150;background:#111429;border-radius:8px}.zone-tab.active{border-color:var(--cyan);background:#16233b;box-shadow:0 0 24px #61e7ff16}.zone-tab b{display:block;font-size:12px;margin-bottom:7px}.zone-tab span{font:10px 'Space Mono';color:#7e88a6}.zone-content{max-width:1180px;margin:auto;border:1px solid #2d3355;border-radius:14px;background:linear-gradient(135deg,#151a31dd,#101426dd);padding:25px;min-height:365px}.trail{display:flex;align-items:center;justify-content:space-around;position:relative;padding:45px 10px}.trail:before{content:'';height:2px;background:linear-gradient(90deg,var(--violet),var(--cyan));position:absolute;left:7%;right:7%;top:50%;opacity:.6}.node{width:106px;height:106px;border-radius:50%;border:1px solid #465079;background:#171d36;z-index:1;text-align:center;padding:17px 6px;font-size:25px;transition:.2s}.node:hover{transform:translateY(-8px);border-color:var(--cyan);box-shadow:0 0 25px #61e7ff55}.node span{display:block;font:9px 'Space Mono';color:#aab4d5;margin-top:8px}.node.locked{filter:grayscale(1);opacity:.4}.zone-caption{display:flex;justify-content:space-between;align-items:center;border-top:1px solid #2d3355;padding-top:20px;color:#9da8c9;font-size:13px}.battle-arena{max-width:1050px;margin:30px auto 15px;display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:center}.combatant{border:1px solid #343b61;background:#14182bcb;border-radius:14px;padding:20px;position:relative}.combatant.enemy{margin-top:30px}.combatant h3{margin:0 0 5px;font-size:22px}.meta{font:10px 'Space Mono';color:#98a3c3}.hp-wrap{height:10px;background:#30354c;border-radius:9px;margin-top:16px;overflow:hidden}.hp{height:100%;background:linear-gradient(90deg,#44d69b,#b5e85f);transition:.35s;width:70%}.hp.low{background:linear-gradient(90deg,#ff5e76,#ffb45e)}.sprite{height:160px;display:grid;place-items:center;font-size:85px;filter:drop-shadow(0 12px 15px #0008);animation:bob 2s infinite ease-in-out}@keyframes bob{50%{transform:translateY(-9px)}}.battle-log{max-width:1050px;margin:auto;min-height:36px;color:#aeb8d4;font:12px 'Space Mono';border-left:2px solid var(--cyan);padding:10px 14px}.battle-actions{max-width:1050px;margin:14px auto;display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.action-btn{background:#191d34;border:1px solid #363e60;padding:15px 10px;border-radius:7px;text-align:left}.action-btn:hover{border-color:var(--violet);background:#252044}.action-btn b{display:block;font-size:12px}.action-btn small{color:#8994b4;font:10px 'Space Mono'}.dex-grid{max-width:1180px;margin:auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:12px}.dex-card{padding:16px;background:#14182c;border:1px solid #2d3555;border-radius:10px}.dex-card h3{margin:0 0 8px}.type{font:10px 'Space Mono';padding:4px 7px;border-radius:3px;background:#312958;color:#c7bcff}.modal{position:fixed;inset:0;background:#070912aa;backdrop-filter:blur(10px);z-index:20;display:grid;place-items:center;padding:20px}.modal.hidden{display:none}.modal-card{max-width:520px;width:100%;padding:26px;border:1px solid #52619a;background:#14182b;border-radius:14px;box-shadow:0 20px 70px #0009}.modal-card h2{margin-top:0}.shop-items{display:grid;gap:8px}.shop-item{display:flex;justify-content:space-between;align-items:center;padding:13px;border:1px solid #303858;border-radius:7px}.toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%) translateY(90px);background:#d9f8ff;color:#101526;padding:11px 18px;border-radius:6px;font:11px 'Space Mono';z-index:30;transition:.3s}.toast.show{transform:translateX(-50%)}@media(max-width:720px){.hero-grid{grid-template-columns:1fr;min-height:auto;padding-top:35px}.hero-art{height:260px;order:-1}.core{width:105px;height:105px;font-size:40px}.orbit-a{width:230px;height:110px}.orbit-b{width:290px;height:165px}.signal{font-size:8px}.section-head{align-items:start;flex-direction:column}.battle-arena{grid-template-columns:1fr}.combatant.enemy{margin-top:0}.battle-actions{grid-template-columns:repeat(2,1fr)}.trail{gap:8px;padding:25px 0}.node{width:72px;height:72px;font-size:17px;padding:12px 2px}.node span{font-size:7px}.zone-content{padding:14px}.hero-copy h1{letter-spacing:-3px}.header-right{gap:10px;font-size:10px}}
</style>
</head>
<body>
<div id="game"><header class="topbar"><div class="brand"><span class="brand-mark">✦</span><div><b>AETHELGARD</b><small>RESONANCE PROTOCOL</small></div></div><div class="header-right"><span id="save-state" class="save-dot">● SYNCED</span><span id="shards">◈ 120</span><button id="audio-btn" class="icon-btn" aria-label="Toggle audio">♫</button></div></header><main><section id="menu-screen" class="screen active"><div class="hero-grid"><div class="hero-copy"><p class="eyebrow">FIELD OPERATIVE // 07</p><h1>Conduct the<br><em>impossible.</em></h1><p class="lede">Aethelgard is vibrating out of tune. Build your resonance team, cross fractured zones, and restore the world's harmonic core.</p><div class="menu-actions"><button id="continue-btn" class="primary-btn">ENTER THE FIELD <span>→</span></button><button id="new-btn" class="ghost-btn">NEW HARMONIC PROFILE</button></div><p class="hint">AUTO-SAVE ACTIVE <span>•</span> LOCAL PROFILE ENCRYPTED</p></div><div class="hero-art"><div class="orbit orbit-a"></div><div class="orbit orbit-b"></div><div class="core">✦<span>AE</span></div><div class="signal s1">PYRO / 94.2</div><div class="signal s2">HYDRO / 71.8</div><div class="signal s3">VOLT / 88.6</div></div></div></section><section id="map-screen" class="screen"><div class="section-head"><div><p class="eyebrow">NAVIGATION // AETHELGARD</p><h2>Resonance Atlas</h2><p class="muted">Trace the signal. Stabilize each node.</p></div><div class="head-actions"><button id="dex-btn" class="ghost-btn small">◈ CONDUCTORS DEX</button><button id="shop-btn" class="ghost-btn small">⌂ FIELD SHOP</button></div></div><div id="zone-tabs" class="zone-tabs"></div><div id="zone-content" class="zone-content"></div></section><section id="battle-screen" class="screen"><div class="battle-top"><button id="flee-btn" class="ghost-btn small">← ABORT SIGNAL</button><span id="battle-label" class="eyebrow">LIVE HARMONIC // WILD SIGNAL</span></div><div id="battle-arena" class="battle-arena"></div><div id="battle-log" class="battle-log"></div><div id="battle-actions" class="battle-actions"></div></section><section id="dex-screen" class="screen"><div class="section-head"><div><p class="eyebrow">ARCHIVE // 18 KNOWN FREQUENCIES</p><h2>Conductors Dex</h2></div><button id="dex-back" class="ghost-btn small">← ATLAS</button></div><div id="dex-grid" class="dex-grid"></div></section></main><div id="modal" class="modal hidden"></div><div id="toast" class="toast"></div></div>
<script>
(function () {
'use strict';
var __mods = {};
var __cache = {};
var __map = {};
function __require(id) {
  if (__cache[id]) return __cache[id].exports;
  var module = __cache[id] = { exports: {} };
  var factory = __mods[id];
  if (!factory) throw new Error("Module not found: " + id);
  factory(module.exports, function (spec) {
    var target = (__map[id] && __map[id][spec]) || spec;
    return __require(target);
  }, module);
  return module.exports;
}

// ── module: src/main.ts ──
__mods["src/main.ts"] = function (exports, require, module) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const families = [
    { names: ['Emberkit', 'Pyrowolf', 'Ignisaur'], type: 'Pyro', emoji: '🔥', base: [42, 18, 14, 16] },
    { names: ['Droplet', 'Geoxus', 'Neptunian'], type: 'Hydro', emoji: '💧', base: [46, 16, 17, 13] },
    { names: ['Seedling', 'Thornback', 'Bloomgoliath'], type: 'Flora', emoji: '🌿', base: [48, 15, 20, 10] },
    { names: ['Sparky', 'Boltsaber', 'Stormlord'], type: 'Volt', emoji: '⚡', base: [38, 20, 12, 22] },
    { names: ['Gusty', 'Slipstream', 'Zephyrus'], type: 'Zephyr', emoji: '🪶', base: [40, 16, 13, 24] },
    { names: ['Pebble', 'Obsidian', 'Terrasunder'], type: 'Earth', emoji: '◈', base: [52, 19, 23, 8] }
];
const species = [];
families.forEach(f => f.names.forEach((name, i) => species.push({ name, type: f.type, emoji: f.emoji, base: f.base.map(v => v + i * 9), evo: i < 2 ? [8, 15][i] : 99, moves: [{ name: 'Resonant Pulse', power: 32 + i * 7, element: f.type }, { name: 'Harmonic Break', power: 46 + i * 8, element: f.type }, { name: 'Prism Surge', power: 62 + i * 9, element: f.type }] })));
const zones = [{ name: 'Verdant Canopy', range: 'LV 1—5', desc: 'Luminous boughs where Flora and Zephyr frequencies braid through the mist.', nodes: [['🌾', 'WILD SIGNAL'], ['✦', 'MYSTERY CACHE'], ['♨', 'HEALING SPRING'], ['◉', 'GATEKEEPER']] }, { name: 'Sunken Grotto', range: 'LV 5—10', desc: 'An aquatic cathedral beneath the roots. The tide remembers every frequency.', nodes: [['🌊', 'WILD SIGNAL'], ['♢', 'WANDERING CONDUCTOR'], ['✦', 'MYSTERY CACHE'], ['◉', 'GATEKEEPER']] }, { name: 'Obsidian Crags', range: 'LV 10—15', desc: 'Black glass ridges charged by Pyro storms and Volt weather.', nodes: [['⚡', 'WILD SIGNAL'], ['♨', 'HEALING SPRING'], ['♢', 'WANDERING CONDUCTOR'], ['◉', 'GATEKEEPER']] }, { name: 'Apex Pillar', range: 'LV 15+', desc: 'The world-spine. Four final harmonics converge above the cloudline.', nodes: [['🔥', 'WILD SIGNAL'], ['♢', 'CONDUCTOR DUEL'], ['◉', 'FINAL GATE']] }];
class Synth {
    constructor() {
        this.ctx = null;
        this.enabled = true;
    }
    play(kind) { if (!this.enabled)
        return; this.ctx ?? (this.ctx = new AudioContext()); const o = this.ctx.createOscillator(), g = this.ctx.createGain(); o.type = 'square'; o.frequency.value = kind === 'hit' ? 180 : kind === 'select' ? 520 : kind === 'level' ? 760 : 340; g.gain.setValueAtTime(.035, this.ctx.currentTime); g.gain.exponentialRampToValueAtTime(.001, this.ctx.currentTime + .16); o.connect(g); g.connect(this.ctx.destination); o.start(); o.stop(this.ctx.currentTime + .17); }
}
const synth = new Synth();
let profile = { shards: 120, zone: 0, team: [0], inventory: { prism: 5, elixir: 2, cleanser: 2 }, bosses: [] };
let team = [];
let active = 0;
let enemy = null;
let wild = true;
let battleZone = 0;
const $ = (id) => document.getElementById(id);
function save() { localStorage.setItem('aethelgard-save', JSON.stringify({ profile, team: team.map(m => ({ id: species.indexOf(m.species), level: m.level, hp: m.hp, max: m.max, xp: m.xp })) })); $('shards').textContent = '◈ ' + profile.shards; $('save-state').textContent = '● SYNCED'; }
function load() { const raw = localStorage.getItem('aethelgard-save'); if (raw) {
    try {
        const d = JSON.parse(raw);
        profile = d.profile;
        team = d.team.map((m) => ({ ...m, species: species[m.id] }));
    }
    catch {
        reset();
    }
}
else
    reset(); save(); }
function reset() { profile = { shards: 120, zone: 0, team: [0], inventory: { prism: 5, elixir: 2, cleanser: 2 }, bosses: [] }; team = [make(species[0], 3)]; }
function make(s, l) { return { species: s, level: l, max: s.base[0] + l * 4, hp: s.base[0] + l * 4, xp: 0 }; }
function screen(id) { document.querySelectorAll('.screen').forEach(x => x.classList.remove('active')); $(id).classList.add('active'); }
function toast(t) { const e = $('toast'); e.textContent = t; e.classList.add('show'); setTimeout(() => e.classList.remove('show'), 2200); }
function renderMap() { screen('map-screen'); $('zone-tabs').innerHTML = zones.map((z, i) => `<button class="zone-tab ${i === profile.zone ? 'active' : ''}" data-zone="${i}"><b>${z.name}</b><span>${z.range} · ${i <= profile.zone ? 'UNLOCKED' : 'LOCKED'}</span></button>`).join(''); document.querySelectorAll('[data-zone]').forEach(b => b.onclick = () => { const i = +b.dataset.zone; if (i <= profile.zone) {
    battleZone = i;
    renderMap();
} }); const z = zones[battleZone]; $('zone-content').innerHTML = `<p class="eyebrow">ACTIVE REGION // ${String(battleZone + 1).padStart(2, '0')}</p><h3>${z.name}</h3><p class="muted">${z.desc}</p><div class="trail">${z.nodes.map((n, i) => `<button class="node" data-node="${i}">${n[0]}<span>${n[1]}</span></button>`).join('')}</div><div class="zone-caption"><span>Signal integrity <b style="color:#70e0b0">${92 - battleZone * 7}%</b></span><span>PARTY ${team.length}/3 · ${team.map(m => m.species.name).join(' / ')}</span></div>`; document.querySelectorAll('[data-node]').forEach(b => b.onclick = () => node(+b.dataset.node)); save(); }
function node(i) { synth.play('select'); if (i === 2 && zones[battleZone].nodes[i][1].includes('HEAL')) {
    team.forEach(m => m.hp = m.max);
    toast('Healing spring restored the party.');
    save();
    renderMap();
    return;
} if (i === 1 && zones[battleZone].nodes[i][1].includes('CACHE')) {
    profile.shards += 45;
    profile.inventory.prism++;
    toast('Cache opened: +45 shards, +1 prism.');
    save();
    renderMap();
    return;
} const s = species[(battleZone * 2 + i) % species.length]; enemy = make(s, Math.max(2, battleZone * 5 + 3 + i)); wild = !zones[battleZone].nodes[i][1].includes('CONDUCTOR') && !zones[battleZone].nodes[i][1].includes('GATE'); startBattle(); }
function startBattle() { screen('battle-screen'); renderBattle(); const bossLines = ['The Canopy Gatekeeper: “Every leaf carries a note. Prove you can hear the whole chord.”', 'The Grotto Warden: “The deep remembers your footsteps, Conductor. Sink or synchronize.”', 'The Crags Sentinel: “Ash and lightning do not forgive dissonance. Strike with intent.”', 'The Apex Custodian: “At the pillar, there is no wild signal—only the frequency you chose.”']; log(wild ? 'A wild Resonant answers your frequency.' : bossLines[battleZone]); }
function log(t) { $('battle-log').textContent = t; }
function renderBattle() { if (!enemy)
    return; const p = team[active]; $('battle-arena').innerHTML = `<div class="combatant enemy"><div class="meta">OPPOSING SIGNAL · LV ${enemy.level}</div><h3>${enemy.species.name}</h3><div class="sprite">${enemy.species.emoji}</div><div class="hp-wrap"><div class="hp ${enemy.hp < enemy.max * .3 ? 'low' : ''}" style="width:${enemy.hp / enemy.max * 100}%"></div></div><div class="meta">${enemy.hp} / ${enemy.max} HP</div></div><div class="combatant"><div class="meta">ACTIVE RESONANT · LV ${p.level}</div><h3>${p.species.name}</h3><div class="sprite">${p.species.emoji}</div><div class="hp-wrap"><div class="hp ${p.hp < p.max * .3 ? 'low' : ''}" style="width:${p.hp / p.max * 100}%"></div></div><div class="meta">${p.hp} / ${p.max} HP · XP ${p.xp}/100</div></div>`; $('battle-actions').innerHTML = `${p.species.moves.map((m, i) => `<button class="action-btn" data-move="${i}"><b>${m.name}</b><small>${m.element} · PWR ${m.power}</small></button>`).join('')}<button class="action-btn" id="prism-btn"><b>◇ Aether Prism</b><small>${profile.inventory.prism} remaining</small></button><button class="action-btn" id="heal-btn"><b>+ Core Restorer</b><small>${profile.inventory.elixir} remaining</small></button>`; document.querySelectorAll('[data-move]').forEach(b => b.onclick = () => attack(+b.dataset.move)); $('prism-btn').onclick = capture; $('heal-btn').onclick = heal; }
function modifier(a, b) { return (a === 'Pyro' && b === 'Flora') || (a === 'Hydro' && b === 'Pyro') || (a === 'Flora' && b === 'Hydro') || (a === 'Zephyr' && b === 'Earth') || (a === 'Earth' && b === 'Volt') || (a === 'Volt' && b === 'Zephyr') ? 1.7 : ((a === 'Pyro' && b === 'Hydro') || (a === 'Hydro' && b === 'Flora') || (a === 'Flora' && b === 'Pyro') || (a === 'Zephyr' && b === 'Volt') || (a === 'Earth' && b === 'Zephyr') || (a === 'Volt' && b === 'Earth') ? .65 : 1); }
function attack(i) { if (!enemy)
    return; const p = team[active], m = p.species.moves[i], crit = Math.random() < .1, d = Math.max(1, Math.floor(((2 * p.level / 5 + 2) * m.power * (p.species.base[1] / enemy.species.base[2]) / 50 + 2) * modifier(m.element, enemy.species.type) * (crit ? 1.5 : .9))); enemy.hp = Math.max(0, enemy.hp - d); synth.play('hit'); log(`${m.name} dealt ${d} damage${crit ? ' — CRITICAL HARMONIC' : ''}.`); if (enemy.hp <= 0) {
    win();
    return;
} setTimeout(() => enemyTurn(), 450); renderBattle(); }
function enemyTurn() { if (!enemy)
    return; const p = team[active], d = Math.max(1, Math.floor((enemy.species.base[1] * enemy.level / Math.max(1, p.species.base[2])) * .45)); p.hp = Math.max(0, p.hp - d); log(`${enemy.species.name} disrupted ${p.species.name} for ${d}.`); if (p.hp <= 0) {
    p.hp = 1;
    toast('Your Resonant held the line.');
} renderBattle(); save(); }
function win() { if (!enemy)
    return; const p = team[active]; p.xp += 55; p.hp = Math.min(p.max, p.hp + 8); profile.shards += wild ? 25 : 60; if (p.xp >= 100) {
    p.xp -= 100;
    p.level++;
    p.max += 5;
    p.hp = p.max;
    synth.play('level');
    toast(`${p.species.name} reached level ${p.level}!`);
    const evo = species.find(s => s.name === p.species.name);
    if (evo && evo.evo <= p.level) {
        const next = species[species.indexOf(evo) + 1];
        p.species = next;
        toast(`Evolution: ${next.name}!`);
    }
} if (!wild && !profile.bosses.includes(battleZone)) {
    profile.bosses.push(battleZone);
    profile.zone = Math.min(3, profile.zone + 1);
    toast('Zone unlocked. The atlas expands.');
} log('Signal stabilized. Rewards secured.'); save(); setTimeout(renderMap, 900); }
function capture() { if (!enemy || !wild)
    return toast('Conductors cannot be captured.'); if (profile.inventory.prism < 1)
    return toast('No Aether Prisms remaining.'); profile.inventory.prism--; const chance = .25 + (1 - enemy.hp / enemy.max) * .6; if (Math.random() < chance) {
    team.push(enemy);
    toast(`${enemy.species.name} harmonized with your prism.`);
    save();
    setTimeout(renderMap, 700);
}
else {
    log('The prism cracked. The wild signal resists.');
    enemyTurn();
    renderBattle();
} }
function heal() { const p = team[active]; if (profile.inventory.elixir < 1)
    return toast('No Core Restorers remaining.'); profile.inventory.elixir--; p.hp = Math.min(p.max, p.hp + Math.floor(p.max * .5)); toast('Core restored by 50%.'); renderBattle(); save(); }
function renderDex() { screen('dex-screen'); $('dex-grid').innerHTML = species.map((s, i) => `<article class="dex-card"><div class="sprite" style="height:76px">${s.emoji}</div><h3>${String(i + 1).padStart(2, '0')} · ${s.name}</h3><span class="type">${s.type}</span><p class="meta">BASE ${s.base.join(' / ')}<br>EVOLUTION ${s.evo === 99 ? '—' : `LV ${s.evo}`}</p></article>`).join(''); }
function shop() { $('modal').classList.remove('hidden'); $('modal').innerHTML = `<div class="modal-card"><p class="eyebrow">CAMP SHOP // EXCHANGE SHARDS</p><h2>Field Supply</h2><div class="shop-items"><div class="shop-item"><span>Harmonizer Prism ×3</span><button class="primary-btn" data-buy="prism">40 ◈</button></div><div class="shop-item"><span>Core Restorer ×1</span><button class="primary-btn" data-buy="elixir">35 ◈</button></div><div class="shop-item"><span>Resonance Elixir ×1</span><button class="primary-btn" data-buy="cleanser">50 ◈</button></div></div><button class="ghost-btn" id="close-modal" style="margin-top:18px">CLOSE</button></div>`; $('close-modal').onclick = () => $('modal').classList.add('hidden'); document.querySelectorAll('[data-buy]').forEach(b => b.onclick = () => { const k = b.dataset.buy, cost = k === 'prism' ? 40 : k === 'elixir' ? 35 : 50; if (profile.shards >= cost) {
    profile.shards -= cost;
    profile.inventory[k]++;
    toast('Supply acquired.');
    save();
    shop();
}
else
    toast('Not enough shards.'); }); }
function start() { load(); $('continue-btn').onclick = renderMap; $('new-btn').onclick = () => { if (confirm('Reset your harmonic profile?')) {
    localStorage.removeItem('aethelgard-save');
    load();
    toast('New profile initialized.');
} }; $('flee-btn').onclick = renderMap; $('dex-btn').onclick = renderDex; $('dex-back').onclick = renderMap; $('shop-btn').onclick = shop; $('audio-btn').onclick = () => { synth.enabled = !synth.enabled; toast(synth.enabled ? 'Audio enabled' : 'Audio muted'); }; renderMap(); screen('menu-screen'); }
start();
};

// ── entry ──
__require("src/main.ts");
})();
</script>
</body>
</html>
<!-- agent-meta {"model":"openai/gpt-5.6-luna-pro","provider":"openrouter","persona":"typescript","sessionId":"8f3ad612-a26e-45e0-8a26-6c9bef27947d","tokensIn":403200,"tokensOut":28105,"tokensTotal":431305,"turns":11,"toolCalls":18,"failedToolCalls":3,"timestamp":"2026-07-31T03:41:17.218Z"} -->