/*
    Plotato Engine license:
    Copyright 2021-2022 Shark in a Hat (shark_in_a_hat@protonmail.com)

    Permission to use, copy, modify, and/or distribute this software
    for any purpose with or without fee is hereby granted, provided
    that the above copyright notice and this permission notice
    appear in all copies.

    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
    WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
    WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
    THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
    CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
    NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
    CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

:root {
    --color_bg_gray: rgb(128, 128, 128);
    --color_bg_lightgray: rgb(166, 166, 168);
    --color_bg_darkgray: rgb(86, 86, 88);
    --color_gray40: rgba(200,200,200,0.4);
    --color_light: rgba(255, 255, 240, 1.0);
    --color_dim: rgb(225, 230, 225);
    --color_dark: rgb(48, 48, 48);
    --color_black90: rgba(0, 0, 0, 0.9);
    --color_black75: rgba(0, 0, 0, 0.75);
    --color_black70: rgba(0, 0, 0, 0.7);
    --color_black60: rgba(0, 0, 0, 0.6);
    --color_black50: rgba(0, 0, 0, 0.5);
    --color_black20: rgba(0, 0, 0, 0.2);
    --color_white90: rgba(255, 255, 255, 0.9);
    --color_white70: rgba(255, 255, 255, 0.7);
    --color_white50: rgba(255, 255, 255, 0.5);
    --color_scroll1: rgba(180, 180, 180,0.9);
    --color_scroll2: rgba(160, 160, 160,0.9);
    --color_green: rgba(60,200,75,0.9);
    --color_red: rgba(240,90,90,0.9);

    --color_choice_dark: rgba(75, 42, 58, 0.9);
    --color_choice_background: rgba(124, 68, 95, 0.9);
    --color_choice_border: rgba(200, 200, 200, 0.4);

    --color_text_pink: #ffc6d9;

    --color_main_background: rgba(43, 28, 40, 0.9);
    --color_panel_background: rgba(66, 43, 59, 0.9);
    --color_border: rgba(101, 70, 90, 0.95);

    --color_npc: #A6A6A6;
    --color_p0: #f2c94c;
    --color_p1: #F4C257;
    --color_p2: #F6BB62;
    --color_p3: #F7B36D;
    --color_p4: #F9AC78;
    --color_mai: #FF8EA4;
    --color_iris: #A78BFA;
    --color_prim: #FFADCF;
    --color_camellia: #FB923C;
    --color_sumire: #b782d2;
    --color_ren: #879EF5;
    --color_alyssa: #65C987;
    --color_dahlia: #C184A5;
    --color_aster: #A2CC69;
    --color_ollie: #F57972;
    --color_lupin: #36B9CC;
    

    --body_width: 96vw;
    --use_vh: 0;
    --padding_standard: 0.3em;
    --border_standard_width: 2px;
    --border_radius_high: 16px;
    --border_radius_menu: 10px;
    --border_radius_low: 3px;

    --font_base: 1.5em;
    --font_small: 1.3em;
}

/* Cool font, with good readability */
@font-face{
    font-family: "figtree";
    src:url('../font/Figtree[wght].ttf');
    font-weight: 675;
    font-display: block;
}
@font-face{
    font-family: "figtreebold";
    src:url('../font/Figtree-Black.otf');
    font-display: block;
}
@font-face{
    font-family: "daycard";
    src:url('../font/momo.otf');
    font-display: block;
}
@font-face{
    font-family: "storycan";
    src:url('../font/Storycan.otf');
    font-display: block;
}
/* Font Awesome (for icons) */
@font-face{
    font-family: "fa-solid-900";
    src:url('../font/fa-solid-900.ttf');
    font-display: block;
}

/*################################################################################################################################
## General Elements
################################################################################################################################*/

*, *::before, *::after {
    user-select: none;
    user-drag: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
    box-sizing: inherit;
}
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}
html {
    box-sizing: border-box;
}
body {
    background-color: var(--color_bg_darkgray);
    margin: 0;
    color:  var(--color_light);
    letter-spacing: 0.01em;
}
img, a {
    user-drag: none;
    -webkit-user-drag: none;
}
img {
    pointer-events: none;
}

/* Scrollbar style for firefox */
* {
    scrollbar-width: auto;
    scrollbar-color: var(--color_scroll1) var(--color_black20);
}
/* Scrollbar style for chrome, edge, and safari */
/* width */
::-webkit-scrollbar {
  width: 8px;
}
/* Track */
::-webkit-scrollbar-track {
  border-radius: 10px;
}
/* Handle */
::-webkit-scrollbar-thumb {
  background: var(--color_scroll1);
  border-radius: 10px;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: var(--color_scroll2);
}

/* Links */
a {
  color: var(--color_green);
}
a:visited {
  color: var(--color_green);
}
a:hover {
  text-shadow: 0 0 1px rgba(220,220,220,0.5);
}

/* Drop down style */
select {
    color: var(--color_light);
    font-size: 100%;
    font-family: figtree;
    white-space: nowrap;
    padding: 1px 5px;
    background-color: var(--color_white90);
    border-style: none;
    border-radius: 3px;
    margin: 2px;

    cursor: pointer;
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;

    background-repeat: no-repeat;
    background-size: 3em auto;
    background-position: right 0.5em center;
    background-image: url('../img/svg/triangle.svg');
}

