* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --text-color: blueviolet;
    --red: red;
    --blue: dodgerblue;
    --white: white;
    --text-outline: -2px -2px 0 var(--white), 2px -2px 0 var(--white), -2px 2px 0 var(--white), 2px 2px 0 var(--white);
}

@font-face {
    font-family: 'MarioKartDS';
    src: url('/assets/fonts/Mario-Kart-DS.ttf');
}

@font-face {
    font-family: 'Pixel';
    src: url('/assets/fonts/W95FA.otf');
}

body {
    height: 100vh;
    overflow: hidden;
    font-family: 'Pixel';
    font-size: 18px;
    line-height: 1.5;
}

p {
    margin: 10px 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'MarioKartDS';
    letter-spacing: 1px;
    word-spacing: 5px;
    text-transform: uppercase;
    word-break: break-word;
    margin: 10px 0;
}

h1 {
    font-size: 30px;
    text-align: center;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
}

img {
    image-rendering: pixelated;
}

#splash {
    flex-direction: column;
    justify-content: space-between;
    background-color: var(--white);
    background-image: url('/assets/art/SugarStarluxe\ Neoterra\ Banner\ \(Jan\ 22\,\ 2026\).png');
    background-size: 1500px;
    background-position: center 90%;
    animation: slideUpBg 1.5s ease-out forwards;
}

@keyframes slideUpBg {
    to {
        background-position: center bottom;
    }
}

#splash #banner {
    max-width: 95%;
    max-height: 200px;
    z-index: 2;
    animation: cartoonyBounceDown 1.2s ease-out forwards;
    transition: filter 0.15s ease, box-shadow 0.15s ease;
}

#splash #banner:hover {
    filter: brightness(1.1) saturate(1.2);
}

#splash #banner:active {
    filter: brightness(1.2);
    animation: bonk 0.2s ease-in-out;
}

@keyframes bonk {
    50% {
        filter: brightness(1.4) saturate(1.4);
    }
}

@keyframes cartoonyBounceDown {
    0% {
        transform: translateY(-80px) scaleY(1.05);
    }

    40% {
        transform: translateY(20px) scaleY(0.85) scaleX(1.1);
    }

    55% {
        transform: translateY(-30px) scaleY(1.05);
    }

    70% {
        transform: translateY(10px) scaleY(0.95);
    }

    85% {
        transform: translateY(-8px) scaleY(1.02);
    }

    100% {
        transform: translateY(0) scaleY(1);
    }
}

#splash #img-start {
    max-width: 95%;
    max-height: 120px;
    margin-bottom: 70px;
    opacity: 0;
    transform: scale(0.5);
    animation: popIn 0.7s ease forwards, blink 2s infinite;
    animation-delay: 2s, 3s;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    50%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes blink {

    0%,
    50%,
    100% {
        opacity: 1;
    }

    25%,
    75% {
        opacity: 0;
    }
}

#splash #modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: var(--white);
    border: 5px ridge var(--text-color);
    outline: 5px solid var(--white);
    padding: 15px 30px;
    border-radius: 10px;
    z-index: 9999;
    color: var(--text-color);
    font-size: 18px;
    width: 90%;
    height: 60%;
    overflow: auto;
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.1s ease;
    pointer-events: none;
}

#splash #modal.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

#splash #modal button {
    display: block;
    margin: auto;
    margin-top: 15px;
    margin-bottom: 5px;
    padding: 10px 20px;
    font-size: 26px;
    border: 3px ridge var(--text-color);
    border-radius: 10px;
    cursor: pointer;
    background: linear-gradient(180deg, rgb(222, 222, 222), var(--white), var(--white));
    font-family: 'MarioKartDS';
    text-transform: uppercase;
    text-shadow: var(--text-outline);
    color: var(--text-color);
    transition:
        background 0.4s ease,
        color 0.3s ease,
        border-color 0.3s ease,
        text-shadow 0.3s ease;
}

#splash #modal button:hover {
    background: linear-gradient(180deg, lightcyan, lightcyan, var(--white));
    color: var(--blue);
    border-color: var(--blue);
}

#splash #modal button:active {
    background: linear-gradient(180deg, yellow, lemonchiffon, var(--white));
    color: orange;
    border-color: orange;
}

/* FORCE hidden elements to stay hidden */
[hidden] {
    display: none !important;
}

#home {
    background-color: var(--white);
    background-size: cover;
    background-position: center;
    transition: background 0.2s ease;
    height: 100vh;
    padding-left: 5%;
    box-sizing: border-box;
}

