/*
  Refined Sunken Stars CSS — Dark-Sea Vibe + Robust Layout
  Uses only web-safe assets (no external images), minimal dependencies
*/

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital@1&family=Spectral:wght@300;400;600&display=swap');

:root {
    --primary-color: #0a1c20;
    --secondary-color: #0c5356;
    --accent-color: #8c1a15;
    --light-accent: #c27b21;
    --dark-color: #040d0f;
    --light-color: #e8e8df;
    --text-color: #111;
    --border-color: #333;
    --shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    
    --primary-font: 'Cormorant Garamond', serif;
    --secondary-font: 'Spectral', serif;
}

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

/* Add question mark cursor for elements with tooltips */
[title], 
[data-tooltip],
.has-tooltip {
    cursor: help;
}

body {
    font-family: var(--secondary-font);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #121212;
    background-image: url('../img/bg.jpg');
    background-size: cover;
    background-blend-mode: darken;
}

#dice-box {
  position: fixed;
  top: 0;
  left: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  z-index: 10000;
  pointer-events: none;
}

#dice-box canvas {
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 1;
}

.hidden-dice {
    transition: all 0.5s;
    opacity: 0 !important;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
}

/* Header */
header {
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: 15px 20px;
    margin-bottom: 0;
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--accent-color);
    width: 900px;
    margin: 0 auto 0 auto;
    position: fixed; 
    top: 0; 
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Header styling defined above */

header h1 {
    font-family: var(--primary-font);
    font-size: 2rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.controls {
    display: flex;
    gap: 10px;
}

/* Buttons */
.main-btn, .secondary-btn, .small-btn, .icon-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--primary-font);
    transition: all 0.2s;
}

.icon-btn {
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--secondary-color);
    color: white;
}

.icon-btn:hover {
    background-color: #0c7476;
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

.main-btn {
    background-color: var(--light-accent);
    color: white;
    font-size: 12pt;
}

.main-btn:hover {
    background-color: #d88b24;
}

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

.secondary-btn:hover {
    background-color: #0c7476;
}

.small-btn {
    padding: 4px 8px;
    font-size: 0.9rem;
    background-color: var(--light-accent);
    color: white;
}

.small-btn:hover {
    background-color: #d88b24;
}

/* Character Sheet */
.character-sheet {
    background: var(--light-color);
    padding: 15px;
    border-radius: 0 0 5px 5px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    border-top: none;
    background-size: cover;
    background-position: center;
    background-blend-mode: overlay;
    max-width: 900px;
    margin: 0 auto;
    font-size: 0.9rem;
    position: relative;
	margin-top: 81px;
}

/* Add a subtle overlay to improve text readability over the background image */
.character-sheet::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(232, 232, 223, 0.85); /* Uses var(--light-color) with opacity */
    z-index: 0;
    border-radius: 0 0 5px 5px;
}

/* Ensure content appears above the overlay */
.character-sheet > * {
    position: relative;
    z-index: 1;
}

.sheet-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.sheet-header h2 {
    font-family: var(--primary-font);
    color: var(--primary-color);
    font-size: 1.8rem;
}

/* Character Details Section */
.character-details .row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#characterName {
	height: 40px;
}

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

.field label {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

input, select, textarea {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--secondary-font);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--secondary-color);
    outline: none;
}

input:disabled, select:disabled {
	color: var(--primaty-color);
	padding: 8px;
	border: none;
	background-color: #FFFFFF99;
	height: auto !important;
	/* for Firefox */
	-moz-appearance: none;
	/* for Chrome */
	-webkit-appearance: none;
}

/* For IE10 */
select:disabled::-ms-expand {
  display: none;
}

.description {
    font-size: 0.75rem;
    color: #555;
    margin-top: 3px;
    line-height: 1.3;
    font-style: italic;
}

/* Removed the patron-section, court-selector, and patron-selector classes 
   as they're no longer needed with the new layout */

