:root {
    /* Main Pastel Pink Palette */
    --bg-color: #fff0f3;        /* Soft Blush Background */
    --safe-white: #ffffff;
    --border-color: #ffcad4;    /* Pastel Pink Border */
    --accent-pink-dark: #f497ad; /* Deeper pink for buttons/text */
    
    /* CLEAR Indicators (Vivid for functionality) */
    --indicator-green: #2ecc71;  /* Clear Emerald */
    --indicator-red: #ff4757;    /* Clear Bright Red */
    --indicator-yellow: #f1c40f; /* Clear Sunflower Yellow */
    --indicator-blue: #70a1ff; /* Pastel Sky Blue */
    
    /* Soft Shadow */
    --cozy-shadow: 4px 4px 0px rgba(244, 151, 173, 0.3);
}

body {
    background-color: var(--bg-color);
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    display: flex;
    flex-direction: column-reverse;
}
html {
    scroll-behavior: smooth;
    overflow-x: hidden; /* Disables horizontal scrolling forever */
}
#vault-container {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    padding: 100px 0;
    gap: 15px;
}

.row {
    display: flex;
    gap: 15px;
}

.safe {
    width: 100px;
    height: 100px;
    background: var(--safe-white);
    border: 3px solid var(--border-color);
    border-radius: 18px;
    box-shadow: var(--cozy-shadow);
    cursor: pointer;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.15s ease-in-out;
}

.safe:hover {
    border-color: var(--accent-pink-dark);
    transform: scale(1.02);
}

.safe:active { 
    transform: translate(2px, 2px); 
    box-shadow: 1px 1px 0px var(--border-color); 
}

/* Indicators: Vivid and Glowing for Clarity */
.indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid white; 
    position: absolute;
    top: 10px;
    right: 10px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.green { 
    background: var(--indicator-green); 
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.4); 
}

.red { 
    background: var(--indicator-red); 
    box-shadow: 0 0 8px rgba(255, 71, 87, 0.4); 
}

.yellow { 
    background: var(--indicator-yellow); 
    box-shadow: 0 0 8px rgba(241, 196, 15, 0.4); 
}

.blue { 
    background: var(--indicator-blue); 
    box-shadow: 0 0 8px rgba(112, 161, 255, 0.4); 
}
#nav-overlay {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 10;
    background: white;
    padding: 15px;
    border: 3px solid var(--border-color);
    box-shadow: var(--cozy-shadow);
    border-radius: 12px;
}

/* Modals */
#safe-modal {
    position: fixed;
    inset: 0;
    background: rgba(255, 182, 193, 0.3);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: white;
    border: 4px solid var(--border-color);
    padding: 25px;
    border-radius: 20px;
    width: 400px;
    box-shadow: 8px 8px 0px var(--border-color);
}

.hidden { display: none !important; }

#editor-body {
    border: 2px solid #ffe5ec;
    background: #fffafa;
    min-height: 150px;
    margin: 10px 0;
    padding: 12px;
    border-radius: 10px;
    outline: none;
    color: #4a4a4a;
}

button {
    background: white;
    color: var(--accent-pink-dark);
    border: 2px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

button:hover { 
    background: var(--border-color); 
    color: white; 
}

input { 
    padding: 8px; 
    border: 2px solid var(--border-color); 
    border-radius: 8px; 
    margin: 5px 0;
    background: #fffafa;
}

#word-count-container {
    text-align: right;
    font-size: 0.8rem;
    margin-bottom: 10px;
    color: var(--accent-pink-dark);
}

.limit-reached {
    color: var(--indicator-red) !important;
    font-weight: bold;
}

/* Updated Status Overlay to match Pastel Theme */
.status-overlay {
    position: fixed;
    right: 30px; /* Aligned with the left nav-overlay spacing */
    top: 50%;
    transform: translateY(-50%);
    background: white; /* Matching your nav-overlay and modal style */
    padding: 20px;
    border: 3px solid var(--border-color); /* Pastel Pink Border */
    border-radius: 18px; /* Matching safe border-radius */
    box-shadow: var(--cozy-shadow); /* Using your custom cozy shadow */
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--accent-pink-dark); /* Using your deeper pink for text */
    font-family: 'Segoe UI', sans-serif;
    font-weight: bold;
    font-size: 1rem;
}