#home .event-buttons {
    gap: 3rem;
    max-width: 650px;
    width: 90%;
    align-items: flex-start;
    position: relative;
}

/* Base button styles */
#home .event-buttons button {
    font-size: clamp(18px, 6vw, 55px);
    font-family: 'MarioKartDS', sans-serif;
    text-transform: uppercase;
    word-spacing: 5px;
    width: 100%;
    padding: clamp(15px, 2vw, 25px) clamp(25px, 4vw, 50px);
    aspect-ratio: 5.25 / 1;
    cursor: pointer;
    color: var(--white);
    border: 7px ridge var(--text-color);
    outline: 5px solid var(--white);
    border-radius: 10px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.5);
}

/* Hover effect */
#home .event-buttons button:hover {
    transform: perspective(500px) rotateY(0deg) scale(1.05);
    outline: 7px solid yellow;
    color: yellow;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
    filter: brightness(1.15);
}

#home .event-buttons button:active {
    background: yellow !important;
}

/* Gradients & staggered left padding */
#home .event-buttons button:nth-child(2) {
    background: linear-gradient(135deg, orange, red);
    margin-left: 0;
}

#home .event-buttons button:nth-child(3) {
    background: linear-gradient(135deg, cyan, blue);
    margin-left: 40px;
}

#home .event-buttons button:nth-child(5) {
    background: linear-gradient(135deg, lime, green);
    margin-left: 80px;
}

#home .event-buttons button:nth-child(4) {
    background: linear-gradient(135deg, fuchsia, blueviolet);
    margin-left: 120px;
}

#title {
    font-size: 45px;
    margin-left: 15px;
    color: var(--white);
    text-shadow: 0 0 2px black, 0 0 2px black, 0 0 2px black;
    word-break: break-word;
}

#singleplayer,
#about,
#neoterra {
    background-image: url('/assets/art/Background 5 (Jan 24, 2026).png');
    background-size: cover;
    background-position: center;
}

#multiplayer {
    background-image: url('/assets/art/Background 5B (Jan 24, 2026).png');
    background-size: cover;
    background-position: center;
}

#options {
    background-image: url('/assets/art/Background 5C (Jan 24, 2026).png');
    background-size: cover;
    background-position: center;
}

#singleplayer .category-tabs {
    background: linear-gradient(0deg, orange, red);
    background-color: red;
}

#multiplayer .category-tabs {
    background: linear-gradient(0deg, dodgerblue, blue);
    background-color: blue;
}

#options .category-tabs {
    background: linear-gradient(0deg, fuchsia, blueviolet);
    background-color: blueviolet;
}

/* LEFT TABS */
.category-tabs {
    display: flex;
    border-right: 2px solid var(--white);
    max-width: 100%;
    width: 25%;
    padding: 20px 10px;
    gap: 5px;
}

button.tab {
    border: 5px ridge var(--text-color);
    font-size: 30px;
    line-height: 1;
    padding: 12px 15px;
}

.tab.active,
.stray-btn.metal-item.active,
.stray-btn:active,
.metal-tab:active,
.metal-tab.active,
.socials img:active,
.option-toggle:active {
    border-color: var(--red) !important;
    color: var(--red) !important;
    background: yellow !important;
}

.stray-btn {
    max-width: 100%;
    padding: 7px 20px;
    font-size: 26px;
    border: 3px ridge var(--text-color);
    border-radius: 10px;
    cursor: pointer;
    background: linear-gradient(180deg, rgb(222, 222, 222), var(--white), var(--white));
    font-family: 'MarioKartDS';
    text-transform: uppercase;
    text-shadow: var(--text-outline);
    text-align: center;
    word-spacing: 5px;
    color: var(--text-color);
    word-break: break-word;
}

.stray-btn:hover,
.metal-tab:hover,
.socials img:hover,
.option-toggle:hover {
    background: linear-gradient(180deg, lightcyan, lightcyan, var(--white));
    color: var(--blue);
    border-color: var(--blue);
}

.stray-btn:active {
    background: linear-gradient(180deg, yellow, lemonchiffon, var(--white));
    color: orange;
    border-color: orange;
}

