:root {
    --primary: #1a237e;
    --primary-light: #3949ab;
    --secondary: #0d1421;
    --accent: #ffc107;
    --accent-light: #ffca28;
    --bg-dark: #1e2a3a;
    --bg-paper: #fafafa83;
    --bg-card: #ffffff65;
    --text: #212121;
    --text-light: #616161;
    --border: #cfd8dc70;
    --success: #2e7d32;
    --danger: #c62828;
    --hp: #e53935;
    --mp: #1e88e5;
    --def: #43a047;
}
/* ================================
   VIDEO BACKGROUND
================================ */
#video-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  background: black;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

.app-container {
    max-width: 90%;
    margin: 0 auto;
    padding: 15px;
}

.app-header {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 8px 8px 0 0;
    border: 2px solid var(--accent);
}

.app-header h1 {
    color: var(--accent-light);
    font-size: 1.8rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.app-header p {
    color: #b0bec5;
    font-size: 0.9rem;
    margin-top: 5px;
}

.tabs {
    display: flex;
    background: var(--bg-dark);
    border: 2px solid var(--accent);
    border-top: none;
}

.tab {
    flex: 1;
    padding: 12px 20px;
    background: var(--bg-dark);
    color: #b0bec5;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab:hover {
    background: var(--primary);
    color: white;
}

.tab.active {
    background: var(--bg-paper);
    color: var(--text);
    border-bottom-color: var(--accent);
}

.tab-content {
    display: none;
    background: var(--bg-paper);
    padding: 20px;
    border: 2px solid var(--accent);
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.tab-content.active {
    display: block;
}

.form-section {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.form-section h2 {
    color: var(--primary);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
    font-size: 1.1rem;
    text-transform: uppercase;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.portrait-preview {
    display: block;
    margin-top: 8px;
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--accent);
}

.stat-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.points-display {
    background: var(--bg-card);
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-weight: bold;
    text-align: center;
    border: 2px solid var(--border);
}

.points-display span {
    font-size: 1.2rem;
}

.attributes-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.attribute-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 6px;
    text-align: center;
}

.attribute-input label {
    font-weight: bold;
    color: var(--primary);
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.attribute-input input {
    width: 50px;
    padding: 5px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    border: 1px solid var(--border);
    border-radius: 3px;
}

.attribute-input .modifier {
    display: inline-block;
    margin-top: 5px;
    padding: 3px 10px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}

.btn-primary,
.btn-secondary {
    padding: 10px 18px;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: #b0bec5;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 15px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
}

#characterSheet {
    background: var(--bg-paper);
    min-height: 600px;
    font-size: 0.9rem;
}

.sheet-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--bg-dark) 100%);
    padding: 15px 20px;
    border-radius: 6px 6px 0 0;
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    gap: 15px;
}

.sheet-portrait {
    width: 90px;
    height: 90px;
    border-radius: 6px;
    border: 3px solid var(--accent);
    object-fit: cover;
    background: white;
}

.header-main {
    flex: 1;
}

.character-name {
    color: var(--accent-light);
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.header-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #cfd8dc;
    font-size: 0.8rem;
}

.header-details span {
    background: rgba(255,255,255,0.1);
    padding: 3px 8px;
    border-radius: 3px;
}

.sheet-content {
    border: 2px solid var(--accent);
    border-top: none;
    display: grid;
    grid-template-columns: 280px 1fr;
}

.sheet-sidebar {
    background: var(--bg-card);
    padding: 15px;
    border-right: 2px solid var(--accent);
}

.sheet-sidebar h3 {
    color: var(--primary);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    text-transform: uppercase;
}

.attribute-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    margin-bottom: 8px;
    background: var(--bg-paper);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.attr-name {
    font-weight: bold;
    color: var(--primary);
    width: 35px;
    font-size: 0.8rem;
}

.attr-score {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text);
    width: 35px;
    text-align: center;
}

.attr-mod {
    display: inline-block;
    width: 38px;
    padding: 3px;
    background: var(--primary);
    color: white;
    text-align: center;
    border-radius: 3px;
    font-weight: bold;
    font-size: 0.85rem;
}

.combat-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.combat-stat-box {
    background: var(--bg-paper);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px;
    text-align: center;
}

.combat-stat-box.hp {
    border-color: var(--hp);
    background: #ffebee;
}

.combat-stat-box.mp {
    border-color: var(--mp);
    background: #e3f2fd;
}

