/* Start Screen */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a002a 0%, #000 80%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    text-align: center;
}

#start-content {
    animation: fadeInScale 1.2s ease-out;
}

.start-title {
    font-family: 'Cinzel', serif;
    font-size: 140px;
    font-weight: 900;
    margin: 0;
    letter-spacing: 12px;
    text-transform: uppercase;
    background: linear-gradient(to bottom, #ffcc00 0%, #ff3300 50%, #000000 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px rgba(255, 69, 0, 0.8));
    position: relative;
    animation: lavaFlow 3s infinite alternate ease-in-out, lightningStrike 2s infinite;
}

@keyframes lavaFlow {
    from { filter: drop-shadow(0 0 20px #ff4500) brightness(1); }
    to { filter: drop-shadow(0 0 50px #ffcc00) brightness(1.2); }
}

@keyframes lightningStrike {
    0%, 10%, 16%, 50%, 94%, 100% { filter: brightness(1) contrast(1); }
    12%, 95% { filter: brightness(4) contrast(2) drop-shadow(0 0 80px #fff); }
    14%, 97% { filter: brightness(2.5) contrast(1.5); }
}

.start-subtitle {
    font-family: 'Cinzel', serif;
    font-size: 48px;
    font-weight: bold;
    color: #ffffff;
    margin: 30px 0 100px 0;
    letter-spacing: 8px;
    text-transform: uppercase;
    text-shadow: 0 0 20px #ffd700, 0 0 40px #ffffff, 0 0 60px #ffd700;
    opacity: 0.9;
    animation: divineGlow 2s infinite alternate ease-in-out;
}

@keyframes divineGlow {
    from { text-shadow: 0 0 20px #ffd700, 0 0 40px #fff; opacity: 0.8; }
    to { text-shadow: 0 0 40px #ffd700, 0 0 80px #fff, 0 0 120px #ffd700; opacity: 1; }
}

#start-game-btn {
    background: transparent;
    color: #ffd700;
    border: 4px solid #ffd700;
    padding: 30px 90px;
    font-family: 'Cinzel', serif;
    font-size: 36px;
    font-weight: bold;
    letter-spacing: 8px;
    cursor: pointer;
    border-radius: 0;
    box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.2), 0 0 30px rgba(255, 215, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    text-transform: uppercase;
    overflow: hidden;
    position: relative;
}

#start-game-btn:hover {
    color: #000;
    background: #ffd700;
    box-shadow: 0 0 40px #ffd700, 0 0 80px #ff4500;
    transform: translateY(-3px) scale(1.05);
}

#start-game-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: 0.5s;
}

#start-game-btn:hover::before {
    left: 100%;
}

/* Start Screen Exit Animation */
.shrink-to-info {
    animation: shrinkAndMoveToInfo 0.8s cubic-bezier(0.7, 0, 0.3, 1) forwards;
    pointer-events: none;
}

@keyframes shrinkAndMoveToInfo {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: blur(0);
    }
    100% {
        transform: scale(0.1) translate(0, 400%);
        opacity: 0;
        filter: blur(10px);
    }
}

/* Records Overlay */
#records-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

#records-content {
    width: 90%;
    height: 80%;
    background: #111;
    border: 6px solid #ffd700;
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#records-header {
    padding: 30px;
    background: #222;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 3px solid #333;
    position: relative;
}

#records-header h2 { margin: 0; color: #ffd700; font-size: 54px; }

#close-records {
    background: none; border: none; color: #fff; font-size: 60px; cursor: pointer;
    position: absolute;
    right: 30px;
}

#records-tabs {
    display: flex;
    background: #1a1a1a;
}

.tab-btn {
    flex: 1;
    padding: 30px;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-weight: bold;
    border-bottom: 6px solid transparent;
    font-size: 36px;
}

.tab-btn.active {
    color: #ffd700;
    border-bottom: 6px solid #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

#tab-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 45px;
    box-sizing: border-box;
}

.tab-pane { 
    display: none !important; 
    width: 100%;
    box-sizing: border-box;
}
.tab-pane.active { display: block !important; }

/* Unlock Modal */
#unlock-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s ease-out;
}

