@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400..700&family=Great+Vibes&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Pacifico&family=Caveat:wght@400..700&family=Satisfy&family=Cookie&family=Permanent+Marker&family=Indie+Flower&family=Shadows+Into+Light&display=swap');

/* Visually hidden class - hides content from view but keeps it accessible to screen readers and search engines */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

h1:focus {
    outline: none;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Light bubblegum wash behind app chrome (not canvas). */
body.betasafe-app-body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(ellipse 80% 50% at 20% 10%, rgba(255, 182, 193, 0.14), transparent 55%),
        radial-gradient(ellipse 70% 45% at 85% 90%, rgba(255, 105, 180, 0.09), transparent 50%);
}

/* Bubblegum bubbles overlay — floating pink circles over the background.
   Outer .bubble handles vertical rise + opacity; inner .bubble-inner handles
   scale pulse so the two transform animations never conflict on one element. */
.bubblegum-bubbles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    contain: layout paint;
}
.bubblegum-bubbles .bubble {
    position: absolute;
    bottom: 0;
    opacity: 0;
}
.bubblegum-bubbles .bubble--rise-full  { animation: bubbleRiseFull linear infinite; }
.bubblegum-bubbles .bubble--rise-pop-low { animation: bubbleRisePopLow linear infinite; }
.bubblegum-bubbles .bubble--rise-pop-mid { animation: bubbleRisePopMid linear infinite; }
.bubblegum-bubbles .bubble-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform-origin: center;
    animation: bubblePulse ease-in-out infinite alternate;
}
@keyframes bubbleRiseFull {
    0%   { transform: translateY(0);      opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-110vh); opacity: 0; }
}
@keyframes bubbleRisePopLow {
    0%   { transform: translateY(0);     opacity: 0; }
    12%  { opacity: 1; }
    65%  { opacity: 1; }
    100% { transform: translateY(-50vh); opacity: 0; }
}
@keyframes bubbleRisePopMid {
    0%   { transform: translateY(0);     opacity: 0; }
    12%  { opacity: 1; }
    78%  { opacity: 1; }
    100% { transform: translateY(-80vh); opacity: 0; }
}
@keyframes bubblePulse {
    from { transform: scale(var(--pulse-min, 0.9)); }
    to   { transform: scale(var(--pulse-max, 1.1)); }
}
@media (prefers-reduced-motion: reduce) {
    .bubblegum-bubbles .bubble { animation: none; opacity: 0.35; }
    .bubblegum-bubbles .bubble-inner { animation: none; transform: none; }
}

/* Editor: optional pause (BetaSafe.setBubblegumBackgroundAnimationPaused) while canvas has media — same visuals as reduced-motion bubbles. */
body.betasafe-app-body.betasafe-disable-bubble-anim .bubblegum-bubbles .bubble,
body.betasafe-disable-bubble-anim .bubblegum-bubbles .bubble {
    animation: none !important;
    opacity: 0.35;
}

body.betasafe-app-body.betasafe-disable-bubble-anim .bubblegum-bubbles .bubble-inner,
body.betasafe-disable-bubble-anim .bubblegum-bubbles .bubble-inner {
    animation: none !important;
    transform: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 2px solid #FF6B9D;
}

.invalid {
    outline: 2px solid #8a759e;
}

.validation-message {
    color: #8a759e;
}

.blazor-error-boundary {
        background: var(--pink-primary); /* Solid bubblegum pink */
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(138, 117, 158, 0.3);
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* Help ? modal — detailed overlay (EditorHelpOverlay.razor) */
.help-detail-popup {
    text-align: left;
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem;
}
.help-detail-title {
    font-family: var(--font-stylish);
    color: var(--pink-primary);
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.35rem;
    font-weight: 700;
}
.help-detail-h {
    color: var(--pink-primary);
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 600;
}
.help-detail-p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}
.help-detail-list {
    font-size: 0.9rem;
    line-height: 1.8;
    padding-left: 1.2rem;
    margin-bottom: 0.5rem;
}
.help-detail-popup code {
    font-size: 0.85em;
    background: rgba(255, 20, 147, 0.12);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}
.help-detail-popup kbd {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 20, 147, 0.45);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-size: 0.85em;
}

.darker-border-checkbox.form-check-input {
    border-color: #FF6B9D;
}

.darker-border-checkbox.form-check-input:checked {
    background-color: #FF6B9D;
    border-color: #FF6B9D;
}

/* Consent Checkbox Styling */
.consent-checkbox-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border: 3px solid #FFB4DD; /* Bubble gum pink border */
    border-radius: 16px;
    margin-top: 1rem;
    margin-bottom: 1rem;
    background: rgba(255, 180, 221, 0.05); /* Very light bubble gum pink background */
    transition: all 0.3s ease;
}

/* Scrollable terms container */
.terms-scrollable {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
}