.combat-stat-box.def {
    border-color: var(--def);
    background: #e8f5e9;
}

.combat-stat-box .stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 4px;
}

.combat-stat-box .stat-value {
    font-size: 1.4rem;
    font-weight: bold;
}

.combat-stat-box.hp .stat-value { color: var(--hp); }
.combat-stat-box.mp .stat-value { color: var(--mp); }
.combat-stat-box.def .stat-value { color: var(--def); }

.combat-stat-box .stat-input {
    width: 50px;
    padding: 3px;
    text-align: center;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 3px;
}

.initiative-speed {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.init-box {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: var(--bg-paper);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
}

.init-box .stat-label {
    font-weight: 600;
    color: var(--text-light);
}

.init-box .stat-val {
    font-weight: bold;
    color: var(--primary);
}

.element-box, .god-box {
    padding: 8px;
    background: var(--bg-paper);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 0.8rem;
}

.element-box p, .god-box p {
    margin: 2px 0;
}

.sheet-main {
    padding: 15px;
    background: var(--bg-paper);
}

.section-title {
    color: var(--primary);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--accent);
    font-size: 0.95rem;
    text-transform: uppercase;
    font-weight: 600;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 20px;
}

.skill-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
}

.skill-row.proficient {
    background: #fff8e1;
    border-color: var(--accent);
}

.skill-row input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.skill-mod {
    font-weight: bold;
    width: 30px;
    text-align: center;
    font-size: 0.8rem;
}

.skill-name {
    flex: 1;
    font-size: 0.85rem;
}

.skill-attr {
    color: var(--text-light);
    font-size: 0.7rem;
}

.talents-section {
    margin-bottom: 20px;
}

.talent-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
}

.talent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--primary);
    color: white;
    cursor: pointer;
}

.talent-header h4 {
    font-size: 0.9rem;
    font-weight: 600;
}

.talent-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

.talent-desc {
    font-size: 0.75rem;
    color: #b0bec5;
    padding: 0 12px 8px;
}

.talent-skills {
    display: none;
    padding: 10px;
    background: var(--bg-paper);
}

.talent-category.expanded .talent-skills {
    display: block;
}

.talent-skill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    margin-bottom: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.talent-skill:hover {
    border-color: var(--primary);
}

.talent-skill.selected {
    background: #e8eaf6;
    border-color: var(--primary);
}

.talent-skill input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.talent-skill span {
    flex: 1;
}

.talent-skill small {
    color: var(--text-light);
    font-size: 0.7rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.info-box {
    background: var(--bg-card);
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.info-box h4 {
    color: var(--primary);
    font-size: 0.8rem;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.info-box p {
    font-size: 0.85rem;
    color: var(--text-light);
}

.equipment-box {
    background: var(--bg-card);
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 15px;
}

.equipment-box h4 {
    color: var(--primary);
    font-size: 0.8rem;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.money {
    display: flex;
    gap: 15px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.money span {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary);
}

.race-box {
    background: #fff3e0;
    padding: 10px;
    border: 1px solid #ff9800;
    border-radius: 4px;
    margin-bottom: 15px;
}

.race-box h4 {
    color: #e65100;
    font-size: 0.8rem;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--success);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
}

@media print {
    body {
        background: white;
    }
    
    .app-header,
    .tabs,
    .form-actions,
    .form-section {
        display: none !important;
    }
    
    .tab-content {
        display: block !important;
        border: none !important;
        padding: 0 !important;
    }
    
    #characterSheet {
        box-shadow: none !important;
    }
    
    .sheet-content {
        border: 1px solid #ccc;
    }
}

@media (max-width: 800px) {
    .sheet-content {
        grid-template-columns: 1fr;
    }
    
    .sheet-sidebar {
        border-right: none;
        border-bottom: 2px solid var(--accent);
    }
    
    .attributes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 500px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .attributes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .header-details {
        flex-direction: column;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }

    
    .attributes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-details {
        flex-direction: column;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }

}
.sheet-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 15px;
    border: 2px solid #333;
    background: white;
    padding: 10px;
    min-height: 100vh;
}

.sheet-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sheet-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sheet-identity {
    display: flex;
    gap: 10px;
    border: 2px solid #333;
    padding: 10px;
    background: #f5f5f5;
}

.sheet-portrait {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 1px solid #333;
    background: #ddd;
    flex-shrink: 0;
}

.sheet-portrait.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #666;
}

