* {
    box-sizing: border-box;
}

:root {
    --background: #090a0c;
    --dark: #111318;
    --dark-2: #0b0c0f;

    --red: #ff4545;
    --red-dark: #83261f;
    --red-border: #be3b32;
    --red-glow: rgba(190, 59, 50, 0.45);

    --text: #ffffff;
    --text-muted: #999999;
    --text-dark: #666666;

    --border: #252932;
}


/* =========================
   HTML / BODY
========================= */

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(
            circle at 50% 45%,
            rgba(190, 59, 50, 0.12),
            transparent 35%
        ),
        #090a0c;

    color: var(--text);

    font-family:
        "Quicksand",
        Helvetica,
        Arial,
        sans-serif;

    overflow-x: hidden;

    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Ccircle cx='5' cy='5' r='3' fill='white'/%3E%3C/svg%3E") 5 5, auto;
    text-transform: lowercase;
}

button,
input,
textarea,
select {
    text-transform: lowercase;
}

body.sidebar-layout {
    padding-right: 104px;
}

body.sidebar-layout > #header,
body.sidebar-layout > #footer {
    display: none;
}

#particles-js {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}


/* =========================
   CLICKABLE ELEMENTS
========================= */

button,
a,
img,
.headericons,
.gamebtns,
.quick-app,
.top-logo,
.footer-logo {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Ccircle cx='5' cy='5' r='3' fill='white'/%3E%3C/svg%3E") 5 5, auto !important;
}

input,
textarea {
    cursor: text !important;
}


/* =========================
   SELECTION
========================= */

::selection {
    background: var(--red);
    color: #0d0d0d;
}


/* =========================
   BACKGROUND
========================= */

#background {
    position: fixed;

    inset: 0;

    z-index: 0;

    pointer-events: none;

    background:
        radial-gradient(
            circle at 15% 30%,
            rgba(255, 69, 69, 0.08),
            transparent 25%
        ),
        radial-gradient(
            circle at 85% 70%,
            rgba(190, 59, 50, 0.08),
            transparent 30%
        );
}

#lowtaperfade {
    position: fixed;

    inset: 0;

    z-index: 2;

    pointer-events: none;

    background:
        linear-gradient(
            #0e0e0e00,
            #0c0c0c55
        );
}


/* =========================
   PARTICLES
========================= */

#teacher-setup-dialogs-container {
    position: fixed;

    inset: 0;

    width: 100%;
    height: 100%;

    overflow: hidden;

    z-index: 1;

    pointer-events: none;
}

#teacher-setup-dialogs-container canvas {
    position: absolute;

    inset: 0;

    width: 100% !important;
    height: 100% !important;

    pointer-events: none;
}


/* =========================
   HEADER
========================= */

#header {
    position: fixed;

    top: 7px;
    left: 50%;

    transform: translateX(-50%);

    width: calc(100% - 30px);
    max-width: 1600px;

    height: 60px;

    padding: 7px 12px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    background: rgb(29 9 9 / 78%);

    backdrop-filter: blur(8px);

    border: 1px solid rgba(190, 59, 50, 0.08);

    border-radius: 20px;

    z-index: 9999;

    box-shadow:
        0 5px 25px rgba(0, 0, 0, 0.25);
}


/* =========================
   HEADER ICONS
========================= */

.headericons {
    width: 42px;
    height: 42px;

    object-fit: contain;

    border-radius: 12px;

    padding: 5px;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;

    border: 3px solid transparent;
}

.headericons:hover {
    transform: scale(1.08);

    background: var(--red-dark);

    border-color: var(--red-border);

    box-shadow:
        0 0 10px var(--red-border),
        0 0 20px rgba(190, 59, 50, 0.25);
}

#header > .right {
    display: flex;

    align-items: center;

    gap: 5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-button {
    width: 42px;
    height: 42px;
    min-height: 42px;
    display: grid;
    place-items: center;
    padding: 5px;
    margin: 0;
    background: transparent;
    border: 3px solid transparent;
    border-radius: 12px;
}

