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

body {
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
    color: #e0e0e0;
    min-height: 100vh;
    padding: 1rem;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: #f0c674;
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.character-header {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.character-name-input {
    flex: 1;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(240, 198, 116, 0.3);
    border-radius: 8px;
    color: #f0c674;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.3s ease;
}

.character-name-input:focus {
    outline: none;
    border-color: rgba(240, 198, 116, 0.6);
}

.character-name-input::placeholder {
    color: rgba(240, 198, 116, 0.4);
}

.health-container {
    display: flex;
    gap: 0.5rem;
    min-width: 14.5rem;
    justify-content: flex-end;
}

.heart {
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.2s ease;
    user-select: none;
}

.heart.full {
    color: #ef4444;
}

.heart.empty {
    color: rgba(255, 255, 255, 0.2);
}

.heart.disabled {
    display: none;
}

.heart:hover {
    transform: scale(1.2);
}

.character-sheet {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.characteristics-column,
.spells-column {
    display: flex;
    flex-direction: column;
}

.characteristic-section {
    margin-bottom: 1.25rem;
}

.characteristic-section:last-child {
    margin-bottom: 0;
}

.spells-column .characteristic-section {
    margin-top: 1.25rem;
}

h2 {
    color: #f0c674;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.characteristic-list,
.spell-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.traits-row,
.ribbons-row,
.quirks-row,
.equipment-row,
.characteristic-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.3s ease;
}

.traits-row:hover,
.ribbons-row:hover,
.quirks-row:hover,
.equipment-row:hover,
.characteristic-row:hover {
    background: rgba(255, 255, 255, 0.08);
}

.traits-input,
.ribbons-input,
.quirks-input,
.equipment-input {
    flex: 1;
    font-size: 1.125rem;
    color: #f0c674;
    font-weight: 500;
    background: transparent;
    border: none;
    outline: none;
    padding: 0;
}

.traits-input::placeholder,
.ribbons-input::placeholder,
.quirks-input::placeholder,
.equipment-input::placeholder {
    color: rgba(240, 198, 116, 0.3);
}

.traits-actions,
.ribbons-actions,
.quirks-actions,
.equipment-actions {
    display: flex;
    gap: 0.5rem;
}

.characteristic-input {
    width: 100%;
    background: transparent;
    border: none;
    color: #f0c674;
    font-size: 1rem;
    outline: none;
}

.characteristic-input::placeholder {
    color: rgba(240, 198, 116, 0.3);
}

.spell-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.3s ease;
}

.spell-row:hover {
    background: rgba(255, 255, 255, 0.08);
}


.spell-name {
    flex: 1;
    font-size: 1.125rem;
    color: #f0c674;
    font-weight: 500;
}

.spell-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-replace,
.btn-delete {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s ease, background 0.2s ease;
}

.btn-replace {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.btn-replace:hover {
    transform: rotate(180deg) scale(1.1);
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

.btn-delete {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: white;
}

.btn-delete.disabled {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-delete:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
}

.btn-delete.disabled:hover {
    transform: none;
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.btn-replace:active,
.btn-delete:active {
    transform: scale(0.95);
}

@media (max-width: 900px) {
    .character-sheet {
        grid-template-columns: 1fr;
    }

    .spells-column {
        order: 2;
    }
}

@media (max-width: 640px) {
    body {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .character-header {
        flex-direction: column;
        align-items: stretch;
    }

    .health-container {
        justify-content: center;
        margin-top: 0.5rem;
    }

    .spell-row {
        flex-wrap: wrap;
    }

    .spell-name {
        flex-basis: 100%;
        order: 3;
        margin-top: 0.5rem;
    }
}
