:root {
    --bg-dark: #060810;
    --bg-panel: #0d1525;
    --bg-panel-border: #1e293b;
    --accent-gold: #f59e0b;
    --accent-red: #ef4444;
    --accent-blue: #0284c7;
    --accent-green: #10b981;
    --accent-purple: #a855f7;
    --accent-cyan: #00f0ff;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Cinzel', serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    line-height: 1.5;
}

.game-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 20px;
    max-width: 1440px;
    margin: 0 auto;
}

/* App Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-panel);
    border: 1px solid var(--bg-panel-border);
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.badge-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent-gold);
    background: rgba(245, 158, 11, 0.15);
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 4px;
}

.app-header h1 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    letter-spacing: 1px;
}

.accent-gold { color: var(--accent-gold); }

.turn-box {
    background: #141f36;
    border: 1px solid var(--accent-gold);
    padding: 8px 18px;
    border-radius: 30px;
}

.turn-pill {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-gold);
    font-weight: 700;
}

.header-actions { display: flex; gap: 10px; }

.btn {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--bg-panel-border);
    background: #1e293b;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.btn:hover { background: #334155; border-color: var(--accent-gold); }
.btn-gold { background: var(--accent-gold); color: #000; font-weight: 700; border: none; }
.btn-gold:hover { background: #d97706; color: #fff; }
.btn-secondary { background: #141f36; color: var(--text-muted); }
.btn-mic { background: rgba(2, 132, 199, 0.2); border-color: var(--accent-blue); color: var(--accent-blue); }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; font-family: var(--font-mono); }

/* Main Arena Grid */
.arena-grid {
    display: grid;
    grid-template-columns: 320px 1fr 340px;
    gap: 20px;
    flex: 1;
}

@media (max-width: 1200px) {
    .arena-grid { grid-template-columns: 1fr; }
}

.panel {
    background: var(--bg-panel);
    border: 1px solid var(--bg-panel-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
}

.panel-header h3 {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    color: var(--accent-gold);
}

.level-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    padding: 2px 8px;
    border-radius: 12px;
}

/* Vitals & Meters */
.vitals-group { display: flex; flex-direction: column; gap: 4px; }
.stat-row { display: flex; justify-content: space-between; font-size: 0.85rem; font-family: var(--font-mono); }

.meter-bar {
    height: 10px;
    background: #1e293b;
    border-radius: 5px;
    overflow: hidden;
}

.meter-bar.large { height: 14px; border-radius: 7px; }

.meter-fill { height: 100%; transition: width 0.4s ease; }
.fill-green { background: var(--accent-green); }
.fill-blue { background: var(--accent-blue); }
.fill-red { background: var(--accent-red); }

.buffs-container { display: flex; flex-wrap: wrap; gap: 6px; }

.buff-pill {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: #141f36;
    border: 1px solid var(--bg-panel-border);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 12px;
}

/* Quick Spells */
.quick-spells h4 {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.template-buttons { display: flex; flex-direction: column; gap: 8px; }

.template-btn {
    background: #121c2e;
    border: 1px solid var(--bg-panel-border);
    color: var(--text-main);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-btn:hover {
    border-color: var(--accent-gold);
    background: #182740;
    transform: translateX(4px);
}

/* Center Stage & Boss */
.center-stage { flex: 1; }

.boss-card {
    background: #121c2e;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.boss-header { display: flex; align-items: center; justify-content: space-between; }
.boss-header h2 { font-family: var(--font-serif); font-size: 1.25rem; color: var(--accent-red); }
.boss-subtitle { font-size: 0.78rem; color: var(--text-muted); font-family: var(--font-mono); }
.boss-status-badge { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent-yellow); background: rgba(245, 158, 11, 0.15); padding: 4px 10px; border-radius: 12px; }

/* Spellcraft Forge */
.spellcraft-forge {
    background: #090e1a;
    border: 1px solid var(--accent-gold);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.spellcraft-forge h3 { font-family: var(--font-serif); font-size: 1.05rem; color: var(--accent-gold); }
.forge-subtitle { font-size: 0.82rem; color: var(--text-muted); }

.input-group { display: flex; gap: 8px; }

.input-group input {
    flex: 1;
    background: #121c2e;
    border: 1px solid var(--bg-panel-border);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.88rem;
}

/* JSON Inspector */
.json-inspector {
    background: #040710;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inspector-header { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent-cyan); }
.json-badge { background: rgba(0, 240, 255, 0.15); padding: 2px 6px; border-radius: 10px; }

.json-code {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: #38bdf8;
    background: #080d18;
    padding: 12px;
    border-radius: 6px;
    white-space: pre-wrap;
    max-height: 180px;
    overflow-y: auto;
}

/* Combat Feed */
.combat-feed {
    flex: 1;
    min-height: 380px;
    max-height: 480px;
    background: #040710;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.log-entry {
    padding: 6px 10px;
    border-radius: 4px;
    background: #0e1726;
    border-left: 3px solid var(--accent-blue);
    line-height: 1.4;
}

.log-entry.success { border-left-color: var(--accent-green); color: #86efac; }
.log-entry.damage { border-left-color: var(--accent-red); color: #fca5a5; }
.log-entry.system { border-left-color: var(--accent-gold); color: #fde047; }
.log-entry.error { border-left-color: var(--accent-purple); color: #d8b4fe; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(4, 8, 16, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-card {
    background: var(--bg-panel);
    border: 2px solid var(--accent-gold);
    border-radius: 16px;
    padding: 32px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-card h2 { font-family: var(--font-serif); font-size: 1.8rem; color: var(--accent-gold); }

/* Author Details Footer */
.author-footer {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.footer-card {
    background: rgba(13, 21, 37, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px 28px;
    text-align: center;
    max-width: 850px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.developed-by { font-size: 0.9rem; color: #94a3b8; }
.developed-by .author-name { color: #00f0ff; font-weight: 700; }
.developed-by .heart { color: #ef4444; display: inline-block; animation: heartPulse 1.5s infinite; }
@keyframes heartPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
.footer-links { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; font-size: 0.85rem; }
.footer-link { color: #00f0ff; text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.footer-links .dot { color: #475569; }
.tech-badges { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.badge-pill { background: rgba(6, 182, 212, 0.08); border: 1px solid rgba(6, 182, 212, 0.3); color: #38bdf8; padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-family: var(--font-mono); display: inline-flex; align-items: center; gap: 4px; }
.copyright-text { font-size: 0.75rem; color: #64748b; }
