lionplayz007

Create a complete, modern, dark Minecraft-inspired website for a Minecraft SMP plugin called "Elemental Powers".

The website should feel like an official Minecraft fantasy SMP plugin website, with a polished UI, Minecraft-inspired pixel-art details, elemental effects, smooth animations, glowing cards, and a professional game-community design.

IMPORTANT:

Do not invent, remove, rename, or add any elements or abilities.

Use exactly the 15 elements listed below.

━━━━━━━━━━━━━━━━━━━━ ELEMENTAL POWERS ━━━━━━━━━━━━━━━━━━━━

  1. 🌪️ AIR

Rarity: Common Ability 1: Wind Blade Cooldown: 0 seconds Ability 2: Tornado Cooldown: 10 seconds

  1. 🌳 WOOD

Rarity: Common Ability 1: Vine Whip Cooldown: 0 seconds Ability 2: Thorn Shield Cooldown: 10 seconds

  1. 🌍 EARTH

Rarity: Common Ability 1: Rock Throw Cooldown: 0 seconds Ability 2: Earthquake Cooldown: 10 seconds

  1. 💧 WATER

Rarity: Uncommon Ability 1: Water Blast Cooldown: 0 seconds Ability 2: Healing Wave Cooldown: 10 seconds

  1. 🔥 FIRE

Rarity: Uncommon Ability 1: Fireball Cooldown: 0 seconds Ability 2: Flame Burst Cooldown: 10 seconds

  1. 🌿 NATURE

Rarity: Uncommon Ability 1: Healing Roots Cooldown: 0 seconds Ability 2: Poison Bloom Cooldown: 10 seconds

  1. ❄️ ICE

Rarity: Rare Ability 1: Ice Shard Cooldown: 0 seconds Ability 2: Freeze Cooldown: 10 seconds

  1. 🔩 METAL

Rarity: Rare Ability 1: Metal Spike Cooldown: 0 seconds Ability 2: Iron Armor Cooldown: 10 seconds

  1. ⚡ LIGHTNING

Rarity: Epic Ability 1: Lightning Bolt Cooldown: 0 seconds Ability 2: Chain Lightning Cooldown: 10 seconds

  1. ☠️ POISON

Rarity: Epic Ability 1: Poison Dart Cooldown: 0 seconds Ability 2: Toxic Cloud Cooldown: 10 seconds

  1. 💡 LIGHT

Rarity: Legendary Ability 1: Light Beam Cooldown: 0 seconds Ability 2: Radiant Shield Cooldown: 10 seconds

  1. 🌑 DARKNESS

Rarity: Legendary Ability 1: Shadow Bolt Cooldown: 0 seconds Ability 2: Dark Veil Cooldown: 10 seconds

  1. 👤 SHADOW

Rarity: Mythic Ability 1: Shadow Step Cooldown: 0 seconds Ability 2: Invisibility Cooldown: 10 seconds

  1. 🔋 ENERGY

Rarity: Mythic Ability 1: Energy Beam Cooldown: 0 seconds Ability 2: Energy Pulse Cooldown: 10 seconds

  1. 🌌 SPACE

Rarity: Divine Ability 1: Teleport Cooldown: 0 seconds Ability 2: Gravity Well Cooldown: 10 seconds

━━━━━━━━━━━━━━━━━━━━ RARITY SYSTEM ━━━━━━━━━━━━━━━━━━━━

Use these exact rarity tiers:

⚪ Common 🟢 Uncommon 🔵 Rare 🟣 Epic 🟠 Legendary 🔴 Mythic 🌈 Divine

Rarity distribution:

Common:

  • Air
  • Wood
  • Earth

Uncommon:

  • Water
  • Fire
  • Nature

Rare:

  • Ice
  • Metal

Epic:

  • Lightning
  • Poison

Legendary:

  • Light
  • Darkness

Mythic:

  • Shadow
  • Energy

Divine:

  • Space

Make each rarity visually distinct.

Common should look simple and clean.

Uncommon should have a stronger visual effect.

