/* Menu and UI Components */

.modal-overlay {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
}

.changelog-modal {
    background: rgba(20, 10, 40, 0.95);
    border: 3px solid var(--accent-color);
    border-radius: 25px;
    padding: 25px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.2);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s;
}

.close-modal-btn:hover {
    transform: scale(1.2);
}

.modal-title {
    font-family: 'Marck Script', cursive;
    font-size: 2.2rem;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.menu-content {
    position: relative;
    z-index: 10;
    text-align: center;
    width: 90%;
    max-width: 400px;
}

.game-title {
    font-family: 'Marck Script', cursive;
    font-size: 4rem;
    color: var(--accent-color);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 4px 4px 0px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.15rem;
    animation: float 3s ease-in-out infinite;
    position: relative;
}

/* Removed Santa emoji and square borders */

.changelog-content {
    max-height: 300px;
    overflow-y: auto;
    text-align: left;
    background: rgba(0,0,0,0.3);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 10px;
}

.changelog-list {
    list-style: none;
    font-size: 0.95rem;
    color: #e0a7ff;
}

.changelog-list li {
    margin-bottom: 10px;
    padding-left: 10px;
    border-left: 2px solid var(--accent-color);
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.magic-button {
    background: url('button_bg.png') no-repeat center;
    background-size: 100% 100%;
    background-color: transparent;
    border: none !important;
    outline: none !important;
    padding: 22px 55px;
    font-family: 'Pangolin', cursive;
    font-size: 1.6rem;
    color: #fff;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.2s;
    min-width: 240px;
    text-decoration: none;
    user-select: none;
}

.magic-button:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.magic-button:active {
    transform: scale(0.92);
    filter: brightness(0.9);
}



.magic-button[disabled] {
    filter: grayscale(0.8) brightness(0.7);
    cursor: not-allowed;
    pointer-events: none;
}

.magic-button.locked {
    filter: grayscale(0.8) brightness(0.7);
    cursor: not-allowed;
}

.lock-tag {
    position: absolute;
    bottom: -10px;
    right: -10px;
    background: #ff4444;
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 5px;
    transform: rotate(-10deg);
    border: 1px solid white;
}

.magic-button.small {
    padding: 15px 35px;
    font-size: 1.1rem;
    min-width: 160px;
}



.btn-text {
    position: relative;
    z-index: 2;
    text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.8);
}

.beta-badge {
    background: #ff4444;
    color: white;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    vertical-align: middle;
    font-weight: bold;
    text-shadow: none;
    box-shadow: 0 0 5px rgba(255,0,0,0.5);
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: #ff4444;
    font-size: 0.75rem;
    font-weight: 900;
    padding: 4px 14px;
    border-radius: 20px;
    margin-left: 8px;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
    border: 2px solid rgba(255, 68, 68, 0.5);
    vertical-align: middle;
    letter-spacing: 1px;
    animation: adminGlow 1.5s infinite alternate ease-in-out;
    user-select: none;
}

.badge-icon {
    font-size: 1rem;
    margin-right: 4px;
}

@keyframes adminGlow {
    from { box-shadow: 0 0 5px rgba(255, 68, 68, 0.2); transform: scale(1); }
    to { box-shadow: 0 0 15px rgba(255, 68, 68, 0.6); transform: scale(1.05); }
}

.selection-container {
    z-index: 20;
    width: 95%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: popIn 0.5s ease-out;
}

.section-title {
    font-family: 'Marck Script', cursive;
    font-size: 3rem;
    color: var(--accent-color);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.character-cards {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.char-card {
    background: rgba(20, 10, 40, 0.85);
    border: 2px solid rgba(224, 167, 255, 0.3);
    border-radius: 20px;
    width: 280px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.char-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--accent-color);
}

.char-card.selected {
    border-color: #ffd700;
    box-shadow: 0 0 35px rgba(255, 215, 0, 0.6), inset 0 0 15px rgba(255, 215, 0, 0.2);
    transform: scale(1.05);
    animation: outlinePulse 1.5s infinite alternate;
}

@keyframes outlinePulse {
    from { border-color: #ffd700; box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); }
    to { border-color: #ffffff; box-shadow: 0 0 40px rgba(255, 215, 0, 0.8); }
}

.char-card.selected::after {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ffd700;
    color: #000;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.char-image-container {
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 15px;
}

.char-portrait {
    max-height: 100%;
    filter: drop-shadow(0 0 15px rgba(224, 167, 255, 0.5));
}

.char-info h3 {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.role {
    font-size: 0.9rem;
    color: #e0a7ff;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.skills {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.85rem;
    background: rgba(0,0,0,0.3);
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.controls-hint {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}

.selection-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.loading-content {
    text-align: center;
    z-index: 100;
}

.magic-spinner {
    width: 80px;
    height: 80px;
    border: 5px solid rgba(224, 167, 255, 0.2);
    border-top: 5px solid #ffd700;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite, glowPulse 1.5s ease-in-out infinite alternate;
}

.loading-text {
    font-family: 'Marck Script', cursive;
    font-size: 2.5rem;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Settings Screen */
.settings-container {
    background: rgba(20, 10, 40, 0.95);
    border: 2px solid var(--accent-color);
    border-radius: 30px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 20;
}

.settings-group {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 15px;
    text-align: left;
}

.settings-group h3 {
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-bottom: 10px;
    padding-bottom: 5px;
}

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

.setting-item span {
    font-size: 1.1rem;
}

/* Switch UI */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

select, input[type="range"] {
    background: #333;
    color: white;
    border: 1px solid #555;
    padding: 5px;
    border-radius: 5px;
    font-family: 'Pangolin', cursive;
}

/* Multiplayer & Lobby Styles */
.magic-input {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--accent-color);
    padding: 12px 20px;
    border-radius: 15px;
    color: white;
    font-family: 'Pangolin', cursive;
    font-size: 1.2rem;
    width: 100%;
    margin-bottom: 10px;
}

.magic-input.small {
    width: 150px;
    margin-right: 10px;
}

.join-area {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
}

.lobby-container {
    background: rgba(20, 10, 40, 0.95);
    border: 2px solid var(--accent-color);
    border-radius: 30px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    text-align: center;
}

.players-list {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
}

.player-slot {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 15px;
    border: 1px dashed rgba(255, 215, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.slot-name {
    font-size: 1.4rem;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.slot-status {
    font-size: 0.8rem;
    color: #888;
}

.character-selection-mini {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.mini-card {
    width: 100px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    padding: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.mini-card img {
    width: 60px;
    height: 80px;
    object-fit: contain;
}

.mini-card span {
    display: block;
    margin-top: 5px;
    font-size: 0.9rem;
}

.mini-card.selected {
    border-color: var(--accent-color);
    background: rgba(255, 215, 0, 0.1);
}

.mini-card.occupied {
    filter: grayscale(1);
    cursor: not-allowed;
}

.occupy-tag {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background: #ff4444;
    color: white;
    font-size: 0.7rem;
    padding: 2px 5px;
    display: none;
    border: 1px solid white;
}

.mini-card.occupied .occupy-tag {
    display: block;
}

.digital-id {
    font-family: 'Pangolin', cursive;
    color: #ffd700;
    background: none;
    text-shadow: 2px 2px 0px #000;
    font-size: 3.5rem;
    letter-spacing: 5px;
    display: block;
    margin-top: 10px;
}

/* Dev Log & Admin Styles */
.changelog-container {
    width: 100%;
    max-height: 400px;
    overflow-y: auto;
    text-align: left;
    background: rgba(0,0,0,0.4);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
}

.log-entry {
    margin-bottom: 25px;
    padding-bottom: 15px;
}

.log-entry h3 {
    color: var(--accent-color);
    margin-bottom: 10px;
}

.log-entry ul {
    list-style: none;
    color: #e0a7ff;
}

.log-entry li::before {
    content: "✦ ";
    color: var(--accent-color);
}

.modal-overlay-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: none;
    z-index: 5000;
    pointer-events: none;
}

.modal-overlay-fixed.visible {
    display: block;
}

.admin-modal {
    background: linear-gradient(135deg, #1a0525 0%, #0a051a 100%);
    border: 2px solid var(--accent-color);
    border-radius: 20px;
    padding: 15px;
    width: 320px;
    position: absolute;
    top: 50px;
    left: 50px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
    max-height: 80vh;
    overflow-y: auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,215,0,0.2);
    margin-bottom: 15px;
    cursor: move;
    user-select: none;
    color: var(--accent-color);
    font-weight: bold;
}

.close-x {
    background: none;
    border: none;
    color: #ff4444;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}

@media (min-width: 601px) {
    .admin-grid {
        grid-template-columns: 1fr 1fr;
    }
    .admin-group.full-width {
        grid-column: span 2;
    }
}

.admin-group {
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-tool-btn {
    background: #444;
    border: 1px solid #666;
    color: white;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
}

.admin-tool-btn:hover { background: #555; }

.admin-tool-btn.primary {
    background: var(--accent-color);
    color: #000;
    font-weight: bold;
}

.admin-manage-list {
    margin-top: 15px;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 10px;
}

.admin-log-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
}

.admin-log-item:last-child { border-bottom: none; }

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

.admin-mini-btn {
    padding: 4px 8px;
    font-size: 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    color: white;
}

.admin-mini-btn.edit { background: #4a90e2; }
.admin-mini-btn.delete { background: #d0021b; }

.admin-row {
    display: flex;
    gap: 10px;
}

/* Cutscene Styles */
.cutscene-container {
    width: 90%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    z-index: 20;
}

.cutscene-slide {
    display: none;
    flex-direction: column;
    align-items: center;
    animation: fadeInSlide 0.5s ease-out;
}

.cutscene-slide.active {
    display: flex;
}

.cutscene-img {
    width: 100%;
    border-radius: 20px;
    border: 3px solid var(--accent-color);
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    margin-bottom: 20px;
}

.cutscene-img-placeholder {
    width: 100%;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.5);
    border-radius: 20px;
    border: 3px solid var(--accent-color);
    margin-bottom: 20px;
}

.cutscene-text {
    font-family: 'Pangolin', cursive;
    font-size: 1.5rem;
    color: #fff;
    text-align: center;
    text-shadow: 2px 2px 4px #000;
    line-height: 1.4;
    background: rgba(0,0,0,0.6);
    padding: 20px;
    border-radius: 15px;
}

.cutscene-controls {
    margin-top: 10px;
}

/* Character Stats Screen Styles */
.stats-menu-container {
    width: 95%;
    max-width: 800px;
    background: rgba(10, 5, 30, 0.95);
    border: 2px solid var(--accent-color);
    border-radius: 40px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 50;
    box-shadow: 0 0 50px rgba(0,0,0,0.9);
}

.stats-layout {
    display: flex;
    width: 100%;
    gap: 30px;
    min-height: 400px;
}

.stats-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100px;
}

.stat-char-thumb {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 15px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-char-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
}

.stat-char-thumb:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.05);
}

.stat-char-thumb.selected {
    border-color: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-color);
    background: rgba(255, 215, 0, 0.1);
}

.stats-main-view {
    flex: 1;
    display: flex;
    gap: 20px;
    align-items: center;
    animation: fadeInSlide 0.5s ease-out;
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.char-preview-area {
    width: 200px;
    height: 300px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.stats-large-portrait {
    max-height: 100%;
    max-width: 100%;
    z-index: 2;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.4));
}

.aura-glow {
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3), transparent 70%);
    animation: glowPulse 2s infinite alternate;
}

.char-details-panel {
    flex: 1;
    text-align: left;
}

.char-details-panel h3 {
    font-family: 'Marck Script', cursive;
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.char-lore {
    font-size: 1rem;
    line-height: 1.4;
    color: #e0a7ff;
    margin-bottom: 15px;
    font-style: italic;
}

.char-magic-info {
    background: rgba(0,0,0,0.4);
    padding: 15px;
    border-radius: 10px;
    font-size: 0.95rem;
    border-left: 3px solid var(--accent-color);
    margin-bottom: 20px;
}

.stats-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-row span {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #aaa;
}

.stat-bar-bg {
    width: 100%;
    height: 12px;
    background: #222;
    border-radius: 6px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4e50, var(--accent-color));
    box-shadow: 0 0 10px var(--accent-color);
    transition: width 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@media (max-width: 600px) {
    .stats-layout {
        flex-direction: column;
        align-items: center;
    }
    .stats-sidebar {
        flex-direction: row;
        width: 100%;
        justify-content: center;
    }
    .stats-main-view {
        flex-direction: column;
    }
    .char-preview-area {
        height: 200px;
    }
    .char-card {
        width: 160px;
        padding: 10px;
    }
    .char-image-container {
        height: 120px;
    }
    .char-info h3 {
        font-size: 1.2rem;
    }
    .section-title {
        font-size: 2rem;
    }
    .skills, .role, .controls-hint {
        display: none;
    }
}

.return-subtitle {
    margin: 0 0 1.65rem;
    color: #f7e8ff;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.48rem;
    text-shadow: 0 0 8px #7b2ff7, 0 0 22px #ff4ecd;
    animation: returnPulse 2.2s ease-in-out infinite;
}

@keyframes returnPulse {
    0%, 100% { opacity: 0.72; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1.04); }
}
