/* Custom Font */
@font-face {
    font-family: 'Microgramma';
    src: url('fonts/Microgramma D Extended Bold/Microgramma D Extended Bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
    font-display: swap; /* Better performance - shows fallback while loading */
}

:root {
    --font-body: 'Inter', 'Atkinson Hyperlegible', 'Recursive', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Microgramma', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-recursive: 'Recursive', 'Inter', 'Atkinson Hyperlegible', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Recursive', 'Atkinson Hyperlegible Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
    --font-button: 'Atkinson Hyperlegible', 'Inter', 'Recursive', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    /* Light Mode (clean, neutral + teal accent) */
    --bg-primary: #f5f7fb;
    --bg-secondary: #ffffff;
    --text-primary: #1f2933;
    --text-secondary: #52606d;
    --border-color: #c5ccd6;
    --accent: #1f7a8c;
    --red: #e5484d;
    --blue: #2f80ed;
    --yellow: #f2c94c;
    --green: #2fbf71;
    --orange: #f2994a;
    --purple: #3f6fb5;
    --pink: #d17a63;
    --cyan: #2d9cdb;
    
    /* Shadow */
    --shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    /* Dark Mode (Pitch Black) */
    --bg-primary: #000000;
    --bg-secondary: #1a1a1a;
    --text-primary: #f8f8f2;
    --text-secondary: #6272a4;
    --border-color: #6272a4;
    --accent: #FAA519;
    --red: #ff5555;
    --blue: #8be9fd;
    --yellow: #f1fa8c;
    --green: #50fa7b;
    --orange: #ffb86c;
    --purple: #bd93f9;
    --pink: #ff79c6;
    --cyan: #8be9fd;
    
    --shadow: rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    padding: 20px;
    min-height: 100vh;
    line-height: 1.5;
}

button {
    font-family: var(--font-button);
    text-transform: none;
    letter-spacing: 0.02em;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    transition: margin-right 0.4s ease, padding-right 0.4s ease;
    padding-right: 0;
}

body.battlefield-active .container {
    max-width: calc(1400px - 320px);
    margin-right: 320px;
    padding-right: 20px;
}

.battlefield-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 2px solid var(--border-color);
    box-shadow: -6px 0 12px var(--shadow);
    transform: translateX(100%);
    transition: transform 0.4s ease;
    z-index: 900;
    display: flex;
    flex-direction: column;
    padding: 20px 18px;
    gap: 16px;
}

.battlefield-panel.active {
    transform: translateX(0);
}

.battlefield-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-right: 6px;
}

.round-indicator {
    font-size: 0.95em;
    padding: 8px 14px;
    border-radius: 999px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-mono);
    margin-right: 4px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-variation-settings: "CASL" 0, "MONO" 1;
}

.round-indicator.inactive {
    opacity: 0.6;
}

.battlefield-header h2 {
    font-size: 1.2em;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 6px;
}

.battlefield-header p {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.battlefield-header .lutar-button {
    width: 100%;
    justify-content: center;
    margin-top: 15px;
    padding: 18px 24px;
    font-size: 1.3em;
    font-weight: 700;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--red);
    border: 3px solid var(--red);
    color: var(--bg-primary);
    box-shadow: 0 4px 12px rgba(255, 85, 85, 0.4);
    animation: lutar-button-pulse 2s ease-in-out infinite;
}

.battlefield-header .lutar-button:hover {
    background: var(--red);
    border-color: var(--red);
    color: var(--bg-primary);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 85, 85, 0.6);
    animation: none;
}

@keyframes lutar-button-pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(255, 85, 85, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 6px 20px rgba(255, 85, 85, 0.7), 0 0 30px rgba(255, 85, 85, 0.3);
        transform: scale(1.02);
    }
}

.battlefield {
    flex: 1;
    display: grid;
    grid-template-rows: repeat(5, 1fr);
    gap: 12px;
}

.battlefield-section {
    border: 2px solid var(--border-color);
    border-radius: 14px;
    padding: 10px;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.battlefield-section.is-drop-target {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(189, 147, 249, 0.4);
}

.battlefield-section-label {
    font-size: 0.85em;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.battlefield-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 42px;
}

.battlefield-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid currentColor;
    background: rgba(0, 0, 0, 0.05);
    cursor: grab;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden;
}

[data-theme="dark"] .battlefield-dot {
    background: rgba(255, 255, 255, 0.05);
}