Rare should have a blue magical glow.

Epic should have a powerful purple effect.

Legendary should have an intense golden/orange effect.

Mythic should have an extremely powerful red/dark magical effect.

Divine should have the most impressive rainbow/cosmic effect with particles, stars, and a premium visual appearance.

━━━━━━━━━━━━━━━━━━━━ ABILITY SYSTEM ━━━━━━━━━━━━━━━━━━━━

Every element has exactly two abilities.

Ability 1:

  • Cooldown: 0 seconds
  • This is the primary/basic ability.

Ability 2:

  • Cooldown: 10 seconds
  • This is the secondary/stronger ability.

Show the cooldown clearly on every element card and ability card.

Use a visual cooldown badge such as: "0s Cooldown" "10s Cooldown"

━━━━━━━━━━━━━━━━━━━━ ELEMENT ACQUISITION SYSTEM ━━━━━━━━━━━━━━━━━━━━

Every element must have its own unique crafting recipe.

Players can obtain elements through crafting.

When a player joins the SMP for the first time, the player should randomly receive ONE element.

The random first-join element system applies to exactly 14 elements.

The 14 randomly obtainable elements are:

Air Wood Earth Water Fire Nature Ice Metal Lightning Poison Light Darkness Shadow Energy

IMPORTANT:

Space is the ONLY exception.

🌌 SPACE CANNOT be randomly received when a player joins the SMP.

Space is crafting-only.

Space can ONLY be obtained by crafting its special Divine recipe.

━━━━━━━━━━━━━━━━━━━━ CRAFTING RECIPE SYSTEM ━━━━━━━━━━━━━━━━━━━━

Every element must have its own unique Minecraft crafting recipe.

Create a dedicated "Crafting Recipes" page/section.

Each recipe should show:

  • Element name
  • Element emoji/icon
  • Rarity
  • 3x3 Minecraft crafting grid
  • Required Minecraft materials
  • Result item
  • Short description
  • Whether the element can be randomly obtained on SMP join

Higher-rarity elements should require more valuable and difficult-to-obtain Minecraft materials.

Common recipes should be relatively easy.

Uncommon recipes should require moderately valuable materials.

Rare recipes should require rare materials.

Epic recipes should require very rare materials.

Legendary recipes should require extremely valuable materials.

Mythic recipes should require end-game materials.

Divine Space should have the hardest and most prestigious crafting recipe of all.

Make the recipes feel balanced for an SMP survival progression system.

━━━━━━━━━━━━━━━━━━━━ FIRST JOIN SYSTEM ━━━━━━━━━━━━━━━━━━━━

Create a section called "First Join Element".

Explain that when a player joins the SMP for the first time, they receive one random element.

The player should receive exactly ONE random element.

Space must never be included in this random selection.

Add a visual random-element animation concept, such as a spinning elemental roulette/wheel.

Show the 14 eligible elements in the random selection.

Display a warning/info: "🌌 Space is not available through First Join Randomization."

━━━━━━━━━━━━━━━━━━━━ WEBSITE PAGES / SECTIONS ━━━━━━━━━━━━━━━━━━━━

Create these main sections:

  1. HOME
  2. ELEMENTS
  3. ABILITIES
  4. RARITIES
  5. CRAFTING RECIPES
  6. FIRST JOIN
  7. HOW IT WORKS
  8. PLUGIN FEATURES
  9. DOWNLOAD

━━━━━━━━━━━━━━━━━━━━ HOME / HERO SECTION ━━━━━━━━━━━━━━━━━━━━

Hero title:

"ELEMENTAL POWERS"

Subtitle:

"Master the Elements. Become Unstoppable."

Add a short description:

"Choose your element, master powerful abilities, craft legendary powers, and dominate the SMP."

Add two buttons:

"Explore Elements" "Download Plugin"

Use an impressive Minecraft-inspired elemental background with particles and magical effects.

━━━━━━━━━━━━━━━━━━━━ ELEMENTS PAGE ━━━━━━━━━━━━━━━━━━━━