/* Indicators in the overlay - using your CSS variables */
.status-overlay .indicator {
    position: static; /* Removes the absolute positioning from the general .indicator class */
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

/* Ensure the overlay numbers stand out */
.stat-item span {
    min-width: 25px; /* Keeps numbers aligned */
    text-align: right;
}


/* Styling for the timer message */
.time-lock-msg {
    text-align: center;
    padding: 20px;
    color: var(--accent-pink-dark);
}

.time-lock-msg h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.time-lock-msg p {
    font-weight: bold;
    font-size: 1.1rem;
    background: #f0f7ff;
    padding: 10px;
    border-radius: 10px;
    border: 2px dashed var(--indicator-blue);
}

.indicator.blue {
    background-color: #007bff;
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    animation: pulse-blue 2s infinite;
}

@keyframes pulse-blue {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(0, 123, 255, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}
/* The Ripple Effect */
.indicator.warning-pulse::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(0, 123, 255, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: wave-ripple 1.5s infinite;
    pointer-events: none; /* Don't block clicks */
}

@keyframes wave-ripple {
    0% { width: 20px; height: 20px; opacity: 1; border: 2px solid #007bff; }
    100% { width: 150px; height: 150px; opacity: 0; border: 4px solid #007bff; }
}

/* Make the safe itself shake slightly during the last 10 seconds */
.safe.final-countdown {
    animation: shake 0.2s infinite;
    z-index: 10; /* Bring it to the front */
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    50% { transform: translate(-1px, -2px) rotate(-1deg); }
    100% { transform: translate(1px, 1px) rotate(0deg); }
}

/* The Full-Screen Shockwave */
.indicator.global-wave::after {
    content: "";
    position: fixed; /* Fixes it to the screen */
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: transparent;
    border: 5px solid rgba(0, 123, 255, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none; /* Allows clicking through it */
    z-index: 9999; /* Stays above everything else */
    animation: full-page-ripple 3s infinite ease-out;
}

@keyframes full-page-ripple {
    0% {
        width: 0vw;
        height: 0vw;
        opacity: 1;
        border-width: 20px;
    }
    100% {
        width: 300vw; /* Massive size to ensure it clears corners */
        height: 300vw;
        opacity: 0;
        border-width: 1px;
    }
}

/* Intensify shaking for the safe itself */
.safe.critical-countdown {
    animation: hyper-shake 0.1s infinite;
    box-shadow: 0 0 20px #007bff;
}

@keyframes hyper-shake {
    0% { transform: translate(2px, 2px); }
    50% { transform: translate(-2px, -2px); }
    100% { transform: translate(2px, 2px); }
}

#announcement-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(90deg, #007bff, #00c6ff);
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    z-index: 10000; /* Stays above the vault and the wave */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.5s ease;
}

#announcement-bar.hidden {
    display: none;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

#announcement-jump-btn {
    background: white;
    color: #333;
    border: none;
    padding: 5px 15px;
    margin-left: 15px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    transition: transform 0.2s;
}

#announcement-jump-btn:hover {
    transform: scale(1.1);
    background: #eee;
}
/* Vertical Scrollbar - Pastel Pink */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #fff0f5; /* Lavender Blush (very pale pink) */
}

::-webkit-scrollbar-thumb {
    background: #ffb6c1; /* Light Pink */
    border-radius: 10px;
    border: 2px solid #fff0f5; /* Matches track to create a floating effect */
}

::-webkit-scrollbar-thumb:hover {
    background: #ff8da1; /* Slightly darker pink on hover */
}
#online-counter {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 15px;
    border-radius: 20px;
    border: 2px solid #ffb6c1; /* Pastel Pink */
    color: #ff8da1;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

#online-counter .dot {
    width: 8px;
    height: 8px;
    background-color: #2ecc71; /* Green for "Live" */
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}