* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden; 
    background: #fdfdfd; 
}

.background-wall {
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #ffffff 0%, #ebebeb 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.02); /* Very soft vignette */
}

/* Hidden Text */
.hidden-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    font-weight: 200;
    color: rgba(0, 0, 0, 0.05); /* Extremely subtle ghosted text */
    letter-spacing: 2px;
    z-index: 1; /* Below the board container */
    pointer-events: none;
    text-transform: uppercase;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8), -1px -1px 2px rgba(0, 0, 0, 0.02); /* Emboss effect */
}

/* Wood Board Container Physics */
.wood-board-container {
    perspective: 1200px;
    z-index: 10;
    position: relative;
}

.wood-board {
    width: 800px;
    height: 500px;
    background-color: #2b1f1a;
    background-image: url('wood.png');
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    position: relative;
    /* Soft ambient occlusion shadows + heavy drop shadow */
    box-shadow: 
        0 40px 100px rgba(0, 0, 0, 0.5), /* Deep shadow implying distance */
        0 10px 30px rgba(0, 0, 0, 0.3), /* Tighter dark shadow */
        inset 0 1px 1px rgba(255, 255, 255, 0.1), /* Highlight edge */
        inset 0 -2px 10px rgba(0, 0, 0, 0.8); /* Inner darkness on bottom edge */
    display: flex;
    justify-content: center;
    align-items: center;
    transform-origin: top center;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.6s ease;
}

/* Gravity feels heavy animation on hover */
@keyframes creak {
    0% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(1px) rotate(0.1deg); }
    50% { transform: translateY(0px) rotate(-0.1deg); }
    75% { transform: translateY(2px) rotate(0.05deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

.wood-board:hover {
    animation: creak 3s infinite ease-in-out;
}

/* Nails */
.nail {
    position: absolute;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    transition: transform 0.2s ease, opacity 0.5s ease;
}

.nail:hover {
    transform: scale(1.15);
}

.nail.removed {
    transform: translateY(200vh) rotate(360deg);
    opacity: 0;
    pointer-events: none;
    transition: transform 1s cubic-bezier(0.5, 0, 1, 0.5), opacity 1s;
}

.nail-head {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    /* Metallic luster using radial gradient */
    background: radial-gradient(circle at 35% 35%, #f4f4f4 0%, #b8b8b8 40%, #5a5a5a 80%, #2b2b2b 100%);
    box-shadow: 
        2px 5px 8px rgba(0,0,0,0.8), /* nail cast shadow */
        inset -1px -1px 3px rgba(255,255,255,0.4), /* edge highlight */
        inset 1px 1px 3px rgba(0,0,0,0.5);
    position: relative;
    transition: box-shadow 0.2s ease;
}

.nail:hover .nail-head {
    box-shadow: 
        2px 8px 12px rgba(0,0,0,0.6), 
        inset -1px -1px 3px rgba(255,255,255,0.4), 
        inset 1px 1px 3px rgba(0,0,0,0.5);
}

.nail-head::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle at center, #666 0%, #111 100%);
    box-shadow: inset 0px 1px 2px rgba(0,0,0,0.9);
}

.top-left { top: 20px; left: 20px; }
.top-right { top: 20px; right: 20px; }
.bottom-left { bottom: 20px; left: 20px; }
.bottom-right { bottom: 20px; right: 20px; }


/* The Glass Interface inside */
.glass-ui {
    width: 65%;
    height: 65%;
    background: rgba(255, 255, 255, 0.03); 
    /* Frosted glass */
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.08); /* crisp edge */
    border-radius: 20px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.2), 
        inset 0 1px 0 rgba(255, 255, 255, 0.1); /* Subtle top inner highlight */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    position: relative;
    z-index: 5;
}

.brand-title {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 300;
    font-size: 2.2rem;
    letter-spacing: -0.5px;
    margin-bottom: 50px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.buttons-container {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: center;
}

.inset-button {
    flex: 1;
    padding: 18px 0;
    /* Inset style mimicking physical press */
    background: rgba(10, 10, 10, 0.5);
    box-shadow: 
        inset 0 2px 6px rgba(0, 0, 0, 0.9), /* inner darkness */
        0 1px 1px rgba(255, 255, 255, 0.1); /* bottom rim */
    color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.inset-button:hover {
    background: rgba(20, 20, 20, 0.6);
    color: #ffffff;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.7), 
        0 1px 1px rgba(255, 255, 255, 0.15);
}

.inset-button:active {
    background: rgba(0, 0, 0, 0.9);
    color: rgba(255, 255, 255, 0.6);
    box-shadow: 
        inset 0 4px 10px rgba(0, 0, 0, 1), 
        0 1px 0 rgba(255, 255, 255, 0.02);
    transform: translateY(1px);
}

.reveal-hint {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.3);
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.5s;
    font-weight: 500;
}

/* Physics states depending on removed nails */
.board-slip-left {
    transform: rotate(6deg) translateY(30px);
    box-shadow: 0 60px 120px rgba(0, 0, 0, 0.6);
}

.board-slip-right {
    transform: rotate(-6deg) translateY(30px);
    box-shadow: 0 60px 120px rgba(0, 0, 0, 0.6);
}

.board-hang-heavy {
    transform: translateY(40px) scale(0.98);
    box-shadow: 0 80px 150px rgba(0, 0, 0, 0.7);
}

/* Hard Drop */
.board-drop {
    transform: translateY(200vh) rotate(15deg) scale(0.9);
    opacity: 0;
    transition: transform 1.2s cubic-bezier(0.5, 0, 1, 0.5), opacity 1.2s;
}

/* Drop text Reveal Highlight */
.reveal-text-glow {
    color: rgba(0, 0, 0, 0.8) !important;
    text-shadow: 0 4px 20px rgba(0,0,0,0.1) !important;
    transition: color 1s ease, text-shadow 1s ease;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(40, 40, 40, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    pointer-events: none;
}

.toast.show {
    bottom: 40px;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.glass-modal {
    width: 500px;
    max-height: 80vh;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.modal-overlay.active .glass-modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-weight: 500;
    color: #1d1d1f;
    font-size: 1.4rem;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: #86868b;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #1d1d1f;
}

.modal-body {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    transition: background 0.2s;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.8);
}

.file-item-name {
    font-size: 0.95rem;
    color: #1d1d1f;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.download-link {
    color: #0066cc;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

.download-link:hover {
    text-decoration: underline;
}

/* Drag over state */
.wood-board.drag-over .glass-ui {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255,255,255,0.4);
    box-shadow: 0 0 20px rgba(255,255,255,0.2) inset;
}