input[type="text"] {
    font-size: 100%;
    font-family: figtree;
}
/*Hide the file input thing, so we can actually style it...*/
input[type="file"] {
    display: none;
}
input[type="text"]::selection {
    background-color: lightblue;
}
textarea::selection {
    background-color: lightblue;
}

/*################################################################################################################################
## Miscellaneous Elements
################################################################################################################################*/
/* Scrollable container, used all over the place*/
.scrollable {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

/* Placeholder, needed for proper positioning */
.container {
    position: absolute;       /* absolute to center inside body */
    top: 50%;
    left: 50%;
    width: calc(100vh * 16 / 9);  /* try to fill height first */
    height: calc(100vw * 9 / 16); /* try to fill width first */
    max-width: 100vw;        /* never exceed viewport */
    max-height: 100vh;       /* never exceed viewport */
    transform: translate(-50%, -50%); /* center it */
    overflow: hidden;
    user-select: none;
    user-drag: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
}

/* Credit text */
.credits {
    position: absolute;
    top: 15%;
    left: 0;
    width: 100%;
    text-align: center;
    font-family: figtree;
    font-size: 280%;
    color: var(--color_light);
    text-shadow: 1px 1px 5px black;
    pointer-events: none;
    animation-name: fade_in_out;
    animation-duration: 4000ms;
    animation-iteration-count: 1;
    opacity: 0.0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Font Awesome icons*/
.icon_aws {
    margin:0 5px;
    padding:0;
    display: inline-block;
    background-color: transparent;
    text-shadow: 0 0 1em black;
    border: none;
    font-size: 125%;
    color:  var(--color_white90);
    border-radius: 10px;
    font-family: fa-solid-900;
    cursor: pointer;
}
.icon_button_aws {
    width: 1.3em;
    height: 1.3em;
    padding: 0;
    display: inline-flex;
    background-color: transparent;
    text-shadow: 0 0 3px black;
    border: none;
    font-size: 125%;
    color: var(--color_white90);
    border-radius: 10px;
    font-family: fa-solid-900;
    cursor: pointer;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
}
.icon_button_aws.small {
    width: 1em;
    height: 1em;
}
.settings_icon {
    cursor: default;
    width: 1em;
}

/* H1 used for loading text*/
h1{
    text-align: center;
    font-family: figtree;
}

.selectable{
    word-break: break-all;
    padding: 1em;
}
.selectable::selection {
    background-color: yellow;
}

/* Timeout Text */
.load_timeout {
    pointer-events: none;
    color: transparent;
    animation-name: delay_vis;
    animation-duration: 12000ms;
    animation-fill-mode: forwards;
}
@keyframes delay_vis {
  0% {color:transparent;}
  90% {color:transparent;}
  100% {color:var(--color_light);}
}

/* Portrait mode warning*/
.portrait_mode {
    display: none;
}
@media (orientation: portrait) {
    .portrait_mode{
        display: block;
        width: 90%;
        margin: 1em;
        text-align: center;
        font-family: figtree;
        font-size: 3.5vh;
        text-shadow: 0 0 5px black;
        cursor: default;
    }
}
@media (min-aspect-ratio: 16/9) {
    :root {
    --body_width: 170vh;
    --use_vh: 1;
    }
}

/* Spin animation for loading spinner*/
@keyframes rotate360 {
  to {transform: rotate(-360deg);}
}
/* Animation for phone icon*/
@keyframes rotate90 {
  75%  {transform: rotate(95deg);}
  100%  {transform: rotate(90deg);}
}

#top_text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* centers both horizontally and vertically */

    font-size: 400%;
    font-weight: bold;
    font-family: daycard;
    color: white;

    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    z-index: 1;

    pointer-events: none;
    text-align: center; /* keeps multi-line text centered */
}

/*################################################################################################################################
## Start / Age Overlays
################################################################################################################################*/
.logo_overlay, .adult_overlay {
    position: fixed;
    inset: 0;
    background: black;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 5;
    cursor: default;
}
.logo_overlay {
    z-index: 6;
}
.logo_content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    /* animation */
    opacity: 0;
    transform: scale(0.9);
    animation: fadeInScale 1s ease-out forwards;
}
.adult_content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1em;

    /* animation */
    opacity: 0;
    transform: scale(0.95);
    animation: fadeInScale 0.8s ease-out forwards;
}
.adult_text {
    font-family: figtree;
    text-align: center;
    font-size: 5vmin;
    color: white;
    width: 50%;
}

.logo_hat, .logo_star, .logo_text {
    width: 30vmin;
}
.logo_star {
    position: absolute;
    transform-origin: 85% 23%;
    animation: starShake 3s ease-in-out forwards;
}
.logo_text {
    position: absolute;
    opacity: 0;
    transform: translateY(15px);
    animation: textFadeUp 2s ease-out forwards;
    animation-delay: 0.1s; /* optional, so it comes after the hat */
}
.adult_warning {
    width: 20vmin;
}

/* Keyframes */
@keyframes fadeInScale {
    to {
        opacity: 1;
        transform: scale(1);
    }
}
@keyframes textFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes starShake {
  0%   { transform: rotate(0deg); }
  15%  { transform: rotate(8deg); }
  35%  { transform: rotate(-6deg); }
  55%  { transform: rotate(4deg); }
  75%  { transform: rotate(-2deg); }
  100% { transform: rotate(0deg); }
}

/*################################################################################################################################
## Monetize Elements
################################################################################################################################*/