#unlock-content {
    width: 840px;
    background: linear-gradient(145deg, #1a1a1a, #000);
    border: 9px solid #ffd700;
    border-radius: 45px;
    padding: 75px;
    text-align: center;
    box-shadow: 0 0 120px rgba(255, 215, 0, 0.3);
    position: relative;
    overflow: hidden;
}

#unlock-header {
    color: #ffd700;
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 60px;
    letter-spacing: 3px;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

#unlock-icon {
    font-size: 180px;
    margin-bottom: 45px;
    filter: drop-shadow(0 0 45px rgba(255, 255, 255, 0.5));
    animation: iconPulse 2s infinite alternate;
}

@keyframes iconPulse {
    from { transform: scale(1); filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.3)); }
    to { transform: scale(1.1); filter: drop-shadow(0 0 75px rgba(255, 255, 255, 0.7)); }
}

#unlock-name {
    color: #00e5ff;
    font-size: 66px;
    font-weight: bold;
    margin-bottom: 45px;
    text-transform: uppercase;
    text-shadow: 0 0 24px rgba(0, 229, 255, 0.6);
}

#unlock-desc {
    color: #bbb;
    font-size: 39px;
    line-height: 1.6;
    margin-bottom: 60px;
    font-style: italic;
}

#unlock-resume-hint {
    color: #666;
    font-size: 30px;
    margin-top: 30px;
    animation: hintPulse 1.5s infinite alternate;
}

/* Game Over Screen */
#game-over-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: bloodFadeIn 0.5s forwards;
}

@keyframes bloodFadeIn {
    from { background: rgba(0, 0, 0, 0); }
    to { background: radial-gradient(circle, rgba(40, 0, 0, 0.95) 0%, rgba(0, 0, 0, 1) 100%); }
}

#game-over-content {
    text-align: center;
    padding: 120px;
    max-width: 900px;
}

#game-over-title {
    color: #ff0000;
    font-size: 84px;
    text-shadow: 0 0 60px #8b0000, 0 0 15px #000;
    margin-bottom: 60px;
    font-family: serif;
    letter-spacing: 6px;
    animation: eeriePulse 3s infinite alternate;
}

@keyframes eeriePulse {
    from { transform: scale(1); text-shadow: 0 0 30px #8b0000; }
    to { transform: scale(1.05); text-shadow: 0 0 90px #ff0000, 0 0 30px #fff; }
}

#game-over-msg {
    color: #bbb;
    font-size: 42px;
    line-height: 1.6;
    font-style: italic;
    margin-bottom: 90px;
}

#final-stats {
    color: #888;
    font-size: 36px;
    margin-bottom: 120px;
    border-top: 3px solid #333;
    padding-top: 30px;
}

#retry-btn {
    background: linear-gradient(to bottom, #4a0000, #000);
    color: #ff0000;
    border: 3px solid #8b0000;
    padding: 36px 72px;
    font-weight: bold;
    cursor: pointer;
    font-size: 36px;
    letter-spacing: 3px;
    transition: all 0.3s;
    box-shadow: 0 0 45px rgba(139, 0, 0, 0.3);
}

#retry-btn:hover {
    background: #8b0000;
    color: #fff;
    box-shadow: 0 0 90px #ff0000;
    transform: translateY(-6px);
}

#cancel-restart-btn {
    background: rgba(20, 20, 20, 0.8);
    color: #888;
    border: 3px solid #444;
    padding: 36px 72px;
    font-weight: bold;
    cursor: pointer;
    font-size: 36px;
    letter-spacing: 3px;
    transition: all 0.3s;
}

#cancel-restart-btn:hover {
    background: #222;
    color: #fff;
    border-color: #666;
    transform: translateY(-6px);
}

/* Relics Overlay */
#relics-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2100;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(15px);
}

#relics-content {
    width: 960px;
    max-height: 85%;
    background: linear-gradient(145deg, #1a1a1a, #0a0a0a);
    border: 6px solid #ff4500;
    border-radius: 36px;
    padding: 45px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 120px rgba(255, 69, 0, 0.3);
}