/* Custom scrollbar for terms (bubble gum pink) */
.terms-scrollable::-webkit-scrollbar {
    width: 10px;
}

.terms-scrollable::-webkit-scrollbar-track {
    background: rgba(255, 180, 221, 0.1);
    border-radius: 5px;
}

.terms-scrollable::-webkit-scrollbar-thumb {
    background: #FFB4DD; /* Bubble gum pink */
    border-radius: 5px;
}

.terms-scrollable::-webkit-scrollbar-thumb:hover {
    background: #FF9FD1;
}

.consent-checkbox-container:hover {
    background: rgba(255, 20, 147, 0.1);
    box-shadow: 0 0 20px rgba(255, 20, 147, 0.3);
}

.consent-checkbox {
    width: 24px !important;
    height: 24px !important;
    margin: 0 !important;
    cursor: pointer !important;
    border: 2px solid #FF1493 !important; /* Hot pink border */
    border-radius: 6px !important;
}

.consent-checkbox:checked {
    background-color: #FF1493 !important; /* Hot pink fill */
    border-color: #FF1493 !important;
}

.consent-checkbox:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 20, 147, 0.25) !important;
}

/* Trim checkbox styling mirrors consent checkbox color treatment */
.trim-checkbox {
    width: 20px !important;
    height: 20px !important;
    cursor: pointer !important;
    border: 2px solid var(--pink-primary) !important;
    border-radius: 6px !important;
}

.trim-checkbox:checked {
    background-color: var(--pink-primary) !important;
    border-color: var(--pink-primary) !important;
}

.trim-checkbox:hover {
    border-color: #ff9fd1 !important;
}

.trim-checkbox:focus {
    border-color: var(--pink-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 180, 221, 0.35) !important;
}

/* AI preset active state — hot pink outline via box-shadow to avoid btn-group layout shift */
/* position + z-index: btn-group overlaps buttons with -1px margin; without stacking, the left outline of the middle button is painted under the previous sibling */
.ai-preset-active {
    position: relative;
    z-index: 2;
    color: #FF1493 !important;
    background-color: transparent !important;
    border-color: #FF1493 !important;
    box-shadow: inset 0 0 0 1px #FF1493, 0 0 0 2px #FF1493 !important;
    font-weight: 600;
}
.ai-preset-active:hover,
.ai-preset-active:focus-visible {
    background-color: rgba(255, 20, 147, 0.1) !important;
}

/* AI custom detection checkboxes — hot pink accent */
.ai-custom-checkbox {
    accent-color: #FF1493 !important;
    cursor: pointer;
}
.ai-custom-checkbox:focus {
    border-color: #FF1493 !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 20, 147, 0.25) !important;
}
.ai-custom-checkbox:checked {
    background-color: #FF1493 !important;
    border-color: #FF1493 !important;
}

#editorCanvas {
    width: 100%;
    height: auto;
    display: block;
    image-rendering: pixelated;
    background: #2a1a2e;
}

:root {
    --pink-primary: #FFB4DD; /* Bubble gum pink */
    /* For rgba(var(--pink-primary-rgb), a) — matches --pink-primary */
    --pink-primary-rgb: 255, 180, 221;
    --pink-light: #FFD4E8;
    --purple-primary: #8a759e; /* Theme purple */
    --purple-dark: #6d5a7e;
    --purple-accent: #9d8aae;
    /* Keyboard shortcut <kbd> badges — softer purple */
    --kbd-badge-bg: #b595c5;
    --gradient-main: linear-gradient(135deg, #FFB4DD 0%, #b89ac8 50%, #8a759e 100%);
    --gradient-soft: linear-gradient(135deg, #FFE5F0 0%, #F8D7E9 100%);
    --font-stylish: 'Dancing Script', cursive;
}

body {
    background: linear-gradient(135deg, #FFF0F7 0%, #FFE5F0 50%, #F8D7E9 100%);
    min-height: 100vh;
    position: relative;
}

/* Waifu background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 50%; /* Only take up left half of screen */
    height: 100%;
    background-image: none;
    background-size: contain;
    background-position: bottom left; /* Left side */
    background-repeat: no-repeat;
    opacity: 0.10;
    pointer-events: none;
    z-index: -1;
    filter: blur(0.5px);
}

    body.bg-loaded-left::before {
        background-image: url('https://assets.betasafe-editor.com/waifu-bg.svg?v=2');
        background-size: 69%;
        background-repeat: no-repeat;
    }

/* Waifu background on the right side (already facing correct direction) */
body::after {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    width: 50%; /* Only take up right half of screen */
    height: 100%;
    background-image: none;
    background-size: contain;
    background-position: bottom right; /* Right side */
    background-repeat: no-repeat;
    opacity: 0.10;
    pointer-events: none;
    z-index: -1;
    filter: blur(0.5px);
}

body.bg-loaded-right::after {
    background-image: url('https://assets.betasafe-editor.com/waifu-bg2.svg?v=2');
}

.page-container {
    padding: 2rem;
    max-width: 1800px;
    margin: 0 auto;
}

/* Top title strip removed — social icons live in sidebar under Keyboard Shortcuts */
.title-container {
    position: relative;
    margin-bottom: 2rem;
}

/* Social row directly below Keyboard Shortcuts card (outside the card; spacing only) */
.sidebar-controls .keyboard-shortcuts-social {
    margin-top: 0.25rem;
}

.consent-social-icons {
    max-width: 800px;
    width: 100%;
}

/* Consent page hero — /landing-final.png */
.consent-landing-hero {
    max-width: min(96vw, 800px);
    width: 100%;
}

.consent-landing-hero .landing-hero-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    opacity: 50%;
    border-radius: 20px;
}

/* Single-line header: title left, slogan, then social icons right — all on one line */
.title-container .header-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 1rem 1.5rem;
    width: 100%;
}

