html, body {
    height: 100%;
    overflow: hidden; /* Prevent page scroll */
}

body {
    background: #e5f6fd;
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
    height: 100vh;
    width: 100vw;
    /* Custom Wii cursor (hidden by default, handled by JS) */
    cursor: none !important;
}

/* Always hide the system cursor everywhere */
*,
*:hover,
*:active {
    cursor: none !important;
}

.wii-bg-image {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: #e5f6fd url('https://win98icons.alexmeub.com/icons/png/windows-0.png') center bottom no-repeat;
    pointer-events: none;
    overflow: hidden;
}

.wii-menu-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;   /* Move content to top */
    align-items: flex-start;       /* Move content to left */
    background: transparent;
    z-index: 1;
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
}

.wii-menu-close {
    font-size: 2rem;
    color: #888;
    text-decoration: none;
    background: #fff;
    border-radius: 50%;
    width: 2.2rem;
    height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.wii-menu-close:hover {
    background: #e0e0e0;
}

.wii-menu-exit {
    position: fixed;
    top: 2.5vh;
    right: 2vw;
    z-index: 100002;
    font-size: 2.2rem;
    color: #888;
    text-decoration: none;
    background: #fff;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px #b8e2f2;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    margin-right: 38px;
}
.wii-menu-exit:hover {
    background: #e0e0e0;
    color: #222;
}

.wii-menu-sections {
    display: flex;
    flex-direction: row;
    gap: 2.5rem; /* spacing between sections */
    width: 100vw;
    max-width: 100vw;
    overflow-x: auto;
    overflow-y: hidden;
    padding-left: 2vw;
    padding-right: 2vw;
    scrollbar-width: none; /* Firefox */
}
.wii-menu-sections::-webkit-scrollbar {
    display: none;
}

/* Each section is a vertical column */
.wii-section-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 220px; /* ensures label + row stay together */
}

.wii-section-bar {
    background: #dbefff;
    color: #1a3c5a;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0.5rem 1.5rem;
    border-radius: 1.5rem;
    margin: 1.2rem 0 0.5rem 0;
    box-shadow: 0 2px 8px #b8e2f2;
    width: fit-content;
}

.wii-channels-row {
    display: flex;
    flex-direction: row;
    gap: 2.5rem;
    margin-bottom: 0.3rem; /* reduced from 1.2rem */
    justify-content: flex-start;
    align-items: flex-end;
    overflow-x: visible;
    max-width: none;
    padding-bottom: 1em;
    cursor: grab;
    background: transparent;
    scrollbar-width: none;
}
.wii-channels-row::-webkit-scrollbar {
    display: none;
}

.wii-channel {
    width: 200px;
    height: 140px;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 4px 12px #b8e2f2, 0 1px 0 #b8e2f2 inset;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
    border: 2px solid #e0e0e0;
    position: relative;
    overflow: hidden;
    min-width: 200px;
    min-height: 140px;
    max-width: 200px;
    max-height: 140px;
    margin-bottom: 0.5em;
    /* Remove any unwanted padding/margin at the bottom */
    padding-bottom: 0;
}

/* Thumbnail fills the entire channel */
.wii-channel::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    z-index: 1;
    opacity: 1;
    pointer-events: none;
}

/* Set background image from JS */
.wii-channel[data-bg]::before {
    background-image: var(--bg-url);
}

/* Caption below thumbnail */
.wii-channel span {
    font-family: 'Press Start 2P', 'Calibri', sans-serif;
    font-size: 0.95rem;
    color: #1a3c5a;
    background: rgba(255,255,255,0.92);
    border-radius: 8px;
    padding: 2px 10px 17px 10px; /* More top, less bottom */
    margin-bottom: 0px;
    margin-top: 0;
    text-align: center;
    width: 96%;
    position: relative;
    left: unset;
    bottom: unset;
    transform: none;
    z-index: 2;
    box-shadow: 0 2px 8px #b8e2f2, 0 4px 16px #4ab6e688;
    letter-spacing: 0.03em;
    font-weight: bold;
    display: block;
    overflow: visible;
}