.header-button img {
    width: 24px;
    height: 24px;
    display: block;
    object-fit: contain;
}

.header-button:hover {
    background: var(--red-dark);
    border-color: var(--red-border);
}


/* =========================
   MAIN GAME PAGE
========================= */

#roddyricchboxselect {
    position: relative;

    z-index: 10;

    width: min(1600px, calc(100% - 30px));

    margin: 0 auto;

    padding:
        85px
        15px
        100px;

    text-align: center;

    min-height: 100vh;
}


/* =========================
   TITLE
========================= */

#title {
    margin: 5px 0 4px;

    font-size: clamp(28px, 5vw, 46px);

    line-height: 1;

    font-weight: 700;

    letter-spacing: -1px;

    color: #fff;

    text-shadow:
        0 0 25px rgba(255, 69, 69, 0.12);
}

#resourcecount {
    margin: 8px 0 20px;

    color: var(--text-dark);

    font-size: 13px;

    font-weight: 600;
}


/* =========================
   SEARCH
========================= */

#teachertouchbar {
    width: min(420px, 90%);

    height: 48px;

    padding:
        10px
        18px;

    margin: 10px auto 20px;

    display: block;

    background: var(--dark);

    color: white;

    border:
        3px solid var(--border);

    border-radius: 28px;

    outline: none;

    font-family:
        "Quicksand",
        sans-serif;

    font-size: 15px;

    font-weight: 600;

    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.2);

    transition:
        width 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

#teachertouchbar::placeholder {
    color: #777;
}

#teachertouchbar:hover {
    border-color: var(--red-border);
}

#teachertouchbar:focus {
    width: min(500px, 92%);

    background: #140606;

    border-color: var(--red-border);

    box-shadow:
        0 0 5px var(--red-border),
        0 0 15px var(--red-border),
        0 0 25px rgba(190, 59, 50, 0.25);
}


/* =========================
   GAMES CONTAINER
========================= */

#mathworksheets {
    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(105px, 1fr)
        );

    gap: 14px;

    justify-items: center;

    align-items: center;

    padding: 10px 5px 30px;
}


/* =========================
   GAME BUTTONS
========================= */

.gamebtns {
    width: 105px;
    height: 105px;

    display: block;

    object-fit: cover;

    border:
        3px solid var(--border);

    border-radius: 17px;

    background: var(--dark);

    padding: 0;

    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.2);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.gamebtns:hover {
    transform: scale(1.08);

    background: var(--red-dark);

    border-color: var(--red-border);

    box-shadow:
        0 0 10px var(--red-border),
        0 0 20px var(--red-border),
        0 0 30px rgba(190, 59, 50, 0.2);

    filter: brightness(1.05);
}

.gamebtns:active {
    transform: scale(0.97);
}


/* =========================
   END TEXT
========================= */

#roddyricchboxselect > p {
    margin-top: 15px;

    color: #777;

    font-size: 13px;

    font-weight: 600;
}


/* =========================
   FOOTER
========================= */

#footer {
    position: fixed;

    bottom: 7px;
    left: 50%;

    transform: translateX(-50%);

    width: auto;
    min-width: 280px;

    height: 52px;

    padding:
        6px
        9px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    background: rgb(29 9 9 / 78%);

    backdrop-filter: blur(8px);

    border: 1px solid rgba(190, 59, 50, 0.08);

    border-radius: 20px;

    z-index: 9999;

    box-shadow:
        0 5px 25px rgba(0, 0, 0, 0.2);
}

#online {
    margin: 0;

    padding: 0;

    font-size: 11px;

    font-weight: 700;

    color: #aaa;

    white-space: nowrap;
}

#footer > .right {
    display: flex;

    align-items: center;

    gap: 4px;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.footer-right button {
    width: 30px;
    height: 30px;
    min-height: 30px;
    display: grid;
    place-items: center;
    padding: 3px;
    margin: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 9px;
}

.footer-right button:hover {
    background: transparent;
    border-color: var(--red-border);
}

.footer-right button img {
    width: 16px;
    height: 16px;
    display: block;
    object-fit: contain;
}


