/* =========================================================
   WorkStudy styles
   All colors come from the theme variables below. js/color.js
   changes these variables when you pick a theme, so every page
   and every button follows the theme automatically.
   The values here are the default (purple) look.
   ========================================================= */

:root{
    --bg:radial-gradient(circle at top left,#8b5cf640 0%,transparent 35%), radial-gradient(circle at bottom right,#a855f740 0%,transparent 35%), 
#1a0d24;
    --c1:
#6b21a8;
    --c2:
#a855f7;
    --text:
#ead5ff;
    --glow:0 0 20px rgba(168,85,247,.5), 0 0 40px rgba(168,85,247,.3);
    --input:
#2b1f3d;
    --panel:
#1c1328;
}

@font-face{
    font-family:"Pusab";
    src:url("../fonts/pusab.otf") format("opentype");
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    min-height:100vh;
    background:var(--bg);
    color:var(--text);
    font-family:"Pusab",sans-serif;
    padding:20px;
}

/* ---------- Shared button look ---------- */

.sidebar button,
.topbar button,
#settingsBtn,
#homeBtn,
#legacyBtn,
#websiteBtn,
.gameCard,
#customizePanel button,
#websitePanel button{
    border:none;
    background:linear-gradient(135deg, var(--c1), var(--c2));
    color:white;
    font-family:"Pusab",sans-serif;
    cursor:pointer;
    box-shadow:0 8px 20px rgba(0,0,0,.35);
    transition:.25s;
}

.sidebar button:hover,
.topbar button:hover,
#settingsBtn:hover,
#homeBtn:hover,
#legacyBtn:hover,
#websiteBtn:hover,
.gameCard:hover,
#customizePanel button:hover,
#websitePanel button:hover{
    transform:translateY(-3px);
    filter:brightness(1.15);
    box-shadow:var(--glow);
}

/* ---------- Layout ---------- */

.sidebar{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
}

.sidebar button,
.topbar button{
    padding:14px 22px;
    border-radius:18px;
    font-size:16px;
}

.main{
    margin-top:60px;
}

.welcome{
    text-align:center;
}

.welcome h1{
    font-size:60px;
    color:var(--text);
    text-shadow:var(--glow);
}

.welcome p{
    margin-top:20px;
    font-size:30px;
    color:var(--text);
}

.topbar{
    display:flex;
    gap:10px;
    margin-top:20px;
    margin-bottom:20px;
}

.topbar input,
#searchBar{
    padding:14px;
    border:none;
    border-radius:18px;
    background:var(--input);
    color:var(--text);
    font-family:"Pusab",sans-serif;
}

.topbar input{
    flex:1;
}

.topbar input::placeholder,
#searchBar::placeholder{
    color:var(--text);
    opacity:.7;
}

.searchContainer{
    margin:20px 0;
}

#searchBar{
    width:100%;
    font-size:16px;
}

#websiteFrame{
    width:100%;
    height:85vh;
    border:none;
    border-radius:18px;
    background:white;
}

/* ---------- Games ---------- */

.gamesGrid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
    gap:20px;
    margin-top:20px;
}

.gameCard{
    padding:18px;
    border-radius:18px;
    font-size:16px;
}

/* ---------- Floating buttons ---------- */

#settingsBtn{
    position:fixed;
    bottom:20px;
    right:20px;
    padding:14px 22px;
    border-radius:18px;
}

#homeBtn{
    position:fixed;
    top:20px;
    right:20px;
    padding:14px 22px;
    border-radius:18px;
    z-index:999;
}

#legacyBtn{
    position:fixed;
    top:20px;
    right:20px;
    margin-top:0;
    padding:8px 14px;
    border-radius:10px;
    z-index:999;
}

/* ---------- Settings panel ---------- */

#customizePanel{
    position:fixed;
    top:0;
    right:0;
    width:320px;
    height:100vh;
    background:var(--panel);
    border-left:1px solid rgba(255,255,255,.1);
    padding:20px;
    overflow-y:auto;
    z-index:999999;
    transform:translateX(100%);
    transition:transform .3s ease;
}

#customizePanel.open{
    transform:translateX(0);
}

body.panelOpen{
    padding-right:320px;
    transition:padding-right .3s ease;
}

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

.customizeHeader h2{
    margin:0;
    font-size:20px;
    color:var(--text);
    white-space:nowrap;
}

.dropdownHeader{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-top:20px;
    margin-bottom:10px;
    color:var(--text);
}

.dropdownArrow{
    width:32px;
    height:32px;
    display:flex;
    justify-content:center;
    align-items:center;
    border-radius:8px;
    background:rgba(255,255,255,.08);
    cursor:pointer;
    user-select:none;
    transition:transform .25s ease, background .25s ease;
}

.dropdownArrow:hover{
    background:rgba(255,255,255,.15);
}

.dropdownArrow.rotated{
    transform:rotate(90deg);
}