/* CAROUSEL AREA */
.carousel-wrapper {
    display: flex;
    max-width: 100%;
    width: 75%;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Carousel buttons */
.carousel-btn {
    position: absolute;
    transform: translateY(-50%);
    border-width: 5px;
    top: 50%;
    font-size: 36px;
    height: 180px;
    z-index: 10;
}

.carousel-btn.left {
    left: 20px;
}

.carousel-btn.right {
    right: 20px;
}

.carousel {
    gap: 60px;
    padding: 0;
    will-change: transform;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.carousel-item {
    display: flex;
    flex-direction: column;
    /* Changed from space-evenly to prevent content-based shifting */
    justify-content: flex-start;
    align-items: center;
    width: 600px;
    max-width: 100%;
    /* Highly recommended: set a hard limit */
    height: 50vh;
    padding: 20px;
    flex-shrink: 0;
    text-align: center;
    background: var(--white);
    color: var(--text-color);
    text-shadow: var(--text-outline);
    border: 10px solid var(--white);
    outline: 10px ridge var(--text-color);
    border-radius: 30px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.carousel-item img {
    width: 100%;
    max-width: 100%;
    height: 300px;
    /* Or a fixed px value like 300px */
    object-fit: cover;
    /* This crops the image instead of stretching the container */
    border-radius: 20px;
    margin-bottom: 15px;
    flex-shrink: 0;
    /* Prevents the image from squishing to fit text */
}

#singleplayer .carousel-item.active {
    background: yellow;
    color: var(--red);
    outline-color: var(--red);
    transform: scale(1.05);
}

#singleplayer .carousel-item.active img {
    border-color: var(--red);
}

#multiplayer .carousel-item.active {
    background: rgb(118, 255, 255);
    color: rgb(0, 128, 255);
    outline-color: rgb(0, 128, 255);
    transform: scale(1.05);
}

#multiplayer .carousel-item.active img {
    border-color: rgb(0, 128, 255);
}

#options .carousel-item.active {
    background: rgb(253, 118, 255);
    color: rgb(136, 0, 255);
    outline-color: rgb(136, 0, 255);
    transform: scale(1.05);
}

#options .carousel-item.active img {
    border-color: rgb(132, 0, 255);
}


.carousel-item h2 {
    margin: 0;
    font-size: xx-large;
}

.carousel-item p {
    margin: 0;
    font-size: large;
}

#guestbook-frame,
#whiteboard-frame,
#poll-frame,
#puzzle-frame {
    width: 100%;
    height: 100%;
    padding: 30px;
}

#guestbook-frame iframe,
#whiteboard-frame iframe,
#poll-frame iframe,
#puzzle-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 25px;
    outline: 10px ridge var(--text-color);
    border: 10px solid var(--white);
    background: var((--white));
}

.options-frame {
    width: 100%;
    background: var(--white);
    border: 10px solid var(--white);
    outline: 10px ridge var(--text-color);
    border-radius: 30px;
    margin: 20px;
    padding: 10px 20px;
    box-sizing: border-box;
    gap: 20px;
    color: var(--text-color);
    text-shadow: var(--text-outline);
}

/* Section header */
.options-frame h2 {
    margin: 0 0 10px 0;
    text-align: center;
    font-size: 36px;
}

.option-row {
    justify-content: space-between;
    padding: 15px 20px;
    border: 4px ridge var(--text-color);
    border-radius: 14px;
    background: linear-gradient(180deg, #f5f5f5, var(--white));
}

.option-label {
    font-size: 22px;
}

.option-toggle {
    font-family: 'MarioKartDS';
    font-size: 22px;
    word-spacing: 5px;
    color: var(--text-color);
    text-shadow: var(--text-outline);
    width: 35%;
    padding: 8px 18px;
    border: 4px solid var(--text-color);
    border-bottom-width: 7px;
    border-radius: 10px;
    background: var(--white);
    cursor: pointer;
}

.option-toggle.off {
    background: linear-gradient(180deg, #cfcfcf, #e0e0e0);
    color: gray;
    text-shadow: none;
}

.option-slider {
    width: 35%;
}

.option-slider input[type="range"] {
    width: 100%;
}

.theme-dropdown {
    font-family: 'MarioKartDS';
    text-transform: uppercase;
    font-size: 22px;
    word-spacing: 5px;
    color: var(--text-color);
    text-shadow: var(--text-outline);
    width: 35%;
    height: 50px;
    padding: 8px 18px;
    border: 4px solid var(--text-color);
    border-bottom-width: 7px;
    border-radius: 10px;
    background: var(--white);
    cursor: pointer;
    text-align: center;
}

/* ABOUT SCREEN LAYOUT */
#about .player-container {
    height: 100vh;
    padding: 20px 25px;
}

#about h1 {
    margin-top: 0;
}