/* All four link buttons*/
.monetize {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    display: flex;
    justify-content: space-between;
}
.circle_btn {
    position: relative;
    background: none;
    box-shadow: none;
    width: 16%;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}
/* Just the Patreon link button centered */
.patreon_plug {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7%;
    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%);
    pointer-events: auto;
}

.patreon_plug .circle_btn {
    width: 100%;
    height: 100%;
}
.circle_btn img{
    position: absolute;
    width: 100%;
    height: 100%;
    transition: 
        filter 0.2s ease,
        transform 0.2s ease,
        opacity 0.2s ease;
}
/* Base button icon */
.circle_btn .buttons{
    opacity: 1;
}
/* Line overlay starts hidden */
.circle_btn .ero_lines{
    opacity: 0;
    transform: scale(1.5);
}
/* Show lines on hover */
.circle_btn:hover .ero_lines{
    opacity: 1;
    transform: scale(1.85);
}
/* Click press effect */
.circle_btn:active{
    transform: scale(0.95);
}

/* Glow effects */
.patreon:hover .buttons{
    filter:
        drop-shadow(0 0 8px #f96854)
        drop-shadow(0 0 18px #f96854);
    transform: scale(1.1);
}
.itchio:hover .buttons{
    filter:
        drop-shadow(0 0 8px #fa5c5c)
        drop-shadow(0 0 18px #fa5c5c);
    transform: scale(1.1);
}
.discord:hover .buttons{
    filter:
        drop-shadow(0 0 8px #7289DA)
        drop-shadow(0 0 18px #7289DA);
    transform: scale(1.1);
}
.subscribestar:hover .buttons{
    filter:
        drop-shadow(0 0 8px #ff4081)
        drop-shadow(0 0 18px #ff4081);
    transform: scale(1.1);
}

/* Pulsing effect on the buttons*/
@keyframes cutePulse {
    0%   { transform: scale(1) rotate(0deg); }
    25%  { transform: scale(1.04) rotate(1deg); }
    50%  { transform: scale(1) rotate(0deg); }
    75%  { transform: scale(1.04) rotate(-1deg); }
    100% { transform: scale(1) rotate(0deg); }
}
.circle_btn{
    animation: cutePulse 6s ease-in-out infinite;
}

/*################################################################################################################################
## Generic Modal Element
################################################################################################################################*/

/* Modal dialog box */
.click_anywhere {
    position: fixed;
    z-index: 4;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    cursor: pointer;
}
.modal {
    position: fixed;
    z-index: 4;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: var(--color_black60);
    backdrop-filter: blur(4px);

    display: flex;
    align-items: center;    /* vertical centering */
    justify-content: center; /* horizontal centering */
    padding: 0;
}
.modal_content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;

    background: var(--color_choice_background);
    color: var(--color_light);
    border-radius: 10px;
    border-style: solid;
    border-width: var(--border_standard_width);
    border-color: var(--color_white70);
    text-shadow: 0 0 3px black;
    font-family: figtree;
    font-size: 150%;
    text-align: center;
    overflow: hidden;
    padding: 1em;
    margin: auto;
}
.modal_buttons {
    display: flex;
    gap: 0.2em;
}
.modal_button {
    width: 5em;
    font-size: 100%;
    font-family: figtree;
    color:  var(--color_black90);
    background-color: var(--color_white90);
    padding: 2px;

    border: none;
    border-radius: 3px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
}
.modal_button:active {
    transform: translate(0, 1px);
}

.cfg_button{
    width: 3em;
    font-size: 100%;
    font-family: figtree;
    display: block;
    color:  var(--color_black90);
    background-color: var(--color_white90);
    padding: 2px;
    border: none;
    border-radius: 3px;
    text-decoration: none;
    text-shadow: none;
    text-align: center;
    cursor: pointer;
}
.cfg_button:active{
    transform: translate(0, 1px);
}

/*################################################################################################################################
## Relationship Modal Element
################################################################################################################################*/
.relationship_panel{
    flex: 0 0 auto;          /* prevent stretching */
    width: 65%;
    height: 65%;
    position: relative;
    display: flex;
    flex-direction: column;
    margin: auto;
}
.relationship_menu {
    display: flex;
    width: 100%;
    height: 100%;
    border: solid var(--color_border);
    border-radius: 16px;
    overflow: hidden;
    font-size: 150%;
    font-family: figtree;
}

/* ===== LEFT: Scrollable Character List ===== */
.relationship_list {
    width: 30%;
    background: var(--color_main_background);
    padding: 1em;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.character_header {
    font-size: 150%;
    margin-bottom: 20px;
    text-align: center;
    color: #ffc6d9;
}
.character_list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    min-height: 0;
}
.character {
    padding: 0.5em;
    margin-bottom: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.character:hover {
    background: var(--color_panel_background);
}
.character.active {
    background: var(--color_choice_background);
}

/* ===== MIDDLE: Character Picture Column ===== */
.profile_image {
    width: 30%;
    height: 100%;
    object-fit: contain;
    object-position: bottom;
    background: var(--color_panel_background);
}

/* ===== RIGHT: Character Info Column ===== */
.relationship_profile {
    width: 40%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--color_panel_background);
}
.profile_header {
    text-align: center;
    border-bottom: 2px solid var(--color_border);
    flex-shrink: 0;
}
.profile_name {
    font-size: 150%;
    color: #F5EFF7;
}

/* Hearts */
.profile_hearts {
    font-size: 125%;
    margin-bottom: 6px;
}
.profile_heart {
    margin: 0 2px;
}
.profile_heart.filled {
    color: #FF75AE;
}
.profile_heart.half {
    background: linear-gradient(to right, #FF75AE 50%, rgba(255,255,255,0.2) 50%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}
.profile_heart.empty {
    color: rgba(255,255,255,0.2);
}

/* Profile info rows */
.profile_info {
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    overflow-y: auto;
    min-height: 0;
}
.info_row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 2px solid var(--color_border);
}
.info_label {
    opacity: 0.7;
    flex-shrink: 0;    /* label stays fixed width */
    width: 5em;        /* adjust to fit longest label */
}
.info_value {
    color: #ffbcd6;
    flex: 1;                 /* takes remaining space */
    text-align: right;        /* right-align text */
    white-space: normal;      /* allows wrapping if too long */
    overflow-wrap: break-word; /* breaks long words */
}

/* Likes/Dislikes lists */
.profile_likes ul,
.profile_dislikes ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.profile_likes li,
.profile_dislikes li {
    padding: 4px 0;
    opacity: 0.9;
}

/* Soft scrollbar for right panel */
.profile_info::-webkit-scrollbar {
    width: 6px;
}
.profile_info::-webkit-scrollbar-thumb {
    background: rgba(255, 105, 180, 0.4);
    border-radius: 6px;
}

/*################################################################################################################################
## Modding Element
################################################################################################################################*/
.mod_menu{
    background-color: var(--color_dark);
    padding: 0.5em 2em;
    margin-bottom: 5px;
    border-radius: 10px;
    box-shadow: 3px 3px 5px var(--color_black50);
    font-family: figtree;
    font-size: 120%;
    color:  var(--color_light);
    text-shadow: 0 0 3px black;
    text-align: center;
}

.mod_button{
    font-size: 100%;
    color:  var(--color_black90);
    background-color: lightgray;
    padding: 0.4em 1.0em;
    margin: 5px;
    border: solid black 1px;
    border-radius: 3px;
    text-decoration: none;
    font-family: figtree;
    text-align: center;
    text-shadow: none;
    cursor: pointer;
}
.mod_button:active{
    transform: translate(0, 1px);
}

.mod_div{
    border: solid black 1px;
    border-radius: 3px;
    background-color: var(--color_bg_darkgray);
    padding: 0.5em 0.5em 1em 0.5em;
    margin: 0.2em;
}

/*################################################################################################################################
## History Element
################################################################################################################################*/
.menu_header{
    font-size: 1.5em;
    color:  var(--color_text_pink);
    text-align: center;
}
.history_content{
    background-color: var(--color_panel_background);
    padding: 1em;
    border: solid var(--color_border);
    border-radius: 10px;
    font-family: figtree;
    color: var(--color_light);
    text-shadow: 0 0 3px black;
    width: 65%;
    height: 65%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}
.history_txt{
    font-size: var(--font_small);
    margin: 0.5em;
    padding-right: 20px;
    white-space: pre-wrap;
    word-wrap: break-word;

    flex: 1;              /* fills available space */
    overflow-y: auto;     /* ONLY this scrolls */
}

/*################################################################################################################################
## TTS Element
################################################################################################################################*/
.tts_config{
    background-color: var(--color_panel_background);
    padding: 1em;
    border: solid var(--color_border);
    border-radius: 10px;
    font-family: figtree;
    color:  var(--color_light);
    text-shadow: 0 0 3px black;
    max-height: 65%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.tts_voices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, auto);
    gap: 10px;
    overflow-y: auto;
}
.tts_voice {
    box-sizing: border-box;
    min-width: 0;
    margin: 0;
    padding: 12px 10px;
    border-top: 3px solid var(--color_border);
    white-space: normal;
}
.tts_name_tag {
    display: block;
    margin-bottom: 6px;
    font-size: 1.5em;
    font-weight: bold;
    text-align: left;
}
.tts_voice select {
    font-size: 1.3em;
    width: 100%;
}
.tts_slider {
    width: 100%;
    flex: 1;
    min-width: 0;
}
.tts_slider_row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 5px 0;
}
.tts_slider_row label {
    width: 3em;
    font-size: 1.3em;
    flex-shrink: 0;
}
.tts_button{
    width: 6em;
    font-size: 1.5em;
    font-family: figtree;
    color:  var(--color_black90);
    background-color: var(--color_white90);
    padding: 2px;
    margin: 0.1em auto;
    display: block;
    border: none;
    border-radius: 3px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
}
.tts_button:active{
    transform: translate(0, 1px);
}
.tts_txt{
    font-size: 1.3em;
    margin: 0.5em;
}

/*overlay for color splash effects, FF has no backdrop-filter support so just use for color effect*/
.overlay{
    width: 100%;
    height: 100%;
    top: 0;
    position: absolute;
    animation-name: no_anim;
    animation-iteration-count: 1;
    animation-timing-function: ease-in-out;
    opacity: 0.0;
    pointer-events: none;
}
/* Main image but larger, scrolling from top to bottom, also used for parallax effect  */
.overscroll_img_y {
    width: 100%;
    height: calc(var(--body_width) * 0.5625);
    position: absolute;
    object-fit: cover;
    object-position: 0% 0%;
    animation-name: scroll_y;
    animation-delay: 300ms;
    animation-duration: 15000ms;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    animation-direction: alternate;
}
@keyframes scroll_y {
  0% {
    object-position: 100% 0%;
  }
  100% {
    object-position: 100% 100%;
  }
}
/* Main image but larger, scrolling from left to right, also used for parallax effect  */
.overscroll_img_x {
    position: absolute;
    width: calc(var(--body_width));
    height: calc(var(--body_width) * 0.5625);
    object-fit: cover;
    object-position: 0% 0%;
    animation-name: scroll_x;
    animation-duration: 12000ms;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    animation-direction: alternate;
}
@keyframes scroll_x {
  0% {
    object-position: 0% 100%;
  }
  100% {
    object-position: 100% 100%;
  }
}

/* Main image is the main image, d'uh */
.main_img {
    width: 100%;
    height: auto;
    position: absolute;
    animation-name: fade_in;
    animation-duration: 500ms;
    animation-iteration-count: 1;
    animation-timing-function: ease-in-out;
    pointer-events: none;
}

/* image overlayed on top of all other imgs (also on top of pc/npc ) */
.imgs_overlay {
    width: 100%;
    height: auto;
    position: absolute;
    left: 0;
    top: 0;
}
.overlay_blend_screen {
    width: 100%;
    height: auto;
    position: absolute;
    mix-blend-mode: screen;
}

.overlay_normal {
    width: 100%;
    height: auto;
    position: absolute;
}

/* fade-in used for main img cross fade*/
@keyframes fade_in {
  from {opacity: 0.0;}
  to   {opacity: 1.0;}
}

/* fade-out used for overlay/splash effect*/
@keyframes fade_out {
  from {opacity: 1.0;}
  to   {opacity: 0.0;}
}

@keyframes fade_in_out {
  0% {opacity: 0.0;}
  10% {opacity: 1.0;}
  80% {opacity: 1.0;}
  100%   {opacity: 0.0;}
}

/*################################################################################################################################
## Main Text
################################################################################################################################*/
/* Main text container, at the bottom */
.main_txt {
    contain: layout;
    position: absolute;
    bottom: 3em;
    left: 50%;
    width: 90%;
    max-width: 100ch;
    max-height: 40%;
    /*min-height: 6em;*/
    min-height: auto;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translate(-50%, 0%);
    background-color: var(--color_black75);
    /*padding: 0.5em 2.5em 2.5em 1.5em;*/
    padding: 1.6em 3em 1.9em 1.6em;

    border-radius: 10px;
    cursor: pointer;
    animation-name: no_anim;
    animation-duration: 300ms;
    animation-iteration-count: 1;
    animation-direction: alternate;
    animation-timing-function: ease-in-out;
    backdrop-filter: blur(4px);
    z-index: 2;
}

/* Text change may not always be obvious,
 *  so we need to draw attention to the monkey part of the brain with motion */
@keyframes popin {
  0% {transform: translate(-50%, 0%) scale(1.0) ;}
  33% {transform: translate(-50%, 0%) scale(1.02) ;}
  66% {transform:  translate(-50%, 0%) scale(0.98) ;}
  100% {transform:  translate(-50%, 0%) scale(1.0) ;}
}

/* pre is used for the main text to add newlines if needed without extra markup*/
/* max-height used for stupid mobile browsers changing font size*/
pre {
    margin: 0;
    font-family: figtree;
    font-size: 160%;
    color:  var(--color_light);
    text-shadow: 0 0 3px black;
    white-space: pre-wrap;
    word-wrap: break-word;
    pointer-events: none;
    -webkit-font-smoothing: antialiased;
}

.txt_hide_ico{
    font-size: 1.6em;
    padding-top: 0.3em;
    display: inline-block;
    text-shadow: 0 0 1em black;
    border: none;
    color: var(--color_gray40);
    font-family: fa-solid-900;
    cursor: pointer;
    height: 1.5em;
    width: 2em;
    text-align: center;
    position: absolute;
    top: 0;
    right:0;
}

/* Used only for the pointing arrow on main text box*/
.arrow_anim{
    font-size: 180%;
    font-family: fa-solid-900;
    pointer-events: none;
    position: absolute;
    top:55%;
    transform: translate(0, -50%);
    right: 1em;
    color: var(--color_gray40);
    text-shadow: 0 0 3px rgba(0,0,0,0.2);
    animation-duration: 500ms;
    animation-iteration-count: infinite;
    animation-direction: alternate;
    animation-timing-function: ease-in-out;
    animation-name: wobble;
}
@keyframes wobble {
  from {right: 1em;}
  to {right: 0.5em;}
}

/*################################################################################################################################
## Error Message
################################################################################################################################*/
/* Error msg */
#error_box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 7; /* make sure it's above UI */

    display: flex;
    flex-direction: column;
    align-items: center;
}
.error_txt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;

    color: red;
    background-color: black;
    border-radius: 2px;
    padding: 1em;
    border: solid yellow;
    font-family: figtree;
    font-size: 1.5em;
    text-align: center;

    user-select: text;
    -webkit-user-select: text;
}

.error_txt::selection {
    background-color: yellow;
}

/* Buttons for controls */
.cfg_button{
    width: 3em;
    font-family: figtree;
    display: block;
    color:  var(--color_black90);
    background-color: var(--color_white90);
    padding: 2px;
    margin: 2px auto;
    border: none;
    border-radius: 3px;
    text-decoration: none;
    text-shadow: none;
    text-align: center;
    cursor: pointer;
}
.cfg_button:active{
    color: var(--color_black90);
    transform: translate(0, 1px);
}
.cfg_button:visited {
    color: var(--color_black90);
}
.cfg_button:hover {
    color: var(--color_black90);
}

.err_button{
    font-size: 100%;
    font-family: figtree;
    display: block;
    color:  black;
    background-color: red;
    padding: 2px 1em;
    margin: 2px auto;
    border: none;
    border-radius: 3px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
}
.err_button:active{
    transform: translate(0, 1px);
}

.script_button{
    font-size: 100%;
    display: block;
    color:  var(--color_black90);
    background-color: lightgray;
    padding: 2px;
    margin: 5px;
    border: solid black 1px;
    border-radius: 3px;
    text-decoration: none;
    font-family: figtree;
    text-align: center;
    cursor: pointer;
}
.script_button:active{
    transform: translate(0, 1px);
}

/*################################################################################################################################
## Choice Buttons
################################################################################################################################*/
/* Choice buttons*/
.choice_box{
    display: flex;
    flex-flow: column wrap;
    position: absolute;
    top: 1.1em;
    max-height: 65%;
    width: 100%;
    padding: 0 2em;
    gap: 0.3em;
    z-index: 3;
}
.choice_button{
    min-width: 40%;
    
    height: 2.2em;
    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 150%;
    color:  var(--color_light);
    background-color: var(--color_choice_dark);
    padding: 0.4em 1.6em;
    margin: 0 auto;
    border-radius: 10px;
    border: 3px solid var(--color_choice_border);
    font-family: figtree;
    text-align: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    text-shadow: 0 0 10px black;
}
.choice_button:active{
    transform: translate(0, 2px);
}
.choice_button:hover{
    background-color: var(--color_choice_background);
}

/*################################################################################################################################
## Outfits Element
################################################################################################################################*/
.dropdown_top {
    background-image: url('../img/svg/shirt_triangle.svg');
}
.dropdown_bra {
    background-image: url('../img/svg/bra_triangle.svg');
}
.dropdown_accessory {
    background-image: url('../img/svg/neck_triangle.svg');
}
.dropdown_bottom {
    background-image: url('../img/svg/pants_triangle.svg');
}
.dropdown_panties {
    background-image: url('../img/svg/panties_triangle.svg');
}
.dropdown_socks {
    background-image: url('../img/svg/socks_triangle.svg');
}

/* Shared dropdown styles */
.dropdown, .dropdown:focus {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    font-family: figtree;
    color: var(--color_dark);
    background-color: var(--color_light);
    border: 2px solid var(--color_white70);
    border-radius: 10px;
    padding: 0.2em 0 0.2em 0.5em;
    margin-top: 0.2em;
    margin-bottom: 0.5em;
    text-align: left;
    text-align-last: left;
    cursor: pointer;
    outline: none;
}
.dropdown:hover {
    border-color: rgba(0,0,0,0.35);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.dropdown:disabled {
    background-color: var(--color_black50);
    color: var(--color_gray50);
    cursor: not-allowed;
}
.dropdown_filter .dropdown_filter:focus {
    width: 100%;
}

/*################################################################################################################################
## Shop / Wardrobe
################################################################################################################################*/
.clothing_panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    align-items: stretch;
    padding: 0.5em;
}
/*Buttons for the shop/wardrobe  */
.shop_button,
.outfit_button,
.outfit_button_wide {
    width: 100%;
    box-sizing: border-box;   /* important! */
    display: block;
    font-size: 100%;
    color: var(--color_light);
    text-shadow: 0 0 3px black;
    background-color: var(--color_choice_background);
    padding: 0.4em 1.6em;     /* now this works */
    margin: 0.2em auto;
    border-radius: 10px;
    border: 2px solid var(--color_gray40);
    font-family: figtree;
    text-align: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
}
.shop_button:hover,
.outfit_button:hover,
.outfit_button_wide:hover {
    border-color: var(--color_white90);
    filter: brightness(1.3);
}
.shop_button:active,
.outfit_button:active,
.outfit_button_wide:active {
    transform: translate(0, 2px);
}

#outfit_add, #shop_close {
    color: var(--color_text_pink);
    border-color: var(--color_white70);
}

/*################################################################################################################################
## Outfits
################################################################################################################################*/
.outfit_row {
    position: relative;      /* container for absolute delete button */
    width: 100%;
    display: flex;           /* make row a flex container */
    align-items: center;     /* vertically center everything in the row */
    margin-bottom: 0.2em;
    margin-top: 0.2em;
}
.outfit_button {
    display: flex;                  /* make button a flex container */
    justify-content: center;        /* horizontal centering */
    align-items: center;            /* vertical centering */
    width: 100%;
    padding: 0.4em 1.6em;
    margin: 0;
    box-sizing: border-box;
    font-size: 100%;
    font-family: figtree;
    text-align: center;             /* fallback for old browsers */
    line-height: normal;
    color: var(--color_light);
    text-shadow: 0 0 3px black;
    background-color: var(--color_choice_background);
    border-radius: 10px;
    border: 2px solid var(--color_gray40);
    cursor: pointer;
    backdrop-filter: blur(4px);
    position: relative;
}
.outfit_button:active + .del_outfit_button {
    transform: translateY(2px); /* move down slightly */
}
.del_outfit_button {
    position: absolute;      /* float over the row */
    right: 0em;           /* distance from right edge */
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;     /* center icon vertically */
    justify-content: center; /* center icon horizontally */
    font-family: fa-solid-900;
    font-size: 1.2em;
    color: var(--color_light);
}
.del_outfit_button:hover {
    color: var(--color_red);
}
/* Make the container of buttons a flex row */
#outfits {
    display: flex;
    flex-direction: column;   /* stack outfit rows vertically */
}

/* Target each pair of buttons */
#outfits button.outfit_button,
#outfits button.del_outfit_button {
    display: inline-flex;     /* allow inline alignment */
    vertical-align: middle;
}

/* make the outfit button fill remaining space */
#outfits button.outfit_button {
    flex: 1 1 auto;           /* grow to fill row */
    width: auto;              /* override 100% */
}