.battlefield-dot:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.battlefield-dot.dot-enemy {
    color: var(--red);
}

.battlefield-dot.dot-friendly {
    color: var(--green);
}

.battlefield-dot.dot-player {
    color: var(--blue);
}

.battlefield-dot img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.battlefield-dot.current-turn {
    animation: current-turn-pulse 1.5s ease-in-out infinite;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    will-change: transform, box-shadow;
}

.battlefield-dot.current-turn::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0.6;
    animation: current-turn-ring 1.5s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

.battlefield-dot.current-turn img {
    pointer-events: none;
    user-select: none;
}

.battlefield-dot.current-turn:active {
    cursor: grabbing;
    animation-play-state: paused;
}

@keyframes current-turn-pulse {
    0%, 100% {
        box-shadow: 0 0 8px currentColor, 0 0 16px currentColor, 0 0 24px rgba(0, 0, 0, 0.4);
        transform: scale(1.1);
    }
    50% {
        box-shadow: 0 0 16px currentColor, 0 0 32px currentColor, 0 0 48px currentColor, 0 0 64px rgba(0, 0, 0, 0.5);
        transform: scale(1.25);
    }
}

@keyframes current-turn-ring {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.4);
        opacity: 0;
    }
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    gap: 20px;
    flex-wrap: wrap;
}

