/* ========================================
   Additional Styles for Novel Game Features
======================================== */

/* ========================================
   Effects Layer
======================================== */
.effects-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

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

.flash-overlay {
    opacity: 1;
    transition: opacity 0.1s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(calc(var(--shake-intensity, 10px) * -1));
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(var(--shake-intensity, 10px));
    }
}

.shaking {
    animation: shake 0.5s ease-in-out;
}

/* ========================================
   Modal Variants
======================================== */
.modal-content.modal-large {
    max-width: 900px;
    max-height: 90vh;
}

.modal-content.modal-small {
    max-width: 400px;
}

/* ========================================
   Backlog Styles
======================================== */
.backlog-container {
    max-height: 60vh;
    overflow-y: auto;
}

.backlog-entry {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.backlog-entry:last-child {
    border-bottom: none;
}

.backlog-speaker {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.backlog-text {
    color: var(--text-primary);
    line-height: 1.7;
}

.backlog-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem;
}

/* ========================================
   Settings Styles
======================================== */
.settings-group {
    margin-bottom: 1.5rem;
}

.settings-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.settings-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.settings-control input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

.settings-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.settings-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.settings-control span {
    min-width: 60px;
    text-align: right;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.settings-actions {
    margin-top: 2rem;
    text-align: center;
}

.settings-btn {
    padding: 0.75rem 2rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.settings-btn:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

/* ========================================
   Gallery Styles
======================================== */
.gallery-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.gallery-tab {
    flex: 1;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.gallery-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.gallery-tab:hover:not(.active) {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    max-height: 50vh;
    overflow-y: auto;
}

.gallery-card {
    aspect-ratio: 16/9;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.gallery-card:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.gallery-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem;
}

.ending-card {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
}

.ending-card.unlocked {
    border-color: rgba(99, 102, 241, 0.3);
}

.ending-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.ending-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.character-card {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
}

.character-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.character-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.cg-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    cursor: pointer;
}

.cg-viewer img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
}

.cg-viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

/* ========================================
   Menu Modal Styles
======================================== */
.menu-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-item {
    padding: 1rem 1.5rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.menu-item:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
}

.menu-item.danger {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

/* ========================================
   Chapter Select Styles
======================================== */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

.chapter-card {
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
}

.chapter-card.unlocked:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.chapter-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.chapter-title {
    font-weight: 600;
    color: var(--text-primary);
}

.chapter-lock {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    font-size: 1.2rem;
}