.title-container .header-row .stylish-title,
.title-container .header-row .title-slogan {
    white-space: nowrap;
}

.title-container .header-social-icons {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Social icons inside header are in flow, not fixed */
.title-container .social-icon {
    position: static;
    top: auto;
    right: auto;
    bottom: auto;
}

.title-container .beta-portal-icon,
.title-container .reddit-icon,
.title-container .beer-icon {
    right: auto;
}

.title-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="roses" x="0" y="0" width="50" height="50" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="8" fill="none" stroke="rgba(255,180,221,0.2)" stroke-width="0.5"/><path d="M15,25 Q25,15 35,25 Q25,35 15,25" fill="none" stroke="rgba(255,180,221,0.15)" stroke-width="0.3"/><path d="M25,15 Q35,25 25,35 Q15,25 25,15" fill="none" stroke="rgba(255,180,221,0.15)" stroke-width="0.3"/><circle cx="12.5" cy="12.5" r="3" fill="none" stroke="rgba(255,180,221,0.1)" stroke-width="0.2"/><circle cx="37.5" cy="12.5" r="3" fill="none" stroke="rgba(255,180,221,0.1)" stroke-width="0.2"/><circle cx="12.5" cy="37.5" r="3" fill="none" stroke="rgba(255,180,221,0.1)" stroke-width="0.2"/><circle cx="37.5" cy="37.5" r="3" fill="none" stroke="rgba(255,180,221,0.1)" stroke-width="0.2"/></pattern></defs><rect width="100" height="100" fill="url(%23roses)"/></svg>');
    background-size: 200px 200px;
    background-repeat: repeat;
    background-position: center;
    opacity: 0.4;
    z-index: -1;
    pointer-events: none;
}

.stylish-title {
    font-family: var(--font-stylish);
    color: #FF1493 !important; /* Hot pink */
    font-size: 4.5rem; /* Increased from 3rem */
    margin-bottom: 0;
    margin-top: 1rem; /* Add top margin */
    padding: 0.5rem 0; /* Add vertical padding */
    text-shadow: 2px 2px 4px rgba(138, 117, 158, 0.1);
    background: none !important; /* Remove any gradient background */
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    -webkit-text-fill-color: #FF1493 !important; /* Hot pink */
    line-height: 1.2; /* Tighter line height for larger text */
}

.title-slogan {
    font-family: var(--font-stylish);
    color: #FF1493 !important; /* Hot pink */
    font-size: 2rem; /* Increased from 1.5rem */
    margin: 0.5rem 0 1rem 0; /* Add vertical margins */
    padding: 0.25rem 0; /* Add vertical padding */
    opacity: 1;
    line-height: 1.3; /* Better line height */
}

.section-title {
    font-family: var(--font-stylish);
    color: var(--pink-primary); /* Bubblegum pink */
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-align: center;
}

/* Section title in controls box should be hot pink */
.sidebar-controls .card .section-title {
    color: #FF1493 !important; /* Hot pink */
    font-weight: 700 !important;
}

/* Social icons - top right on desktop, bottom on mobile */
.social-icon {
    position: fixed;
    top: 20px;
    z-index: 1000;
    font-size: 2.5rem;
    background: var(--pink-primary); /* Bubblegum pink */
    border: 3px solid #FF1493; /* Hot pink border */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(255, 180, 221, 0.3);
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-icon:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 8px 24px rgba(255, 180, 221, 0.5);
}

/* Sidebar social row (not fixed-position header icons) */
.sidebar-social-icons {
    min-height: 64px;
}

.sidebar-social-icons .social-icon {
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 52px;
    height: 52px;
    font-size: 1.9rem;
    margin: 0;
    transform: none !important;
}

.sidebar-social-icons .social-icon:hover {
    transform: translateY(-1px) !important;
}

.sidebar-social-icons .beta-portal-icon {
    padding: 6px;
}