Display all 15 elements as interactive cards.

Every card must show:

  • Emoji/icon
  • Element name
  • Rarity
  • Ability 1
  • Ability 1 cooldown
  • Ability 2
  • Ability 2 cooldown
  • Acquisition method
  • Crafting availability

Add hover animations.

When a card is clicked, open a detailed modal/page containing:

  • Element name
  • Rarity
  • Element description
  • Both abilities
  • Cooldowns
  • Crafting recipe
  • Acquisition method
  • First-join availability

━━━━━━━━━━━━━━━━━━━━ SEARCH AND FILTERS ━━━━━━━━━━━━━━━━━━━━

Add a search bar.

Users should be able to search elements by name.

Add rarity filters:

All Common Uncommon Rare Epic Legendary Mythic Divine

Add an acquisition filter:

All Random First Join Craftable Crafting Only

━━━━━━━━━━━━━━━━━━━━ ABILITIES PAGE ━━━━━━━━━━━━━━━━━━━━

Show all 30 abilities.

Organize them by element.

Clearly display:

Element Ability Cooldown Ability type

Remember:

There are exactly 2 abilities per element.

Total: 15 Elements 30 Abilities

━━━━━━━━━━━━━━━━━━━━ RARITIES PAGE ━━━━━━━━━━━━━━━━━━━━

Create a beautiful rarity progression section:

Common → Uncommon → Rare → Epic → Legendary → Mythic → Divine

Explain that Divine is the highest rarity.

Show which elements belong to each rarity.

━━━━━━━━━━━━━━━━━━━━ HOW IT WORKS ━━━━━━━━━━━━━━━━━━━━

Create a simple 4-step system:

STEP 1:

Join the SMP.

STEP 2:

Receive one random elemental power.

STEP 3:

Master your two elemental abilities.

STEP 4:

Craft other elemental powers and progress through the SMP.

Add an important note:

"Space is the only element that cannot be obtained through random first-join selection. It must be crafted."

━━━━━━━━━━━━━━━━━━━━ PLUGIN FEATURES ━━━━━━━━━━━━━━━━━━━━

Create feature cards for:

  • 15 Unique Elements
  • 30 Unique Abilities
  • Rarity System
  • Custom Crafting Recipes
  • Random First-Join Element
  • Space Divine Element
  • Ability Cooldowns
  • Element Progression
  • Responsive Configuration
  • SMP-Friendly Gameplay

━━━━━━━━━━━━━━━━━━━━ DOWNLOAD SECTION ━━━━━━━━━━━━━━━━━━━━

Create a professional download section.

Title:

"READY TO MASTER YOUR ELEMENT?"

Description:

"Bring Elemental Powers to your Minecraft SMP and give every player a unique elemental journey."

Add a large:

"DOWNLOAD PLUGIN"

button.

Also include placeholder buttons for:

"Documentation" "Discord" "GitHub"

Do not invent real URLs. Use placeholder links that can be replaced later.

━━━━━━━━━━━━━━━━━━━━ DESIGN REQUIREMENTS ━━━━━━━━━━━━━━━━━━━━

Use a dark Minecraft-inspired fantasy theme.

Use:

  • Dark backgrounds
  • Pixel-art-inspired borders
  • Minecraft-style UI details
  • Elemental particles
  • Glowing cards
  • Smooth hover effects
  • Subtle animations
  • Glass/metal fantasy panels
  • High-quality typography
  • Responsive layouts

The website should look like a premium Minecraft plugin website, not a generic AI-generated website.

Use strong visual hierarchy.

Make the Divine Space element visually stand out from every other element.

Make the website fully responsive for:

  • Desktop
  • Tablet
  • Mobile

Add smooth scrolling and polished page transitions.

Keep the UI fast, clean, readable, and professional.

━━━━━━━━━━━━━━━━━━━━ IMPORTANT RULES ━━━━━━━━━━━━━━━━━━━━

There are EXACTLY 15 elements.

There are EXACTLY 30 abilities.

Every element has EXACTLY 2 abilities.