/* make the delete button shrink to content */
#outfits button.del_outfit_button {
    flex: 0 0 auto;           /* don’t grow */
    width: auto;
    padding: 0.4em 0.8em;     /* smaller than wide button */
    margin-left: 0.5em;       /* space from outfit button */
}

/*################################################################################################################################
## Shop
################################################################################################################################*/
.shop_button {
    /* image display */
    background-size: contain;  /* size of item icon */
    background-repeat: no-repeat;
    background-position-x: 5%;   /* push image a bit from left edge */
    background-position-y: center; /* vertical center */
}

.inventory_slots {
    display: block; /* ensures plain text displays inside scrollable */
    text-align: left;
    color: var(--color_light);
    padding-left: 0.1em; /* small buffer */
    padding-right: 0.1em; /* small buffer */
}

/* Placeholder for even spaced elements*/
.flex_spacer{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0.3em 0;
}
/* Labels in the shop/wardrobe screen with optional icons */
.shop_header {
    font-family: figtree;
    color: var(--color_light);
    text-shadow: 0 0 3px black;
}
.shop_header::before {
    font-size: 80%;
    content: attr(data-icon_before);
    font-family: fa-solid-900;
    font-weight: 900;
}
.shop_header::after {
    font-size: 80%;
    content: attr(data-icon_after);
    font-family: fa-solid-900;
    font-weight: 900;
}
.shop_label {
    font-family: figtree;
    color: var(--color_light);
    text-shadow: 0 0 3px black;
}
/* Blinking text for the shop money and lewdness */
.blinker{
    font-family: figtree;
    color: var(--color_light);
    animation-name: no_anim;
    animation-duration: 150ms;
    animation-iteration-count: 2
}
/* keyframes for blinking text*/
@keyframes no_anim {
}
@keyframes blink_red {
  from {color: var(--color_light);}
  to {color: red;}
}
@keyframes blink_green {
  from {color: var(--color_light);}
  to {color: var(--color_green);}
}

