:root {
    --petal-frost: #FCD9EFff;
    --eggshell: #FAF3DDff;
    --lavender-veil: #FDE7F9ff;
    --lavender-veil-2: #FCE2FBff;
    --petal-frost-2: #FDDBEAff;
    --vanilla-custard: #FDEBB5ff;
    --mullin-blue: #96AFE7;
    --blush: #FFCAD4;
    --regal-txt: #2C1877;
    --lavender-night: #875ff5;
    --grass: #A4D999;
    --tealDust: #8FDEDB;

    /* Rainbow Ring Colors */

    --rainbowRed: #ffadad;
    --rainbowOrange: #ffdea1;
    --rainbowYellow: #ffffb5;
    --rainbowGreen: #c2ffc2;
    --rainbowBlue: #b8d4ff;
    --rainbowIndigo: #9e97e0;
    --rainbowPurple: #cfb0ff;
    --rainbowPink: #ffd8f2;
}

@font-face {
    font-family: UNI;
    src: url('/Assets/fonts/UNI.ttf');
}

body {
    background: var(--lavender-veil);
    color: var(--regal-txt);

    height: 100vh;
}

#watchWrapper,
#mainWrapper {
    margin: 0 auto;
    padding: 30px;

    background: var(--petal-frost-2);

    border-style: solid;
    border-image: url("/assets/borders/whiteCircle.png") 90 round;
    background-clip: padding-box;
    border-width: 50px;
    border-top: none;
    border-bottom: none;

    -webkit-box-shadow: inset 5px 5px 20px white;
    box-shadow: inset 5px 5px 20px white;

    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

#mainWrapper {
    max-width: 900px;
}

#watchWrapper {
    max-width: 1100px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header img {
    transition: transform .25s;
}

header img:hover {
    transform: scale(1.05);
}

#subtitle {
    opacity: 0.6;
    font-style: italic;
}

main {
    display: flex;
    flex-direction: column;
    gap: 30px;

    text-align: center;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: UNI;

    font-weight: normal;
}

a {
    color: blueviolet;
    font-weight: bold;
}

* {
    scrollbar-width: thin;
    box-sizing: border-box;
    scrollbar-color: var(--vanilla-custard) white;
}

/* & Main Structure */

#characterCards .scrollbox {
    display: flex;
    gap: 20px;
    overflow-y: visible;

    padding: 10px 0;

    /* ? Decided to turn this into a bounce marquee for some reason. */
    animation: bouncing-text 10s linear infinite alternate;
}

@keyframes bouncing-text {
    0% {
        transform: translateX(3%);
    }

    100% {
        transform: translateX(-60%);
    }
}

.characterCard {
    display: flex;
    flex-direction: column;
    flex: 0 0 180px;
    height: 300px;

    border-style: solid;
    border-image: url("/assets/borders/borderfilledB.png") 8 round;
    background-clip: padding-box;
    border-width: 8px;
    transition: transform .2s, box-shadow .2s;
    overflow: hidden;
}

.characterCard:hover {
    transform: translateY(-4px);
}

.characterCard h2 {
    margin: 0;
    width: 100%;
    padding: 10px;
    padding-bottom: 0;

    font-size: 1.5em;

    background: var(--lavender-veil);
}

.characterCard img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 25px;

    padding: 10px;
}

.characterCard .shortDescription p {
    margin: 0;
    font-size: 0.9em;
    opacity: 0.85;

    background: var(--lavender-veil);
    padding: 5px;

    height: 60px;
    text-align: center;
}

/* & Character Card specific edits */

#eurynomeCard img {
    object-position: left;
}

#molechCard img {
    object-position: top;
}

/* ~ Helpers */

.spacer {
    flex: 1;
}

/* ~ Watch Link */

#watchLink,
#mangaLink {
    background: var(--vanilla-custard);
    padding: 20px;
    border-radius: 50px;

    position: relative;

    border: 8px solid white;
}

#watchLink *,
#mangaLink * {
    margin-bottom: 10px;
}

#watchLink a,
#mangaLink a,
#backLink a {
    display: inline-block;
    margin: 0;

    background: var(--petal-frost);
    padding: 15px 50px;
    border-radius: 999px;
    border: 5px solid white;

    position: relative;
    z-index: 2;

    font-family: 'Times New Roman', Times, serif;
    text-decoration: none;

    font-size: 1.2em;


    color: var(--regal-txt);
    transition: letter-spacing .25s;
}

#watchLink a:hover,
#backLink a:hover {
    letter-spacing: 0.2em;
}

#mangaLink {
    background: var(--grass);
}

#mangaLink a {
    background-color: var(--rainbowRed);
    cursor: not-allowed;
}