/* LEFT OC */
.about-left {
    flex: 1;
    margin-right: -25px;
}

.about-left img {
    max-width: 100%;
    max-height: 85%;
    z-index: 1;
    animation: cartoonyBounceDown 1.2s ease-out forwards;
}

/* RIGHT SIDE */
.about-right {
    flex: 2;
    gap: 20px;
    animation: popIn 0.7s ease forwards;
}

/* ROWS */
.about-row {
    gap: 20px;
    flex: 1;
    padding: 5px;
    overflow: auto;
}

#about-box-wide {
    outline-color: lime;
    color: green;
}

/* PANELS */
.about-box {
    background: var(--white);
    color: var(--text-color);
    border-radius: 10px;
    border: 5px solid var(--white);
    outline: 5px ridge var(--text-color);
    padding: 10px 20px;
    height: max-content;
    overflow: auto;
}

/* STATS PANEL */
#stats-box {
    outline-color: red;
    color: red;
    flex: 0 0 35%;
}

.stats-list {
    gap: 15px;
}

.stat {
    justify-content: space-between;
    border-bottom: 2px dashed red;
    word-break: break-word;
    gap: 15px;
}

.stat-label {
    font-weight: bold;
    letter-spacing: 1px;
    word-spacing: 5px;
}

.stat-value {
    text-align: right;
}

.stat-value.online {
    color: limegreen;
    animation: blink 2s infinite;
}

.socials a {
    line-height: 0;
    text-decoration: none;
}

.socials img {
    border: 3px ridge red;
    border-radius: 10px;
    margin: 2.5px;
    padding: 5px;
    max-width: 40px;
    max-height: 40px;
    object-fit: cover;
}

#interest-box {
    outline-color: var(--blue);
    color: var(--blue);
}

#interest-row>div img {
    border: 5px solid var(--white);
    border-radius: 10px;
    outline: 3px ridge dodgerblue;
    width: 80px;
    height: 80px;
    object-fit: cover;
}

#interest-row>div:nth-child(6n + 1) img {
    outline-color: red;
}

#interest-row>div:nth-child(6n + 2) img {
    outline-color: orange;
}

#interest-row>div:nth-child(6n + 3) img {
    outline-color: gold;
}

#interest-row>div:nth-child(6n + 4) img {
    outline-color: limegreen;
}

#interest-row>div:nth-child(6n + 5) img {
    outline-color: dodgerblue;
}

#interest-row>div:nth-child(6n + 6) img {
    outline-color: blueviolet;
}

#metal-mode {
    justify-content: flex-start;
    height: 100%;
}

.metal-tabs {
    gap: 10px;
    height: 10%;
    padding: 15px;
}

.metal-tab {
    font-family: 'MarioKartDS';
    text-transform: uppercase;
    font-size: 22px;
    word-spacing: 5px;
    padding: 10px 15px;
    background: linear-gradient(180deg, #f5f5f5, var(--white));
    color: var(--text-color);
    border: 5px ridge var(--text-color);
    border-bottom-width: 7px;
    border-radius: 14px 14px 8px 8px;
    text-shadow: var(--text-outline);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease;
    width: 100%;
}

.metal-tab:hover {
    transform: translateY(-2px);
}

.metal-layout {
    height: 90%;
    padding: 10px;
}

.metal-list {
    display: flex;
    width: 60%;
    padding: 15px;
    overflow-y: auto;
}

.metal-item {
    display: grid;
    grid-template-columns: 2.5ch 1fr;
    gap: 12px;
    padding: 16px 8px;
    text-align: left;
    align-items: center;
    white-space: normal;
}

.metal-item span {
    pointer-events: none;
}

.metal-index {
    text-align: center;
    opacity: 0.7;
    flex-shrink: 0;
}

.metal-name {
    font-size: 22px;
    line-height: 1.25;
    word-break: break-word;
}

.metal-preview {
    display: flex;
    padding: 0 15px;
    width: 40%;
}

.metal-preview img {
    max-width: 100%;
    height: 300px;
    animation: popIn 0.7s ease forwards;
}

.metal-content,
#select-an-item {
    background: var(--white);
    margin-top: 25px;
    padding: 5px 25px;
    border: 3px ridge var(--text-color);
    border-radius: 10px;
    overflow: auto;
}

.metal-content h2 {
    color: var(--text-color);
    text-align: center;
    line-height: 1;
    margin-bottom: 0;
}