.title-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.app-title {
    font-size: 2.5em;
    color: var(--accent);
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.app-subtitle {
    font-size: 0.95em;
    color: var(--text-secondary);
    max-width: 420px;
}

h1 {
    font-size: 2.5em;
    color: var(--accent);
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
    flex: 1;
}

.primary-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.secondary-actions {
    position: relative;
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.more-button {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.more-button:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

.more-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 10px 20px var(--shadow);
    padding: 10px;
    display: none;
    flex-direction: column;
    gap: 6px;
    z-index: 1000;
}

.more-menu.open {
    display: flex;
}

.menu-item {
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    padding: 8px 10px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

.more-menu .theme-toggle {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    justify-content: flex-start;
    font-size: 0.9em;
    text-transform: none;
    letter-spacing: 0;
    padding: 8px 10px;
}

.more-menu .theme-toggle:hover {
    background: var(--bg-primary);
    border-color: var(--border-color);
    transform: none;
}

.more-menu .theme-icon {
    font-size: 1.1em;
}

.theme-label {
    font-size: 0.9em;
}

@media (max-width: 720px) {
    .app-header {
        align-items: stretch;
    }

    .header-actions {
        align-items: stretch;
    }

    .primary-actions {
        justify-content: flex-start;
    }

    .secondary-actions {
        justify-content: flex-start;
    }

    .more-menu {
        left: 0;
        right: auto;
        width: 100%;
    }
}
.theme-toggle {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.theme-toggle:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.1);
}

.export-button {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.export-button:hover {
    background: var(--green);
    border-color: var(--green);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

.import-button {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.import-button:hover {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

.dice-button {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.dice-button:hover {
    background: var(--yellow);
    border-color: var(--yellow);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

.add-button {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.add-button:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

.recovery-button {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.recovery-button:hover {
    background: var(--pink);
    border-color: var(--pink);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

.history-button {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.history-button:hover {
    background: var(--cyan);
    border-color: var(--cyan);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

.combat-button {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.combat-button:hover {
    background: var(--orange);
    border-color: var(--orange);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

.combat-button.active {
    background: var(--red);
    border-color: var(--red);
    color: var(--bg-primary);
    box-shadow: 0 0 10px rgba(255, 85, 85, 0.5);
}

.combat-button.active:hover {
    background: var(--red);
    border-color: var(--red);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(255, 85, 85, 0.7);
}

.lutar-button {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.lutar-button:hover {
    background: var(--red);
    border-color: var(--red);
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(255, 85, 85, 0.7);
}

.passar-turno-button {
    background: var(--cyan);
    border: 3px solid var(--cyan);
    border-radius: 8px;
    padding: 15px 24px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: 700;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 15px;
    margin-bottom: 10px;
    animation: passar-turno-pulse 2s ease-in-out infinite;
    box-shadow: 0 4px 12px rgba(139, 233, 253, 0.4);
}

.passar-turno-button:hover {
    background: var(--cyan);
    border-color: var(--cyan);
    color: var(--bg-primary);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(139, 233, 253, 0.6);
    animation: none;
}

@keyframes passar-turno-pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(139, 233, 253, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 6px 20px rgba(139, 233, 253, 0.7), 0 0 30px rgba(139, 233, 253, 0.3);
        transform: scale(1.02);
    }
}

.delete-character-btn {
    background: transparent;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    opacity: 0.7;
    color: var(--text-primary);
}

.character-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.edit-character-btn {
    background: transparent;
    border: none;
    font-size: 1.1em;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    opacity: 0.7;
    color: var(--text-primary);
}

.edit-character-btn:hover {
    opacity: 1;
    background: var(--blue);
    transform: scale(1.05);
}

.delete-character-btn:hover {
    opacity: 1;
    background: var(--red);
    transform: scale(1.1);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.characters-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    padding: 20px 0;
    transition: all 0.5s ease;
}

.character-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.character-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--shadow);
}

/* Character type styling */
.character-card.character-enemy {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(255, 85, 85, 0.15) 100%);
    border-color: rgba(255, 85, 85, 0.5);
}

.character-card.character-enemy:hover {
    border-color: rgba(255, 85, 85, 0.8);
    box-shadow: 0 6px 12px var(--shadow), 0 0 8px rgba(255, 85, 85, 0.3);
}

.character-card.character-friendly {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(80, 250, 123, 0.15) 100%);
    border-color: rgba(80, 250, 123, 0.5);
}

.character-card.character-friendly:hover {
    border-color: rgba(80, 250, 123, 0.8);
    box-shadow: 0 6px 12px var(--shadow), 0 0 8px rgba(80, 250, 123, 0.3);
}

.character-card.character-neutral {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(139, 233, 253, 0.1) 100%);
    border-color: rgba(139, 233, 253, 0.4);
    filter: grayscale(20%);
}

.character-card.character-neutral:hover {
    border-color: rgba(139, 233, 253, 0.7);
    box-shadow: 0 6px 12px var(--shadow), 0 0 8px rgba(139, 233, 253, 0.2);
}

/* Current Turn Glow */
.character-card.current-turn {
    animation: current-turn-glow 2s ease-in-out infinite;
    border-color: #FAA519 !important;
    border-width: 3px !important;
    box-shadow: 0 0 20px rgba(250, 165, 25, 0.6), 
                0 0 40px rgba(250, 165, 25, 0.4), 
                0 0 60px rgba(250, 165, 25, 0.2),
                0 4px 6px var(--shadow) !important;
    position: relative;
    z-index: 10;
}

.character-card.current-turn::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 14px;
    border: 2px solid #FAA519;
    opacity: 0.8;
    animation: current-turn-halo 2s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

.character-card.current-turn::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 16px;
    background: radial-gradient(ellipse at center, rgba(250, 165, 25, 0.3) 0%, transparent 70%);
    animation: current-turn-glow-ring 2s ease-in-out infinite;
    pointer-events: none;
    z-index: -2;
}

/* Current turn takes precedence over perto da morte */
.character-card.current-turn.perto-da-morte {
    animation: current-turn-glow 2s ease-in-out infinite;
}

@keyframes current-turn-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(250, 165, 25, 0.6), 
                    0 0 40px rgba(250, 165, 25, 0.4), 
                    0 0 60px rgba(250, 165, 25, 0.2),
                    0 4px 6px var(--shadow);
        border-color: #FAA519;
    }
    50% {
        box-shadow: 0 0 30px rgba(250, 165, 25, 0.8), 
                    0 0 60px rgba(250, 165, 25, 0.6), 
                    0 0 90px rgba(250, 165, 25, 0.4),
                    0 0 120px rgba(250, 165, 25, 0.2),
                    0 4px 6px var(--shadow);
        border-color: #FAA519;
    }
}

@keyframes current-turn-halo {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
        box-shadow: 0 0 15px rgba(250, 165, 25, 0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
        box-shadow: 0 0 25px rgba(250, 165, 25, 0.8), 0 0 50px rgba(250, 165, 25, 0.4);
    }
}

@keyframes current-turn-glow-ring {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* Perto da Morte - Pulsating red animation */
.character-card.perto-da-morte {
    animation: pulsar-vermelho 1.5s ease-in-out infinite;
    border-color: var(--red);
}

@keyframes pulsar-vermelho {
    0%, 100% {
        box-shadow: 0 4px 6px var(--shadow), 0 0 0 0 rgba(255, 85, 85, 0.4);
        border-color: var(--red);
    }
    50% {
        box-shadow: 0 4px 6px var(--shadow), 0 0 0 8px rgba(255, 85, 85, 0);
        border-color: var(--red);
        background: rgba(255, 85, 85, 0.1);
    }
}

.character-card.perto-da-morte:hover {
    animation: pulsar-vermelho 1.5s ease-in-out infinite;
    transform: translateY(-2px);
}

.character-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.character-avatar {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    object-fit: cover;
    background: var(--bg-primary);
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.character-avatar:hover {
    border-color: var(--accent);
    transform: scale(1.05);
    box-shadow: 0 2px 8px var(--shadow);
}

.character-name {
    font-size: 1.4em;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
    flex: 1;
    font-family: 'Inter', 'Atkinson Hyperlegible', 'Recursive', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="dark"] .character-name {
    color: #f0f0f0;
}

.status-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.status-bar-container {
    position: relative;
}

.status-bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 0.9em;
    color: #2a2a2a;
    font-weight: 500;
    font-family: var(--font-recursive);
    font-variation-settings: "CASL" 0;
}

.status-bar-label span:last-child {
    font-family: var(--font-recursive);
    font-variant-numeric: tabular-nums;
    font-variation-settings: "CASL" 0;
}

[data-theme="dark"] .status-bar-label {
    color: #e0e0e0;
}

.status-bar {
    height: 28px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-primary);
}

.status-bar.healing,
.status-bar.health-loss,
.status-bar.mana-spent,
.status-bar.mana-recovered,
.status-bar.action-spent,
.status-bar.action-recovered {
    overflow: visible;
}

.status-bar:hover {
    border-color: var(--accent);
    transform: scale(1.02);
}

.status-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    font-weight: 600;
    font-size: 0.85em;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.status-bar-fill.health {
    background: var(--red);
}

.status-bar-fill.mana {
    background: var(--blue);
}

.status-bar-fill.action {
    background: var(--yellow);
}

.status-bar-value {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    font-size: 0.85em;
    z-index: 1;
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8), 0 0 4px rgba(255, 255, 255, 0.5);
    font-family: var(--font-recursive);
    font-variant-numeric: tabular-nums;
    font-variation-settings: "CASL" 0;
}

[data-theme="dark"] .status-bar-value {
    color: #f0f0f0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8), 0 0 4px rgba(0, 0, 0, 0.5);
}

/* Healing animation - green swish effect */
.status-bar.healing::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(80, 250, 123, 0.5),
        rgba(80, 250, 123, 0.9),
        rgba(80, 250, 123, 0.5),
        transparent
    );
    animation: healing-swipe 1s ease-out;
    z-index: 3;
    pointer-events: none;
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(80, 250, 123, 0.6);
}

.status-bar.healing .status-bar-fill {
    position: relative;
    z-index: 2;
}

.status-bar.healing .status-bar-value {
    z-index: 4;
}

@keyframes healing-swipe {
    0% {
        left: -100%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Health loss animation - red swish right to left */
.status-bar.health-loss::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 85, 85, 0.5),
        rgba(255, 85, 85, 0.9),
        rgba(255, 85, 85, 0.5),
        transparent
    );
    animation: health-loss-swipe 1s ease-out;
    z-index: 3;
    pointer-events: none;
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(255, 85, 85, 0.6);
}

.status-bar.health-loss .status-bar-fill {
    position: relative;
    z-index: 2;
}

.status-bar.health-loss .status-bar-value {
    z-index: 4;
}

@keyframes health-loss-swipe {
    0% {
        right: -100%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        right: 100%;
        opacity: 0;
    }
}

/* Mana spent animation - black swish right to left */
.status-bar.mana-spent::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 0, 0, 0.4),
        rgba(0, 0, 0, 0.8),
        rgba(0, 0, 0, 0.4),
        transparent
    );
    animation: mana-spent-swipe 1s ease-out;
    z-index: 3;
    pointer-events: none;
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.status-bar.mana-spent .status-bar-fill {
    position: relative;
    z-index: 2;
}

.status-bar.mana-spent .status-bar-value {
    z-index: 4;
}

@keyframes mana-spent-swipe {
    0% {
        right: -100%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        right: 100%;
        opacity: 0;
    }
}

/* Mana recovered animation - blue swish left to right */
.status-bar.mana-recovered::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(139, 233, 253, 0.5),
        rgba(139, 233, 253, 0.9),
        rgba(139, 233, 253, 0.5),
        transparent
    );
    animation: mana-recovered-swipe 1s ease-out;
    z-index: 3;
    pointer-events: none;
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(139, 233, 253, 0.6);
}