/* ! Manga Reading Section */

/* & Watch player */

#episodePlayer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ? Basically just so that I can position the controls where I want them lol */

#playerWrapper {
    position: relative;
}

#sidebarWrapper {
    position: relative;
    overflow: hidden;
    background: white;

    border-style: solid;
    border-image: url("/assets/borders/whiteCircle.png") 90 round;
    background-clip: padding-box;
    border-width: 40px;
}

#ambliPlayer {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    /* ? reserves the real size upfront so it doesn't default to the old 2:1 video box before metadata loads, then jump */
    border-radius: 30px;
    padding: 10px;

    cursor: pointer;
}

#playPauseFlash {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;

    font-size: 4em;
    color: white;
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, .5));

    opacity: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

#playPauseFlash.flash {
    animation: playPauseFlash .6s ease;
}

@keyframes playPauseFlash {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.6);
    }

    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.3);
    }
}

#episodeListToggle {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;

    border: none;
    background: none;
    cursor: pointer;
}

#episodeSidebar {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    width: 220px;
    height: 100%;

    display: flex;
    flex-direction: column;

    background: white;
    padding: 10px;

    border-style: solid;
    border-image: url("/assets/borders/whiteCircle.png") 60 round;
    background-clip: padding-box;
    border-width: 10px;

    transform: translateX(100%);
    transition: transform .25s;
}

#episodeSidebar.show {
    transform: translateX(0);
}

#nowPlayingLabel {
    opacity: 0.7;
    font-style: italic;
    margin-bottom: 10px;
}

#episodeList {
    display: flex;
    flex-direction: column;
    gap: 8px;

    flex: 1;
    min-height: 0; /* ? without this, flex children won't shrink below content size, so overflow-y never actually kicks in */

    overflow-y: auto;
}

.episodeButton {
    padding: 8px;
    border: 1px solid currentColor;
    background: transparent;
    cursor: pointer;

    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
}

.episodeButton.active {
    font-weight: bold;
    font-style: italic;
    text-decoration: underline;
}

#customControls {
    display: flex;
    align-items: center;
    gap: 10px;

    position: absolute;
    bottom: 20px;
    left: 50%;

    transform: translateX(-50%);

    z-index: 2;
    width: 90%;
}

#customControls button {
    border: none;
    background: none;
    cursor: pointer;
}

#playPauseButton,
#muteButton,
#fullScreenButton,
#episodeListToggle {
    color: var(--regal-txt);
    font-size: 1.4em;
}

#episodeListToggle {
    background: white;
    border-bottom-right-radius: 15px;
}

#seekBar {
    flex: 1;
    width: 100%;
}

input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    height: 16px;
    margin: 0;
    background: transparent;
}

input[type=range]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: var(--blush);
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--vanilla-custard);
    border: 1px solid black;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

input[type=range]::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: var(--blush);
}

input[type=range]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--vanilla-custard);
    border: 1px solid black;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

input[type=range]:focus {
    outline: none;
}

#timeDisplay {
    white-space: nowrap;
    font-size: 1.1em;
}

/* ? Did you know you could target stuff in fullscreen like this???? */
#playerWrapper:fullscreen #sidebarWrapper {
    border: none;
}

#playerWrapper:fullscreen #customControls {
    background: white;
    padding: 10px;
    border-radius: 10px;
}

#playerWrapper:fullscreen #customControls,
#playerWrapper:fullscreen #episodeListToggle {
    opacity: 1;
    transition: opacity .3s ease;
}

#playerWrapper.controlsHidden:fullscreen #customControls,
#playerWrapper.controlsHidden:fullscreen #episodeListToggle {
    opacity: 0;
    pointer-events: none;
}

#playerWrapper.controlsHidden:fullscreen {
    cursor: none;
}

/* & Episode banner */

#episodeBanner {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 2;

    transform: translate(-50%, -100%);
    transition: transform .5s ease;

    pointer-events: none;

    background: var(--blush);
    border-radius: 999px;
}

#episodeBanner.show {
    top: 20px;
    transform: translate(-50%, 0);
}

.chain {
    display: block;
    position: absolute;
    top: -20px;
    width: 1px;
    height: 20px;

    border-left: 3px dotted gray;
}

.chainLeft {
    left: 40px;
}

.chainRight {
    right: 40px;
}

#bannerBody {
    display: flex;
    flex-direction: column;
    align-items: center;

    min-width: 200px;
    max-width: 350px;

    padding: 8px 16px;
}

#bannerNumber {
    font-style: italic;
}