.sidebar-social-icons .beta-portal-icon img {
    width: 36px;
    height: 36px;
}

.sidebar-social-icons .reddit-icon svg {
    width: 28px;
    height: 28px;
}

.sidebar-social-icons .email-icon {
    color: #FF1493;
}

.sidebar-social-icons .email-icon svg {
    width: 26px;
    height: 26px;
}

.sidebar-social-icons .debug-copy-icon {
    background: #424242;
    border-color: #616161;
    cursor: pointer;
    color: #fff;
    padding: 0;
}

.sidebar-social-icons .debug-copy-icon:hover {
    background: #616161;
    border-color: #9E9E9E;
}

.sidebar-social-icons .debug-copy-icon svg {
    width: 22px;
    height: 22px;
    fill: #fff;
}

/* Position each icon from right to left */
.beer-icon {
    right: 20px; /* Rightmost */
}

.reddit-icon {
    right: 95px; /* Middle */
    color: white; /* White for fill */
}

.reddit-icon svg {
    width: 32px;
    height: 32px;
    fill: white !important; /* White fill */
}

.reddit-icon svg path {
    fill: white !important; /* White fill */
}

.beta-portal-icon {
    right: 170px; /* Leftmost */
    padding: 8px;
}

.beta-portal-icon img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.sidebar-controls {
    padding-right: 1rem;
}

#editorCanvas {
    width: 100%;
    height: auto;
    max-height: none;
    display: block;
    background: #2a1a2e;
    cursor: crosshair;
    border-radius: 13px; /* Slightly less than card border-radius to account for border */
    box-shadow: 0 8px 32px rgba(196, 69, 105, 0.3);
    touch-action: none; /* Prevents ALL default touch behaviors including scroll */
}

/* Mobile optimizations */


.card {
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(138, 117, 158, 0.15);
    transition: all 0.3s ease;
}

/* Canvas card wrapper - hot pink border, no padding */
.card:has(#editorCanvas) {
    border: 3px solid #FF1493 !important; /* Hot pink border */
    padding: 0 !important; /* Remove padding so border hugs canvas */
    border-radius: 16px; /* Match card border radius */
    overflow: hidden; /* Ensure canvas doesn't overflow rounded corners */
    /* scrollIntoView(block:start) respects this so the full canvas area isn’t clipped under the fold */
    scroll-margin-top: min(12vh, 6rem);
    scroll-margin-bottom: 1rem;
}

/* Fit-to-window: pink border hugs the scaled preview (JS sets .preview-fit-active + px size; column width still drives buffer in betasafe.js) */
.card:has(#editorCanvas.preview-fit-active) {
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
}

/* Controls card with bubblegum pink theme */
.sidebar-controls .card {
    background: #FFB4DD !important; /* Bubblegum pink */
    backdrop-filter: blur(10px);
    color: #FF1493 !important; /* Hot pink text */
    border: 3px solid #FF1493 !important; /* Hot pink border */
}

.sidebar-controls .card .text-muted {
    color: #FF1493 !important; /* Hot pink */
    opacity: 0.8;
}

.sidebar-controls .card .form-label,
.sidebar-controls .card .form-check-label {
    color: white !important; /* White labels */
    font-weight: 700 !important;
}

/* Checkboxes — hot pink (override default / Bootstrap blue accent) */
.sidebar-controls .card .form-check-input {
    --bs-form-check-bg: #fff;
    width: 1.15em;
    height: 1.15em;
    margin-top: 0.15em;
    border: 2px solid #FF1493 !important;
    background-color: #fff !important;
    cursor: pointer;
    accent-color: #FF1493;
}
.sidebar-controls .card .form-check-input:checked {
    background-color: #FF1493 !important;
    border-color: #FF1493 !important;
    --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}
.sidebar-controls .card .form-check-input:focus {
    border-color: #FF1493 !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 20, 147, 0.35) !important;
    outline: none;
}
.sidebar-controls .card .form-check-input:focus:not(:checked) {
    background-color: #fff !important;
}
.sidebar-controls .card .form-check-input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.15);
}

/* <details> summaries used var(--pink-primary) inline — same as card bg (#FFB4DD), so labels were invisible */
.sidebar-controls .card details > summary {
    cursor: pointer;
    color: #FF1493 !important;
    font-weight: 700;
}
.sidebar-controls .card details > summary:hover {
    text-decoration: underline;
}

.sidebar-controls .card .form-control,
.sidebar-controls .card .form-select {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
    color: #333;
}

.sidebar-controls .card .form-control:focus,
.sidebar-controls .card .form-select:focus {
    background: white;
    border-color: var(--pink-primary);
}

/* Restart — white outline on bubblegum Controls card */
.sidebar-controls .card .btn-restart-outline {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
    font-weight: 700;
}

.sidebar-controls .card .btn-restart-outline:hover {
    background: rgba(255, 255, 255, 0.38) !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

.sidebar-controls .card .btn-restart-outline:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.55);
    outline: none;
}

