:root {
    --ink-black: #1a1a1a;
    --paper-white: #f9f7f4;
    --aged-gold: #d4af37;
    --deep-burgundy: #5c0f1e;
    --forest-green: #2d4a3e;
    --rust-orange: #c84b31;
    --shadow: rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Crimson Text', serif;
    background: linear-gradient(135deg, #f9f7f4 0%, #ede7dc 100%);
    color: var(--ink-black);
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.02) 2px, rgba(0,0,0,.02) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,.02) 2px, rgba(0,0,0,.02) 4px);
    pointer-events: none;
    z-index: 1;
    opacity: 0.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

header {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeInDown 1s ease-out;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--deep-burgundy) 0%, var(--rust-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--aged-gold), transparent);
}

.subtitle {
    font-style: italic;
    font-size: 1.3rem;
    color: var(--forest-green);
    margin-top: 1.5rem;
    opacity: 0;
    animation: fadeIn 1s ease-out 0.3s forwards;
}

.customization-panel {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    animation: fadeIn 1s ease-out 0.4s backwards;
}

.customize-toggle {
    padding: 0.75rem 1.25rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    font-weight: 600;
    background: var(--aged-gold);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.customize-toggle:hover {
    background: var(--deep-burgundy);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(92, 15, 30, 0.3);
}

.customize-options {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    padding: 2rem;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 10px 30px var(--shadow);
    width: 400px;
    max-width: 90vw;
}

.color-section {
    margin-bottom: 2rem;
}

.color-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--deep-burgundy);
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.color-btn {
    width: 50px;
    height: 50px;
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.color-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.color-btn.selected {
    border: 3px solid var(--deep-burgundy);
    box-shadow: 0 0 0 3px rgba(92, 15, 30, 0.2);
}

.reset-btn {
    padding: 0.75rem 2rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 600;
    background: transparent;
    color: var(--deep-burgundy);
    border: 2px solid var(--deep-burgundy);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.reset-btn:hover {
    background: var(--deep-burgundy);
    color: white;
}

.controls {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    animation: fadeIn 1s ease-out 0.5s backwards;
}

.category-btn {
    padding: 1rem 2rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid var(--ink-black);
    background: white;
    color: var(--ink-black);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--ink-black);
    transition: left 0.3s ease;
    z-index: -1;
}

.category-btn:hover::before {
    left: 0;
}

.category-btn:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--shadow);
}

.category-btn.active {
    background: var(--deep-burgundy);
    color: white;
    border-color: var(--deep-burgundy);
}

.generate-btn {
    padding: 1.5rem 3rem;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--deep-burgundy) 0%, var(--rust-orange) 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(92, 15, 30, 0.3);
    position: relative;
    overflow: hidden;
    margin: 2rem auto;
    display: block;
}

.generate-btn::after {
    content: '\2726';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 3rem;
    opacity: 0;
    transition: all 0.4s ease;
}

.generate-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(92, 15, 30, 0.4);
}

.generate-btn:active::after {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 1;
}

.inspiration-card {
    background: white;
    padding: 3rem;
    border-radius: 0;
    box-shadow: 0 20px 60px var(--shadow);
    position: relative;
    margin: 3rem auto;
    max-width: 800px;
    border: 1px solid rgba(0,0,0,0.1);
    transform-origin: center;
    animation: cardAppear 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.inspiration-card::before {
    content: '\201C';
    position: absolute;
    top: -20px;
    left: 30px;
    font-family: 'Playfair Display', serif;
    font-size: 8rem;
    color: var(--aged-gold);
    opacity: 0.3;
    line-height: 1;
}

.card-category {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--rust-orange);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--deep-burgundy);
    line-height: 1.2;
}

.card-content {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #333;
}

.card-prompt {
    font-style: italic;
    padding: 1.5rem;
    background: rgba(212, 175, 55, 0.1);
    border-left: 4px solid var(--aged-gold);
    margin-top: 2rem;
    font-size: 1.1rem;
    color: var(--forest-green);
}

.plot-points-section,
.characters-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--deep-burgundy);
    margin-bottom: 1rem;
}

.plot-points-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.plot-points-list li {
    padding: 0.75rem 0 0.75rem 2rem;
    font-family: 'Crimson Text', serif;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #333;
    position: relative;
}

.plot-points-list li::before {
    content: '\2192';
    position: absolute;
    left: 0;
    color: var(--aged-gold);
    font-weight: bold;
    font-size: 1.2rem;
}

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

.character-card {
    padding: 1rem;
    background: linear-gradient(135deg, rgba(92, 15, 30, 0.05) 0%, rgba(45, 74, 62, 0.05) 100%);
    border: 1px solid rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.character-card:hover {
    border-color: var(--aged-gold);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(45, 74, 62, 0.1) 100%);
    transform: translateY(-2px);
}

.character-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--deep-burgundy);
    margin-bottom: 0.5rem;
}

.character-role {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: var(--forest-green);
    margin-bottom: 0.3rem;
    font-style: italic;
}

.character-trait {
    font-family: 'Crimson Text', serif;
    font-size: 0.95rem;
    color: #666;
}