/*################################################################################################################################
## Wardrobe
################################################################################################################################*/
.pinned_section {
    flex-shrink: 0;
    padding-top: 0.5em;
    border-top: 1px solid var(--color_gray40); /* optional separator */
}
#inventory_slots select {
    width: 100%;
}

/* Grid -used for shop/wardrobe layout */
.grid {
  position: absolute;
  top: 1em;
  right: 1em;
  width: 70%;
  height: calc(100% - 2em);
  display: grid;
  gap: 0.6em;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: 3fr 5fr;
  grid-template-areas:
    'left right_top'
    'left right_bottom';
}
/* ..more for the grid*/
.grid_box {
    background-color: var(--color_main_background);
    border-radius: 10px;
    color:  var(--color_light);
    text-shadow: 0 0 3px black;
    font-family: figtree;
    font-size: 150%;
    text-align: center;
    overflow: hidden;
    backdrop-filter: blur(4px);
    padding: 0.5em 0.5em;
}
/* Placeholder for positioning elements near the centre */
.center {
    position: absolute;
    top: 4%;
    left: 50%;
    transform: translate(-50%, 0);
    width: 40%;
}

/* Placeholder for positioning elements in the left top corner */
.top_left {
    position: absolute;
    top: 6px;
    left: 6px;
}