#relics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #333;
    padding-bottom: 24px;
    margin-bottom: 36px;
}

#relics-header h2 {
    color: #ff4500;
    margin: 0;
    font-size: 48px;
    text-transform: uppercase;
    letter-spacing: 6px;
    text-shadow: 0 0 15px rgba(255, 69, 0, 0.5);
}

#close-relics {
    background: none;
    border: none;
    color: #888;
    font-size: 54px;
    cursor: pointer;
    transition: color 0.2s;
}

#close-relics:hover {
    color: #fff;
}

#relics-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
    overflow-y: auto;
    padding: 15px;
    max-height: 600px;
    scrollbar-width: none;
}

#relics-grid::-webkit-scrollbar {
    display: none;
}

#relic-details {
    margin-top: 45px;
    padding: 30px;
    background: #0a0a0a;
    border: 3px solid #333;
    border-radius: 24px;
    min-height: 240px;
    font-size: 30px;
    color: #bbb;
    line-height: 1.4;
}

.relic-detail-title {
    color: #ff4500;
    font-weight: bold;
    font-size: 36px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.relic-detail-effect {
    color: #00ff00;
    font-size: 30px;
    margin-bottom: 18px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
}

.relic-detail-lore {
    font-style: italic;
    color: #666;
    line-height: 1.3;
}

.relic-toast {
    position: absolute;
    bottom: 300px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 69, 0, 0.9);
    color: #fff;
    padding: 15px 45px;
    border-radius: 60px;
    font-size: 30px;
    font-weight: bold;
    z-index: 3000;
    animation: relicFadeUp 1.5s forwards;
    pointer-events: none;
    white-space: nowrap;
    border: 3px solid #fff;
    box-shadow: 0 0 45px rgba(255, 69, 0, 0.5);
}

@keyframes relicFadeUp {
    0% { opacity: 0; transform: translate(-50%, 0); }
    20% { opacity: 1; transform: translate(-50%, -30px); }
    80% { opacity: 1; transform: translate(-50%, -30px); }
    100% { opacity: 0; transform: translate(-50%, -60px); }
}

/* Boss Victory Overlay */
.boss-victory-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.95) 100%);
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: victoryFlash 0.8s ease-out forwards;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.boss-victory-content {
    text-align: center;
    width: 100%;
    padding: 120px 0;
    background: linear-gradient(90deg, transparent, rgba(139, 0, 0, 0.2), rgba(139, 0, 0, 0.4), rgba(139, 0, 0, 0.2), transparent);
    border-top: 4px solid #ff4500;
    border-bottom: 4px solid #ff4500;
    box-shadow: 0 0 100px rgba(255, 69, 0, 0.3);
    animation: victorySlideIn 1s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.boss-victory-header {
    font-family: 'Cinzel', serif;
    font-size: 42px;
    color: #ff4500;
    letter-spacing: 12px;
    margin-bottom: 30px;
    text-transform: uppercase;
    text-shadow: 0 0 20px #ff0000;
}

.boss-victory-name {
    font-family: 'Cinzel', serif;
    font-size: 110px;
    font-weight: 900;
    color: #fff;
    text-shadow: 
        0 0 30px #ff4500,
        0 0 60px #8b0000,
        0 0 90px #000;
    margin-bottom: 60px;
    letter-spacing: 4px;
}

.boss-victory-reward {
    font-size: 36px;
    color: #ffd700;
    margin-bottom: 15px;
    font-weight: bold;
    letter-spacing: 2px;
}

.boss-victory-bonus {
    font-size: 48px;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    margin-bottom: 60px;
}

.boss-victory-hint {
    font-size: 24px;
    color: #888;
    font-style: italic;
    animation: hintBreathe 1.5s infinite alternate;
}

@keyframes victoryFlash {
    0% { opacity: 0; background-color: #fff; }
    20% { opacity: 1; background-color: rgba(255, 69, 0, 0.4); }
    100% { opacity: 1; }
}

@keyframes victorySlideIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
