body {
    margin: 0;
    background-color: #0f0f0f; 
    color: #ffffff;
    font-family: Arial, sans-serif;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
}

/* --- COLLAPSIBLE SIDEBAR --- */
.sidebar-wrapper {
    position: relative;
    height: 100vh; /* Locked to screen height */
    flex-shrink: 0; /* Prevents video from crushing it */
    z-index: 100;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 0;
}

.sidebar-wrapper.collapsed {
    margin-left: -300px; 
}

.sidebar {
    width: 300px;
    height: 100%; /* Force it to stretch top-to-bottom */
    background-color: #1a1a1a;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333;
}

.sidebar-toggle {
    position: absolute;
    top: 20px;
    right: -14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    z-index: 1000;
    transition: opacity 0.2s ease, transform 0.3s ease, background-color 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.sidebar-toggle svg { 
    width: 16px; 
    height: 16px; 
}

.sidebar-wrapper:hover .sidebar-toggle, 
.sidebar-toggle:hover {
    opacity: 1;
}

.sidebar-wrapper.collapsed .sidebar-toggle {
    opacity: 1;
    transform: rotate(180deg);
    right: -35px;
    background-color: #2a2a2a;
    color: #fff;
    border-color: #444;
}

/* --- LOAD MENU & FORMS --- */
.load-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
}

#roundSelect {
    width: 100%;
    padding: 10px;
    background-color: #2a2a2a;
    color: #3ea6ff;
    border: 1px solid #444;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}

.add-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid #333;
}

.add-form input, .add-form button {
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
}

.add-form input {
    background-color: #2a2a2a;
    color: white;
}

.add-form button {
    background-color: #3ea6ff;
    color: black;
    font-weight: bold;
    cursor: pointer;
}

.add-form button:hover {
    background-color: #65b8ff;
}

/* --- GAME LIST --- */
ul#gameList {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1; /* Pushes the add-form to the bottom */
    overflow-y: auto; /* Creates a scrollbar when games overflow */
    margin-bottom: 20px;
    padding-right: 5px; /* Prevents text from hitting the scrollbar */
}

.game-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2a2a2a;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
}

.game-item:hover {
    background-color: #3a3a3a;
}

.game-item span {
    line-height: 1.4;
    padding-right: 10px;
}

.delete-btn {
    background-color: transparent; 
    color: #6c849c; 
    border: none;
    padding: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.delete-btn svg {
    width: 18px;
    height: 18px;
}

.delete-btn:hover {
    color: #ff6b6b; 
}

/* --- MAIN VIDEO AREA --- */
.main-content {
    flex: 1; 
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 1280px;
    aspect-ratio: 16 / 9; 
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    background-color: #000;
}

.video-wrapper:fullscreen {
    max-width: 100vw;
    max-height: 100vh;
    background-color: #0f0f0f;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    border: none;
    display: none; 
}

.video-wrapper iframe.active {
    display: block; 
}

/* --- CUSTOM CONTROLS --- */
.custom-fs-btn {
    position: absolute;
    bottom: 83px; /* Kept your exact position */
    right: 27px;  /* Kept your exact position */
    width: 40px;  /* Kept your exact size */
    height: 40px; /* Kept your exact size */
    border-radius: 50%;
    background-color: transparent; 
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: background-color 0.2s ease, opacity 0.3s ease; 
}

.custom-fs-btn svg {
    width: 22px;
    height: 22px;
}

.custom-fs-btn:hover {
    background-color: rgba(255, 255, 255, 0.2); 
    transform: none; 
    box-shadow: none; 
}

.custom-fs-btn.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* --- EVALUATION MASK --- */
.eval-mask {
    position: absolute;
    background-color: black; 
    z-index: 9999; 
    
    top: 1.1%;      
    left: 62.5%;      
    width: 1.2%;     
    height: 51.9%;   
    
    border: 1px solid #222; 
    display: none; 
}

/* --- THE BULLETPROOF FULLSCREEN OVERRIDE --- */
body.is-fullscreen .sidebar-wrapper {
    display: none !important; /* Hides the new wrapper AND the toggle button */
}

body.is-fullscreen .app-container {
    display: block; 
}

body.is-fullscreen .main-content {
    padding: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000; 
    display: flex;
    justify-content: center;
    align-items: center;
}

body.is-fullscreen .video-wrapper {
    max-width: 100vw;
    max-height: 100vh;
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9; 
    box-shadow: none; 
}
