@import url("https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&family=Dancing+Script:wght@400..700&family=Flavors&family=Glass+Antiqua&family=Orbitron&family=Rubik+Glitch&family=SUSE:wght@100..800&family=Tilt+Neon&display=swap");

:root {
  --main-bg: #222;
  --insta: hotpink;
  --standard: #296b8b;
  --hipster: #bb4377;
  --cursed: #6ab410;
  --business: #0077cc;
  --office: #546e7a;
  --brainrot: #8b5cf6;
  --techbro: #00bcd4;
}

* {
    box-sizing: border-box;
}

body,
html {
    min-height: 100%;
    align-content: center;
    margin:0;
    padding:0;
}

html {
    background-color: #333;
    background: linear-gradient(#111, var(--main-bg));
}

html[currentmode="standard"] {
    --main-bg: var(--standard);
}
html[currentmode="hipster"] {
    --main-bg: var(--hipster);
}
html[currentmode="cursed"] {
    --main-bg: var(--cursed);
}
html[currentmode="business"] {
    --main-bg: var(--business);
}
html[currentmode="office"] {
    --main-bg: var(--office);
}
html[currentmode="brainrot"] {
    --main-bg: var(--brainrot);
}
html[currentmode="insta"] {
    --main-bg: var(--insta);
}
html[currentmode="techbro"] {
    --main-bg: var(--techbro);
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: "SUSE", sans-serif;
    font-optical-sizing: auto;
    font-weight: 100;
    font-style: normal;
    font-size: clamp(0.75rem, 1.25vw, 1.0rem);
}

h1 {
    color: white;
    margin-bottom: 0;
}

section {
    --gap: 2rem;
    --gap: clamp(0.6rem, calc(.1rem + 4vw), 2rem);
    --sectionpad: 3rem;
    --sectionpad: calc(var(--gap) * 1.5);
    --cornerrad: 10px;
    --cornerrad: calc(var(--gap) / 3);
    display: grid;
    font-family: "SUSE", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    gap: var(--gap);
    background-color: #ffffffe6;
    padding: 3rem;
    padding: var(--sectionpad);
    width: clamp(45ch, 90vw, 800px);
    border-radius: var(--cornerrad);
    position:relative;
    margin-block-end: var(--sectionpad);
}

#container {
    display: flex;
    gap: calc(var(--gap) / 2);
    flex-direction: row;
    align-content: center;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    padding-bottom: var(--gap);
    border-bottom: 1px solid #ccc;
}

dfn {
    --dfn-f: black;
    --dfn-c: #666;
    background: white;
    cursor: pointer;
    font-size: 1.75em;
    color: var(--dfn-c);
    font-style: normal;
    display: block;
    border: 1px solid #ccc;
    border-radius: 0.2rem;
    padding-inline: 0.5rem;
}

dfn:first-letter {
    font-size: 1.3em;
    color: var(--dfn-f);
    text-decoration: underline;
}

input {
    font-size: 1.5em;
    padding: 0.5rem;
    max-width: 100%;
}
#inputrow {
    display: flex;
    width: 100%;
}
#input {
    flex-basis:100%;
}


#speak:hover {
    filter: brightness(1.2);
}

#speak:active {
    transform: scale(0.98);
}

::placeholder {
    color: #ccc;
}

#outputrow {
    margin: -2.5rem;
    padding: 2rem;
    margin: calc(0px - var(--sectionpad));
    margin-top: 0rem;
    padding: 3rem;
    padding: var(--sectionpad);
    background: #fff;
    border-radius: 0 0 10px 10px;
    display: flex;
    align-content: center;
    align-items: center;
    gap: var(--gap);
    justify-content: space-between;
}
output {
    font-size: 1.5em;
    em {
        display:none;
        opacity: 0.3;
        font-size: 80%;
        font-style: normal;
    }
}
output:before, output:after {
    content: "\201C ";
    font-size: 2rem;
    opacity:0.2;
    line-height: 1rem;
    vertical-align: bottom;
}
output:after {
    content: "\201D";
}
#speak {
    font-size: 3em;
    cursor: pointer;
    transition: filter 0.2s;
}
output:empty ~ #speak {
    opacity:0.2;
    pointer-events: none;
}
output:empty:before, output:empty:after {
    display:none;
}

#punctrow {
    margin-block: -1em;
    padding: 0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    font-size: .8rem;
    border: none;
    input {
        margin: 0;
        margin-right: 0.5rem;
    }
}
#punctrow:has(input:checked) ~ #outputrow output em {
    display:inline;
}
/* */
@keyframes bounce {
    0% {
        transform: scale(0.9);
    }

    80% {
        transform: scale(1.1);
    }

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

@keyframes flip {
    0% {
        transform: rotateX(0deg);
    }

    50% {
        transform: rotateX(90deg);
    }

    100% {
        transform: rotateX(0deg);
    }
}

dfn.run-animation {
    animation: bounce 0.2s cubic-bezier(0.7, -0.61, 0.39, 1.57);
}

dfn.flip-animation {
    animation: flip 0.2s linear;
}

#modeSelector {
    position: relative;
    margin: 1.5rem auto;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    user-select: none;
    -webkit-user-select: none;
}