.ending-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(0,0,0,0.1);
}

.ending-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--deep-burgundy);
    margin-bottom: 1.5rem;
    text-align: center;
}

.ending-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ending-card {
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(45, 74, 62, 0.05) 0%, rgba(92, 15, 30, 0.05) 100%);
    border: 2px solid rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.ending-card:hover {
    border-color: var(--aged-gold);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(200, 75, 49, 0.1) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px var(--shadow);
}

.ending-card::after {
    content: '\2193 Click to explore';
    position: absolute;
    bottom: 0.5rem;
    right: 1rem;
    font-size: 0.75rem;
    color: var(--aged-gold);
    opacity: 0;
    transition: opacity 0.3s ease;
    font-style: italic;
    font-family: 'Crimson Text', serif;
}

.ending-card:hover::after {
    opacity: 1;
}

.ending-type {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--deep-burgundy);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ending-description {
    font-family: 'Crimson Text', serif;
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
}

.ending-expanded {
    margin-top: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(45, 74, 62, 0.1) 100%);
    border-left: 4px solid var(--aged-gold);
    animation: slideDown 0.3s ease-out;
    border-radius: 4px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ending-expanded-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--deep-burgundy);
    margin-bottom: 0.75rem;
}

.ending-expanded-content {
    font-family: 'Crimson Text', serif;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #333;
    white-space: pre-line;
    text-align: left;
}

.ending-expanded-content strong {
    font-family: 'Cormorant Garamond', serif;
    color: var(--deep-burgundy);
    font-size: 1.1rem;
    display: block;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ending-expanded-content strong:first-child {
    margin-top: 0;
}

.ending-loading {
    text-align: center;
    padding: 1.5rem;
    font-style: italic;
    color: var(--forest-green);
    font-family: 'Crimson Text', serif;
}

.elements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.element-tag {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(45, 74, 62, 0.1) 0%, rgba(45, 74, 62, 0.05) 100%);
    border: 1px solid var(--forest-green);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.element-tag:hover {
    background: var(--forest-green);
    color: white;
    transform: translateY(-2px);
}

.element-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.7;
    display: block;
    margin-bottom: 0.3rem;
}

.element-value {
    font-weight: 600;
    font-size: 1.1rem;
}

.save-btn {
    margin-top: 2rem;
    padding: 1rem 2rem;
    background: transparent;
    border: 2px solid var(--forest-green);
    color: var(--forest-green);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.save-btn:hover {
    background: var(--forest-green);
    color: white;
}

.saved-ideas {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid rgba(0,0,0,0.1);
}

.saved-ideas h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--deep-burgundy);
}

.saved-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.saved-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.delete-all-btn {
    padding: 0.75rem 1.5rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 600;
    background: transparent;
    color: var(--rust-orange);
    border: 2px solid var(--rust-orange);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.delete-all-btn:hover {
    background: var(--rust-orange);
    color: white;
}

.emergency-clear-btn {
    padding: 0.75rem 1.5rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 600;
    background: var(--deep-burgundy);
    color: white;
    border: 2px solid var(--deep-burgundy);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.emergency-clear-btn:hover {
    background: #4a0c17;
    border-color: #4a0c17;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(92, 15, 30, 0.3);
}

.saved-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.saved-item {
    background: white;
    padding: 1.5rem;
    padding-right: 3.5rem;
    border: 1px solid rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.saved-item:hover {
    box-shadow: 0 10px 30px var(--shadow);
    transform: translateY(-5px);
}

.saved-item-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--deep-burgundy);
}

.saved-item-category {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--rust-orange);
    margin-bottom: 0.5rem;
}

.saved-item-snippet {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
}

.delete-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: white;
    border: 2px solid var(--rust-orange);
    color: var(--rust-orange);
    cursor: pointer !important;
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: all 0.3s ease;
    font-weight: bold;
    line-height: 1;
    z-index: 100;
    padding: 0;
    pointer-events: auto !important;
}

.saved-item:hover .delete-btn {
    opacity: 1;
    transform: scale(1.1);
}

.delete-btn:hover {
    background: var(--rust-orange);
    color: white;
    transform: scale(1.2);
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: scale(0.9) rotateX(10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotateX(0deg);
    }
}

.custom-builder {
    background: white;
    padding: 3rem;
    border-radius: 0;
    box-shadow: 0 20px 60px var(--shadow);
    margin: 3rem auto;
    max-width: 800px;
    border: 1px solid rgba(0,0,0,0.1);
    animation: fadeIn 1s ease-out 0.7s backwards;
}

.builder-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--deep-burgundy);
}

.builder-subtitle {
    text-align: center;
    font-style: italic;
    font-size: 1.1rem;
    color: var(--forest-green);
    margin-bottom: 2rem;
}

