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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

h1 {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.btn {
    padding: 15px 30px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background-color: #f44336;
    color: white;
}

.btn-secondary:hover {
    background-color: #da190b;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

.character-sheet {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.character-sheet.hidden {
    display: none;
}

.header {
    border-bottom: 3px solid #667eea;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.header h2 {
    color: #333;
    font-size: 2em;
    margin-bottom: 10px;
}

.basic-info {
    display: flex;
    gap: 30px;
    color: #666;
    font-size: 1.1em;
}

.stats-section,
.combat-section,
.skills-section,
.equipment-section,
.background-section {
    margin-bottom: 30px;
}

h3 {
    color: #667eea;
    font-size: 1.5em;
    margin-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.stat-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-name {
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 8px;
    opacity: 0.9;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-modifier {
    font-size: 1.2em;
    opacity: 0.9;
}

.combat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.combat-stat {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.combat-stat strong {
    color: #333;
}

.combat-stat span {
    color: #667eea;
    font-weight: bold;
    font-size: 1.2em;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-item {
    background: #e7f3ff;
    color: #0066cc;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.95em;
    font-weight: 500;
    border: 1px solid #b3d9ff;
}

.equipment-list {
    list-style: none;
    padding: 0;
}

.equipment-list li {
    background: #f8f9fa;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 3px solid #4CAF50;
}

.equipment-list li:before {
    content: "⚔️ ";
    margin-right: 10px;
}

.background-section p {
    background: #fff9e6;
    padding: 15px;
    border-radius: 8px;
    line-height: 1.6;
    color: #333;
    border-left: 4px solid #ffc107;
    font-style: italic;
}

/* Editable field styles */
.editable {
    cursor: text;
    transition: all 0.2s ease;
    outline: none;
}

.editable:hover {
    background-color: #f0f8ff;
}

.editable:focus {
    background-color: #e3f2fd;
    box-shadow: 0 0 0 2px #667eea;
    border-radius: 4px;
}

.inline-edit {
    display: inline-block;
    min-width: 80px;
    padding: 2px 6px;
    border-radius: 4px;
}

.editable-input {
    border: 2px solid transparent;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 1em;
    font-family: inherit;
    background: transparent;
    transition: all 0.2s ease;
    width: 60px;
    text-align: center;
}

.editable-input:hover {
    background-color: #f0f8ff;
    border-color: #b3d9ff;
}

.editable-input:focus {
    outline: none;
    background-color: white;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.inline-input {
    width: 70px;
    font-weight: bold;
    color: #667eea;
    font-size: 1.2em;
}

.editable-stat {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 80px;
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 5px;
    transition: all 0.2s ease;
}

.editable-stat:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.editable-stat:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.4);
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.editable-equipment {
    cursor: text;
    transition: background-color 0.2s ease;
}

.editable-equipment:hover {
    background-color: #e8f5e9 !important;
}

.editable-equipment:focus {
    outline: 2px solid #4CAF50;
    background-color: #f1f8e9 !important;
}

.btn-add {
    background-color: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.btn-add:hover {
    background-color: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-add:active {
    transform: translateY(0);
}

/* Hide spinner buttons in number inputs for webkit browsers */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 0.5;
}

input[type="number"]:hover::-webkit-inner-spin-button,
input[type="number"]:hover::-webkit-outer-spin-button {
    opacity: 1;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8em;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .basic-info {
        flex-direction: column;
        gap: 10px;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .combat-grid {
        grid-template-columns: 1fr;
    }
}