/*################################################################################################################################
## Status and Stats
################################################################################################################################*/
.status, .dream_status {
    position: absolute;
    bottom:0.5em;
    left: 0.6em;
    font-size: 1.4em;
    font-family: figtree;
    color:   var(--color_light);
    cursor: default;
    text-shadow:
        -1px 0px 1px black,
        0px -1px 1px black,
        0px 1px 1px black,
        1px 0px 1px black,
        -2px -2px 4px var(--color_black70),
        2px -2px 4px var(--color_black70),
        -2px 2px 4px var(--color_black70),
        2px 2px 4px var(--color_black70);
}
.stats {
    position: absolute;
    bottom: 0.5em;
    right: 0.6em;
    font-size: 1.4em;
    font-family: figtree;
    color: var(--color_light);
    cursor: default;
    text-shadow:
        -1px 0px 1px black,
        0px -1px 1px black,
        0px 1px 1px black,
        1px 0px 1px black,
        -2px -2px 4px var(--color_black70),
        2px -2px 4px var(--color_black70),
        -2px 2px 4px var(--color_black70),
        2px 2px 4px var(--color_black70);
}
.stat {
    position: relative;
    cursor: help;
}
.stat_tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 80%;
    color: var(--color_light);
    white-space: nowrap;
    z-index: 3;
}
    