.status-bar.mana-recovered .status-bar-fill {
    position: relative;
    z-index: 2;
}

.status-bar.mana-recovered .status-bar-value {
    z-index: 4;
}

@keyframes mana-recovered-swipe {
    0% {
        left: -100%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Action spent animation - dark yellow/amber swish right to left */
.status-bar.action-spent::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(241, 250, 140, 0.4),
        rgba(255, 184, 108, 0.8),
        rgba(241, 250, 140, 0.4),
        transparent
    );
    animation: action-spent-swipe 1s ease-out;
    z-index: 3;
    pointer-events: none;
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(255, 184, 108, 0.6);
}

.status-bar.action-spent .status-bar-fill {
    position: relative;
    z-index: 2;
}

.status-bar.action-spent .status-bar-value {
    z-index: 4;
}

@keyframes action-spent-swipe {
    0% {
        right: -100%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        right: 100%;
        opacity: 0;
    }
}

/* Action recovered animation - yellow swish left to right */
.status-bar.action-recovered::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(241, 250, 140, 0.5),
        rgba(241, 250, 140, 0.9),
        rgba(241, 250, 140, 0.5),
        transparent
    );
    animation: action-recovered-swipe 1s ease-out;
    z-index: 3;
    pointer-events: none;
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(241, 250, 140, 0.6);
}