.identity-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.field-row {
    display: flex;
    gap: 5px;
}

.field-row.three-col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}

.field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.field.small {
    flex: 1;
}

.field label {
    font-size: 0.6rem;
    font-weight: bold;
    text-transform: uppercase;
    color: #333;
}

.field input {
    padding: 3px 5px;
    border: 1px solid #999;
    font-size: 0.85rem;
    border-radius: 0;
}

.sheet-section {
    border: 2px solid #333;
    padding: 8px;
    background: white;
}

.section-header {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    border-bottom: 1px solid #333;
    padding-bottom: 4px;
    margin-bottom: 8px;
    color: #333;
}

.attributes-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
}

.attr-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #999;
    padding: 4px;
    background: #f9f9f9;
}

.attr-label {
    font-size: 0.65rem;
    font-weight: bold;
    color: #333;
}

.attr-input {
    width: 35px;
    text-align: center;
    padding: 2px;
    font-size: 0.9rem;
    font-weight: bold;
    border: 1px solid #999;
}

.attr-mod {
    font-size: 0.7rem;
    font-weight: bold;
    color: #666;
    background: #eee;
    padding: 1px 4px;
    margin-top: 2px;
}

.combat-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.combat-row {
    display: flex;
    gap: 8px;
}

.combat-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.combat-stat label {
    font-size: 0.65rem;
    font-weight: bold;
    text-transform: uppercase;
}

.combat-stat input {
    padding: 3px 5px;
    border: 1px solid #999;
    font-size: 0.85rem;
}

.combat-stat.vital input {
    border-color: #c62828;
    background: #ffebee;
}

.combat-stat.mana input {
    border-color: #1565c0;
    background: #e3f2fd;
}

.stat-pair {
    display: flex;
    align-items: center;
    gap: 3px;
}

.stat-pair input {
    width: 40px;
    text-align: center;
}

.stat-pair span {
    font-weight: bold;
}

.element-row {
    display: flex;
    gap: 8px;
}

.element-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.element-field label {
    font-size: 0.65rem;
    font-weight: bold;
    text-transform: uppercase;
}

.element-field input {
    padding: 3px 5px;
    border: 1px solid #999;
    font-size: 0.8rem;
}

.god-info input {
    width: 100%;
    padding: 5px;
    border: 1px solid #999;
    font-size: 0.9rem;
    font-weight: bold;
}

.exp-bar-container {
    padding: 5px 0;
}

.exp-info {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.exp-info span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
}

.exp-info input {
    width: 60px;
    padding: 2px 5px;
    border: 1px solid #999;
    font-size: 0.85rem;
}

.skills-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid #eee;
}

.skill-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border: 1px solid #eee;
    font-size: 0.75rem;
    cursor: pointer;
}

.skill-row:hover {
    background: #f5f5f5;
}

.skill-row.selected {
    background: #e3f2fd;
    border-color: #1976d2;
}

.skill-row input {
    width: 14px;
    height: 14px;
}

.skill-mod {
    font-weight: bold;
    font-size: 0.7rem;
    min-width: 25px;
}

.skill-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-attr {
    font-size: 0.65rem;
    color: #666;
}

.talents-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.talent-category {
    border: 1px solid #ccc;
}

.talent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 8px;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
}

.talent-header:hover {
    background: #eee;
}

.talent-toggle {
    font-weight: bold;
}

.talent-skills {
    display: none;
    padding: 5px;
    background: #fafafa;
    border-top: 1px solid #ccc;
}

.talent-category.expanded .talent-skills {
    display: block;
}

.talent-skill {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px;
    font-size: 0.75rem;
    cursor: pointer;
}

.talent-skill:hover {
    background: #eee;
}

.talent-skill.selected {
    background: #e8f5e9;
}

.talent-skill input {
    width: 12px;
    height: 12px;
}

.story-text,
.marks-text,
.equipment-text {
    width: 100%;
    min-height: 60px;
    padding: 5px;
    border: 1px solid #999;
    font-size: 0.8rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 5px;
}

.marks-text {
    min-height: 40px;
}

.equipment-text {
    min-height: 80px;
}

.money-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding-top: 5px;
    border-top: 1px solid #eee;
}

.money-row span {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.8rem;
}

.money-row label {
    font-weight: bold;
    font-size: 0.7rem;
}