.stat:hover .stat_tooltip {
    display: block;
}

/*################################################################################################################################
## Settings Menu
################################################################################################################################*/
/* Settings panel */
details > summary {
  cursor: pointer;
  list-style: none;
}
details > summary::-webkit-details-marker {
  display: none;
}

.left_corner {
    position: absolute;
    top: 0.5em;
    left: 0.5em;
    display: flex;
    align-items: flex-start;
    gap: 0.3em;
    z-index: 3;
}
.right_corner {
    position: absolute;
    top: 0.5em;
    right: 0.5em;
    display: flex;
    align-items: flex-start;
    gap: 0.3em;
    z-index: 3;
}
.settings_panel {
    font-size: 1em;
    display: flex;
    flex-direction: column;
    gap: 0.6em;
    margin: 0.2em 0.4em 0.4em 0.4em;
}
.settings_row {
    display: flex;
    align-items: center;
    gap: 0.2em;
}
.buttons {
    display: flex;
    gap: 0.2em;
}
.settings_panel::before {
    position: absolute;
    content: 'v0.1.0';
    transform: translate(1.6em, -1.45em);
    pointer-events: none;
}
.top_button {
    flex: 1;
    text-align: center;
}
.settings_label {
    width: 3em;
    flex-shrink: 0;
}
.hslider {
    flex: 1;
}
.settings_group {
    display: flex;
    align-items: center;
    gap: 0.6em; /* space between label and button cluster */
    width: 100%;
}
.settings_buttons {
    display: flex;
    gap: 0em;
}
.settings_group .settings_label{
    width: auto;
}
.settings_reset_button {
    margin-left: auto;
}