Ability 1 always has a 0-second cooldown.

Ability 2 always has a 10-second cooldown.

Every element has its own crafting recipe.

14 elements can be randomly assigned on first SMP join.

Space is NOT randomly assigned.

Space is crafting-only.

Space is Divine rarity.

Do not create additional elements, abilities, rarities, or acquisition methods.

Do not change any element names, ability names, rarity names, or cooldowns listed above.

Build the website as a complete, polished, interactive Minecraft Elemental Powers plugin showcase.

Kodari AI
KodariAug 22 at 7:50 am 2
  1. Create the single-page website shell with all required sections and accessible modal/filter controls.

  2. Create the visual system with a dark Minecraft-fantasy theme, rarity-specific effects, responsive layouts, and animations.

  3. Create the interaction layer with exact element/ability/recipe data, search, filters, recipe rendering, roulette animation, modal details, and smooth navigation.

Implemented a complete responsive Elemental Powers website with:

  • Dark Minecraft-inspired fantasy UI

  • Exact 15 elements and 30 abilities

  • Rarity-specific card styling

  • Element search and rarity/acquisition filters

  • Interactive element detail modals

  • Complete crafting recipe section with 3×3 grids

  • First Join Element roulette interface

  • Exact 14-element randomization pool excluding Space

  • Rarity progression section

  • How It Works section

  • Plugin features section

  • Download, Documentation, Discord, and GitHub placeholder links

  • Responsive desktop, tablet, and mobile layouts

  • Smooth scrolling, reveal animations, glowing effects, and responsive navigation

Created files:

  • index.html

  • styles.css

  • script.js