/* =========================
   FOOTER ICONS
========================= */

#footer .headericons {
    width: 36px;
    height: 36px;

    padding: 4px;

    border-radius: 11px;
}


/* =========================
   CORNER IMAGE
========================= */

#cornerimage {
    position: fixed;

    width: 370px;
    height: 468px;

    right: 96px;
    bottom: -4px;

    object-fit: contain;

    object-position: bottom right;

    padding: 0;
    margin: 0;

    border: 0;

    border-radius: 0;

    z-index: 4;

    pointer-events: none;
}

@media (max-width: 650px) {
    body.sidebar-layout {
        padding-right: 80px;
    }

    #cornerimage {
        right: 78px;
        max-width: calc(100% - 82px);
    }
}


/* =========================
   LOADING SCREEN
========================= */

#loading-screen {
    position: fixed;

    inset: 0;

    width: 100%;
    height: 100%;

    background:
        radial-gradient(
            circle at 50% 45%,
            rgba(190, 59, 50, 0.08),
            transparent 30%
        ),
        #121212;

    color: white;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    text-align: center;

    padding: 24px;

    z-index: 99999;

    opacity: 1;

    visibility: visible;

    transition:
        opacity 0.5s ease,
        visibility 0.5s ease;
}

#loading-screen.fade-out {
    opacity: 0;

    visibility: hidden;

    pointer-events: none;
}


/* =========================
   LOADING TITLE
========================= */

#loading-title {
    margin: 0;

    font-family:
        "Quicksand",
        sans-serif;

    font-size: 25px;

    font-weight: 700;
}

#messageforyou {
    margin:
        10px
        20px
        0;

    max-width: 600px;

    width: min(600px, 100%);

    color: #aaa;

    font-family:
        "Quicksand",
        sans-serif;

    font-size: 14px;

    font-weight: 500;
}

#elementcounter {
    margin: 7px 0 0;

    color: #666;

    font-family:
        "Quicksand",
        sans-serif;

    font-size: 12px;

    font-weight: 500;
}


/* =========================
   LOADING CONTENT
========================= */

#dabottom {
    display: flex;

    flex-direction: column;

    align-items: center;
}


/* =========================
   SKIP LOADING
========================= */

#skiploading {
    display: none;

    color: white;

    background: var(--dark);

    border:
        3px solid var(--border);

    padding:
        8px
        18px;

    border-radius: 12px;

    margin-top: 10px;

    font-family:
        "Quicksand",
        sans-serif;

    font-size: 13px;

    text-decoration: none;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

#skiploading:hover {
    background: var(--red-dark);

    border-color: var(--red-border);

    box-shadow:
        0 0 10px var(--red-border);
}


/* =========================
   LOADING BAR
========================= */

#loadingbar {
    position: absolute;

    left: 0;
    bottom: 0;

    width: 0%;

    height: 5px;

    background:
        linear-gradient(
            90deg,
            #83261f,
            #ff4545
        );

    transition:
        width 0.15s ease;
}


/* =========================
   ORIGINAL SPINNER
========================= */

.spinner {
    width: 17.6px;
    height: 17.6px;

    position: relative;

    margin-bottom: 44px;

    flex-shrink: 0;

    animation:
        spinner-o824ag
        1.4s
        infinite
        linear;
}

.spinner div {
    position: absolute;

    width: 100%;
    height: 100%;

    background: var(--red);

    border-radius: 50%;

    animation:
        spinner-vse6n7
        1.75s
        infinite
        ease;
}

.spinner div:nth-child(1) {
    --rotation: 90;
}

.spinner div:nth-child(2) {
    --rotation: 180;
}

.spinner div:nth-child(3) {
    --rotation: 270;
}

.spinner div:nth-child(4) {
    --rotation: 360;
}

@keyframes spinner-vse6n7 {
    0%,
    100% {
        transform:
            rotate(
                calc(
                    var(--rotation) * 1deg
                )
            )
            translateY(0);
    }

    50% {
        transform:
            rotate(
                calc(
                    var(--rotation) * 1deg
                )
            )
            translateY(300%);
    }
}