/* Attributes Section */
.attributes-container {
    margin: 8px 0;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: rgba(20, 20, 20, 0.05);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.attributes-container h3, 
.derived-stats h3,
.traits-section h3,
.belongings-section h3,
.notes-section h3 {
    font-family: var(--primary-font);
    color: var(--primary-color);
    margin-bottom: 6px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 4px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

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

.attribute-item {
    display: flex;
    flex-direction: column;
    padding: 5px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 0.75rem;    
}

.attribute-item label {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 0.8rem;
    width: 100%;	
}

.attribute-item .top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 2px;
}

.attribute-item input {
    width: 40px;
    height: 22px;
    text-align: center;
    font-size: 0.75rem;
    padding: 0 2px;
    opacity: 0.8; /* Slightly de-emphasize the roll value */
}

.attribute-item input:disabled {
	display: none;
}

.modifier {
    font-weight: bold;
    color: var(--secondary-color);
    font-size: 1.1rem; /* Increased from 0.75rem */
    text-shadow: 0px 0px 1px rgba(12, 83, 86, 0.3);
    width: 100%;
    text-align: center;
    margin-top: 4px;
    margin-bottom: 4px; /* Added bottom margin */
    background-color: rgba(12, 83, 86, 0.05);
    border-radius: 3px;
    padding: 2px 0 3px; /* Increased bottom padding */
    cursor: pointer !important;
}

.modifier:hover {
    background-color: rgba(12, 83, 86, 0.01);
}

.modifier:active {
    background-color: #00000022;
}

/* Derived Attributes */
.derived-stats {
    margin: 8px 0;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: rgba(20, 20, 20, 0.05);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.stats-category {
    margin-bottom: 10px;
}

.stats-subtitle {
    font-size: 0.85rem;
    color: var(--accent-color);
    margin: 6px 0;
    padding-left: 4px;
    border-left: 3px solid var(--accent-color);
}

.resistances-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

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

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    
}

.stat.resistance {
    border-color: #b8783b;
    background-color: rgba(220, 170, 110, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);    
}

.stat label {
    font-weight: bold;
    margin-bottom: 2px;
    color: var(--primary-color);
    font-size: 0.7rem;
}

.stat span {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--secondary-color);       
}

.stat.resistance span {
    background: none;
    cursor: help !important;
}

#statInitiative {
    background-color: rgba(12, 83, 86, 0.05);
    width: 80%;
    text-align: center;
    cursor: pointer !important; 
}

#statInitiative:hover {
    background-color: rgba(12, 83, 86, 0.01);
}

#statInitiative:active {
    background-color: #00000022;
}

/* Traits Section */
.traits-section {
    margin: 8px 0;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: rgba(20, 20, 20, 0.05);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.traits-grid {
    display: block;
}

.trait-card {
    padding: 8px;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    font-size: 0.85rem;
}

.trait-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23000000' fill-opacity='0.03' fill-rule='evenodd'%3E%3Cpath d='M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.7;
    z-index: 0;
    pointer-events: none;
}

.trait-card h4 {
    color: var(--accent-color);
    border-bottom: 1px solid #eee;
    padding-bottom: 3px;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.trait-content {
    font-size: 0.95rem;
}

.trait-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eee;
}

.trait-item strong, .selected-trait strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 3px;
}

.trait-item p, .selected-trait p {
    font-size: 0.9rem;
    color: #555;
}

.selected-trait {
    background-color: rgba(236, 154, 41, 0.1);
    border-left: 3px solid var(--light-accent);
    padding: 10px;
    margin-bottom: 15px;
}