.dropdownContent{
    max-height:0;
    overflow:hidden;
    opacity:0;
    transform:translateY(-10px);
    transition:max-height .35s ease, opacity .25s ease, transform .25s ease;
}

.dropdownContent.open{
    max-height:1000px;
    opacity:1;
    transform:translateY(0);
    margin-top:10px;
}

#customizePanel h3{
    margin-top:20px;
    margin-bottom:10px;
    color:var(--text);
}

#customizePanel hr{
    margin:20px 0;
    border:none;
    border-top:1px solid rgba(255,255,255,.1);
}

#customizePanel button{
    width:100%;
    padding:12px;
    margin-bottom:10px;
    border-radius:12px;
}

#customizePanel .closeBtn{
    width:40px;
    height:40px;
    display:flex;
    justify-content:center;
    align-items:center;
    padding:0;
    margin:0;
    border-radius:50%;
    background:rgba(255,255,255,.12);
    box-shadow:none;
    flex-shrink:0;
}

#customizePanel .closeBtn:hover{
    background:rgba(255,255,255,.22);
    transform:none;
}

/* Danger zone button stays red on every theme */
#dangerDropdown button{
    background:linear-gradient(135deg,
#991b1b,
#ef4444);
}

/* Account */
#accountName{
    color:var(--text);
    margin-bottom:10px;
    text-align:center;
}

#version{
    position:fixed;
    bottom:20px;
    left:20px;
    color:var(--text);
}

/* ---------- Saved websites (Website Viewer page) ---------- */

#websiteBtn{
    position:fixed;
    bottom:20px;
    right:20px;
    padding:14px 22px;
    border-radius:18px;
    z-index:1000;
}

#websitePanel{
    position:fixed;
    top:0;
    right:0;
    width:280px;
    height:100vh;
    padding:20px 20px 90px;
    background:var(--panel);
    border-left:1px solid rgba(255,255,255,.1);
    overflow-y:auto;
    z-index:999;
    transform:translateX(100%);
    transition:transform .3s ease;
}

#websitePanel.open{
    transform:translateX(0);
}

/* Make room so the panel doesn't cover the Open / Home buttons */
body:has(#websitePanel.open){
    padding-right:300px;
    transition:padding-right .3s ease;
}

#websitePanel h3{
    margin-bottom:15px;
    color:var(--text);
}

#websitePanel button{
    width:100%;
    padding:12px;
    margin-bottom:10px;
    border-radius:12px;
    font-size:15px;
    text-align:left;
}

#addWebsiteBtn{
    text-align:center !important;
}

/* ---------- Status panel + support link ---------- */

#statusPanel{
    position:fixed;
    left:20px;
    bottom:20px;
    display:flex;
    flex-direction:column;
    gap:6px;
    padding:12px;
    border-radius:14px;
    background:rgba(0,0,0,.35);
    border:1px solid var(--c2);
    backdrop-filter:blur(10px);
    color:var(--text);
    cursor:pointer;
    z-index:100;
    transition:transform .2s;
}

#statusPanel:hover{
    transform:translateY(-2px);
}

#time,
#battery{
    font-size:15px;
}

.supportContainer{
    position:fixed;
    left:50%;
    bottom:500px;
    transform:translateX(-50%);
    z-index:100;
}

.supportBtn{
    color:var(--c2);
    text-decoration:none;
    font-family:"Pusab",sans-serif;
    transition:.2s;
}

.supportBtn:hover{
    color:var(--text);
}

/* ---------- Login & Signup pages ---------- */

.auth-container{
    width:90%;
    max-width:450px;
    margin:40px auto;
    padding:25px;
    background:var(--panel);
    border:2px solid var(--c1);
    border-radius:18px;
    box-shadow:var(--glow);
    text-align:center;
}

.auth-container h1{
    color:var(--text);
    margin-bottom:10px;
}

.auth-container p{
    color:var(--text);
    opacity:.85;
    margin-bottom:20px;
}

.auth-container input{
    width:100%;
    padding:12px;
    margin-top:10px;
    background:var(--input);
    color:var(--text);
    border:2px solid var(--c1);
    border-radius:10px;
    font-family:"Pusab",sans-serif;
    outline:none;
    transition:.2s ease;
}

.auth-container input:focus{
    border-color:var(--c2);
    box-shadow:var(--glow);
}

.auth-container input::placeholder{
    color:var(--text);
    opacity:.7;
}

.auth-container button{
    width:100%;
    margin-top:10px;
    padding:12px;
    background:var(--c1);
    color:var(--text);
    border:2px solid var(--c2);
    border-radius:10px;
    font-family:"Pusab",sans-serif;
    cursor:pointer;
    transition:.2s ease;
}

.auth-container button:hover{
    transform:translateY(-2px);
    box-shadow:var(--glow);
}

.auth-container button:active{
    transform:translateY(0);
}

.auth-container .secondary-btn{
    background:var(--panel);
}

.auth-container .home-btn{
    margin-top:15px;
}

.cf-turnstile{
    display:flex;
    justify-content:center;
    margin-top:15px;
    margin-b