@keyframes spinner-o824ag {
    to {
        transform: rotate(360deg);
    }
}


/* =========================
   MESSAGE BOX
========================= */

.message-box {
    position: fixed;

    top: 80px;
    left: 50%;

    transform: translateX(-50%);

    max-width: min(500px, calc(100% - 30px));

    padding:
        10px
        16px;

    background: rgba(24, 9, 9, 0.92);

    border:
        2px solid var(--border);

    border-radius: 14px;

    color: white;

    font-size: 13px;

    z-index: 9998;

    backdrop-filter: blur(8px);

    opacity: 0;

    pointer-events: none;

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}


/* =========================
   HOME PAGE SUPPORT
========================= */

#index-sidebar {
    position: fixed;
    top: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 9999;
    width: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 9px;
    background: rgba(15, 17, 21, 0.9);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(12px);
}

#index-sidebar button {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    padding: 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

#index-sidebar button:hover {
    background: var(--red-dark);
    border-color: var(--red-border);
    transform: translateY(-2px);
}

#index-sidebar button img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.sidebar-logo {
    width: 60px !important;
    height: 60px !important;
    padding: 4px !important;
    margin-bottom: 24px;
}

.sidebar-logo img {
    width: 56px !important;
    height: 56px !important;
}

.sidebar-navigation,
.sidebar-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.sidebar-footer {
    margin-top: auto;
}

#roddyricchboxhome {
    position: fixed;

    left: calc(50% - 38px);
    top: 25vh;

    transform: translateX(-50%);

    width: calc(100% - 100px);

    padding: 20px;

    text-align: center;

    z-index: 9998;
}

#maintitle {
    margin: 0;

    font-size:
        clamp(
            48px,
            7vw,
            72px
        );

    font-weight: 700;

    letter-spacing: -2px;

    text-shadow:
        0 0 25px
        rgba(255, 69, 69, 0.15);
}

.description {
    margin-top: 7px;

    color: #999;

    font-size: 15px;
}


/* =========================
   HOME QUICK APPS
========================= */

.quick-apps-container {
    display: flex;

    justify-content: center;

    align-items: center;

    flex-wrap: wrap;

    gap: 13px;

    margin-top: 32px;
}

.quick-app {
    width: 95px;
    height: 95px;

    display: flex;

    justify-content: center;

    align-items: center;

    background:
        rgba(24, 9, 9, 0.7);

    border:
        3px solid var(--border);

    border-radius: 15px;

    transition:
        all 0.2s ease;
}

.quick-image {
    width: 68px;
    height: 68px;

    object-fit: cover;

    border-radius: 15px;

    border:
        3px solid transparent;

    transition:
        0.2s ease;
}

.quick-app:hover {
    transform: scale(1.08);

    background: var(--red-dark);

    border-color: var(--red-border);

    box-shadow:
        0 0 10px var(--red-border),
        0 0 20px var(--red-border),
        0 0 30px rgba(190, 59, 50, 0.4);
}

.quick-app:hover .quick-image {
    border-color: var(--red);

    transform: scale(1.05);
}




/* =========================
   HOME BUTTONS
========================= */

.search-button {
    height: 50px;

    margin: 0;

    padding:
        0
        20px;

    background: var(--dark);

    border:
        3px solid var(--border);

    border-radius: 30px;

    color: white;

    font-family:
        "Quicksand",
        sans-serif;

    font-size: 1em;

    transition:
        all 0.2s ease;
}

.search-button:hover {
    background: var(--red-dark);

    border-color: var(--red-border);

    box-shadow:
        0 0 10px var(--red-border),
        0 0 20px rgba(190, 59, 50, 0.25);
}


/* =========================
   GAME PLAYER SUPPORT
========================= */

#player {
    position: fixed;

    inset: 0;

    display: flex;

    gap: 12px;

    padding: 12px;

    background: #270f0f;
}