.settings_local_saves{
    display: flex;
    flex-direction: column;
    gap: 0.2em;
}
.settings_slot{
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.slot_number{
    width: 2em;
    vertical-align: middle;
}
.slot_name{
    max-width: 10em; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle; 
}
.slot_actions{
    display: flex;
    gap: 0.25em;
}

/*################################################################################################################################
## UI Buttons (history, rollback, cheats, relationship)
################################################################################################################################*/
.ui_button {
    border: none;
    outline: none;
    box-shadow: none;
    font-family: figtree;
    font-size: 150%;
    color:  var(--color_white70);
    background-color: var(--color_black70);
    padding: var(--padding_standard);
    border-radius: var(--border_radius_menu);
    backdrop-filter: blur(4px);
}

.ui_close {
    position: absolute;
    top: 0.5em;
    right: 0.5em;
    margin: 0;
}

/*################################################################################################################################
## Questlog Menu
################################################################################################################################*/
.questlog{
    text-align: right;
}
.questlog_panel{
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    margin: 0.2em 0.4em 0.4em 0.4em;
}
.questlog_text{
    font-size: 1em;
    width: 12.5em;
    text-align: left;
    max-height: calc(var(--body_width) * 0.3);
    overflow-y: auto;
    overflow-x: hidden;
}
.questlog_text::before{
    font-size: 1em;
    position: absolute;
    content: 'YOUR TO-DO LIST:';
    transform: translate(0, -1.4em);
    pointer-events: none;
}
.task::before{
    content: '\f0da';
    font-family: fa-solid-900;
    font-weight: 900;
    font-size: 90%;
    margin-right: 5px;
}

/* sliders color */
input[type="range"] {
    accent-color: var(--color_green);
}

/*################################################################################################################################
## Map Markers
################################################################################################################################*/
.map_marker_left{
    font-size: 140%;
    position: absolute;
    color:  var(--color_light);
    text-shadow:
        1px 1px 2px black,
        -1px -1px 2px black,
        -1px 1px 2px black,
        1px -1px 2px black,
        0px 8px 8px var(--color_black70);
    font-family: figtree;
    transform: translate(0, -100%);
    white-space: pre;
    cursor: pointer;
    backface-visibility: hidden;
}
.map_marker_left::before {
    content: attr(data-icon);
    font-family: fa-solid-900;
    font-weight: 900;
    margin-right: 0.2em;
}

/*################################################################################################################################
## Player and NPC Images
################################################################################################################################*/
.npc_img {
    width: 25%;
    height: auto;
    position: absolute;
    right: 0;
    bottom: 0;
    transform: translateY(1%);
}
.pc_img_wet {
    width: 100%;
    height: auto;
    position: absolute;
    left: 0;
    bottom: 0;
    mix-blend-mode: soft-light;
}

/* PC image*/
.pc_img {
    width: 100%;
    height: auto;
    position: absolute;
    left: 0;
    bottom: 0;
}
.pc_imgs {
    width: 25%;
    height: 100%;
    position: absolute;
    left: 0;
    bottom: 0;
    pointer-events:none;
    transform: translateY(1%);
}

/* Nuke all anims if user has reduce motion set*/
@media (prefers-reduced-motion: reduce) {
    @keyframes cutePulse{}
    @keyframes wobble {}
    @keyframes popin {}
    @keyframes rotate360 {}
    @keyframes rotate90 {}
    @keyframes scroll_y {}
    @keyframes scroll_x {}
    @keyframes drug{}
    @keyframes scroll_up_right {}
    @keyframes scroll_up_left {}
    @keyframes blink_green {
      from {color: green;}
      to {color: green;}
    }
    @keyframes blink_pink {
      from {color: pink;}
      to {color: pink;}
    }
    @keyframes fade_in {
      from {opacity: 1.0;}
      to   {opacity: 1.0;}
    }
    @keyframes fade_out {
      from {opacity: 0.0;}
      to   {opacity: 0.0;}
    }
}