.money-row input {
    width: 40px;
    padding: 2px 4px;
    border: 1px solid #999;
    font-size: 0.8rem;
    text-align: center;
}

.competencies-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7rem;
}

.competencies-table th,
.competencies-table td {
    border: 1px solid #999;
    padding: 3px;
    text-align: center;
}

.competencies-table th {
    background: #f5f5f5;
    font-weight: bold;
    font-size: 0.6rem;
}

.competencies-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.competencies-table input[type="radio"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.benediction-info,
.titres-list {
    padding: 8px;
    background: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.benediction-info strong,
.titre-item strong {
    color: #333;
    font-size: 0.9rem;
}

.benediction-info p,
.titre-item p {
    margin: 4px 0;
    font-size: 0.8rem;
    color: #666;
}

.titre-item {
    padding: 8px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.titre-item:last-child {
    margin-bottom: 0;
}

/* SVG Sheet Styles */
.svg-sheet {
    position: relative;
    width: 794px;
    height: 1123px;
    margin: 0 auto;
    background: white;
}

.sheet-bg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.field-overlay {
    position: absolute;
}

.field-overlay input,
.field-overlay select,
.field-overlay textarea {
    width: 100%;
    height: 24px;
    border: 1px solid #999;
    background: transparent;
    font-size: 12px;
    padding: 2px 4px;
}

.field-overlay input:focus,
.field-overlay textarea:focus {
    background: rgba(255, 255, 200, 0.5);
    outline: none;
    border-color: #333;
}

.portrait-field {
    border: 1px dashed #999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.8);
}

.portrait-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portrait-upload {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.attr-overlay {
    position: absolute;
    text-align: center;
}

.attr-overlay .attr-label {
    display: block;
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 2px;
}

.attr-overlay input {
    width: 40px;
    height: 20px;
    text-align: center;
    font-size: 11px;
    border: 1px solid #999;
}

.attr-overlay .attr-mod {
    display: block;
    font-size: 9px;
    color: #666;
    margin-top: 2px;
}

.competencies-section {
    position: absolute;
    max-height: 350px;
    overflow-y: auto;
}

.competencies-section .competencies-table {
    font-size: 9px;
    width: 100%;
    border-collapse: collapse;
}

.competencies-section .competencies-table th,
.competencies-section .competencies-table td {
    border: 1px solid #999;
    padding: 2px;
    text-align: center;
    font-size: 8px;
}

.competencies-section .competencies-table th {
    background: #f0f0f0;
}

.competencies-section .competencies-table td:first-child {
    text-align: left;
    font-size: 8px;
}

.competencies-section input[type="radio"] {
    width: 12px;
    height: 12px;
}

.story-overlay,
.marks-overlay,
.equipment-overlay {
    position: absolute;
    border: 1px solid #999;
    background: transparent;
    font-size: 10px;
    padding: 4px;
    resize: none;
}

.story-overlay:focus,
.marks-overlay:focus,
.equipment-overlay:focus {
    background: rgba(255, 255, 200, 0.5);
}

.money-overlay {
    position: absolute;
    display: flex;
    gap: 10px;
}

.money-overlay span {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 10px;
}

.money-overlay label {
    font-weight: bold;
    font-size: 8px;
}

.money-overlay input {
    width: 40px;
    height: 20px;
    border: 1px solid #999;
    text-align: center;
    font-size: 10px;
}

.benediction-overlay,
.titres-overlay {
    position: absolute;
    font-size: 9px;
}

.benediction-overlay strong,
.titres-overlay strong {
    display: block;
    margin-bottom: 2px;
}

.benediction-overlay p,
.titres-overlay div {
    margin: 0;
    font-size: 8px;
    color: #666;
}

@media print {
    .svg-sheet {
        width: 100%;
        height: 100%;
        page-break-after: always;
    }
    
    .sheet-overlay input,
    .sheet-overlay textarea {
        border: none;
        background: transparent;
    }
}

@media print {
    .sheet-container {
        border: none;
        padding: 0;
    }
    
    .sheet-section {
        border: 1px solid #333;
    }
    
    .sheet-identity {
        border: 1px solid #333;
    }
    
    .skills-list {
        max-height: none;
    }
}

@media (max-width: 900px) {
    .sheet-container {
        grid-template-columns: 1fr;
    }
    
    .attributes-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .skills-list {
        grid-template-columns: 1fr;
    }
}
    
.header-details {
    flex-direction: column;
}

/* Skill Levels */
.skill-levels {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 10px;
}

.skill-levels label {
    display: flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
}

.skill-levels input[type="checkbox"] {
    width: 12px;
    height: 12px;
}

/* Modal PDF */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-overlay.hidden {
    display: none;
}
.modal-content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.modal-content h3 {
    color: var(--primary);
    margin-bottom: 15px;
}
.modal-content p {
    margin-bottom: 12px;
    font-size: 0.95rem;
}
.code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 12px 16px;
    border-radius: 6px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
    margin: 15px 0;
    user-select: all;
}
.modal-note {
    font-size: 0.85rem;
    color: var(--text-light);
}
.modal-content .btn-primary {
    margin-top: 10px;
}
.modal-content .btn-primary.hidden {
    display: none;
}
.progress-bar {
    background: #e0e0e0;
    border-radius: 6px;
    height: 12px;
    overflow: hidden;
    margin: 15px 0 5px;
}
.progress-bar-fill {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    height: 100%;
    width: 0%;
    transition: width 0.25s ease;
    border-radius: 6px;
}

/* Compétences */
.comp-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.comp-item {
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
    overflow: hidden;
}
.comp-item.selected {
    border-color: var(--primary);
    background: #e8eaf6;
}
.comp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 0.9rem;
}
.comp-header.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.comp-header input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.comp-name {
    flex: 1;
    font-weight: 600;
}
.comp-attr {
    background: var(--primary);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: bold;
}
.comp-type {
    background: var(--bg-dark);
    color: #b0bec5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: capitalize;
}
.comp-levels {
    padding: 6px 10px 6px 34px;
    border-top: 1px solid var(--border);
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.comp-level-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.78rem;
    background: white;
    transition: all 0.12s;
}
.comp-level-row:hover {
    border-color: var(--primary-light);
    background: #e8eaf6;
}
.comp-level-row.active {
    border-color: var(--primary);
    background: #e8eaf6;
}
.comp-level-row input[type="radio"] {
    display: none;
}
.lvl-radio-mark {
    width: 14px;
    height: 14px;
    border: 2px solid #999;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}
.comp-level-row.active .lvl-radio-mark {
    border-color: var(--primary);
}
.comp-level-row.active .lvl-radio-mark::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: var(--primary);
    border-radius: 50%;
}
.lvl-name {
    font-weight: 700;
    color: var(--primary);
    min-width: 70px;
    font-size: 0.75rem;
}
.lvl-desc {
    flex: 1;
    color: var(--text-light);
    font-size: 0.72rem;
}
.lvl-bonus {
    font-size: 0.7rem;
    color: var(--success);
    font-weight: 600;
    text-align: right;
    min-width: 90px;
}
.comp-count {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 6px;
}

/* Pagination compétences */
.comp-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
}
.comp-page-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.15s;
}
.comp-page-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.comp-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.comp-page-info {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

/* Compétences page 2 — 4 cartes */
.sheet-comp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.sheet-comp-card {
    border: 1px solid #999;
    border-radius: 4px;
    padding: 8px;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ccc;
    padding-bottom: 4px;
    margin-bottom: 4px;
}
.card-name {
    font-weight: bold;
    font-size: 0.8rem;
}
.card-attr {
    font-size: 0.65rem;
    background: var(--primary);
    color: white;
    padding: 1px 5px;
    border-radius: 3px;
}
.sheet-comp-levels {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-wrap: wrap;
}
.sheet-level-row {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding: 3px 4px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14pt;
    border: 1px solid transparent;
    transition: all 0.1s;
    flex-wrap: wrap;
}
.sheet-level-row:hover {
    background: #e8eaf6;
    border-color: var(--border);
}
.sheet-level-row.checked {
    background: #f0f4ff;
}
.sheet-level-row input[type="checkbox"] {
    width: 12px;
    height: 12px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}
.sl-row-name {
    font-weight: 700;
    color: var(--primary);
    min-width: 55px;
    font-size: 14pt;
    flex-shrink: 0;
}
.sl-row-desc {
    /*flex: 3;*/
    width:100%;
    color: #555;
    font-size: 14pt;
    /*line-height: 1.2;*/
    min-width: 90%;
    order: 4;
}
.sl-row-bonus {
    font-size: 14pt;
    color: var(--success);
    font-weight: 600;
    text-align: right;
    flex-shrink: 0;
}
.comp-empty {
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
}