.mode-selector-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    min-width: 175px;
    padding: 0.65rem 1.4rem;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 28px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    touch-action: none;
}

.mode-selector-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.mode-selector-btn:active, .mode-selector-btn.pressed {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.35);
    border-color: #fff;
}

.mode-selector-btn .mode-arrow {
    font-size: 0.85em;
    transition: transform 0.25s ease;
    opacity: 0.85;
}

.mode-selector-btn.pressed .mode-arrow {
    transform: rotate(180deg);
}

/* Floating Backdrop & Menu Container */
.mode-bubbles-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mode-bubbles-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mode-bubbles-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mode-bubbles-overlay.active .mode-bubbles-backdrop {
    opacity: 1;
}

/* Clean Vertical Stack Container */
.mode-bubbles-container {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 230px;
    padding: 8px;
    background: rgba(18, 22, 30, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
    transform: scale(0.94) translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.mode-bubbles-overlay.active .mode-bubbles-container {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateY(0);
}

/* Individual Mode Option in Vertical Stack */
.mode-bubble {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.05rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}

/* Targeted/Hovered Option in Stack */
.mode-bubble.targeted {
    background: var(--bubble-color, rgba(255, 255, 255, 0.25));
    border-color: rgba(255, 255, 255, 0.85);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.mode-bubble.current-mode {
    border-color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.mode-bubble.current-mode::after {
    content: "✓";
    font-size: 0.9em;
    opacity: 0.85;
}

/* Mode-specific typography */
.mode-bubble[data-mode="standard"] { --bubble-color: var(--standard); font-family: "Tilt Neon", sans-serif; }
.mode-bubble[data-mode="hipster"] { --bubble-color: var(--hipster); font-family: "Glass Antiqua", cursive; }
.mode-bubble[data-mode="business"] { --bubble-color: var(--business); font-family: "SUSE", sans-serif; }
.mode-bubble[data-mode="office"] { --bubble-color: var(--office); font-family: "Courier Prime", monospace; }
.mode-bubble[data-mode="brainrot"] { --bubble-color: var(--brainrot); font-family: "Rubik Glitch", cursive; }
.mode-bubble[data-mode="insta"] { --bubble-color: var(--insta); font-family: "Dancing Script", cursive; }
.mode-bubble[data-mode="techbro"] { --bubble-color: var(--techbro); font-family: "Orbitron", sans-serif; }
.mode-bubble[data-mode="cursed"] { --bubble-color: var(--cursed); font-family: "Flavors", cursive; }

dfn[currentmode="standard"] {
    --dfn-c: #666;
    --dfn-f: var(--standard);
    background: #fff;
    font-family: "Tilt Neon";
    font-size: 1.75em;
}

dfn[currentmode="hipster"] {
    --dfn-c: #8aa9b3;
    --dfn-f: var(--hipster);
    background: #f4f4f4;
    font-family: "Glass Antiqua";
    font-size: 2.1em;
}

dfn[currentmode="cursed"] {
    --dfn-c: #c0392b;
    --dfn-f: var(--cursed);
    background: #efefef;
    font-family: "Flavors";
    font-size: 1.7em;
}

dfn[currentmode="business"] {
    --dfn-c: #444;
    --dfn-f: var(--business);
    font-family: "SUSE";
    font-size: 1.7em;
}

dfn[currentmode="office"] {
    --dfn-c: #455a64;
    --dfn-f: var(--office);
    background: #eceff1;
    font-family: "Courier Prime", monospace;
    font-size: 1.5em;
}

dfn[currentmode="brainrot"] {
    --dfn-c: #c084fc;
    --dfn-f: #4ade80;
    background: #190a2e;
    font-family: "Rubik Glitch";
    font-size: 1.6em;
}

dfn[currentmode="insta"] {
    font-family: "Dancing Script";
    --dfn-c: #9E9E9E;
    --dfn-f: var(--insta);
}
dfn[currentmode="techbro"] {
    --dfn-c: #00ff9f;
    --dfn-f: var(--techbro);
    background: #0b0f14;
    font-family: "Orbitron";
    font-size: 1.5em;
}




.toast {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    z-index: 999;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
    background: #333;
}

.toast.standard {
    background: #333;
}

.toast.hipster {
    background: #8aa9b3;
}

.toast.cursed {
    background: #c0392b;
    /* Hellfire red */
}

.toast.business {
    background: blue;
}

.toast.office {
    background: var(--office);
}

.toast.brainrot {
    background: var(--brainrot);
}

.toast.insta {
    background: #666;
}