.metal-content p {
    color: var(--text-color);
    margin-top: 0;
}

.metal-content .release-date {
    font-weight: bold;
    text-align: center;
    margin: 9px 0 -4px 0;
}

.rarity-meter {
    font-size: 30px;
    text-align: center;
    letter-spacing: 6px;
    color: gold;
}

.flex {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

.nowrap {
    flex-wrap: nowrap;
}

.row {
    flex-direction: row;
}

.column {
    flex-direction: column;
}

.justify-center {
    justify-content: center;
}

.align-center {
    align-items: center;
}

.rainbow-text {
    background: linear-gradient(90deg, #ff3cac, blueviolet, #00d4ff, #00ff94, gold, red);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.star-list {
    list-style: none;
}

.star-list li {
    position: relative;
    padding-left: 25px;
}

.star-list li::before {
    content: "★";
    position: absolute;
    left: 4px;
    top: -4px;
    color: gold;
    font-size: 1.2em;
}

.star-list.nested {
    margin-bottom: 10px;
    padding-left: 20px;
}

#inspirations img {
    margin: 10px;
    max-height: 150px;
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    padding: 10px 0;
}

.gallery img {
    max-width: 100%;
    max-height: 160px;
    transition: transform 0.2s, filter 0.2s;
    cursor: pointer;
}

.gallery img:hover {
    transform: scale(1.1);
    filter: saturate(1.25) brightness(1.1);
}

html[data-theme="dark"] {
    --text-color: white;
    --red: white;
    --blue: cyan;
    --white: black;
}

html[data-theme="dark"] #title {
    text-shadow: 0 0 2px white, 0 0 2px white, 0 0 2px white;
}

html[data-theme="dark"] .carousel-item h2,
html[data-theme="dark"] .carousel-item p {
    color: var(--white);
    text-shadow: none;
}

html[data-theme="dark"] #about-box-wide {
    color: lime;
}

@media (max-width: 768px) {

    #home {
        padding-top: 20px;
    }

    #singleplayer,
    #multiplayer,
    #options,
    #about {
        height: auto;
        overflow: auto;
        padding-bottom: 80px;
    }

    #title {
        font-size: 30px;
    }

    #about .player-container {
        flex-direction: column;
    }

    /* Tabs go on top */
    .category-tabs {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        border-right: none;
        border-bottom: 2px solid var(--white);
        gap: 10px;
    }

    button.tab {
        font-size: 20px;
    }

    #home .event-buttons {
        width: 95%;
    }

    #home .event-buttons button {
        margin-left: 0 !important;
        box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.3);
    }

    #guestbook-frame iframe,
    #whiteboard-frame iframe,
    #poll-frame iframe,
    #puzzle-frame iframe {
        height: 450px;
    }

    .carousel-wrapper {
        width: 100%;
        height: auto;
        padding: 20px 5px;
    }

    .carousel-item {
        width: 55vw;
        margin-top: 15px;
        height: fit-content;
    }

    .carousel-item h2 {
        font-size: 18px;
    }

    .carousel-item p {
        font-size: large;
    }

    .carousel-item img {
        height: 120px;
    }

    .about-box {
        padding: 5px 10px;
        overflow: visible;
    }

    .about-left {
        margin: 0;
    }

    .about-left img {
        max-height: 450px;
    }

    .about-right {
        padding-bottom: 20px;
    }

    .about-row {
        flex-direction: column;
    }

    #metal-mode {
        height: auto;
    }

    .metal-layout {
        padding: 5px;
    }

    .metal-list {
        width: 40%;
        padding: 0;
    }

    .metal-preview {
        width: 60%;
        padding: 0;
    }

    .metal-tabs {
        flex-wrap: wrap;
        padding: 5px;
        height: auto;
    }

    #select-an-item {
        margin: 0;
    }

    .metal-item {
        grid-template-columns: 1.5ch 1fr;
        gap: 5px;
    }

    .metal-name,
    .metal-index {
        font-size: 16px;
    }

    .metal-preview img {
        width: auto;
        height: 150px;
    }

    .metal-layout {
        gap: 10px;
        max-height: 600px;
    }

    #interest-row {
        flex-direction: row;
        gap: 15px;
    }

    .interest-box {
        max-width: 70px;
        max-height: 70px;
    }

    .option-toggle,
    #theme-select {
        width: 100%;
    }

    .gallery img {
        max-height: 100px;
    }
}