#game-area {
    position: relative;

    flex: 1;

    min-width: 0;

    background: #120707;

    border:
        3px solid var(--border);

    border-radius: 20px;

    overflow: hidden;

    box-shadow:
        0 10px 35px
        rgba(0, 0, 0, 0.35);
}

#game-frame {
    width: 100%;
    height: 100%;

    display: block;

    border: 0;

    background: #000;
}

#sidebar {
    width: 190px;

    flex-shrink: 0;

    display: flex;

    flex-direction: column;

    gap: 10px;

    padding: 12px;

    background:
        rgba(29, 9, 9, 0.9);

    border:
        3px solid var(--border);

    border-radius: 20px;

    backdrop-filter: blur(8px);

    box-shadow:
        0 10px 35px
        rgba(0, 0, 0, 0.3);
}

#game-picture {
    width: 100%;

    aspect-ratio: 1 / 1;

    object-fit: cover;

    border:
        3px solid var(--border);

    border-radius: 15px;

    background: var(--dark);

    transition: 0.2s ease;
}

#game-picture:hover {
    border-color: var(--red-border);

    box-shadow:
        0 0 12px
        rgba(190, 59, 50, 0.4);
}

#game-title {
    margin:
        4px 0 5px;

    font-size: 18px;

    font-weight: 700;

    text-align: center;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

#game-subtitle {
    margin:
        0 0 8px;

    color: #777;

    font-size: 11px;

    text-align: center;
}

.sidebar-buttons {
    display: flex;

    flex-direction: column;

    gap: 8px;
}

.player-button {
    width: 100%;

    min-height: 45px;

    padding:
        10px
        12px;

    border:
        3px solid var(--border);

    border-radius: 13px;

    background: var(--dark);

    color: white;

    font-family:
        "Quicksand",
        sans-serif;

    font-size: 13px;

    font-weight: 600;

    transition: 0.2s ease;
}

.player-button:hover {
    background: var(--red-dark);

    border-color: var(--red-border);

    box-shadow:
        0 0 10px
        rgba(190, 59, 50, 0.5),
        0 0 20px
        rgba(190, 59, 50, 0.25);

    transform: translateY(-1px);
}

.player-button:active {
    transform: scale(0.98);
}

.sidebar-spacer {
    flex: 1;
}

#back-button {
    color: #aaa;
}

#back-button:hover {
    color: white;
}

#game-area:fullscreen {
    width: 100vw;

    height: 100vh;

    border: 0;

    border-radius: 0;
}


/* ================================
   SETTINGS PAGE
================================ */

#settings-page {
    position: relative;
    z-index: 10;
    width: min(1500px, calc(100% - 40px));
    margin: 0 auto;
    padding: 45px 0 100px;
    text-transform: lowercase;
}

/* Title */
.settings-heading {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.settings-heading h1 {
    margin: 0;
    font-size: clamp(38px, 5vw, 58px);
    font-weight: 700;
    letter-spacing: 1px;
}


/* ================================
   MAIN GRID
================================ */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(280px, 1fr));
    gap: 16px;
    align-items: stretch;
}


/* ================================
   SETTINGS CARDS
================================ */