Kodari can make mistakes. Review important code before using.
Files
index.html
script.js
styles.css
Code
3 338
script.js
const elements = [
  { name: 'Air', icon: '🌪️', rarity: 'Common', slug: 'common', description: 'A swift affinity that turns open space into momentum and motion.', abilities: [['Wind Blade', '0s', 'Primary'], ['Tornado', '10s', 'Secondary']], recipe: { grid: ['Fea', '—', 'Fea', 'Str', 'Wol', 'Str', '—', 'Fea', '—'], materials: ['Feather', 'String', 'White Wool'], description: 'A light, accessible recipe for a first elemental bond.' }, random: true },
  { name: 'Wood', icon: '🌳', rarity: 'Common', slug: 'common', description: 'A grounded affinity connected to the living grain and growth of the world.', abilities: [['Vine Whip', '0s', 'Primary'], ['Thorn Shield', '10s', 'Secondary']], recipe: { grid: ['Oak', '—', 'Oak', 'Oak', 'Sap', 'Oak', '—', 'Oak', '—'], materials: ['Oak Log', 'Oak Sapling', 'String'], description: 'A survival-friendly recipe shaped from the forest.' }, random: true },
  { name: 'Earth', icon: '🌍', rarity: 'Common', slug: 'common', description: 'A sturdy affinity drawn from the stone beneath every adventure.', abilities: [['Rock Throw', '0s', 'Primary'], ['Earthquake', '10s', 'Secondary']], recipe: { grid: ['Cob', '—', 'Cob', 'Gra', 'Cob', 'Gra', '—', 'Cob', '—'], materials: ['Cobblestone', 'Gravel', 'Granite'], description: 'A dependable early-game recipe using the ground around you.' }, random: true },
  { name: 'Water', icon: '💧', rarity: 'Uncommon', slug: 'uncommon', description: 'A fluid affinity that follows the rhythm of rivers, rain, and tides.', abilities: [['Water Blast', '0s', 'Primary'], ['Healing Wave', '10s', 'Secondary']], recipe: { grid: ['Ice', '—', 'Ice', 'Lap', 'Buc', 'Lap', '—', 'Ice', '—'], materials: ['Ice', 'Lapis Lazuli', 'Water Bucket'], description: 'A moderately valuable recipe for those who seek the current.' }, random: true },
  { name: 'Fire', icon: '🔥', rarity: 'Uncommon', slug: 'uncommon', description: 'A fierce affinity carrying the heat and hunger of an open flame.', abilities: [['Fireball', '0s', 'Primary'], ['Flame Burst', '10s', 'Secondary']], recipe: { grid: ['Coo', '—', 'Coo', 'Bla', 'Neth', 'Bla', '—', 'Coo', '—'], materials: ['Coal', 'Blaze Powder', 'Netherrack'], description: 'A warm Nether-touched recipe with a moderate cost.' }, random: true },
  { name: 'Nature', icon: '🌿', rarity: 'Uncommon', slug: 'uncommon', description: 'A flourishing affinity that binds healing and danger into one cycle.', abilities: [['Healing Roots', '0s', 'Primary'], ['Poison Bloom', '10s', 'Secondary']], recipe: { grid: ['Moss', '—', 'Moss', 'Aza', 'Bee', 'Aza', '—', 'Moss', '—'], materials: ['Moss Block', 'Azalea', 'Bee Nest'], description: 'A living recipe gathered from the greener corners of the world.' }, random: true },
  { name: 'Ice', icon: '❄️', rarity: 'Rare', slug: 'rare', description: 'A rare affinity that preserves, sharpens, and stills everything it touches.', abilities: [['Ice Shard', '0s', 'Primary'], ['Freeze', '10s', 'Secondary']], recipe: { grid: ['Pac', '—', 'Pac', 'Dia', 'Blu', 'Dia', '—', 'Pac', '—'], materials: ['Packed Ice', 'Diamond', 'Blue Ice'], description: 'A cold, rare recipe that demands diamond-level commitment.' }, random: true },
  { name: 'Metal', icon: '🔩', rarity: 'Rare', slug: 'rare', description: 'A forged affinity built from pressure, precision, and enduring strength.', abilities: [['Metal Spike', '0s', 'Primary'], ['Iron Armor', '10s', 'Secondary']], recipe: { grid: ['Iro', '—', 'Iro', 'Cop', 'Net', 'Cop', '—', 'Iro', '—'], materials: ['Iron Block', 'Copper Block', 'Netherite Scrap'], description: 'A forged recipe for players ready to work with rare ores.' }, random: true },
  { name: 'Lightning', icon: '⚡', rarity: 'Epic', slug: 'epic', description: 'An explosive affinity that moves faster than thought and strikes without warning.', abilities: [['Lightning Bolt', '0s', 'Primary'], ['Chain Lightning', '10s', 'Secondary']], recipe: { grid: ['Rod', '—', 'Rod', 'Eme', 'Cha', 'Eme', '—', 'Rod', '—'], materials: ['Lightning Rod', 'Emerald Block', 'Chain'], description: 'A charged epic recipe for bold explorers and builders.' }, random: true },
  { name: 'Poison', icon: '☠️', rarity: 'Epic', slug: 'epic', description: 'A dangerous affinity that rewards patience, precision, and control.', abilities: [['Poison Dart', '0s', 'Primary'], ['Toxic Cloud', '10s', 'Secondary']], recipe: { grid: ['Spi', '—', 'Spi', 'Fer', 'Anc', 'Fer', '—', 'Spi', '—'], materials: ['Spider Eye', 'Fermented Spider Eye', 'Ancient Debris'], description: 'A dangerous epic recipe combining rare and corrupted materials.' }, random: true },
  { name: 'Light', icon: '💡', rarity: 'Legendary', slug: 'legendary', description: 'A radiant affinity that cuts through the dark with focused brilliance.', abilities: [['Light Beam', '0s', 'Primary'], ['Radiant Shield', '10s', 'Secondary']], recipe: { grid: ['Sea', '—', 'Sea', 'Gol', 'Net', 'Gol', '—', 'Sea', '—'], materials: ['Sea Lantern', 'Gold Block', 'Nether Star'], description: 'An extremely valuable recipe for a radiant legendary bond.' }, random: true },
  { name: 'Darkness', icon: '🌑', rarity: 'Legendary', slug: 'legendary', description: 'A deep affinity that gathers in the spaces where light cannot reach.', abilities: [['Shadow Bolt', '0s', 'Primary'], ['Dark Veil', '10s', 'Secondary']], recipe: { grid: ['Obs', '—', 'Obs', 'Cry', 'Net', 'Cry', '—', 'Obs', '—'], materials: ['Obsidian', 'Crying Obsidian', 'Nether Star'], description: 'An extremely valuable recipe forged at the edge of the Nether.' }, random: true },
  { name: 'Shadow', icon: '👤', rarity: 'Mythic', slug: 'mythic', description: 'A mythic affinity that slips between sight, silence, and the unseen.', abilities: [['Shadow Step', '0s', 'Primary'], ['Invisibility', '10s', 'Secondary']], recipe: { grid: ['End', '—', 'End', 'Ely', 'Net', 'Ely', '—', 'End', '—'], materials: ['Ender Pearl', 'Elytra', 'Nether Star'], description: 'An end-game recipe reserved for those who reach the outer islands.' }, random: true },
  { name: 'Energy', icon: '🔋', rarity: 'Mythic', slug: 'mythic', description: 'A mythic affinity that stores raw potential and releases it in pulses.', abilities: [['Energy Beam', '0s', 'Primary'], ['Energy Pulse', '10s', 'Secondary']], recipe: { grid: ['Red', '—', 'Red', 'Net', 'Con', 'Net', '—', 'Red', '—'], materials: ['Redstone Block', 'Nether Star', 'Conduit'], description: 'An end-game recipe that turns rare reserves into raw potential.' }, random: true },
  { name: 'Space', icon: '🌌', rarity: 'Divine', slug: 'divine', description: 'The highest affinity: a cosmic bond shaped from distance, weight, and the stars beyond.', abilities: [['Teleport', '0s', 'Primary'], ['Gravity Well', '10s', 'Secondary']], recipe: { grid: ['Dra', 'Net', 'Dra', 'Net', 'Con', 'Net', 'Dra', 'Net', 'Dra'], materials: ['Dragon Egg', 'Nether Star', 'Conduit'], description: 'The hardest and most prestigious recipe in the elemental progression.' }, random: false }
];