/* New — hot pink (#FF1493) outline on bubblegum Controls card */
.sidebar-controls .card .btn-new-outline {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
    border: 2px solid #FF1493 !important;
    font-weight: 700;
}

.sidebar-controls .card .btn-new-outline:hover {
    background: rgba(255, 20, 147, 0.15) !important;
    color: #ffffff !important;
    border-color: #FF1493 !important;
}

.sidebar-controls .card .btn-new-outline:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(255, 20, 147, 0.45);
    outline: none;
}

/* Video controls — play: same hot pink as .btn-success (“Export Frame PNG”) */
.btn-play-pink {
    background: #FF1493 !important;
    border: 2px solid #FF1493 !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(255, 20, 147, 0.2);
}
.btn-play-pink:hover,
.btn-play-pink:focus-visible {
    background: #FF0D82 !important;
    border-color: #FF0D82 !important;
    color: #fff !important;
    box-shadow: 0 0 16px rgba(255, 20, 147, 0.35);
}

.btn-change-video-light {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
    font-weight: 600;
}
.btn-change-video-light:hover,
.btn-change-video-light:focus-visible {
    background: rgba(255, 255, 255, 0.38) !important;
    color: #ffffff !important;
}

@media (max-width: 991px) {
    .sidebar-controls {
        padding-left: 2px;
        padding-right: 2px;
        max-width: 100%;
    }
}

/* Censor type: normal closed select; browser handles scroll when expanded */
.sidebar-controls .card select.censor-type-select {
    width: 100%;
    padding: 0.35rem 0.5rem;
    line-height: 1.35;
}

.sidebar-controls .card select.censor-type-select option {
    padding: 0.2rem 0.35rem;
}

/* Bubblegum pink selected option (browser support varies for native dropdown popups) */
.sidebar-controls .card select.censor-type-select option:checked,
.sidebar-controls .card select.censor-type-select option:focus,
.sidebar-controls .card select.censor-type-select option:active {
    background: linear-gradient(#ff6fb5, #ff6fb5);
    background-color: #ff6fb5;
    color: #ffffff;
}

/* Theme pink scrollbars where popup/list scrollbar styling is supported */
.sidebar-controls .card select.censor-type-select {
    scrollbar-width: thin;
    scrollbar-color: #FF1493 rgba(255, 20, 147, 0.2);
}

.sidebar-controls .card select.censor-type-select::-webkit-scrollbar {
    width: 10px;
}

.sidebar-controls .card select.censor-type-select::-webkit-scrollbar-track {
    background: rgba(255, 20, 147, 0.15);
    border-radius: 6px;
}

.sidebar-controls .card select.censor-type-select::-webkit-scrollbar-thumb {
    background: #FF1493;
    border-radius: 6px;
}

.sidebar-controls .card select.censor-type-select::-webkit-scrollbar-thumb:hover {
    background: #e0127f;
}

.card:hover {
    box-shadow: 0 12px 48px rgba(138, 117, 158, 0.25);
}

h1, h6 {
    color: #FF1493; /* Hot pink */
    font-weight: bold;
}

/* Image/Video counter titles */
h4.mb-0 {
    color: var(--pink-primary); /* Bubblegum pink */
    font-weight: 600;
}

/* Coffee section title */
.coffee-section h2 {
    color: white;
    font-weight: 700;
}

/* SEO section - all text hot pink */
/* Region cards styling - dark bubblegum pink like restart/new buttons */
.region-card {
    border: 3px solid #FF9FD1 !important; /* Dark bubblegum pink border */
    border-radius: 12px !important; /* Rounded corners */
    background: #FF9FD1 !important; /* Dark bubblegum pink background */
}

.region-selected {
    background: #FF9FD1 !important; /* Dark bubblegum pink for selected */
    color: white !important;
    border: 3px solid #FF9FD1 !important; /* Dark bubblegum pink border */
    border-radius: 12px !important; /* Rounded corners */
}

.region-unselected {
    background: #FF9FD1 !important; /* Dark bubblegum pink background */
    border: 3px solid #FF9FD1 !important; /* Dark bubblegum pink border */
    border-radius: 12px !important; /* Rounded corners */
    color: white !important;
}

/* Ensure region card text uses theme pink when selected */
.region-selected strong,
.region-selected * {
    color: white !important;
}

/* Region card text color - ensure it's visible */
.region-card strong {
    color: inherit;
}

/* Region card inputs must stay readable: dark text on light background (override .region-card * white) */
.region-card .form-control,
.region-card input[type="number"],
.region-card .keyframe-time-input,
.region-card .keyframe-duration-input,
.region-card .region-input {
    color: #212529 !important;
    background: #fff !important;
}
.region-card .form-control::placeholder {
    color: #6c757d !important;
}

/* Help ? buttons — white circle, pink ?, pink border (all instances; overrides Bootstrap .btn pill shape) */
button.keyframe-help-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-sizing: border-box;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    padding: 0 !important;
    flex-shrink: 0;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--pink-primary) !important;
    background: white !important;
    border: 1.5px solid var(--pink-primary) !important;
    border-radius: 50% !important;
}