.builder-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ink-black);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group textarea {
    padding: 1rem;
    font-family: 'Crimson Text', serif;
    font-size: 1.1rem;
    border: 2px solid rgba(0,0,0,0.1);
    background: var(--paper-white);
    color: var(--ink-black);
    resize: vertical;
    min-height: 80px;
    transition: all 0.3s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--aged-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-group textarea::placeholder {
    color: #999;
    font-style: italic;
}

.builder-btn {
    margin-top: 1rem;
}

.creativity-control {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(45, 74, 62, 0.1) 100%);
    padding: 1.5rem;
    border: 2px solid var(--aged-gold);
    margin-bottom: 1rem;
}

.complexity-control {
    background: linear-gradient(135deg, rgba(45, 74, 62, 0.1) 0%, rgba(33, 150, 243, 0.1) 100%);
    padding: 1.5rem;
    border: 2px solid var(--forest-green);
    margin-bottom: 1rem;
}

.creativity-control label,
.complexity-control label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

#creativityValue,
#complexityValue {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--deep-burgundy);
    font-weight: 700;
}

.creativity-label,
.complexity-label {
    font-family: 'Crimson Text', serif;
    font-style: italic;
    color: var(--forest-green);
    font-size: 1rem;
}

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

.slider-marker {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink-black);
    text-align: center;
    line-height: 1.2;
}

.slider-marker small {
    font-size: 0.75rem;
    opacity: 0.7;
    font-style: italic;
}

.creativity-slider {
    flex: 1;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right,
        #4caf50 0%,
        #2196f3 25%,
        #9c27b0 50%,
        #e91e63 75%,
        #ff6b35 100%);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.complexity-slider {
    flex: 1;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right,
        #87ceeb 0%,
        #2196f3 25%,
        #1976d2 50%,
        #0d47a1 75%,
        #1a237e 100%);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.creativity-slider::-webkit-slider-thumb,
.complexity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--deep-burgundy);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.creativity-slider::-webkit-slider-thumb:hover,
.complexity-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.creativity-slider::-moz-range-thumb,
.complexity-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--deep-burgundy);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.creativity-slider::-moz-range-thumb:hover,
.complexity-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.creativity-description,
.complexity-description {
    font-family: 'Crimson Text', serif;
    font-size: 1rem;
    font-style: italic;
    color: #666;
    padding: 0.75rem;
    background: white;
    border-left: 3px solid var(--aged-gold);
    margin-top: 0.5rem;
}

.complexity-description {
    border-left-color: var(--forest-green);
}

.loading-state {
    text-align: center;
    padding: 3rem;
    font-style: italic;
    color: var(--forest-green);
    font-size: 1.2rem;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(212, 175, 55, 0.2);
    border-top-color: var(--aged-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Welcome state */
.welcome-state {
    text-align: center;
    padding: 3rem;
    max-width: 600px;
    margin: 2rem auto;
}

.welcome-state h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--deep-burgundy);
    margin-bottom: 1rem;
}

.welcome-state p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #555;
}

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

    .inspiration-card {
        padding: 2rem;
    }

    .card-title {
        font-size: 2rem;
    }

    .controls {
        gap: 0.5rem;
    }

    .category-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .custom-builder {
        padding: 2rem;
    }

    .builder-title {
        font-size: 2rem;
    }

    .customization-panel {
        top: 1rem;
        right: 1rem;
    }

    .customize-toggle {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .customize-options {
        padding: 1.5rem;
        width: calc(100vw - 2rem);
        max-width: 350px;
    }

    .color-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
        gap: 0.5rem;
    }

    .color-btn {
        width: 40px;
        height: 40px;
    }

    .color-section h3 {
        font-size: 1.2rem;
    }

    .creativity-control {
        padding: 1rem;
    }

    .complexity-control {
        padding: 1rem;
    }

    .creativity-control label,
    .complexity-control label {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    #creativityValue,
    #complexityValue {
        font-size: 1.3rem;
    }

    .slider-container {
        width: 100%;
    }

    .slider-marker {
        font-size: 0.8rem;
    }

    .creativity-description {
        font-size: 0.9rem;
    }

    .complexity-description {
        font-size: 0.9rem;
    }

    .ending-title {
        font-size: 1.5rem;
    }

    .ending-options {
        grid-template-columns: 1fr;
    }

    .ending-card {
        padding: 1rem;
    }

    .ending-type {
        font-size: 1.1rem;
    }

    .ending-description {
        font-size: 0.9rem;
    }

    .ending-expanded {
        padding: 1rem;
        margin-top: 0.75rem;
    }

    .ending-expanded-title {
        font-size: 1.1rem;
    }

    .ending-expanded-content {
        font-size: 0.95rem;
    }

    .ending-card::after {
        font-size: 0.7rem;
        bottom: 0.3rem;
        right: 0.75rem;
    }

    .plot-points-list li {
        font-size: 0.95rem;
        padding-left: 1.5rem;
    }

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

    .character-card {
        padding: 0.75rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .delete-btn {
        opacity: 1;
    }

    .saved-header {
        flex-direction: column;
        align-items: center;
    }

    .saved-actions {
        width: 100%;
        flex-direction: column;
    }

    .saved-ideas h2 {
        font-size: 2rem;
    }

    .delete-all-btn,
    .emergency-clear-btn {
        width: 100%;
        max-width: 300px;
    }
}
