/* THE PRINCE'S PALACE - Master Stylesheet 
   Refined "Ghostly" Edition with Sound Control
*/

/* --- MASTER SWITCHES --- */
:root {
    /* Change 2px to 0px to hide all red development rings globally */
    --ring-weight: 0px; 
}

/* --- GLOBAL LAYOUT --- */
body, html { 
    height: 100%; 
    margin: 0; 
    overflow: hidden; 
    background-color: #000; 
    font-family: 'Georgia', serif; 
}

/* --- SCOREBOARD (THE TAB) --- */
#scoreboard-tab { 
    position: fixed; 
    top: -320px; 
    left: 20px; 
    width: 210px; 
    height: 310px; 
    
    /* GHOSTLY TRANSPARENCY: 0.75 alpha */
    background: rgba(40, 35, 20, 0.75); 
    
    border: 2px solid #DAA520; 
    border-top: none; 
    z-index: 3000; 
    transition: top 0.6s ease-in-out; 
    border-radius: 0 0 20px 20px; 
    padding: 20px; 
    color: #E5D1A1; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

#scoreboard-tab:hover { 
    top: 0; 
}

#scoreboard-tab h3 {
    text-align: center;
    border-bottom: 1px solid #DAA520; 
    padding-bottom: 10px;
    margin-top: 0;
    color: #DAA520;
    text-transform: uppercase;
    font-size: 18px;
    letter-spacing: 1px;
}

#scoreboard-tab p {
    text-align: center;
    font-size: 0.9em;
}

.tab-handle { 
    position: absolute; 
    bottom: -45px; 
    left: 50%; 
    transform: translateX(-50%); 
    background: #DAA520; 
    color: #000; 
    padding: 6px 15px; 
    border-radius: 0 0 25px 25px; 
    cursor: pointer; 
    text-align: center;
    line-height: 1.1;
    width: 130px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.handle-top { display: block; font-size: 11px; font-weight: 900; letter-spacing: 1px; }
.handle-bottom { display: block; font-size: 9px; font-weight: bold; opacity: 0.8; }

/* --- ROOM STATUS LIST --- */
#room-status-list div {
    margin: 8px 0;
    font-size: 0.9em;
    padding-left: 5px;
}

#room-status-list span {
    color: #DAA520;
    font-weight: bold;
}

/* --- ROYAL SOUND TOGGLE SWITCH --- */
.sound-control {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(218, 165, 32, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #111;
    border: 1px solid #DAA520;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 4px;
    bottom: 3px;
    background-color: #DAA520;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: rgba(218, 165, 32, 0.2); }
input:checked + .slider:before { transform: translateX(18px); background-color: #FFF; }

/* --- VIDEO & UI COMPONENTS --- */
video { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    position: absolute; 
    z-index: 10; 
}

.static-overlay { 
    width: 100%; 
    height: 100%; 
    position: absolute; 
    top: 0; left: 0; 
    background-size: cover; 
    background-position: center; 
    z-index: 20; 
}

/* THE SNEAKY RED CIRCLES */
.glow-base { 
    position: absolute; 
    background: radial-gradient(circle, rgba(218, 165, 32, 0.4) 0%, rgba(0,0,0,0) 70%); 
    /* Now listens to the --ring-weight variable */
    border: var(--ring-weight) solid rgba(255, 0, 0, 0.3); 
    border-radius: 50%; 
    cursor: pointer; 
    transform: translate(-50%, -50%); 
    z-index: 50; 
}

.nav-btn { 
    position: absolute; 
    bottom: 40px; right: 40px; 
    background: rgba(0,0,0,0.65); 
    border: 2px solid #B8860B; 
    color: #B8860B; 
    padding: 12px 25px; 
    cursor: pointer; 
    z-index: 60; 
    font-weight: bold; 
    transition: background 0.3s, color 0.3s; 
}

.nav-btn:hover { background: rgba(184, 134, 11, 0.4); color: #FFF; }

/* --- THE "BAM" FACTOR (SUCCESS GLOWS) --- */
.door-unlocked {
    box-shadow: 0 0 20px 5px #FFD700; 
    border-color: #FFD700 !important;
    transition: box-shadow 0.5s ease-in-out, border-color 0.5s ease-in-out;
}

.nav-btn-glow {
    box-shadow: 0 0 20px 5px #FFD700; 
    border-color: #FFD700 !important;
    background: rgba(218, 165, 32, 0.4) !important; 
    color: #FFF !important;
    transition: all 0.5s ease-in-out;
    animation: pulse-glow 2s infinite; 
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 15px 2px #FFD700; }
    50% { box-shadow: 0 0 25px 8px #FFD700; }
    100% { box-shadow: 0 0 15px 2px #FFD700; }
}


@media screen and (max-width: 768px) {
    /* This target the Royal Access box specifically */
    .login-box { 
        width: 90% !important;   /* Make it fill the phone width */
        max-width: 380px;        /* But don't let it get too wide */
        margin: 10% auto;       /* Give it some space from the top */
        padding: 20px;           /* Give the text inside some breathing room */
        box-sizing: border-box; /* Ensures padding doesn't break the width */
    }

    /* This makes the "Begin" button big enough for a thumb */
    .login-box button, .begin-btn {
        width: 100% !important;
        height: 50px;            /* The "Magic Number" for easy tapping */
        font-size: 1.2rem;
    }
}
.login-box h2 {
    color: #DAA520 !important; /* Royal Gold */
    font-size: 1.8rem !important;
}

/* --- LANDSCAPE SAFETY --- */
@media screen and (max-height: 450px) and (orientation: landscape) {
    .login-box {
        margin-top: 5px !important;
        padding: 10px !important;
        transform: scale(0.8); /* Shrinks the whole box slightly to fit the short screen */
    }
    
    .login-box h2 {
        margin-bottom: 5px;
        font-size: 1.2rem !important;
    }
}

@media (max-width: 600px) {
  /* 1. Target the actual 'shelf' holding the doors */
  #door-list {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    gap: 5px;             /* Reduced from 20px to bring them closer */
    padding: 0 20px;       /* Adds a little space at the very start and end */
    justify-content: flex-start !important; /* Forces them to sit tight together */
    -webkit-overflow-scrolling: touch;
    height: auto;
  }

  /* 2. Target the 'frame' around each door */
  .palace-door-frame {
    flex: 0 0 50% !important; /* Changed from 80% to 50% so you see more doors */
    scroll-snap-align: center;
    margin: 0 !important;
    display: flex;
    justify-content: center;
  }

  /* 3. Make the doors themselves a bit bigger for fingers */
  .palace-door {
    width: 100px !important;
    height: 180px !important;
  }
}