.selected-trait h5 {
    color: var(--accent-color);
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.selected-trait strong {
    font-size: 1.1rem;
}

/* Belongings Section */
.belongings-section {
    margin: 8px 0;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: rgba(20, 20, 20, 0.05);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.belongings-grid {
    display: grid;
}

.belongings-card {
    padding: 8px;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    font-size: 0.85rem;
}

.belongings-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23000000' fill-opacity='0.03' fill-rule='evenodd'%3E%3Cpath d='M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.7;
    z-index: 0;
    pointer-events: none;
}

.belongings-card h4 {
    color: var(--accent-color);
    border-bottom: 1px solid #eee;
    padding-bottom: 3px;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.belongings-content {
    font-size: 0.95rem;
    padding: 5px;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
    margin-bottom: 10px;
}

.belongings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.money-section {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 5px 10px;
    background-color: rgba(194, 123, 33, 0.1);
    border-radius: 4px;
    border-left: 3px solid var(--light-accent);
}

.money-section label {
    margin-right: 10px;
    font-weight: bold;
}

.money-section input {
    width: 80px;
    text-align: right;
    padding: 4px 8px;
}

.money-symbol {
    margin-left: 5px;
    font-weight: bold;
    color: var(--light-accent);
}

.generated-belongings, .custom-belongings {
    margin-bottom: 15px;
}

.generated-belongings h5, .custom-belongings h5 {
    font-size: 0.85rem;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.belongings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.belongings-table th, .belongings-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.belongings-table th {
    font-weight: bold;
    background-color: rgba(0, 0, 0, 0.05);
}

.belongings-table tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.belongings-table input {
    width: 100%;
    padding: 4px;
    font-size: 0.85rem;
}

.item-actions {
    display: flex;
    gap: 5px;
}

.item-actions button {
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    font-size: 12px;
    cursor: pointer;
}

.item-actions .delete-btn {
    background-color: #dc3545;
}

.item-actions button:hover {
    opacity: 0.9;
}

.starting-item {
    background-color: rgba(194, 123, 33, 0.05);
}

.amenities-list {
    list-style-type: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.amenities-list li {
    font-size: 0.9rem;
    padding: 4px 8px;
    background-color: #f0f0f0;
    border-radius: 3px;
}

/* Notes Section */
.notes-section {
    margin-top: 8px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: rgba(20, 20, 20, 0.05);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.notes-section textarea {
    width: 100%;
    min-height: 160px; /* Doubled from 80px to 160px */
    resize: vertical;
    font-size: 0.85rem;
    padding: 6px;
}

/* Hide print notes on screen */
#printNotes {
	display: none;
}

    
/* Patron power with Wild Dice styling */
.patron-power-card {
	position: relative !important;
}

/* Wild Dice styling */
.wild-dice {
	color: red !important;
	font-weight: bold !important;
	font-size: 10pt !important;
}

.dice {
	font-size: 14pt;
	font-weight: normal;
	top: 3px;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    color: #666;
    font-size: 0.8rem;
}

/* Print Styles */
@media print {
    @page {
        size: letter portrait;
        margin: 0.25in;
    }
    
    /* Print styles for notes */
    .notes-section textarea {
        display: none !important;
    }
    
    #printNotes {
        display: block !important;
        font-size: 8pt !important;
        line-height: 1.3 !important;
        white-space: pre-wrap !important;
        padding: 4px !important;
        border: none !important;
        min-height: 80px !important;
        overflow: visible !important;
        width: 100% !important;
    }
    
    body {
        background: white;
        font-size: 9pt;
        line-height: 1.2;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    header, footer, .controls, button, .small-btn, .main-btn, .secondary-btn, .icon-btn, 
    #rollStatsBtn, #addItemBtn, #addClassTraitBtn, #addLegacyTraitBtn, .trait-remove-btn {
        display: none !important;
    }
    
    /* Basic page setup */
    .character-sheet {
        background: none !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        max-width: 100% !important;
        padding: 8px !important;
    }
    
    .character-sheet::before {
        display: none !important;
    }
    
    /* Simple layout, no grid */
    .character-sheet {
        display: block !important;
    }
    
    /* Special container for attributes and derived stats */
    .character-sheet::after {
        content: "" !important;
        display: table !important;
        clear: both !important;
    }
    
    /* Clear all backgrounds */
    .character-sheet, .attributes-container, .derived-stats, .traits-section, 
    .patron-power-section, .belongings-section, .notes-section, .attribute-item,
    .stat, .trait-cell, .patron-power-card, .money-section, .starting-item {
        background-color: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    
    /* Compact section styling */
    .traits-section, .patron-power-section, .belongings-section, .notes-section {
        margin: 5px 0 !important;
        padding: 5px 0 !important;
        border-top: 1px solid #999 !important;
        clear: both !important;
    }
    
    /* Special treatment for top sections */
    .attributes-container, .derived-stats {
        margin: 10px 0 0 0 !important;
        padding: 0 !important;
        border: none !important;
    }
    
    /* Simple condensed header */
    .sheet-header {
        text-align: center !important;
        margin-bottom: 5px !important;
    }
    
    .sheet-header h2 {
        font-size: 12pt !important;
        margin: 0 !important;
    }
    
    /* Character details layout */
    .character-details {
        display: flex !important;
        margin-bottom: 3px !important;
    }
    
    .character-details .row {
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
    }
    
    .character-details .field {
        margin-right: 10px !important;
        width: auto !important;
        flex: 1 1 auto !important;
        min-width: 110px !important;
        margin-bottom: 0 !important;
    }
    
    /* Form elements */
    input, select, textarea {
        border: none !important;
        background: transparent !important;
        font-size: 8pt !important;
        padding: 0 !important;
    }
    
    /* Remove dropdown arrows */
    select {
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        appearance: none !important;
        background-image: none !important;
    }
    
    /* Integrated attributes and derived stats - side by side with 50/50 split */
    .attributes-container {
        float: left !important;
        width: 50% !important;
        padding-right: 10px !important;
        box-sizing: border-box !important;
        margin-top: 10px !important;
        margin-bottom: 5px !important;
    }
    
    .derived-stats {
        float: left !important;
        width: 50% !important;
        box-sizing: border-box !important;
        margin-top: 10px !important;
        margin-bottom: 5px !important;
    }
    
    /* Compact attribute modifiers */
    .attributes-grid {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 3px !important;
    }
    
    .attribute-item {
        flex: 1 !important;
        min-width: 40px !important;
        max-width: 50px !important;
        text-align: center !important;
        margin-bottom: 0 !important;
        padding: 0 !important;
    }
    
    /* Hide the attribute values */
    .attribute-item .top-row input {
        display: none !important;
    }
    
    .attribute-item label {
        font-size: 7pt !important;
        text-transform: uppercase !important;
        font-weight: bold !important;
        margin-bottom: 0 !important;
        display: block !important;
    }
    
    .modifier {
        font-size: 12pt !important;
        font-weight: bold !important;
        border: 1px solid #999 !important;
        border-radius: 50% !important;
        width: 25px !important;
        height: 25px !important;
        margin: 0 auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Compact stats display */
    .stats-category {
        margin-bottom: 6px !important;
    }
    
    .stats-subtitle {
        font-size: 7pt !important;
        text-transform: uppercase !important;
        margin: 0 !important;
        font-weight: bold !important;
    }
    
    .resistances-grid, .stats-grid {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        gap: 4px !important;
        margin-bottom: 4px !important;
    }
    
    .stat {
        text-align: center !important;
        width: 32% !important;
        margin-bottom: 2px !important;
        padding: 2px !important;
        border: 1px solid #eee !important;
    }
    
    .stat.resistance {
        width: 32% !important;
    }
    
    .stat label {
        display: block !important;
        font-size: 6pt !important;
        text-transform: uppercase !important;
        margin: 0 !important;
    }
    
    .stat span {
        font-size: 9pt !important;
        font-weight: bold !important;
    }
    
    /* Section headers - different styles for top vs bottom sections */
    .traits-section h3,
    .patron-power-section h3,
    .belongings-section h3,
    .notes-section h3 {
        font-size: 10pt !important;
        text-align: center !important;
        text-transform: uppercase !important;
        margin: 0 0 5px 0 !important;
        padding-bottom: 2px !important;
    }
    
    /* Better headers for top sections */
    .attributes-container h3, 
    .derived-stats h3 {
        font-size: 9pt !important;
        text-align: center !important;
        text-transform: uppercase !important;
        margin: 0 0 5px 0 !important;
        padding-bottom: 2px !important;
        border-bottom: 1px solid #999 !important;
    }
    
    /* Traits styling */
    .traits-table {
        width: 100% !important;
        margin-bottom: 5px !important;
    }
    
    .traits-table td {
        padding: 3px !important;
        border-bottom: 1px solid #eee !important;
    }
    
    .trait-header {
        float: right !important;
    }
    
    .trait-type {
        font-size: 7pt !important;
        font-style: italic !important;
    }
    
    .trait-name {
        font-size: 9pt !important;
        font-weight: bold !important;
        display: block !important;
    }
    
    .trait-description {
        font-size: 8pt !important;
    }

    
    .patron-power-name {
        font-size: 9pt !important;
        font-weight: bold !important;
        border-bottom: 1px solid #eee !important;
        margin-bottom: 3px !important;
        padding-bottom: 2px !important;
        padding-right: 50px !important; /* Make room for wild dice */
    }
    
    .patron-power-description {
        font-size: 8pt !important;
    }
    
    .dice-number {
        font-size: 14pt !important;
        font-weight: bold !important;
        margin-left: 3px !important;
    }
    
    /* Belongings styling */
    .belongings-table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 8pt !important;
    }
    
    .belongings-table th {
        text-align: left !important;
        font-size: 7pt !important;
        text-transform: uppercase !important;
        padding: 2px !important;
    }
    
    .belongings-table td {
        padding: 2px !important;
        border-bottom: 1px solid #eee !important;
    }
    
    /* Money display */
    .money-section {
        margin-bottom: 8px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .money-section label {
        text-transform: uppercase !important;
        font-size: 8pt !important;
        margin-right: 5px !important;
    }
    
    .money-section input {
        width: 40px !important;
        text-align: right !important;
    }
    
    /* Port amenities */
    .port-amenities {
        margin-top: 5px !important;
    }
    
    .port-amenities h4 {
        font-size: 9pt !important;
        margin-bottom: 3px !important;
    }
    
    .amenities-list {
        columns: 3 !important;
        font-size: 7pt !important;
        list-style-type: disc !important;
        padding-left: 20px !important;
    }
    
    /* Notes area styling for screen */
    .notes-section textarea {
        width: 100%;
        height: 90px;
        min-height: 90px;
        font-size: 0.85rem;
        resize: vertical;
    }
    
    /* Make sure everything is visible */
    * {
        overflow: visible !important;
    }
    
    /* Fix for notes area to ensure content is shown */
    @media print {
        pre, blockquote, textarea {
            page-break-inside: avoid !important;
            white-space: pre-wrap !important;
            overflow: visible !important;
        }
    }
    
    /* Hide most buttons */
    .item-actions button, .delete-btn {
        display: none !important;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    header {
        position: relative;
        max-width: 100%;
    }
    header h1 {
        font-size: 18pt;
    }
    header .icon-btn {
        width: 36px;
        display: inline-block;
    }
    .header-content {
        flex-direction: column;
        gap: 10px;
    }

    .character-sheet {
        margin-top: 0;
    }
    
    .character-details .row {
        display: inline;
        width: 49%;
    }

    .character-details .row .field {
        display: inline-flex;
        margin-bottom: 10px;
    }
    
    .attributes-grid, .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .traits-grid, .belongings-grid {
        grid-template-columns: 1fr;
    }
    
    .class-traits {
        grid-column: span 1;
    }
    
    .port-amenities {
        grid-column: span 1;
    }
    
    .amenities-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .controls {
        flex-direction: row;
        width: 100%;
    }
    
    .amenities-list {
        grid-template-columns: 1fr;
    }
}

/* Additional styles for traits table and tooltips */
.traits-table {
    width: 100%;
    margin-bottom: 10px;
    border-collapse: collapse;
}

.traits-table td {
    padding: 6px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.trait-cell {
    position: relative;
    padding: 8px;
}

.trait-header {
    position: absolute;
    top: 6px;
    right: 6px;
}

.trait-type {
    font-size: 0.7rem;
    font-style: italic;
    color: var(--accent-color);
    display: inline-block;
}

.trait-name {
    font-weight: bold;
    display: block;
    margin-bottom: 2px;
    padding-right: 60px; /* Make room for the title in the top right */
}

.trait-description {
    font-size: 0.7rem;
    color: #555;
    line-height: 1.2;
    display: block;
}

.class-traits-container {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #ddd;
}

.class-traits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.class-traits-header h4 {
    margin: 0;
    color: var(--accent-color);
    font-size: 0.9rem;
}

.trait-buttons {
    display: flex;
    gap: 6px;
}

.additional-traits, .legacy-traits {
    margin-top: 15px;
}

.additional-trait, .legacy-trait {
    position: relative;
    margin-bottom: 10px;
    border-left: 2px solid var(--secondary-color);
    padding-left: 8px;
    background-color: rgba(12, 83, 86, 0.05);
}

.legacy-trait {
    border-left-color: var(--accent-color);
    background-color: rgba(140, 26, 21, 0.05);
}

.trait-remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #dc3545;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.trait-remove-btn:hover {
    background-color: #bd2130;
}

.trait-source {
    display: block;
    font-size: 0.7rem;
    color: #777;
    margin-bottom: 3px;
}

/* Character Progression Section */
.progression-section {
    margin: 8px 0;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: rgba(20, 20, 20, 0.05);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    display: none; /* Hidden by default, shown after finalization */
}

.progression-section h3 {
    font-family: var(--primary-font);
    color: var(--primary-color);
    margin-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 4px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.progression-tracks {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.track {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: white;
}

.class-track {
    border-left: 3px solid var(--secondary-color);
}

.patron-track {
    border-left: 3px solid var(--accent-color);
}

.track h4 {
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--primary-color);
    font-size: 0.95rem;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
}

.track-info {
    display: flex;
    margin-bottom: 10px;
    gap: 15px;
}

.level-container, .xp-container {
    flex: 1;
}

.track-info label {
    font-weight: bold;
    display: inline-block;
    width: 45px;
}

.track-info input[type="number"] {
    width: 50px;
    text-align: center;
}

.next-level {
    display: block;
    font-size: 0.8rem;
    margin-top: 4px;
    color: var(--secondary-color);
}

.track-description {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
    line-height: 1.3;
}

.unlocked-features {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

.class-features, .patron-features {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.7);
}

.class-features h4, .patron-features h4 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.class-features {
    border-left: 3px solid var(--secondary-color);
}

.patron-features {
    border-left: 3px solid var(--accent-color);
}

/* Print styles for progression section */
@media print {
    .progression-section {
        margin: 5px 0 !important;
        padding: 5px 0 !important;
        border-top: 1px solid #999 !important;
        background: none !important;
        box-shadow: none !important;
        page-break-inside: avoid !important;
    }
    
    .progression-tracks {
        display: flex !important;
        gap: 5px !important;
    }
    
    .track {
        padding: 4px !important;
        border: 1px solid #ddd !important;
        background: none !important;
    }
    
    .track h4 {
        font-size: 9pt !important;
        margin-bottom: 4px !important;
    }
    
    .track-info {
        margin-bottom: 5px !important;
    }
    
    .track-info label {
        font-size: 7pt !important;
        width: auto !important;
        margin-right: 3px !important;
    }
    
    .track-info input[type="number"] {
        width: 25px !important;
        font-size: 9pt !important;
    }
    
    .next-level {
        font-size: 7pt !important;
    }
    
    .track-description {
        font-size: 6pt !important;
    }
    
    .unlocked-features {
        display: flex !important;
        gap: 5px !important;
        font-size: 7pt !important;
    }
    
    .class-features, .patron-features {
        padding: 4px !important;
        background: none !important;
    }
    
    .class-features h4, .patron-features h4 {
        font-size: 8pt !important;
        margin-bottom: 3px !important;
    }
}

/* Character Actions Section */
.character-actions-section {
    margin: 8px 0;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: rgba(20, 20, 20, 0.05);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.character-actions-section h3 {
    font-family: var(--primary-font);
    color: var(--primary-color);
    margin-bottom: 6px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 4px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Actions Table Styles */
.actions-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.actions-table thead {
    background-color: var(--secondary-color);
    color: white;
}

.actions-table th {
    padding: 8px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: bold;
}

.actions-table td {
    padding: 8px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.action-name {
    font-weight: bold;
    color: var(--secondary-color);
    font-size: 0.95rem;
    width: 15%;
}

.action-description {
    font-size: 0.8rem;
    color: #555;
    width: 50%;
}

.action-hit, .action-damage, .action-roll {
    text-align: center;
    width: 15%;
}

.action-roll-btn {
    background-color: rgba(12, 83, 86, 0.05);
    color: var(--secondary-color);
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
    max-width: 120px;
    display: inline-block;
}

.action-roll-btn:hover {
    background-color: rgba(12, 83, 86, 0.01);
}

#unarmedDamageText {
    font-weight: bold;
    color: var(--accent-color);
}

/* Responsive adjustments for the actions table */
@media (max-width: 768px) {
    .actions-table {
        font-size: 0.85rem;
    }
    
    .action-name {
        width: 20%;
    }
    
    .action-description {
        width: 40%;
    }
    
    .action-roll-btn {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .actions-table thead {
        display: none;
    }
    
    .actions-table, .actions-table tbody, .actions-table tr, .actions-table td {
        display: block;
        width: 100%;
    }
    
    .action-row {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
        overflow: hidden;
    }
    
    .action-name {
        background-color: var(--secondary-color);
        color: white;
        padding: 8px;
        width: 100%;
    }
    
    .action-description {
        padding: 8px;
        width: 100%;
    }
    
    .action-hit, .action-damage, .action-roll {
        padding: 8px;
        text-align: left;
        width: 100%;
    }
    
    .action-roll-btn {
        width: 100%;
        max-width: none;
    }
}

/* Responsive adjustments for actions grid */
@media (max-width: 768px) {
    .actions-grid {
        grid-template-columns: 1fr;
    }
}

/* Patron Power section with dark background */
.patron-power-section {
    margin: 8px 0;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: rgba(20, 20, 20, 0.05);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.patron-power-section h3 {
    font-family: var(--primary-font);
    color: var(--primary-color);
    margin-bottom: 6px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 4px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.patron-power-card {
    padding: 12px;
    border: 1px solid #333;
    border-radius: 4px;
    background-color: #111;
    color: #eee;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.patron-power-name {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--light-accent);
    border-bottom: 1px solid #333;
    padding-bottom: 4px;
}

.patron-power-description {
    font-size: 0.8rem;
    line-height: 1.4;
}

.trait-select-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.trait-select-container label {
    font-size: 0.85rem;
    font-weight: bold;
    white-space: nowrap;
}

.trait-select-container select {
    flex-grow: 1;
    padding: 3px;
    font-size: 0.85rem;
}

.selected-trait {
    background-color: rgba(236, 154, 41, 0.05);
    border-left: 2px solid var(--light-accent);
    padding: 6px 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

/* Class trait styling removed as requested */

/* Combined belongings styles */
#combinedBelongings {
    line-height: 1.3;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    border: 1px dashed #ddd;
    font-size: 0.85rem;
}

.all-belongings-card {
    padding: 8px;
}

.all-belongings-card h4 {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.port-amenities {
    margin-top: 10px;
}

.amenities-list {
    padding-left: 15px;
    margin-top: 5px;
}

.amenities-list li {
    font-size: 0.8rem;
    padding: 2px 5px;
    margin: 2px;
}

.unavailable-amenity {
    opacity: 0.35;
    color: #999;
    text-decoration: line-through;
    font-style: italic;
}