const rarityInfo = [
  ['Common', '⚪', '#d8e1eb', 'The first spark.', ['Air', 'Wood', 'Earth']],
  ['Uncommon', '🟢', '#52dc85', 'A growing force.', ['Water', 'Fire', 'Nature']],
  ['Rare', '🔵', '#4e9fff', 'A magical edge.', ['Ice', 'Metal']],
  ['Epic', '🟣', '#b66aff', 'Power unleashed.', ['Lightning', 'Poison']],
  ['Legendary', '🟠', '#ffab51', 'A radiant legend.', ['Light', 'Darkness']],
  ['Mythic', '🔴', '#ff556d', 'Beyond the known.', ['Shadow', 'Energy']],
  ['Divine', '🌈', '#e8aaff', 'The highest rarity.', ['Space']]
];

const elementsGrid = document.querySelector('#elements-grid');
const abilityList = document.querySelector('#ability-list');
const recipesGrid = document.querySelector('#recipes-grid');
const rarityTrack = document.querySelector('#rarity-track');
const eligibleList = document.querySelector('#eligible-list');
let activeRarity = 'all';

function colorFor(element) { return { common: '#d8e1eb', uncommon: '#52dc85', rare: '#4e9fff', epic: '#b66aff', legendary: '#ffab51', mythic: '#ff556d', divine: '#e8aaff' }[element.slug]; }
function cooldownBadge(value) { return `<span class="cooldown">${value} Cooldown</span>`; }

