body {
    margin: 0;
    background: #000;
    color: white;
    font-family: 'Google Sans', sans-serif;
    overflow: hidden;
}

.wall-grid {
    display: grid;
    height: 100vh;
    width: 100vw;
    /* Grid columns/rows are set via inline style in HTML now, or we can handle it in JS */
    gap: 0;
}

.tile {
    position: relative;
    background: #000;
    cursor: pointer;
    overflow: hidden;
}

.tile:hover img,
.tile:hover video,
.tile:hover .iframe-wrapper {
    transform: scale(1.03);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 1;
}

.tile-header {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12px 10px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 20;
    box-sizing: border-box;
}

.tile-body {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s;
}

.play-icon {
    position: absolute;
    font-size: 60px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
    pointer-events: none;
    z-index: 15;
}

.text-content {
    color: #444;
    font-size: 12px;
    text-align: center;
    padding: 20px;
}

/* --- OVERLAY STYLES --- */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 100;
    display: none;
    flex-direction: column;
}

#overlay-content {
    flex-grow: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#overlay-content iframe,
#overlay-content video,
#overlay-content img {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: contain;
}

#back-btn {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 14px 40px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    backdrop-filter: blur(10px);
    z-index: 101;
    transition: all 0.2s;
    letter-spacing: 1px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    font-family: 'Google Sans', sans-serif;
}

#back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-50%) scale(1.05);
}

.full-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Loader */
.loader {
    border: 4px solid #333;
    border-top: 4px solid #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -20px;
    margin-top: -20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- HIDDEN MENU (TINY PEEL EFFECT) --- */
#peel-trigger {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    z-index: 9000;
    overflow: hidden;
    cursor: pointer;
    transition: width 0.2s, height 0.2s;
}

#peel-ear {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 15px 15px;
    border-color: transparent transparent #333 transparent;
    transition: all 0.3s ease;
    box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.5);
}

#peel-ear::after {
    content: '';
    position: absolute;
    bottom: -15px;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 7px 7px 0 0;
    border-color: #ddd transparent transparent transparent;
}

#menu-container {
    position: fixed;
    top: 0;
    right: -240px;
    width: 220px;
    height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
    z-index: 9001;
    transition: right 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}

#peel-trigger:hover+#menu-container,
#menu-container:hover {
    right: 0;
}

#peel-trigger:hover {
    width: 50px;
    height: 50px;
}

#peel-trigger:hover #peel-ear {
    border-width: 0 0 50px 50px;
    border-color: transparent transparent #555 transparent;
}

.menu-title {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    margin-top: 20px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.menu-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(-5px);
}

.menu-link.active {
    background: #2563eb;
    color: white;
}

.menu-link .material-icons {
    font-size: 18px;
    opacity: 0.7;
}