.wii-channel-caption {
    position: flex;
    min-width: 60px;
    min-height: 10px;
    color: #1a3c5a;
    font-family: 'Press Start 2P', 'Calibri', sans-serif;
    font-size: 0.95rem;
    border-radius: 18px 18px 18px 32px; /* More round on left */
    padding: 4px 16px 4px 18px;
    letter-spacing: 0.03em;
    font-weight: bold;
    z-index: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    margin: 0; /* Ensure no margin pushes it up */
}

.wii-channel {
    z-index: 1;
}
.wii-channel:hover {
    z-index: 10;
    transform: scale(1.06);
    box-shadow: 0 8px 24px #4ab6e6, 0 1px 0 #b8e2f2 inset;
    border-color: #4ab6e6;
}

.wii-footer-time {
    position: fixed;
    left: 50%;
    bottom: 8.5vh;      /* Add some padding from the bottom */
    top: auto;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Segoe UI Mono', 'Consolas', monospace;
    font-size: 1.6rem;
    color: #1a3c5a;
    font-weight: bold;
    letter-spacing: 0.04em;
    margin: 0;
    z-index: 100000;
    background: rgba(255,255,255,0.7);
    border-radius: 12px;
    padding: 0.3em 1em 0.2em 1em;
    box-shadow: 0 2px 8px #b8e2f2;
}

#wii-time {
    font-size: 2.1rem;
    letter-spacing: 0.08em;
}

#wii-date {
    font-size: 1.1rem;
    color: #4a7ca7;
    font-weight: 400;
    margin-top: -0.3em;
}

/* Wii cursor */
#wii-cursor {
    position: fixed;
    top: 0; left: 0;
    width: 48px;
    height: 48px;
    pointer-events: none;
    z-index: 2147483647; /* max value, always on top */
    transform: rotate(0deg);
    transform-origin: 24px 0px; /* Pivot at top center */
    transition: transform 0.08s cubic-bezier(.4,2,.6,1), left 0.04s, top 0.04s;
    will-change: transform, left, top;
    image-rendering: pixelated;
}

#wii-cursor-2 {
    position: fixed;
    top: 0; left: 0;
    width: 48px;
    height: 48px;
    pointer-events: none;
    z-index: 2147483647; /* max value, always on top */
    transform: rotate(0deg);
    transform-origin: 24px 0px; /* Pivot at top center */
    transition: transform 0.08s cubic-bezier(.4,2,.6,1), left 0.04s, top 0.04s;
    will-change: transform, left, top;
    image-rendering: pixelated;
}

/* Add for mute button */
.wii-mute-btn {
    position: fixed;
    left: 2vw;
    bottom: 3vh;
    z-index: 100001;
    background: rgba(255,255,255,0.8);
    border: 2px solid #b8e2f2;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #1a3c5a;
    cursor: pointer;
    box-shadow: 0 2px 8px #b8e2f2;
    transition: background 0.2s;
    user-select: none;
}
.wii-mute-btn:hover {
    background: #e0f7ff;
}

.wii-hand-toggle {
    position: fixed;
    right: 2vw;
    bottom: 3vh;
    z-index: 100001;
    background: rgba(255,255,255,0.8);
    border: 2px solid #b8e2f2;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #1a3c5a;
    cursor: pointer;
    box-shadow: 0 2px 8px #b8e2f2;
    transition: background 0.2s;
    user-select: none;
}
.wii-hand-toggle:hover {
    background: #e0f7ff;
}

.wii-bottom-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: auto;
    z-index: 10; /* Above background, below mute/clock/cursor/modal */
    pointer-events: none;
    user-select: none;
}

/* Modal background filter */
#modal-bg-filter {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(40,60,90,0.25);
    backdrop-filter: blur(6px);
    z-index: 9998;
}

/* Win95 modal window override */
.win95-window {
    display: flex;
    flex-direction: column;
    position: fixed !important;
    top: 10vh;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    max-width: 90vw;
    z-index: 9999;
    box-shadow: 0 8px 32px #2228;
    border-radius: 8px;
}

/* Remove or comment out #wii-hand-toggle-img styles if present */
/* #wii-hand-toggle-img { ... } */

/* Optionally, style the emoji for centering and scaling */
#wii-hand-toggle-emoji {
    display: block;
    margin: auto;
    font-size: 2rem;
    text-align: center;
    line-height: 48px;
}