/* Keyboard shortcuts list items - match Alt badge style with gradient */
.keyboard-shortcuts li {
    color: white !important; /* White text */
}

.keyboard-shortcuts kbd {
    background: var(--kbd-badge-bg) !important; /* Solid purple, no gradient fade */
    color: white !important; /* White text */
    border: none;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(181, 149, 197, 0.35); /* Match general kbd shadow */
}

.keyboard-shortcuts kbd,
.keyboard-shortcuts kbd * {
    color: white !important; /* White text for all kbd elements and their children */
}

.keyboard-shortcuts kbd:hover {
    background: var(--kbd-badge-bg) !important; /* Solid purple on hover, no gradient fade */
    color: white !important; /* Keep white text on hover */
    box-shadow: 0 2px 8px rgba(181, 149, 197, 0.35) !important; /* Keep shadow on hover */
    border: none !important; /* No border on hover */
}

.keyboard-shortcuts kbd:hover * {
    color: white !important; /* Keep white text on hover for children */
}

.keyboard-shortcuts,
.keyboard-shortcuts li,
.keyboard-shortcuts.text-muted {
    color: white !important; /* White text for visibility */
    background: none !important; /* Remove gradient */
}

.keyboard-shortcuts li {
    background: none !important; /* Remove any gradient */
    color: white !important; /* White text */
}

.keyboard-shortcuts li * {
    color: white !important; /* White text for all children */
}

.mt-5 h2,
.mt-5 h3 {
    color: #FF1493 !important; /* Hot pink */
    font-weight: 600;
}

.mt-5 p,
.mt-5 strong {
    color: #FF1493 !important; /* Hot pink */
}

.mt-5 {
    color: #FF1493 !important; /* Hot pink for all text */
}

.mt-5 * {
    color: #FF1493 !important; /* Hot pink for all child elements */
}

.btn-primary {
    background: #FF9FD1 !important; /* Dark bubblegum pink like restart/new buttons */
    border: 3px solid #FF9FD1 !important; /* Dark bubblegum pink border - no hot pink */
    color: white; /* White text */
    font-weight: 700;
    transition: all 0.3s ease;
    border-radius: 16px;
    padding: 12px 24px;
}

.btn-primary:hover {
    background: #FF9FD1; /* Slightly darker pink on hover */
    border-color: #FF9FD1;
    box-shadow: 0 0 20px rgba(255, 180, 221, 0.4);
    transform: translateY(-2px);
    color: white;
}

.btn-success {
    background: #FF1493 !important; /* Hot pink background */
    border: 3px solid #FF1493 !important; /* Hot pink border */
    color: white; /* White text */
    font-weight: 700;
    transition: all 0.3s ease;
    border-radius: 16px;
    padding: 12px 24px;
    box-shadow: 0 4px 16px rgba(255, 20, 147, 0.2);
}

.btn-success:hover {
    background: #FF0D82; /* Slightly darker hot pink on hover */
    border-color: #FF0D82;
    box-shadow: 0 0 20px rgba(255, 20, 147, 0.4);
    transform: translateY(-2px);
}