.settings-card {
    position: relative;
    min-width: 0;
    min-height: 270px;

    padding: 28px 24px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;

    overflow: hidden;

    text-align: center;

    background:
        linear-gradient(
            145deg,
            rgba(42, 24, 24, 0.96),
            rgba(25, 12, 12, 0.96)
        );

    border: 2px solid var(--settings-accent);
    border-radius: 14px;

    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 12px 35px rgba(0, 0, 0, 0.35);

    backdrop-filter: blur(12px);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.settings-card:hover {
    transform: translateY(-3px);

    box-shadow:
        0 0 20px color-mix(
            in srgb,
            var(--settings-accent) 20%,
            transparent
        ),
        0 15px 40px rgba(0, 0, 0, 0.4);
}


/* Make important cards wider */

.settings-card.wide {
    grid-column: span 1;
}


/* Bottom cards */

.settings-card:nth-child(7),
.settings-card:nth-child(8),
.settings-card:nth-child(9) {
    grid-column: span 1;
}


/* ================================
   CARD TEXT
================================ */

.settings-card h2 {
    margin: 5px 0 12px;

    color: #f5f5f5;

    font-size: 21px;
    font-weight: 700;
}

.settings-card > p {
    max-width: 500px;

    margin: 0 0 20px;

    color: var(--settings-muted);

    font-size: 14px;
    line-height: 1.6;
}


/* ================================
   SELECT BOXES
================================ */

.theme-select,
.cloak-select {
    width: min(100%, 250px);
    height: 52px;

    padding: 0 16px;

    color: white;

    background: rgba(8, 8, 8, 0.85);

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;

    outline: none;

    font-family: "Quicksand", sans-serif;
    font-size: 15px;
    font-weight: 600;

    transition: 0.2s ease;
}

.theme-select:focus,
.cloak-select:focus {
    border-color: var(--settings-accent);

    box-shadow:
        0 0 0 3px color-mix(
            in srgb,
            var(--settings-accent) 18%,
            transparent
        );
}


/* ================================
   BUTTONS
================================ */

.settings-actions {
    display: flex;
    justify-content: center;
    align-items: center;

    gap: 12px;

    margin-top: 18px;

    flex-wrap: wrap;
}

.settings-button {
    min-height: 48px;

    padding: 0 20px;

    color: white;

    background: rgba(35, 8, 8, 0.9);

    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;

    font-family: "Quicksand", sans-serif;
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease;
}

.settings-button:hover {
    background: var(--settings-accent-dark);
    border-color: var(--settings-accent);

    transform: translateY(-2px);
}

.settings-button.secondary {
    background: rgba(15, 8, 8, 0.7);
}


/* ================================
   CUSTOM CLOAK
================================ */

.custom-form {
    width: 100%;

    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;

    gap: 8px;

    flex-wrap: wrap;
}

/* Small rounded rectangle inputs */
.custom-form input {
    box-sizing: border-box;

    width: 180px;
    height: 38px;

    flex: 0 0 180px;

    padding: 0 12px;

    color: #fff;

    background: rgba(10, 5, 5, 0.85);

    border: 1px solid var(--border);

    border-radius: 10px;

    outline: none;

    font-family: "Quicksand", sans-serif;
    font-size: 12px;
    font-weight: 600;

    text-align: left;

    transition:
        width 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.custom-form input::placeholder {
    color: #777;

    font-size: 11px;

    opacity: 1;
}

.custom-form input:hover {
    background: rgba(18, 7, 7, 0.95);

    border-color: var(--red-border);
}

.custom-form input:focus {
    background: rgba(12, 5, 5, 0.98);

    border-color: var(--red);

    box-shadow:
        0 0 0 2px rgba(255, 69, 69, 0.12),
        0 0 12px rgba(190, 59, 50, 0.2);

    transform: translateY(-1px);
}

/* Keep buttons compact beside the inputs */
.custom-form .settings-button {
    height: 38px;
    min-height: 38px;

    padding: 0 13px;

    border-radius: 10px;

    font-size: 11px;
}

/* Mobile */
@media (max-width: 600px) {
    .custom-form {
        flex-direction: column;
        width: 100%;
    }

    .custom-form input {
        width: min(100%, 260px);
        flex: 0 1 260px;
    }

    .custom-form .settings-button {
        width: min(100%, 260px);
    }
}


/* ================================
   TOGGLE CARDS
================================ */

.toggle-row {
    width: 100%;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 10px;

    padding: 15px 0;

    border: none;
}

.toggle-copy strong {
    display: block;

    color: white;

    font-size: 16px;
}

.toggle-copy span {
    display: block;

    margin-top: 5px;

    color: var(--settings-muted);

    font-size: 12px;
}

.toggle-buttons {
    display: flex;
    justify-content: center;

    gap: 14px;

    margin-top: 8px;
}

.toggle-button {
    min-width: 82px;
    min-height: 52px;

    padding: 0 16px;

    color: white;

    background: rgba(35, 8, 8, 0.8);

    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;

    font-family: "Quicksand", sans-serif;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition: 0.18s ease;
}

.toggle-button:hover,
.toggle-button.active {
    background: var(--settings-accent-dark);
    border-color: var(--settings-accent);

    transform: translateY(-2px);
}


/* ================================
   STATUS
================================ */

.status {
    margin-top: auto;
    padding-top: 15px;

    color: var(--settings-muted);

    font-size: 12px;
}


/* ================================
   RESPONSIVE
================================ */

@media (max-width: 1100px) {

    .settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 700px) {

    #settings-page {
        width: calc(100% - 24px);
        padding-top: 30px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .settings-card {
        min-height: 240px;
        padding: 22px 16px;
    }

}


/* =========================
   GENERAL BUTTON
========================= */

button {
    font-family:
        "Quicksand",
        sans-serif;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 850px) {

    #mathworksheets {
        grid-template-columns:
            repeat(
                auto-fill,
                minmax(95px, 1fr)
            );

        gap: 10px;
    }

    .gamebtns {
        width: 95px;
        height: 95px;
    }

    #roddyricchboxselect {
        width: calc(100% - 16px);

        padding-left: 5px;
        padding-right: 5px;
    }
}