.status-bar.action-recovered .status-bar-fill {
    position: relative;
    z-index: 2;
}

.status-bar.action-recovered .status-bar-value {
    z-index: 4;
}

@keyframes action-recovered-swipe {
    0% {
        left: -100%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

.initiative-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.initiative-container label {
    font-size: 0.95em;
    color: #2a2a2a;
    font-weight: 500;
    font-family: var(--font-recursive);
    font-variation-settings: "CASL" 0;
}

[data-theme="dark"] .initiative-container label {
    color: #e0e0e0;
}

.initiative-input {
    width: 80px;
    padding: 8px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1em;
    text-align: center;
    transition: border-color 0.2s ease;
    font-family: var(--font-recursive);
    font-variant-numeric: tabular-nums;
    font-variation-settings: "CASL" 0;
}

.initiative-input:focus {
    outline: none;
    border-color: var(--accent);
}

.initiative-input[readonly] {
    background: var(--bg-secondary);
    cursor: not-allowed;
    opacity: 0.8;
}

.character-stats {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 0.95em;
    color: #2a2a2a;
    text-align: center;
    font-weight: 500;
    font-family: var(--font-recursive);
    font-variation-settings: "CASL" 0;
}

[data-theme="dark"] .character-stats {
    color: #e0e0e0;
}

.character-stats span {
    margin: 0 8px;
    color: #1a1a1a;
    font-weight: 600;
    font-family: var(--font-recursive);
    font-variant-numeric: tabular-nums;
    font-variation-settings: "CASL" 0;
}

[data-theme="dark"] .character-stats span {
    color: #f0f0f0;
}

.character-statuses {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
}

.status-header {
    margin-bottom: 8px;
}

.status-edit-link {
    border: none;
    background: transparent;
    color: var(--accent);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    font-family: 'Inter', 'Atkinson Hyperlegible', 'Recursive', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    transition: color 0.2s ease;
}

.status-edit-link:hover {
    color: var(--orange);
}

.status-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.status-tag {
    position: relative;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    cursor: default;
}

.status-empty {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.status-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translate(-50%, 6px);
    width: 220px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.85em;
    line-height: 1.35;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: 0 6px 12px var(--shadow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transition-delay: 0s;
    z-index: 30;
}

.status-tag:hover .status-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition-delay: 0.4s;
}

.status-modal {
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
}

.status-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0 15px;
}

.status-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
}

.status-option:hover {
    border-color: var(--accent);
}

.status-option-input {
    margin-top: 4px;
}

.status-option-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.status-option-desc {
    font-size: 0.85em;
    color: var(--text-secondary);
}

/* Combat mode animations */
.character-card.moving-to-bottom {
    animation: moveToBottom 0.5s ease-out forwards;
    z-index: 1000;
}