.btn-success:disabled {
    background: rgba(var(--pink-primary-rgb), 0.4) !important; /* Disabled bubblegum pink - lighter/transparent */
    border-color: rgba(var(--pink-primary-rgb), 0.5) !important; /* Disabled bubblegum pink border */
    color: rgba(255, 255, 255, 0.6) !important; /* Lighter white text */
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-info {
    background: #FF1493 !important; /* Hot pink background */
    border: 3px solid #FF1493 !important; /* Hot pink border */
    color: white !important; /* White text */
    font-weight: 700;
    transition: all 0.3s ease;
    border-radius: 16px;
    padding: 12px 24px;
    box-shadow: 0 4px 16px rgba(255, 20, 147, 0.2);
}

.btn-info:hover {
    background: #FF0D82; /* Slightly darker hot pink on hover */
    border-color: #FF0D82;
    box-shadow: 0 0 20px rgba(255, 20, 147, 0.4);
    transform: translateY(-2px);
}

.btn-info:disabled {
    background: rgba(var(--pink-primary-rgb), 0.4) !important; /* Disabled bubblegum pink - lighter/transparent */
    border-color: rgba(var(--pink-primary-rgb), 0.5) !important; /* Disabled bubblegum pink border */
    color: rgba(255, 255, 255, 0.6) !important; /* Lighter white text */
    cursor: not-allowed;
    opacity: 0.7;
}

/* Outline buttons in controls section - use hover color (darker pink) */
.sidebar-controls .btn-outline-secondary:not(.btn-sm),
.sidebar-controls .btn-outline-dark:not(.btn-sm),
.sidebar-controls .btn-outline-light:not(.btn-sm) {
    background: #FF9FD1 !important; /* Hover color - slightly darker pink */
    border: 3px solid #FF9FD1 !important; /* Match border to background */
    color: white !important; /* White text */
    font-weight: 600;
    border-radius: 12px; /* Softer corners */
    box-shadow: 0 2px 8px rgba(255, 180, 221, 0.3); /* Subtle shadow */
}

.sidebar-controls .btn-outline-secondary:not(.btn-sm):hover,
.sidebar-controls .btn-outline-dark:not(.btn-sm):hover,
.sidebar-controls .btn-outline-light:not(.btn-sm):hover {
    background: #FF8FC8 !important; /* Even darker pink on hover */
    border-color: #FF8FC8 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(255, 180, 221, 0.4); /* Enhanced shadow on hover */
}

/* Small outline buttons (arrows) - dark bubblegum pink, no hot pink border */
.btn-outline-secondary.btn-sm,
.btn-outline-dark.btn-sm,
.btn-outline-light.btn-sm {
    background: #FF9FD1 !important; /* Dark bubblegum pink background */
    border: 3px solid #FF9FD1 !important; /* Dark bubblegum pink border - no hot pink */
    color: white !important; /* White text and icons */
    font-weight: 600;
    border-radius: 4px; /* Keep sharper corners for arrows */
}

.btn-outline-secondary.btn-sm:hover,
.btn-outline-dark.btn-sm:hover,
.btn-outline-light.btn-sm:hover {
    background: #FF8FC8 !important; /* Even darker pink on hover */
    border-color: #FF8FC8 !important;
    color: white !important;
}

/* General outline buttons outside controls (fallback) */
.btn-outline-secondary:not(.sidebar-controls .btn-outline-secondary):not(.btn-sm),
.btn-outline-dark:not(.sidebar-controls .btn-outline-dark):not(.btn-sm),
.btn-outline-light:not(.sidebar-controls .btn-outline-light):not(.btn-sm) {
    border-color: #FF1493 !important; /* Hot pink border */
    color: white !important; /* White text and icons */
    font-weight: 600;
    border-width: 3px;
    border-radius: 12px; /* Softer corners */
}

.btn-outline-secondary:not(.sidebar-controls .btn-outline-secondary):not(.btn-sm):hover,
.btn-outline-dark:not(.sidebar-controls .btn-outline-dark):not(.btn-sm):hover,
.btn-outline-light:not(.sidebar-controls .btn-outline-light):not(.btn-sm):hover {
    background: #FF9FD1 !important; /* Slightly darker pink on hover */
    border-color: #FF9FD1 !important;
    color: white !important;
}

.btn-outline-info {
    border-color: var(--purple-accent);
    color: var(--purple-accent);
}

.btn-outline-warning {
    border-color: #FF6B9D;
    color: #FF6B9D;
}

.form-control, .form-select {
    border: 2px solid var(--pink-light);
    border-radius: 12px;
    transition: all 0.3s ease;
}

/* File input styling - change "no file chosen" text color */
input[type="file"]::file-selector-button {
    background: var(--pink-primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    margin-right: 8px;
    cursor: pointer;
    font-weight: 600;
}

input[type="file"] {
    color: rgba(255, 180, 221, 0.8); /* Very light bubblegum pink for "no file chosen" text */
}

input[type="file"]::placeholder {
    color: rgba(255, 180, 221, 0.8);
}

/* For browsers that show "No file chosen" text */
input[type="file"]:not(:valid) {
    color: rgba(255, 180, 221, 0.8);
}

.form-control:focus, .form-select:focus {
    border-color: var(--pink-primary);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 157, 0.25);
}

.form-range::-webkit-slider-thumb {
    background: var(--gradient-main);
}

.form-range::-moz-range-thumb {
    background: var(--gradient-main);
}

.coffee-section {
    margin-top: 3rem;
    padding: 2.5rem;
    background: var(--gradient-main);
    border-radius: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 12px 48px rgba(138, 117, 158, 0.3);
}

.coffee-section h2 {
    margin-bottom: 1rem;
    font-weight: 700;
    color: white;
    -webkit-text-fill-color: white;
}

.coffee-section h3 {
    margin-bottom: 1rem;
    font-weight: bold;
    color: white;
    -webkit-text-fill-color: white;
}

.coffee-section p strong {
    color: #FF1493 !important; /* Hot pink */
    font-weight: bold !important;
}

.coffee-btn {
    display: inline-block;
    padding: 14px 32px;
    background: white;
    color: #FF1493 !important; /* Hot pink */
    border: 3px solid #FF1493 !important; /* Hot pink border */
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.coffee-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    color: #FF1493 !important; /* Hot pink */
}

kbd {
    background: var(--kbd-badge-bg) !important; /* Solid purple, no gradient fade */
    color: white !important;
    border: none;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(181, 149, 197, 0.35);
}

/* Ensure all kbd text is white */
kbd,
kbd * {
    color: white !important;
}

.text-muted {
    color: var(--purple-dark) !important;
}

/* Override text-muted for keyboard shortcuts */
.keyboard-shortcuts.text-muted,
.keyboard-shortcuts.text-muted li {
    color: white !important; /* White text for visibility */
}

.bg-light {
    background: var(--gradient-soft) !important;
}

.bg-primary {
    background: var(--gradient-main) !important;
}

/* Thank You Popup Styles */
.thank-you-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.thank-you-popup {
    position: relative;
    background: white;
    border-radius: 24px;
    padding: 3rem 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(138, 117, 158, 0.4);
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.thank-you-emoji-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20rem;
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
    filter: blur(2px);
}

.thank-you-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.thank-you-content h3 {
    font-family: var(--font-stylish);
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.thank-you-content p {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.thank-you-content p strong {
    color: var(--pink-primary);
    font-weight: 700;
}

.thank-you-heart {
    font-size: 2rem;
    color: var(--pink-primary);
    font-weight: bold;
    margin-top: 1rem;
}

@media (max-width: 991px) {
    .page-container {
        padding: 1rem;
    }

    .title-container {
        margin-bottom: 0.5rem;
    }

    .stylish-title {
        font-size: 2rem; /* Reduced for mobile to prevent clipping */
        margin-top: 0.5rem;
        padding: 0.25rem 0;
    }

    .title-slogan {
        font-size: 1.1rem; /* Reduced for mobile to prevent clipping */
        color: #FF1493 !important; /* Hot pink */
        margin: 0.25rem 0 0.5rem 0; /* Reduced bottom margin */
        padding: 0.15rem 0;
    }

    .sidebar-controls {
        padding-right: 0;
    }

    /* preview-fit-active: explicit px sizing from JS — do not apply object-fit / 70vh cap (see betasafe.js updatePreviewFitDisplaySize) */
    #editorCanvas:not(.preview-fit-active) {
        max-height: 70vh;
        object-fit: contain;
    }

    .mobile-hide {
        display: none !important;
    }

    .mobile-only {
        display: inline;
    }

    .row.g-3 {
        display: flex;
        flex-direction: column;
    }

    .mobile-order-1 {
        order: 1;
    }

    .mobile-order-2 {
        order: 2;
    }

    .mobile-order-3 {
        order: 3;
    }

    .col-lg-9, .col-lg-3 {
        max-width: 100%;
        flex: 0 0 100%;
    }

    /* Social icons at bottom on mobile */
    .social-icon {
        top: auto;
        bottom: 20px;
        font-size: 1.8rem;
        width: 50px;
        height: 50px;
        background: var(--pink-primary); /* Bubblegum pink */
        border: 3px solid #FF1493; /* Hot pink border */
    }

    .beer-icon {
        right: 38px;
    }

    .reddit-icon {
        right: 91px;
    }

    .reddit-icon svg {
        width: 24px;
        height: 24px;
        fill: white !important; /* White fill */
    }
    
    .reddit-icon svg path {
        fill: white !important; /* White fill */
    }

    .beta-portal-icon {
        right: 144px;
        padding: 6px;
    }

    .beta-portal-icon img {
        width: 38px;
        height: 38px;
    }
}

@media (min-width: 992px) {
    .mobile-only {
        display: none;
    }
}

/* First-paint boot overlay (dismissed on window load + rAF, max 3s; see App.razor). */
#betasafe-boot-overlay.betasafe-boot-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 1.5rem;
    background: linear-gradient(165deg, rgba(255, 20, 147, 0.94) 0%, rgba(255, 105, 180, 0.9) 45%, rgba(255, 182, 193, 0.88) 100%);
    color: #fff;
    text-align: center;
    pointer-events: auto;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

#betasafe-boot-overlay.betasafe-boot-overlay--dismissed {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.betasafe-boot-overlay__inner {
    max-width: 22rem;
}

.betasafe-boot-overlay__msg {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.betasafe-boot-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1.25rem;
    border: 4px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: betasafe-boot-spin 0.75s linear infinite;
}

@keyframes betasafe-boot-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    #betasafe-boot-overlay.betasafe-boot-overlay {
        transition: none;
    }

    .betasafe-boot-spinner {
        animation: none;
        border-color: rgba(255, 255, 255, 0.65);
    }
}

/* Compact crystallize Randomize (↻); keep ~28px min touch target */
.btn-polygon-random {
    font-size: 0.85rem;
    line-height: 1;
    min-width: 28px;
    min-height: 28px;
    padding: 0.2rem 0.35rem;
}