@media (max-width: 700px) {

    #header {
        width: calc(100% - 16px);
    }

    #header > .right {
        gap: 2px;
    }

    .headericons {
        width: 38px;
        height: 38px;
    }

    #footer {
        width: calc(100% - 25px);
    }

    #cornerimage {
        width: 245px;
        height: 310px;
    }

    #player {
        flex-direction: column;

        padding: 8px;

        gap: 8px;
    }

    #game-area {
        height: calc(100% - 145px);

        min-height: 0;
    }

    #sidebar {
        width: 100%;

        height: 125px;

        flex-direction: row;

        align-items: center;

        padding: 8px;
    }

    #game-picture {
        width: 90px;
        height: 90px;

        flex-shrink: 0;
    }

    .sidebar-info {
        flex: 1;

        min-width: 0;
    }

    #game-title {
        text-align: left;

        margin:
            0
            0
            3px;
    }

    #game-subtitle {
        text-align: left;

        margin: 0;
    }

    .sidebar-buttons {
        width: 125px;

        display: flex;

        flex-direction: column;

        gap: 6px;
    }

    .player-button {
        min-height: 40px;

        padding: 7px;

        font-size: 12px;
    }

    .sidebar-spacer {
        display: none;
    }
}


@media (max-width: 650px) {

    #index-sidebar {
        right: 8px;
        width: 64px;
        padding-left: 6px;
        padding-right: 6px;
    }

    #index-sidebar button {
        width: 42px;
        height: 42px;
        padding: 6px;
    }

    #index-sidebar button img {
        width: 24px;
        height: 24px;
    }

    .sidebar-logo {
        width: 52px !important;
        height: 52px !important;
        margin-bottom: 16px;
    }

    .sidebar-logo img {
        width: 48px !important;
        height: 48px !important;
    }

    #roddyricchboxhome {
        left: calc(50% - 32px);
        width: calc(100% - 82px);
        top: 20vh;
    }

    #maintitle {
        font-size: 52px;
    }

    .quick-apps-container {
        max-width: 390px;

        margin-left: auto;
        margin-right: auto;

        gap: 7px;
    }

    .quick-app {
        width: 82px;
        height: 82px;
    }

    .quick-image {
        width: 58px;
        height: 58px;
    }

}


@media (max-width: 450px) {

    #mathworksheets {
        grid-template-columns:
            repeat(
                3,
                1fr
            );

        gap: 8px;
    }

    .gamebtns {
        width: 100%;

        max-width: 100px;

        height: auto;

        aspect-ratio: 1 / 1;
    }

    #title {
        font-size: 30px;
    }

    #teachertouchbar {
        width: 90%;
    }

    #teachertouchbar:focus {
        width: 95%;
    }

    #footer {
        min-width: 0;

        width: calc(100% - 20px);
    }

    #online {
        font-size: 10px;
    }
}

#cornerimage {
    display: none !important;
}