:root {
    --bg-color: #0b0f19;
    --card-bg: #131b2e;
    --text-color: #f8fafc;
    --neon-pink: #ff007f;
    --neon-blue: #00f0ff;
    --neon-purple: #bd00ff;
    --neon-green: #39ff14;
    --neon-gold: #ffd700;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
}

#game-container {
    width: 100%;
    max-width: 960px;
    background: var(--card-bg);
    border: 3px solid var(--neon-blue);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.25);
}

header {
    text-align: center;
    border-bottom: 2px solid #1e293b;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

header h1 {
    color: var(--neon-blue);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
    margin: 0 0 5px 0;
    letter-spacing: 2px;
}

#round-indicator, #turn-indicator {
    color: #94a3b8;
    font-weight: bold;
}

#current-turn-label {
    color: var(--neon-pink);
}

.screen.hidden { display: none; }

/* Mode Selection */
.mode-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.mode-btn {
    font-size: 1.1rem;
    padding: 15px 25px;
    background: #1e293b;
    color: var(--neon-blue);
    border: 2px solid var(--neon-blue);
}

.mode-btn:hover {
    background: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 15px var(--neon-blue);
}

/* Character Selection */
.char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.char-card {
    border: 2px solid #334155;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    background: #0f172a;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.char-card:hover {
    transform: translateY(-4px);
    border-color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.4);
}

.char-card h3 {
    font-size: 2rem;
    margin: 0 0 10px 0;
    color: var(--neon-pink);
}

/* Battlefield */
.battlefield {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.player-side {
    flex: 1;
    border: 2px dashed #334155;
    background: #0f172a;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.char-badge {
    font-size: 3rem;
    font-weight: bold;
    color: var(--neon-pink);
    text-shadow: 0 0 10px rgba(255, 0, 127, 0.6);
}

.vs-divider {
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--neon-gold);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.stat-bar {
    position: relative;
    height: 22px;
    background: #1e293b;
    border-radius: 11px;
    overflow: hidden;
    margin: 6px 0;
    border: 1px solid #475569;
}

.stat-bar .fill {
    height: 100%;
    width: 100%;
    transition: width 0.3s ease;
}

.hp-bar .fill { background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.eitr-bar .fill { background: var(--neon-purple); box-shadow: 0 0 8px var(--neon-purple); }

.stat-bar span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
}

.letters-row {
    display: flex;
    justify-content: space-around;
    gap: 6px;
    margin-top: 15px;
}

.letter-card {
    border: 2px solid #475569;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    background: #1e293b;
    color: #f8fafc;
    min-width: 45px;
    text-align: center;
    transition: all 0.2s;
}

.letter-card:hover {
    border-color: var(--neon-blue);
}

.letter-card.selected {
    border-color: var(--neon-gold);
    background: #334155;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.letter-card.targetable {
    border-color: var(--neon-green);
    background: #064e3b;
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    0% { box-shadow: 0 0 5px var(--neon-green); }
    100% { box-shadow: 0 0 15px var(--neon-green); }
}

.letter-card.dead {
    text-decoration: line-through;
    opacity: 0.3;
    cursor: not-allowed;
    background: #1e293b;
    border-color: #334155;
}

.letter-card.frozen {
    border-color: var(--neon-blue);
    background: #0284c7;
    color: #fff;
}

.status-badges {
    display: flex;
    flex-direction: column;
    font-size: 0.65rem;
    margin-top: 4px;
    gap: 2px;
}

/* Action Controls & Tooltip */
#controls-panel {
    background: #0f172a;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #334155;
}

#controls-panel h3 {
    margin-top: 0;
    color: #cbd5e1;
    font-size: 1rem;
}

.tooltip-box {
    background: #1e293b;
    border: 1px solid #475569;
    color: var(--neon-blue);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    min-height: 24px;
    margin-bottom: 12px;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    flex: 1;
    min-width: 140px;
    padding: 10px;
    border: 2px solid #475569;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    background: #1e293b;
    color: #f8fafc;
    transition: all 0.2s;
}

.btn:hover {
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.action-btn { border-color: var(--neon-blue); }
.ult-btn { background: #451a03; border-color: var(--neon-gold); color: var(--neon-gold); }
.ult-btn:hover { box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
.skip-btn { background: #082f49; border-color: var(--neon-blue); color: var(--neon-blue); }
.end-btn { background: #052e16; border-color: var(--neon-green); color: var(--neon-green); }
.end-btn:hover { box-shadow: 0 0 10px rgba(57, 255, 20, 0.4); }

/* Popup & Combat Log */
.popup {
    border: 2px solid var(--neon-gold);
    background: #422006;
    color: var(--neon-gold);
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

#combat-log {
    max-height: 100px;
    overflow-y: auto;
    background: #020617;
    color: #38bdf8;
    border: 1px solid #1e293b;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 15px;
    font-family: monospace;
}