function renderElements() {
  const query = document.querySelector('#element-search').value.trim().toLowerCase();
  const acquisition = document.querySelector('#acquisition-filter').value;
  const filtered = elements.filter(element => {
    const matchesQuery = element.name.toLowerCase().includes(query);
    const matchesRarity = activeRarity === 'all' || element.slug === activeRarity;
    const matchesAcquisition = acquisition === 'all' || (acquisition === 'random' && element.random) || (acquisition === 'craftable' && element.random) || (acquisition === 'crafting-only' && !element.random);
    return matchesQuery && matchesRarity && matchesAcquisition;
  });
  elementsGrid.innerHTML = filtered.map((element) => `<article class="element-card ${element.slug} reveal visible" style="--card-color:${colorFor(element)}" data-element="${element.name}">
    <div class="card-top"><span class="element-icon">${element.icon}</span><span class="rarity-pill">${element.rarity}</span></div>
    <h3>${element.name}</h3><div class="card-divider"></div>
    <div class="mini-ability"><span>${element.abilities[0][0]}</span>${cooldownBadge(element.abilities[0][1])}</div>
    <div class="mini-ability"><span>${element.abilities[1][0]}</span>${cooldownBadge(element.abilities[1][1])}</div>
    <div class="card-foot"><span>${element.random ? 'Random + Craftable' : 'Crafting Only'}</span><strong>View details →</strong></div>
  </article>`).join('');
  document.querySelector('#empty-state').hidden = filtered.length !== 0;
  elementsGrid.querySelectorAll('.element-card').forEach(card => card.addEventListener('click', () => openModal(card.dataset.element)));
}

function renderAbilities() {
  abilityList.innerHTML = elements.map(element => `<article class="ability-group ${element.slug}" style="--card-color:${colorFor(element)}"><div class="ability-group-head"><span class="element-icon">${element.icon}</span><h3>${element.name}</h3><span class="rarity-pill" style="margin-left:auto;color:${colorFor(element)}">${element.rarity}</span></div>${element.abilities.map((ability, index) => `<div class="ability-row"><div>${ability[0]}<small>${ability[2]} ability</small></div>${cooldownBadge(ability[1])}</div>`).join('')}</article>`).join('');
}

function renderRarities() {
  rarityTrack.innerHTML = rarityInfo.map((rarity, index) => `<article class="rarity-step" style="--rarity-color:${rarity[2]}"><span class="rarity-number">0${index + 1}</span><span class="rarity-symbol">${rarity[1]}</span><h3>${rarity[0]}</h3><p>${rarity[3]}</p><div class="rarity-members">${rarity[4].map(name => `<span>${name}</span>`).join('')}</div></article>`).join('');
}

function renderRecipes() {
  recipesGrid.innerHTML = elements.map(element => `<article class="recipe-card ${element.slug}" style="--card-color:${colorFor(element)}"><div class="recipe-head"><span class="element-icon">${element.icon}</span><div><h3>${element.name}</h3><small>${element.rarity} Recipe</small></div></div><div class="recipe-body"><div class="craft-grid">${element.recipe.grid.map(slot => `<span class="craft-slot">${slot}</span>`).join('')}</div><div class="craft-result">${element.icon}<b>${element.name}<br>Element</b></div></div><div class="recipe-materials"><p>${element.recipe.description}</p><div class="material-list">${element.recipe.materials.map(material => `<span>${material}</span>`).join('')}</div></div><div class="recipe-footer"><span>${element.random ? 'First Join Eligible' : 'First Join Unavailable'}</span><strong>${element.random ? 'Random + Craftable' : 'Crafting Only'}</strong></div></article>`).join('');
}