@keyframes moveToBottom {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(50px) scale(0.95);
        opacity: 0.7;
    }
    100% {
        transform: translateY(200px) scale(0.9);
        opacity: 0;
    }
}

/* Input Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 16px var(--shadow);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-title {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: var(--accent);
    font-weight: 600;
}

.modal-input {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    margin-bottom: 15px;
    transition: border-color 0.2s ease;
}

.modal-input:focus {
    outline: none;
    border-color: var(--accent);
}

.modal-input[type="file"] {
    padding: 8px;
    cursor: pointer;
}

select.modal-input {
    cursor: pointer;
    background: var(--bg-primary);
}

select.modal-input:focus {
    outline: none;
    border-color: var(--accent);
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

.form-group label {
    user-select: none;
}

.modal-input[type="file"]::-webkit-file-upload-button {
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    font-weight: 500;
}

.modal-input[type="file"]::-webkit-file-upload-button:hover {
    background: var(--purple);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-button {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

.modal-button:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-primary);
}

.modal-button.primary {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

.modal-button.primary:hover {
    background: var(--purple);
    border-color: var(--purple);
}

.modal-hint {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-style: italic;
}

.import-modal {
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
}

.import-grid {
    display: grid;
    gap: 16px;
}

@media (min-width: 720px) {
    .import-grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

.modal-textarea {
    width: 100%;
    min-height: 140px;
    padding: 12px;
    font-size: 0.95em;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    margin-bottom: 12px;
    resize: vertical;
}

.import-preview {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    background: var(--bg-primary);
}

.import-preview h3 {
    margin-bottom: 8px;
    font-size: 1em;
    color: var(--accent);
}

.import-preview .preview-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 0.95em;
}

.import-preview .preview-row strong {
    font-weight: 600;
}

.import-preview .preview-list {
    margin-top: 8px;
    padding: 0;
    list-style: none;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.import-preview .preview-list li {
    padding: 4px 0;
    border-bottom: 1px solid var(--border-color);
}

.import-preview .preview-list li:last-child {
    border-bottom: none;
}

.import-warnings {
    margin-top: 8px;
    color: var(--orange);
    font-size: 0.85em;
}

.import-error {
    color: var(--red);
    font-size: 0.9em;
    margin-top: 8px;
}

.import-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}

.import-mode label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95em;
}

.recovery-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recovery-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
}

.recovery-meta {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.recovery-sample {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 4px;
}

.recovery-empty {
    color: var(--text-secondary);
    font-size: 0.95em;
    text-align: center;
    padding: 16px 0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
}

.history-meta {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.history-delta {
    font-weight: 600;
}

.history-delta.positive {
    color: var(--green);
}

.history-delta.negative {
    color: var(--red);
}

.history-empty {
    color: var(--text-secondary);
    font-size: 0.95em;
    text-align: center;
    padding: 16px 0;
}

.export-button,
.import-button,
.dice-button,
.add-button,
.recovery-button,
.history-button,
.combat-button,
.more-button,
.menu-item,
.modal-button,
.status-edit-link,
.lutar-button,
.passar-turno-button,
.battlefield-header .lutar-button {
    font-family: var(--font-button);
    text-transform: none;
    letter-spacing: 0.02em;
}

/* Dice Modal Styles */
.dice-modal {
    max-width: 420px;
    padding: 15px 20px;
    max-height: 85vh;
    overflow-y: auto;
}

.dice-modal .modal-title {
    font-size: 1.1em;
    margin-bottom: 12px;
}

.dice-modal .form-group {
    margin-bottom: 12px;
}

.dice-modal .form-group label {
    font-size: 0.85em;
    margin-bottom: 4px;
}

.dice-modal .modal-input {
    padding: 8px 10px;
    font-size: 0.95em;
    margin-bottom: 0;
}

.dice-modal .form-row {
    gap: 10px;
    margin-bottom: 12px;
}

.dice-modal .modal-buttons {
    margin-top: 15px;
    margin-bottom: 0;
}

.dice-modal .modal-button {
    padding: 8px 16px;
    font-size: 0.9em;
}

.dice-modal .modal-hint {
    display: none;
}

.dice-results {
    padding: 15px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 2px solid var(--border-color);
    margin-top: 10px;
}

.dice-roll-summary {
    margin-bottom: 15px;
    text-align: center;
}