#bannerNumber::before,
#bannerNumber::after {
    content: "";
    display: inline-block;

    width: 1em;
    height: 1em;
    --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M160.53 20.906c-22.075.207-39.973 9.138-54.218 23.782C89.507 61.962 78.3 87.6 74.876 115.624c-6.847 56.05 16.55 119.953 82.094 146.625l-7.032 17.313c-64.128-26.096-93.275-84.757-94.782-141c-17.36 10.866-27.608 27.05-32.343 46.437c-5.728 23.448-2.727 51.54 7.906 77.844c21.264 52.61 71.37 96.856 138.436 87.594l2.563 18.53c-48.795 6.74-90.183-11.576-119.907-41.03c-8.152 16.216-7.504 32.264-.657 48.312c8.472 19.854 27.498 39.252 52.875 53.594c47.085 26.61 114.8 35.554 173.19 5.094c-5.43-20.99-2.652-45.074 11.342-69.313c22.71-39.332 60.78-49.83 88.375-38.688c13.798 5.572 25.08 16.555 29.875 31.157c4.796 14.6 2.836 32.303-7.375 50.312c-11.8 20.81-34.144 27.877-51.25 22.22c-8.552-2.83-16.22-9.437-18.875-18.876c-2.653-9.44-.142-20.366 7.063-31.313l15.594 10.282c-5.238 7.955-5.5 13.08-4.69 15.967c.813 2.888 2.84 4.895 6.75 6.188c7.822 2.587 21.483-.152 29.158-13.688c8.188-14.44 8.82-26.183 5.843-35.25c-2.976-9.066-9.846-15.954-19.092-19.687c-18.493-7.467-46.14-2.273-65.188 30.72c-14.024 24.29-14.373 45.376-6.72 63.436l2.814 4.375c-.197.13-.397.25-.594.376c.256.497.513 1.008.78 1.5a72 72 0 0 0 6.814 10.28c.1.13.21.25.312.377c.395.49.81.984 1.22 1.468c11.508 13.657 28.358 24.378 47.312 30.283c24.26 7.557 51.596 7.146 74.843-3.75s42.935-31.972 52.69-68.375c3.323-12.406 5.08-23.776 5.5-34.313c.01-.418.023-.832.03-1.25c.087-5.1-.088-10.246-.563-15.406c-.037-.407-.084-.814-.125-1.22c-.032-.27-.06-.544-.093-.813c-3.295-25.79-15.823-46.16-34.345-64.437c-29.635-29.24-75.698-51.638-122.75-74.125s-95.112-45.1-128.875-77.656c-31.683-30.553-49.926-71.185-40.313-124.814c-.72-.01-1.444-.006-2.156 0z'/%3E%3C/svg%3E");
    background: currentColor;
    -webkit-mask-image: var(--svg);
    mask-image: var(--svg);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

#bannerNumber::before {
    margin-right: 5px;
}

#bannerNumber::after {
    margin-left: 5px;
    transform: scaleX(-1);
}

/* & Episode resume popup */

.resumePopup {
    display: flex;
    background: var(--eggshell);
    padding: 10px;
    margin-top: -8px;
    border-radius: 0 0  20px 20px ;

    font-size: small;
    text-align: left;

    animation: resumePopupAttention .5s ease;
}

.resumePopupReset {
    background: var(--lavender-veil-2);
    border: 1px solid black;
    border-radius: 8px;

    font-family: 'Times New Roman', Times, serif;
    color: var(--regal-txt);
}

@keyframes resumePopupAttention {
    0% {
        transform: scale(.85);
        opacity: 0;
    }

    60% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

/* & Loading indicator */

#loadingIndicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    display: none;
}

#loadingIndicator.show {
    display: block;
}

.loader {
    width: 150px;
    height: 75px;
    border-radius: 100px 100px 0 0;
    position: relative;
    overflow: hidden;
}

.loader:before {
    content: "";
    position: absolute;
    inset: 0 0 -100%;
    background: radial-gradient(farthest-side at top, #0000 35%, var(--rainbowPurple), var(--rainbowPurple), var(--rainbowIndigo), var(--rainbowIndigo), var(--rainbowBlue), var(--rainbowBlue), var(--rainbowGreen), var(--rainbowGreen), var(--rainbowYellow), var(--rainbowYellow), var(--rainbowOrange), var(--rainbowOrange), var(--rainbowRed), var(--rainbowRed), #0000) bottom/100% 50% no-repeat;
    animation: l8 2s infinite;
}

@keyframes l8 {

    0%,
    20% {
        transform: rotate(0)
    }

    40%,
    60% {
        transform: rotate(.5turn)
    }

    80%,
    100% {
        transform: rotate(1turn)
    }
}