:root {
    --gold: #d4a017;
    --gold-light: #f0d060;
    --gold-dark: #8b6914;
    --teal: #1a9e9e;
    --teal-light: #40d0d0;
    --teal-dark: #0d5e5e;
    --bg-dark: #0a0f1a;
    --bg-mid: #131b2e;
    --bg-light: #1c2940;
    --red-accent: #c0392b;
    --green-accent: #27ae60;
}

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

body {
    font-family: 'Cinzel', serif;
    background: var(--bg-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Battlefield background */
.battlefield-bg {
    background: 
        radial-gradient(ellipse at 50% 80%, rgba(34, 80, 34, 0.3) 0%, transparent 60%),
        radial-gradient(ellipse at 20% 20%, rgba(20, 40, 80, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(60, 20, 60, 0.3) 0%, transparent 50%),
        linear-gradient(180deg, #0a0f1a 0%, #101825 50%, #0d1a12 100%);
    background-attachment: fixed;
}

/* Hexagonal dice badge */
.hex-die {
    position: relative;
    width: 72px;
    height: 80px;
    cursor: pointer;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

.hex-die:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.6));
}

.hex-die svg {
    width: 100%;
    height: 100%;
}

.hex-die .hex-value {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Fira Code', monospace;
    font-weight: 700;
    font-size: 20px;
    color: #fff;
    text-shadow: 0 0 8px rgba(255,255,255,0.6);
    pointer-events: none;
    z-index: 2;
}

.hex-die .hex-label {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Fira Code', monospace;
    font-weight: 500;
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    pointer-events: none;
    z-index: 2;
}

/* Gold player hex */
.hex-gold .hex-outer { fill: #c8941a; }
.hex-gold .hex-inner { fill: #e8b830; }
.hex-gold .hex-glow { fill: url(#goldGlow); }

/* Teal player hex */
.hex-teal .hex-outer { fill: #156868; }
.hex-teal .hex-inner { fill: #1a9e9e; }
.hex-teal .hex-glow { fill: url(#tealGlow); }

/* Selected state */
.hex-die.hex-selected {
    animation: hexPulse 1s ease-in-out infinite;
}
.hex-die.hex-selected .hex-outer { 
    fill: #27ae60 !important; 
}

/* Target state */
.hex-die.hex-target .hex-outer { 
    fill: #c0392b !important; 
}
.hex-die.hex-target {
    animation: hexPulse 0.8s ease-in-out infinite;
}

/* Valid attacker subtle pulse */
.hex-die.hex-can-attack {
    animation: subtlePulse 2s ease-in-out infinite;
}

@keyframes hexPulse {
    0%, 100% { filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5)); }
    50% { filter: drop-shadow(0 4px 20px rgba(255,255,255,0.4)); }
}

@keyframes subtlePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

@keyframes diceRollHex {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-8deg) scale(0.95); }
    50% { transform: rotate(6deg) scale(1.05); }
    75% { transform: rotate(-3deg) scale(0.98); }
    100% { transform: rotate(0deg) scale(1); }
}

.hex-rolling {
    animation: diceRollHex 0.6s ease-in-out;
}

/* Captured dice (small) */
.captured-hex {
    width: 36px;
    height: 40px;
    opacity: 0.7;
}
.captured-hex .hex-value {
    font-size: 11px;
    top: 40%;
}
.captured-hex .hex-label {
    font-size: 7px;
}

/* Character card */
.char-card {
    background: linear-gradient(145deg, #1c2940, #253552);
    border: 2px solid #3a4a6a;
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
}
.char-card:hover {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(212, 160, 23, 0.3);
    transform: translateY(-4px);
}
.char-card.char-taken {
    opacity: 0.4;
    pointer-events: none;
}

/* Combat log */
.combat-log-container {
    background: rgba(10, 15, 26, 0.85);
    border: 1px solid #2a3a5a;
    border-radius: 8px;
    backdrop-filter: blur(8px);
}

/* Action buttons */
.btn-power {
    background: linear-gradient(135deg, #d35400, #e67e22);
    border: 2px solid #e67e22;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    transition: all 0.2s;
}
.btn-power:hover:not(:disabled) {
    box-shadow: 0 0 16px rgba(230, 126, 34, 0.5);
    transform: translateY(-1px);
}
.btn-power:disabled {
    background: #2a2a3a;
    border-color: #3a3a4a;
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-skill {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    border: 2px solid #9b59b6;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    transition: all 0.2s;
}
.btn-skill:hover:not(:disabled) {
    box-shadow: 0 0 16px rgba(155, 89, 182, 0.5);
    transform: translateY(-1px);
}
.btn-skill:disabled {
    background: #2a2a3a;
    border-color: #3a3a4a;
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-pass {
    background: linear-gradient(135deg, #34495e, #4a6278);
    border: 2px solid #4a6278;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    transition: all 0.2s;
}
.btn-pass:hover:not(:disabled) {
    box-shadow: 0 0 12px rgba(74, 98, 120, 0.5);
    transform: translateY(-1px);
}
.btn-pass:disabled {
    background: #2a2a3a;
    border-color: #3a3a4a;
    opacity: 0.5;
    cursor: not-allowed;
}

/* Player zone */
.player-zone {
    background: rgba(20, 28, 45, 0.7);
    border: 1px solid #2a3a5a;
    border-radius: 12px;
    backdrop-filter: blur(4px);
}

/* Turn indicator glow */
.turn-active-gold {
    border-color: var(--gold) !important;
    box-shadow: 0 0 20px rgba(212, 160, 23, 0.25);
}
.turn-active-teal {
    border-color: var(--teal) !important;
    box-shadow: 0 0 20px rgba(26, 158, 158, 0.25);
}

/* Round pips */
.round-pip {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #4a5a7a;
    background: transparent;
    transition: all 0.3s;
}
.round-pip.won {
    background: var(--gold);
    border-color: var(--gold-light);
    box-shadow: 0 0 6px rgba(212, 160, 23, 0.5);
}

/* Tooltip */
.dice-tooltip {
    position: absolute;
    background: rgba(10, 15, 26, 0.95);
    border: 1px solid var(--gold);
    border-radius: 6px;
    padding: 4px 8px;
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: #fff;
    white-space: nowrap;
    pointer-events: none;
    z-index: 100;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
::-webkit-scrollbar-thumb { background: #3a4a6a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4a5a7a; }

/* Victory screen */
@keyframes victoryGlow {
    0%, 100% { text-shadow: 0 0 20px rgba(212, 160, 23, 0.5); }
    50% { text-shadow: 0 0 40px rgba(212, 160, 23, 0.8), 0 0 60px rgba(212, 160, 23, 0.4); }
}
.victory-text {
    animation: victoryGlow 2s ease-in-out infinite;
}

/* Mode buttons */
.mode-btn {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    border: 2px solid #3a4a6a;
    background: rgba(20, 28, 45, 0.8);
    color: #8899bb;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}
.mode-btn:hover {
    border-color: #5a6a8a;
    color: #aabbdd;
}
.mode-btn.mode-active {
    border-color: var(--gold);
    color: var(--gold-light);
    background: rgba(212, 160, 23, 0.1);
    box-shadow: 0 0 12px rgba(212, 160, 23, 0.2);
}

/* Start button */
.btn-start {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border: 3px solid #2ecc71;
    color: #fff;
    padding: 14px 40px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 2px;
}
.btn-start:hover {
    box-shadow: 0 0 30px rgba(46, 204, 113, 0.5);
    transform: scale(1.05);
}

.footer-link {
    color: #4a5a7a;
    text-decoration: none;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    transition: color 0.3s;
}
.footer-link:hover {
    color: var(--gold);
}