.dice-roll-title {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 10px;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dice-roll-title strong {
    font-size: 1.3em;
    color: var(--yellow);
}

.dice-roll-breakdown {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-top: 8px;
}

.dice-display {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 15px 0;
}

.dice {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow);
}

.dice-critical {
    border-color: var(--yellow);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(241, 250, 140, 0.2) 100%);
    color: var(--yellow);
    animation: dice-critical-pulse 1.5s ease-in-out infinite;
}

.dice-critical-animate {
    animation: dice-critical-glow 2s ease-in-out infinite;
}

@keyframes dice-critical-pulse {
    0%, 100% {
        box-shadow: 0 2px 4px var(--shadow), 0 0 0 0 rgba(241, 250, 140, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 2px 4px var(--shadow), 0 0 0 8px rgba(241, 250, 140, 0);
        transform: scale(1.05);
    }
}

@keyframes dice-critical-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(241, 250, 140, 0.6), 
                    0 0 20px rgba(241, 250, 140, 0.4),
                    0 0 30px rgba(241, 250, 140, 0.2);
        border-color: var(--yellow);
    }
    50% {
        box-shadow: 0 0 20px rgba(241, 250, 140, 0.8), 
                    0 0 40px rgba(241, 250, 140, 0.6),
                    0 0 60px rgba(241, 250, 140, 0.4);
        border-color: var(--yellow);
        transform: scale(1.1);
    }
}

.dice-critical-message {
    text-align: center;
    font-size: 1.2em;
    font-weight: 600;
    color: var(--yellow);
    margin-top: 15px;
    padding: 10px;
    background: rgba(241, 250, 140, 0.1);
    border-radius: 6px;
    border: 2px solid var(--yellow);
    animation: dice-critical-message-pulse 2s ease-in-out infinite;
}

.dice-failure {
    border-color: var(--red);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(255, 85, 85, 0.2) 100%);
    color: var(--red);
    animation: dice-failure-pulse 1.5s ease-in-out infinite;
}

.dice-failure-animate {
    animation: dice-failure-glow 2s ease-in-out infinite;
}

@keyframes dice-failure-pulse {
    0%, 100% {
        box-shadow: 0 2px 4px var(--shadow), 0 0 0 0 rgba(255, 85, 85, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 2px 4px var(--shadow), 0 0 0 8px rgba(255, 85, 85, 0);
        transform: scale(1.05);
    }
}

@keyframes dice-failure-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 85, 85, 0.6), 
                    0 0 20px rgba(255, 85, 85, 0.4),
                    0 0 30px rgba(255, 85, 85, 0.2);
        border-color: var(--red);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 85, 85, 0.8), 
                    0 0 40px rgba(255, 85, 85, 0.6),
                    0 0 60px rgba(255, 85, 85, 0.4);
        border-color: var(--red);
        transform: scale(1.1);
    }
}

.dice-failure-message {
    text-align: center;
    font-size: 1.2em;
    font-weight: 600;
    color: var(--red);
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 85, 85, 0.1);
    border-radius: 6px;
    border: 2px solid var(--red);
    animation: dice-failure-message-pulse 2s ease-in-out infinite;
}

.dice-result-status {
    text-align: center;
    font-size: 1.3em;
    font-weight: 700;
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dice-result-success {
    color: var(--green);
    background: rgba(80, 250, 123, 0.1);
    border: 2px solid var(--green);
}

.dice-result-perfect-success {
    color: var(--yellow);
    background: rgba(241, 250, 140, 0.1);
    border: 2px solid var(--yellow);
    animation: dice-perfect-success-pulse 2s ease-in-out infinite;
}

.dice-result-failure {
    color: var(--red);
    background: rgba(255, 85, 85, 0.1);
    border: 2px solid var(--red);
}

.dice-result-critical-failure {
    color: var(--red);
    background: rgba(255, 85, 85, 0.2);
    border: 3px solid var(--red);
    animation: dice-critical-failure-pulse 1.5s ease-in-out infinite;
}

.dice-meta-info {
    text-align: center;
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-top: 8px;
    font-style: italic;
}

@keyframes dice-critical-message-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.02);
    }
}

@keyframes dice-failure-message-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.02);
    }
}

@keyframes dice-perfect-success-pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(241, 250, 140, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(241, 250, 140, 0.6);
    }
}

@keyframes dice-critical-failure-pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 85, 85, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 85, 85, 0.6);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .characters-container {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2em;
    }
}