function openModal(name) {
  const element = elements.find(item => item.name === name);
  const backdrop = document.querySelector('#modal-backdrop');
  const modal = document.querySelector('#element-modal');
  modal.className = `element-modal ${element.slug}`;
  modal.style.setProperty('--card-color', colorFor(element));
  document.querySelector('#modal-icon').textContent = element.icon;
  document.querySelector('#modal-rarity').textContent = `${element.rarity} · ${element.random ? 'Random First Join + Craftable' : 'Crafting Only'}`;
  document.querySelector('#modal-title').textContent = element.name;
  document.querySelector('#modal-description').textContent = element.description;
  document.querySelector('#modal-abilities').innerHTML = element.abilities.map((ability, index) => `<div class="modal-ability"><div>${ability[0]}<small>${index === 0 ? 'Primary / basic ability' : 'Secondary / stronger ability'}</small></div>${cooldownBadge(ability[1])}</div>`).join('');
  document.querySelector('#modal-recipe').innerHTML = `<strong>Crafting recipe</strong>${element.recipe.description} Required materials: ${element.recipe.materials.join(', ')}.`;
  document.querySelector('#modal-acquisition').innerHTML = `<strong>Acquisition</strong>${element.random ? 'This element can be randomly received exactly once on a player’s first SMP join, and can also be crafted.' : '<b>Space cannot be randomly received when a player joins.</b> It can only be obtained by crafting its special Divine recipe.'}`;
  backdrop.hidden = false;
  document.body.style.overflow = 'hidden';
  document.querySelector('#modal-close').focus();
}

function closeModal() { document.querySelector('#modal-backdrop').hidden = true; document.body.style.overflow = ''; }

document.querySelector('#element-search').addEventListener('input', renderElements);
document.querySelector('#acquisition-filter').addEventListener('change', renderElements);
document.querySelectorAll('.filter-chip').forEach(button => button.addEventListener('click', () => { document.querySelectorAll('.filter-chip').forEach(chip => chip.classList.remove('selected')); button.classList.add('selected'); activeRarity = button.dataset.filter; renderElements(); }));
document.querySelector('#modal-close').addEventListener('click', closeModal);
document.querySelector('#modal-backdrop').addEventListener('click', event => { if (event.target.id === 'modal-backdrop') closeModal(); });
document.addEventListener('keydown', event => { if (event.key === 'Escape') closeModal(); });

const rouletteWheel = document.querySelector('#roulette-wheel');
const rouletteResult = document.querySelector('#roulette-result');
document.querySelector('#spin-button').addEventListener('click', event => {
  const button = event.currentTarget;
  const eligible = elements.filter(element => element.random);
  const winner = eligible[Math.floor(Math.random() * eligible.length)];
  button.disabled = true;
  rouletteResult.textContent = 'The elements are choosing...';
  rouletteWheel.style.animation = 'none';
  rouletteWheel.offsetHeight;
  rouletteWheel.style.animation = 'roulette-spin 2.4s cubic-bezier(.15,.8,.22,1)';
  setTimeout(() => { rouletteResult.innerHTML = `The world chose <strong style="color:${colorFor(winner)}">${winner.icon} ${winner.name}</strong>.`; button.disabled = false; }, 2450);
});

document.querySelectorAll('[data-placeholder]').forEach(link => link.addEventListener('click', event => { event.preventDefault(); }));
const navToggle = document.querySelector('.nav-toggle');
navToggle.addEventListener('click', () => { const nav = document.querySelector('.main-nav'); nav.classList.toggle('open'); navToggle.setAttribute('aria-expanded', nav.classList.contains('open')); });
document.querySelectorAll('.main-nav a').forEach(link => link.addEventListener('click', () => document.querySelector('.main-nav').classList.remove('open')));

const sections = document.querySelectorAll('main section[id]');
const navLinks = document.querySelectorAll('.main-nav a[href^="#"]');
const observer = new IntersectionObserver(entries => entries.forEach(entry => { if (entry.isIntersecting) { const matching = document.querySelector(`.main-nav a[href="#${entry.target.id}"]`); if (matching) { navLinks.forEach(link => link.classList.remove('active')); matching.classList.add('active'); } } }), { rootMargin: '-35% 0px -55% 0px' });
sections.forEach(section => observer.observe(section));
const revealObserver = new IntersectionObserver(entries => entries.forEach(entry => { if (entry.isIntersecting) { entry.target.classList.add('visible'); revealObserver.unobserve(entry.target); } }), { threshold: .08 });
document.querySelectorAll('.reveal').forEach(item => revealObserver.observe(item));

eligibleList.innerHTML = elements.filter(element => element.random).map(element => `<b>${element.icon} ${element.name}</b>`).join('');
renderElements();
renderAbilities();
renderRarities();
renderRecipes();