:root {
    --bg-color: rgba(11, 14, 20, 0.95);
    --border-color: rgba(255, 255, 255, 0.1);
    --font-family: 'Outfit', sans-serif;
    --text-color: #ffffff;
    --label-color: rgba(255, 255, 255, 0.6);
}

/* Base Definitions Drop Other Themes to strictly follow Rich Black 2.0 Materiality Rule */
/* When in a bare web preview, we want a proper background for screenshots. 
   When in-game (FiveM), body is typically transparent via NUI settings, 
   but just to be safe, FiveM handles it. */
body, html {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: var(--font-family);
    user-select: none;
    pointer-events: none;
    background-color: transparent;
}

/* ========================================================
   GREENSCREEN SHOWCASE MODE
   ======================================================== */
body.greenscreen-mode::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #00FF00 !important;
    z-index: -9999;
    pointer-events: none;
}

body.greenscreen-mode {
    pointer-events: auto !important; /* Allow NUI interaction if needed */
}

body.greenscreen-mode * {
    backdrop-filter: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

.notification-container {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 9999;
}

.top-right { top: 20px; right: 20px; }
.bottom-right { bottom: 20px; right: 20px; }
.right-center { top: 50%; right: 20px; transform: translateY(-50%); }

.top-left { top: 20px; left: 20px; }
.bottom-left { bottom: 20px; left: 20px; }
.left-center { top: 50%; left: 20px; transform: translateY(-50%); }

.top-center { top: 20px; left: 50%; transform: translateX(-50%); }
.bottom-center { bottom: 20px; left: 50%; transform: translateX(-50%); }

/* Base Definition Rich Black 2.0 */
.notification {
    position: relative;
    width: 330px;
    min-height: 65px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Premium Diagonal Shimmer Effect on Entrance */
.notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        to right, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.04) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    animation: shimmerSwipe 1.2s ease-out forwards;
    pointer-events: none;
    z-index: 5;
}

@keyframes shimmerSwipe {
    0% { left: -150%; }
    100% { left: 200%; }
}

/* Noise Texture Overlay */
.notification::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 1;
}

/* Layout Specifics for Left vs Right Aligned Positions */
.notification.layout-left .notification-content {
    border-left: 1px solid var(--type-color);
    border-right: none;
    text-align: left;
}
.notification.layout-left .text-wrapper {
    align-items: flex-start;
}
.notification.layout-left .progress-bar {
    left: 0;
    right: auto;
    transform-origin: right; /* Shrinks to left side */
}
.notification.layout-left .progress-bar::after {
    right: 0;
    left: auto;
    box-shadow: 4px 0 10px 1px var(--type-color);
}

.notification.layout-right .notification-content {
    border-right: 1px solid var(--type-color);
    border-left: none;
    text-align: left;
}
.notification.layout-right .text-wrapper {
    align-items: flex-start;
}
.notification.layout-right .progress-bar {
    right: 0;
    left: auto;
    transform-origin: left; /* Shrinks to right side */
}
.notification.layout-right .progress-bar::after {
    left: 0;
    right: auto;
    box-shadow: -4px 0 10px 1px var(--type-color);
}

/* Accent Line directly on content box container */
.notification-content {
    position: relative;
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 16px;
    z-index: 2; /* above noise */
    flex: 1;
    border-left: 1px solid var(--type-color);
}

.notification-icon {
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Removed fussy Glow completely -> crisp, flat, sharp color */
}

.text-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.notification-label {
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--label-color, rgba(255, 255, 255, 0.6));
    margin-bottom: 2px;
}

.notification-message {
    color: var(--text-color, #ffffff);
    font-size: 14px;
    font-weight: 300;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Stack Badge for multiple same notifications */
.stack-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    color: var(--type-color); /* To match the accent */
    min-width: 24px;
    height: 24px;
    border-radius: 0;
    border-top-right-radius: 4px; /* Adjust to container */
    border: none;
    border-top: 1px solid var(--type-color);
    border-right: 1px solid var(--type-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    z-index: 10;
    transform-origin: top right;
}

.badge-pop {
    animation: badgePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes badgePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* Progress bar */
.progress-bar-container {
    height: 2px;
    width: 100%;
    background: rgba(0, 0, 0, 0.3); /* Container / Track */
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 3;
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: var(--type-color);
    transition: width linear;
}

/* Glow-Tip (Elite-Look) */
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0; /* At the shrinking tip */
    width: 10px;
    height: 100%;
    background: transparent;
    box-shadow: 4px 0 10px 1px var(--type-color);
}

/* Animations */
/* Automatically pick animation direction based on layout */
.notification.layout-right.anim-slide-right { animation: slideInRight 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }
.notification.layout-left.anim-slide-right { animation: slideInLeft 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }

.anim-fade-in { animation: fadeIn 0.4s ease forwards; }
.anim-scale-up { animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.anim-bounce-in { animation: bounceIn 0.5s cubic-bezier(0.28, 0.84, 0.42, 1) forwards; }
.anim-flip-in { animation: flipInX 0.6s ease forwards; }

.notification.layout-right.anim-exit {
    animation: slideOutRight 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
}

.notification.layout-left.anim-exit {
    animation: slideOutLeft 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
}

/* Keyframes */
@keyframes slideInRight {
    0% { transform: translateX(110%); }
    100% { transform: translateX(0); }
}

@keyframes slideInLeft {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(0); }
}

@keyframes slideOutRight {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(110%); opacity: 0; }
}

@keyframes slideOutLeft {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(-110%); opacity: 0; }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes scaleUp {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes flipInX {
    0% { transform: perspective(400px) rotate3d(1, 0, 0, 90deg); opacity: 0; }
    40% { transform: perspective(400px) rotate3d(1, 0, 0, -20deg); }
    60% { transform: perspective(400px) rotate3d(1, 0, 0, 10deg); opacity: 1; }
    80% { transform: perspective(400px) rotate3d(1, 0, 0, -5deg); }
    100% { transform: perspective(400px); opacity: 1; }
}

/* ========================================================
   PROGRESS BAR SYSTEM
   ======================================================== */
#progress-container {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9998;
    pointer-events: none;
}

#progress-container.hidden {
    display: none;
}

#progress-box {
    position: relative;
    width: 350px;
    height: 55px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Base Noise Overlay applies to progress box as well */
#progress-box::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 1;
}

/* Shimmer Swipe Effect for ProgressBar */
#progress-box.play-shimmer::before {
    content: '';
    position: absolute;
    top: 0; left: -150%; width: 60%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.04) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    animation: pbShimmerSwipe 1.2s ease-out forwards;
    pointer-events: none;
    z-index: 5;
}

@keyframes pbShimmerSwipe {
    0% { left: -150%; }
    100% { left: 200%; }
}

.progress-content {
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    flex: 1;
    z-index: 2; /* über dem Noise */
}

.progress-text-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex: 1;
}

.progress-value-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Removed position relative */
}

#progress-icon {
    font-size: 20px;
    color: var(--type-color);
}

.icon-pulse {
    animation: pbIconPulseRotate 2s infinite ease-in-out;
}

@keyframes pbIconPulseRotate {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.05) rotate(-3deg); }
    50% { transform: scale(1) rotate(0deg); }
    75% { transform: scale(1.05) rotate(3deg); }
    100% { transform: scale(1) rotate(0deg); }
}

#progress-label {
    font-size: 14px;
    font-weight: 300;
    color: var(--text-color);
    margin: 0;
}

#progress-percent {
    font-size: 16px;
    font-weight: 300;
    color: var(--text-color);
    margin: 0;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

#progress-cancel {
    position: absolute;
    right: 4px; 
    top: 3px; 
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 300;
    letter-spacing: 0.5px;
    display: none;
    z-index: 10;
}

#progress-cancel.show {
    display: block;
}

#progress-fill {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: 0%;
    background-color: var(--type-color);
    transform-origin: left;
}

#progress-fill::after {
    content: '';
    position: absolute;
    top: -1px;
    right: 0;
    width: 2px;
    height: 4px;
    background: #ffffff;
    box-shadow: 0 0 8px 2px var(--type-color), 0 0 12px 2px var(--type-color);
    border-radius: 2px;
}

.pb-fade-in { animation: pbFadeIn 0.3s ease forwards; }
.pb-fade-out { animation: pbFadeOut 0.3s ease forwards; }

@keyframes pbFadeIn {
    0% { opacity: 0; transform: translate(-50%, 20px); }
    100% { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes pbFadeOut {
    0% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, 20px); }
}

/* =========================================
   TEXT UI / INTERACTION SYSTEM
========================================= */

#textui-container {
    position: absolute;
    /* Default position, overridden by JS */
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9997;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    align-items: flex-start;
    /* transition: all 0.3s ease; - Removed to prevent flying across the screen on position change */
}

#textui-container.hidden {
    display: none;
}

.textui-box {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    transition: all 0.2s ease;
}

.textui-key {
    font-weight: 600;
    text-align: center;
    z-index: 2;
    text-transform: uppercase;
}

.textui-text {
    font-weight: 300;
    z-index: 2;
    white-space: nowrap;
}

/* =========================================
   TEXT UI THEMES
========================================= */

@keyframes textuiShimmer {
    0% { transform: translateX(-150%) skewX(-45deg); opacity: 0; }
    10% { transform: translateX(-150%) skewX(-45deg); opacity: 0.7; }
    50% { transform: translateX(250%) skewX(-45deg); opacity: 0.7; }
    100% { transform: translateX(250%) skewX(-45deg); opacity: 0; }
}


/* THEME 1: CLASSIC (Sharp Edge left-accent clone) */
.textui-box.theme-classic { gap: 9px; background: transparent; padding: 0; box-shadow: none; border: none; height: auto; width: max-content; }

.textui-box.theme-classic.style-normal { flex-direction: row; background: var(--bg-color); padding: 5px; border-radius: 4px; gap: 8px; border: 1px solid rgba(255, 255, 255, 0.1); border-left: 4px solid var(--type-color); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8); overflow: hidden; align-items: center; }
.textui-box.theme-classic.style-normal .textui-text { background: transparent; border: none; box-shadow: none; padding: 0 9px 0 0; display: flex; align-items: center; }
.textui-box.theme-classic.style-normal .textui-key { padding: 5px 12px; font-size: 18px; border-radius: 2px; border: none; background: transparent; display: flex; align-items: center; justify-content: center; }

.textui-box.theme-classic.style-key-separated { flex-direction: row; height: 44px; background: transparent; padding: 0; border: none; box-shadow: none; }
.textui-box.theme-classic.style-key-separated .textui-text { background: var(--bg-color); border: 1px solid rgba(255, 255, 255, 0.1); padding: 9px 18px; border-radius: 4px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8); }

.textui-box.theme-classic.style-key-top { flex-direction: column; background: transparent; padding: 0; border: none; box-shadow: none; }
.textui-box.theme-classic.style-key-top .textui-text { background: var(--bg-color); border: 1px solid rgba(255, 255, 255, 0.1); padding: 9px 18px; border-radius: 4px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8); }

.textui-box.theme-classic.style-key-bottom { flex-direction: column-reverse; background: transparent; padding: 0; border: none; box-shadow: none; }
.textui-box.theme-classic.style-key-bottom .textui-text { background: var(--bg-color); border: 1px solid rgba(255, 255, 255, 0.1); padding: 9px 18px; border-radius: 4px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8); }

.textui-box.theme-classic.style-normal::after,
.textui-box.theme-classic.style-key-top .textui-text::after,
.textui-box.theme-classic.style-key-bottom .textui-text::after,
.textui-box.theme-classic.style-key-separated .textui-text::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E"); opacity: 0.04; pointer-events: none; z-index: 1; }

.textui-box.theme-classic .textui-key { background-color: var(--bg-color); color: #ffffff; font-family: 'Outfit', sans-serif; font-size: 18px; padding: 9px 16px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.1); border-left: 4px solid var(--type-color); position: relative; overflow: hidden; }
.textui-box.theme-classic.style-key-separated .textui-key,
.textui-box.theme-classic.style-key-top .textui-key,
.textui-box.theme-classic.style-key-bottom .textui-key { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8); }

.textui-box.theme-classic .textui-text { color: var(--text-color); font-size: 16px; position: relative; overflow: hidden; }

.textui-box.theme-classic.style-key-separated.play-shimmer .textui-key::before,
.textui-box.theme-classic.style-key-separated.play-shimmer .textui-text::before,
.textui-box.theme-classic.style-key-top.play-shimmer .textui-key::before,
.textui-box.theme-classic.style-key-top.play-shimmer .textui-text::before,
.textui-box.theme-classic.style-key-bottom.play-shimmer .textui-key::before,
.textui-box.theme-classic.style-key-bottom.play-shimmer .textui-text::before,
.textui-box.theme-classic.style-normal.play-shimmer::before { content: ''; position: absolute; top: 0; left: -50%; width: 30%; height: 100%; background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0) 100%); transform: skewX(-45deg); animation: textuiShimmer 1.5s cubic-bezier(0.19, 1, 0.22, 1) forwards; animation-delay: 0.1s; z-index: 10; pointer-events: none; }


/* THEME 2: SPLIT (Separated Key and Text Box with depth) (Separated Key and Text Box with depth) */
.textui-box.theme-split {
    gap: 9px;
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: none;
    height: auto;
    width: max-content;
}

/* Style: Normal (Unified Horizontal Container) */
.textui-box.theme-split.style-normal {
    flex-direction: row;
    background: var(--bg-color);
    padding: 5px;
    border-radius: 6px;
    gap: 8px; /* Override default gap for normal */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}
.textui-box.theme-split.style-normal .textui-text {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0 9px 0 0; display: flex; align-items: center;
}

/* Style: Key Separated (Original Split) */
.textui-box.theme-split.style-key-separated {
    flex-direction: row;
    height: 44px;
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
}
.textui-box.theme-split.style-key-separated .textui-text {
    background: var(--bg-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 9px 18px;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

/* Style: Key Top (Vertical Separated Containers) */
.textui-box.theme-split.style-key-top {
    flex-direction: column;
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
}
.textui-box.theme-split.style-key-top .textui-text {
    background: var(--bg-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 9px 18px;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

/* Style: Key Bottom (Vertical Reversed Separated Containers) */
.textui-box.theme-split.style-key-bottom {
    flex-direction: column-reverse;
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
}
.textui-box.theme-split.style-key-bottom .textui-text {
    background: var(--bg-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 9px 18px;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

/* Apply noise filter to unified containers and original split text box */
.textui-box.theme-split.style-normal::after,
.textui-box.theme-split.style-key-top .textui-text::after,
.textui-box.theme-split.style-key-bottom .textui-text::after,
.textui-box.theme-split.style-key-separated .textui-text::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 1;
}

.textui-box.theme-split.style-normal .textui-key {
    padding: 5px 12px;
    font-size: 18px;
}

.textui-box.theme-split .textui-key {
    background-color: var(--bg-color);
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    padding: 9px 16px;
    border-radius: 6px;
    border: 1px solid var(--type-color);
    position: relative;
    overflow: hidden;
    /* Box shadow is conditionally added for separated containers below */
}

.textui-box.theme-split.style-key-separated .textui-key,
.textui-box.theme-split.style-key-top .textui-key,
.textui-box.theme-split.style-key-bottom .textui-key {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.textui-box.theme-split.style-key-separated.play-shimmer .textui-key::before,
.textui-box.theme-split.style-key-separated.play-shimmer .textui-text::before,
.textui-box.theme-split.style-key-top.play-shimmer .textui-key::before,
.textui-box.theme-split.style-key-top.play-shimmer .textui-text::before,
.textui-box.theme-split.style-key-bottom.play-shimmer .textui-key::before,
.textui-box.theme-split.style-key-bottom.play-shimmer .textui-text::before,
.textui-box.theme-split.style-normal.play-shimmer::before {
    content: '';
    position: absolute;
    top: 0; left: -50%; width: 30%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-45deg);
    animation: textuiShimmer 1.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    animation-delay: 0.1s;
    z-index: 10;
    pointer-events: none;
}

.textui-box.theme-split .textui-text {
    color: var(--text-color);
    font-size: 16px;
    position: relative;
    overflow: hidden;
}

/* THEME 3: SOLID (Pill shaped, bold colored border) */
.textui-box.theme-solid { gap: 10px; background: transparent; padding: 0; box-shadow: none; border: none; height: auto; width: max-content; }

.textui-box.theme-solid.style-normal { flex-direction: row; background: var(--bg-color); padding: 5px; border-radius: 26px; gap: 8px; border: 1px solid var(--type-color); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); overflow: hidden; align-items: center; }
.textui-box.theme-solid.style-normal .textui-text { background: transparent; border: none; box-shadow: none; padding: 0 12px 0 0; display: flex; align-items: center; }
.textui-box.theme-solid.style-normal .textui-key { padding: 5px 16px; font-size: 18px; border-radius: 20px; background-color: rgba(255, 255, 255, 0.08); border: none; display: flex; align-items: center; justify-content: center; }

.textui-box.theme-solid.style-key-separated { flex-direction: row; height: 44px; background: transparent; padding: 0; border: none; box-shadow: none; }
.textui-box.theme-solid.style-key-separated .textui-text { background: var(--bg-color); border: 1px solid var(--type-color); padding: 9px 22px; border-radius: 26px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }

.textui-box.theme-solid.style-key-top { flex-direction: column; background: transparent; padding: 0; border: none; box-shadow: none; }
.textui-box.theme-solid.style-key-top .textui-text { background: var(--bg-color); border: 1px solid var(--type-color); padding: 9px 22px; border-radius: 26px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }

.textui-box.theme-solid.style-key-bottom { flex-direction: column-reverse; background: transparent; padding: 0; border: none; box-shadow: none; }
.textui-box.theme-solid.style-key-bottom .textui-text { background: var(--bg-color); border: 1px solid var(--type-color); padding: 9px 22px; border-radius: 26px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }

.textui-box.theme-solid.style-normal::after,
.textui-box.theme-solid.style-key-top .textui-text::after,
.textui-box.theme-solid.style-key-bottom .textui-text::after,
.textui-box.theme-solid.style-key-separated .textui-text::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E"); opacity: 0.04; pointer-events: none; z-index: 1; }

.textui-box.theme-solid .textui-key { background-color: var(--bg-color); color: #ffffff; font-family: 'Outfit', sans-serif; font-size: 18px; padding: 9px 24px; border-radius: 26px; border: 1px solid var(--type-color); position: relative; overflow: hidden; }
.textui-box.theme-solid.style-key-separated .textui-key,
.textui-box.theme-solid.style-key-top .textui-key,
.textui-box.theme-solid.style-key-bottom .textui-key { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }

.textui-box.theme-solid .textui-text { color: var(--text-color); font-size: 16px; position: relative; overflow: hidden; }

.textui-box.theme-solid.style-key-separated.play-shimmer .textui-key::before,
.textui-box.theme-solid.style-key-separated.play-shimmer .textui-text::before,
.textui-box.theme-solid.style-key-top.play-shimmer .textui-key::before,
.textui-box.theme-solid.style-key-top.play-shimmer .textui-text::before,
.textui-box.theme-solid.style-key-bottom.play-shimmer .textui-key::before,
.textui-box.theme-solid.style-key-bottom.play-shimmer .textui-text::before,
.textui-box.theme-solid.style-normal.play-shimmer::before { content: ''; position: absolute; top: 0; left: -50%; width: 30%; height: 100%; background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0) 100%); transform: skewX(-45deg); animation: textuiShimmer 1.5s cubic-bezier(0.19, 1, 0.22, 1) forwards; animation-delay: 0.1s; z-index: 10; pointer-events: none; }


/* =========================================
   SKILL CHECK SYSTEM
========================================= */
.textui-wrapper {
    position: fixed;
    z-index: 9997;
    display: flex;
    justify-content: center;
    align-items: center;
}

.textui-box-element {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.textui-key-element {
    font-weight: 600;
    text-align: center;
    z-index: 2;
    text-transform: uppercase;
}

.textui-text-element {
    font-weight: 300;
    z-index: 2;
    white-space: nowrap;
}

/* Base Demo Elements using the parent themes */
.textui-box-element.theme-classic {
    background: var(--bg-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 1px solid var(--type-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border-radius: 5px;
    padding: 7px 18px 7px 7px;
    gap: 14px;
    overflow: hidden;
    width: max-content;
}
.textui-box-element.theme-classic::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 1;
}
.textui-box-element.theme-classic.play-shimmer::before {
    content: '';
    position: absolute;
    top: 0; left: -50%; width: 30%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-45deg);
    animation: textuiShimmer 1.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    animation-delay: 0.1s;
    z-index: 10;
    pointer-events: none;
}
.textui-box-element.theme-classic .textui-key-element {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    padding: 0 12px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 28px;
    height: 28px;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.textui-box-element.theme-classic .textui-text-element {
    color: var(--text-color);
    font-size: 16px;
    flex-grow: 1;
}

.textui-box-element.theme-split {
    gap: 9px;
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: none;
    width: max-content;
    height: 44px;
}
.textui-box-element.theme-split .textui-key-element {
    background-color: var(--bg-color);
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    padding: 0 16px;
    border-radius: 6px;
    border: 1px solid var(--type-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.textui-box-element.theme-split.play-shimmer .textui-key-element::before,
.textui-box-element.theme-split.play-shimmer .textui-text-element::before {
    content: '';
    position: absolute;
    top: 0; left: -50%; width: 30%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-45deg);
    animation: textuiShimmer 1.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    animation-delay: 0.1s;
    z-index: 10;
    pointer-events: none;
}
.textui-box-element.theme-split .textui-text-element {
    color: var(--text-color);
    background: var(--bg-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 16px;
    padding: 0 18px;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    align-items: center;
    flex-grow: 1;
}
.textui-box-element.theme-split .textui-text-element::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    z-index: 1;
}

.textui-box-element.theme-solid {
    background: var(--bg-color);
    border: 0.5px solid var(--type-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border-radius: 5px;
    padding: 3px 3px 3px 3px;
    gap: 0;
    overflow: hidden;
    width: max-content;
    height: 44px;
}
.textui-box-element.theme-solid::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    z-index: 1;
}
.textui-box-element.theme-solid.play-shimmer::before {
    content: '';
    position: absolute;
    top: 0; left: -50%; width: 30%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-45deg);
    animation: textuiShimmer 1.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    animation-delay: 0.1s;
    z-index: 10;
    pointer-events: none;
}
.textui-box-element.theme-solid .textui-key-element {
    background-color: rgba(255, 255, 255, 0.05); /* Solid Dark Default Area */
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px 0 0 3px;
    box-shadow: none;
    flex-shrink: 0;
}
.textui-box-element.theme-solid .textui-text-element {
    background-color: transparent;
    color: var(--text-color);
    font-size: 16px;
    padding: 0 16px;
    border-radius: 0;
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    align-items: center;
    flex-grow: 1;
    z-index: 2;
}


/* Text UI Positioning Classes */
#textui-container.t-top-left, .textui-wrapper.t-top-left { top: 5%; left: 2%; right: auto; bottom: auto; transform: none; }
#textui-container.t-top-middle, .textui-wrapper.t-top-middle { top: 5%; left: 50%; right: auto; bottom: auto; transform: translateX(-50%); }
#textui-container.t-top-right, .textui-wrapper.t-top-right { top: 5%; right: 2%; left: auto; bottom: auto; transform: none; }
#textui-container.t-left-center, .textui-wrapper.t-left-center { top: 50%; left: 20px; right: auto; bottom: auto; transform: translateY(-50%); }
#textui-container.t-middle-left, .textui-wrapper.t-middle-left { top: 50%; left: 2%; right: auto; bottom: auto; transform: translateY(-50%); }
#textui-container.t-middle-right, .textui-wrapper.t-middle-right { top: 50%; right: 2%; left: auto; bottom: auto; transform: translateY(-50%); }
#textui-container.t-bottom-left, .textui-wrapper.t-bottom-left { bottom: 5%; left: 2%; top: auto; right: auto; transform: none; }
#textui-container.t-bottom-middle, .textui-wrapper.t-bottom-middle { bottom: 5%; left: 50%; top: auto; right: auto; transform: translateX(-50%); }
#textui-container.t-bottom-right, .textui-wrapper.t-bottom-right { bottom: 5%; right: 2%; left: auto; top: auto; transform: none; }

/* Text UI Animations */
.tui-slide-in { animation: tuiSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.tui-slide-out { animation: tuiSlideOut 0.2s ease-in forwards; }

@keyframes tuiSlideIn {
    0% { opacity: 0; transform: translateX(-20px) scale(0.95); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes tuiSlideOut {
    0% { opacity: 1; transform: translateX(0) scale(1); }
    100% { opacity: 0; transform: translateX(-20px) scale(0.95); }
}

/* Fix transform conflicts for middle positions */
#textui-container.t-bottom-middle.tui-slide-in, .textui-wrapper.t-bottom-middle.tui-slide-in {
    animation: tuiSlideInMiddle 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
#textui-container.t-bottom-middle.tui-slide-out, .textui-wrapper.t-bottom-middle.tui-slide-out {
    animation: tuiSlideOutMiddle 0.2s ease-in forwards;
}
#textui-container.t-top-middle.tui-slide-in, .textui-wrapper.t-top-middle.tui-slide-in {
    animation: tuiSlideInMiddle 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
#textui-container.t-top-middle.tui-slide-out, .textui-wrapper.t-top-middle.tui-slide-out {
    animation: tuiSlideOutMiddle 0.2s ease-in forwards;
}

#textui-container.t-left-center.tui-slide-in, .textui-wrapper.t-left-center.tui-slide-in,
#textui-container.t-middle-left.tui-slide-in, .textui-wrapper.t-middle-left.tui-slide-in {
    animation: tuiSlideInLeftCenter 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
#textui-container.t-left-center.tui-slide-out, .textui-wrapper.t-left-center.tui-slide-out,
#textui-container.t-middle-left.tui-slide-out, .textui-wrapper.t-middle-left.tui-slide-out {
    animation: tuiSlideOutLeftCenter 0.2s ease-in forwards;
}

#textui-container.t-middle-right.tui-slide-in, .textui-wrapper.t-middle-right.tui-slide-in {
    animation: tuiSlideInRightCenter 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
#textui-container.t-middle-right.tui-slide-out, .textui-wrapper.t-middle-right.tui-slide-out {
    animation: tuiSlideOutRightCenter 0.2s ease-in forwards;
}

@keyframes tuiSlideInMiddle {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.95); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes tuiSlideOutMiddle {
    0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.95); }
}

@keyframes tuiSlideInLeftCenter {
    0% { opacity: 0; transform: translateY(-50%) translateX(-20px) scale(0.95); }
    100% { opacity: 1; transform: translateY(-50%) translateX(0) scale(1); }
}

@keyframes tuiSlideOutLeftCenter {
    0% { opacity: 1; transform: translateY(-50%) translateX(0) scale(1); }
    100% { opacity: 0; transform: translateY(-50%) translateX(-20px) scale(0.95); }
}

@keyframes tuiSlideInRightCenter {
    0% { opacity: 0; transform: translateY(-50%) translateX(20px) scale(0.95); }
    100% { opacity: 1; transform: translateY(-50%) translateX(0) scale(1); }
}

@keyframes tuiSlideOutRightCenter {
    0% { opacity: 1; transform: translateY(-50%) translateX(0) scale(1); }
    100% { opacity: 0; transform: translateY(-50%) translateX(20px) scale(0.95); }
}

/* =========================================
   RADIAL HUB SYSTEM
========================================= */

#radial-hub-container {
    position: absolute;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 10000;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
    opacity: 0;
}

#radial-hub-container:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

#radial-hub-container.hidden {
    display: none;
}

#radial-hub-center {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

#radial-hub-center:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Noise overlay */
#radial-hub-center::after, .radial-slice::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 1;
}

/* Diagonal Shimmer */
#radial-hub-center::before, .radial-slice::before {
    content: '';
    position: absolute;
    top: 0; left: -150%; width: 50%; height: 100%;
    background: linear-gradient(
        to right, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.04) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    animation: none;
    pointer-events: none;
    z-index: 5;
}

#radial-hub-container:not(.hidden) #radial-hub-center::before,
#radial-hub-container:not(.hidden) .radial-slice::before {
    animation: shimmerSwipe 1.5s ease-out forwards;
}

#radial-hub-icon {
    font-size: 22px;
    color: var(--text-color);
    margin-bottom: 2px;
    z-index: 2;
}

#radial-hub-title {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--label-color);
    z-index: 2;
    text-transform: uppercase;
}

#radial-hub-slices {
    position: absolute;
    width: 0;
    height: 0;
    top: 50%;
    left: 50%;
    z-index: 5;
}

.radial-pie-svg {
    position: absolute;
    pointer-events: none; /* Let clicks pass through gaps */
    transform-origin: center center;
    animation: pieSvgPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes pieSvgPopIn {
    0% { opacity: 0; transform: scale(0.8) rotate(-15deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.radial-pie-path {
    pointer-events: auto; /* Re-enable clicks for the paths */
    fill: var(--bg-color);
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 1px;
    cursor: pointer;
    transition: fill 0.2s ease, stroke 0.2s ease, filter 0.2s ease;
    opacity: 0;
    animation: piePathFadeIn 0.3s ease forwards;
}

@keyframes piePathFadeIn {
    to { opacity: 1; }
}

.radial-pie-path:hover,
.radial-pie-path.hovered {
    fill: rgba(25, 28, 35, 1.0);
    stroke: var(--type-color);
}

.radial-pie-content {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    pointer-events: none; /* Let path handle hover/click */
    opacity: 0;
    animation: pieContentFadeIn 0.3s ease forwards;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pieContentFadeIn {
    to { opacity: 1; }
}

.radial-pie-content.hovered {
    transform: translate(calc(-50% + var(--pos-x)), calc(-50% + var(--pos-y))) scale(1.15) !important;
}

.radial-pie-content i {
    font-size: 20px;
    margin-bottom: 4px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.radial-pie-content span {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--text-color);
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}


/* =========================================
   CONTEXT MENU SYSTEM
========================================= */

#context-menu-container {
    position: absolute;
    top: 50%;
    right: 16%;
    transform: translateY(-50%);
    width: 320px;
    max-height: 70vh;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9996;
    pointer-events: auto; /* Since focus is kept, we want mouse events here */
}

#context-menu-container.hidden {
    display: none;
}

#context-menu-container::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox=\"0 0 200 200\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cfilter id=\"noiseFilter\"%3E%3CfeTurbulence type=\"fractalNoise\" baseFrequency=\"0.85\" numOctaves=\"3\" stitchTiles=\"stitch\"/%3E%3C/filter%3E%3Crect width=\"100%25\" height=\"100%25\" filter=\"url(%23noiseFilter)\"/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 1;
}

#context-menu-header {
    position: relative;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 2;
    border-left: 1px solid var(--type-color, #3498db);
}

#context-menu-header::before {
    content: "";
    position: absolute;
    top: 0; left: -150%; width: 60%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.04) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    animation: pbShimmerSwipe 1.2s ease-out forwards;
    pointer-events: none;
}

#context-menu-header-icon {
    font-size: 20px;
    color: var(--type-color, #3498db);
}

#context-menu-header-title {
    color: var(--text-color);
    font-size: 16px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

#context-menu-close {
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s;
    z-index: 10;
    position: absolute;
    right: 20px;
}

#context-menu-close:hover {
    color: #fff;
}

#context-menu-items {
    position: relative;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Custom Scrollbar for Context Menu */
#context-menu-items::-webkit-scrollbar {
    width: 4px;
}
#context-menu-items::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}
#context-menu-items::-webkit-scrollbar-thumb {
    background: var(--type-color, rgba(255, 255, 255, 0.3));
    border-radius: 4px;
}
#context-menu-items::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.context-menu-item {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    position: relative;
    color: var(--text-color);
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.context-menu-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.context-menu-item-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: var(--item-color, rgba(255, 255, 255, 0.6));
    transition: color 0.2s;
}

.context-menu-item:hover .context-menu-item-icon {
    color: var(--item-hover-color, #fff);
}

.context-menu-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.context-menu-item-title {
    font-size: 14px;
    font-weight: 400;
}

.context-menu-item-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

@keyframes cmSlideInRight {
    0% { transform: translate(110%, -50%); opacity: 0; }
    100% { transform: translate(0, -50%); opacity: 1; }
}
@keyframes cmSlideOutRight {
    0% { transform: translate(0, -50%); opacity: 1; }
    100% { transform: translate(110%, -50%); opacity: 0; }
}
@keyframes cmSlideInLeft {
    0% { transform: translate(-110%, -50%); opacity: 0; }
    100% { transform: translate(0, -50%); opacity: 1; }
}
@keyframes cmSlideOutLeft {
    0% { transform: translate(0, -50%); opacity: 1; }
    100% { transform: translate(-110%, -50%); opacity: 0; }
}

.cm-slide-in { animation: cmSlideInRight 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }
.cm-slide-out { animation: cmSlideOutRight 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards; }

.context-menu-left { right: auto !important; left: 16%; }
.context-menu-left.cm-slide-in { animation: cmSlideInLeft 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }
.context-menu-left.cm-slide-out { animation: cmSlideOutLeft 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards; }


.context-menu-item.read-only {
    cursor: default;
    pointer-events: none;
}
.context-menu-item.read-only:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: transparent;
    transform: none;
}


/* Context Menu Tweaks & Themes */
#context-menu-back {
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s;
    z-index: 10;
    position: absolute;
    left: 20px;
}
#context-menu-back:hover {
    color: #fff;
}
#context-menu-back.hidden {
    display: none;
}

.context-menu-item.selected {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}
.context-menu-item.selected .context-menu-item-icon {
    color: var(--item-hover-color, #fff);
}

/* Theme: Solid */
#context-menu-container.theme-solid {
    background: #11141a;
    border: 1px solid var(--type-color, #3498db);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}
#context-menu-container.theme-solid::after {
    opacity: 0.02; /* slight noise reduction for solid */
}
#context-menu-container.theme-solid #context-menu-header {
    background: rgba(0, 0, 0, 0.4);
    border-left: none;
    border-bottom: 1px solid var(--type-color, #3498db);
}
#context-menu-container.theme-solid .context-menu-item {
    border-radius: 6px;
    margin-bottom: 4px;
}

#context-menu-container.play-shimmer::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 20%; height: 200%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-45deg);
    animation: cmShimmer 1.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    animation-delay: 0.1s;
    z-index: 10;
    pointer-events: none;
}

@keyframes cmShimmer {
    0% { left: -50%; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { left: 150%; opacity: 0; }
}



/* Context Menu Active Selection Adjustment for Solid Theme */
#context-menu-container.theme-solid .context-menu-item.selected {
    background: rgba(255, 255, 255, 0.05); /* Solid specific hover */
    border-color: rgba(255, 255, 255, 0.2);
}


/* SKILL CHECK SYSTEM */
#skillcheck-container { --sc-target-color: #2ecc71; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 200px; height: 200px; z-index: 900; display: flex; justify-content: center; align-items: center; }
#skillcheck-container.hidden { display: none; }
#skillcheck-box { position: relative; width: 100%; height: 100%; background: var(--bg-color); border-radius: 50%; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--border-color); overflow: hidden; display: flex; justify-content: center; align-items: center; }
#skillcheck-svg { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 180px; height: 180px; z-index: 2; overflow: visible; }
.skillcheck-bg { fill: transparent; stroke: rgba(255, 255, 255, 0.05); stroke-width: 8; }
.skillcheck-target { fill: transparent; stroke: #2ecc71; stroke-width: 8; stroke-linecap: round; transform-origin: 50px 50px; transition: stroke 0.2s; }
.skillcheck-indicator { fill: #ffffff; stroke: var(--sc-center-color, rgba(255, 255, 255, 0.15)); stroke-width: 1.5; transform-origin: 50px 50px; }
#skillcheck-key-container { position: absolute; z-index: 3; display: flex; justify-content: center; align-items: center; width: 50px; height: 50px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 8px; }
#skillcheck-key { color: #fff; font-family: 'Outfit', sans-serif; font-size: 24px; font-weight: 600; }
.sc-success .skillcheck-target { stroke: var(--sc-target-color); filter: brightness(1.3); transform: scale(1.05); }
.sc-fail #skillcheck-box { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px #e74c3c; animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake { 10%, 90% { transform: translate3d(-1px, 0, 0); } 20%, 80% { transform: translate3d(2px, 0, 0); } 30%, 50%, 70% { transform: translate3d(-4px, 0, 0); } 40%, 60% { transform: translate3d(4px, 0, 0); } }

/* Skill Check Shimmer */
#skillcheck-box.play-shimmer::before {
    content: '';
    position: absolute;
    top: 0; left: -150%; width: 60%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.04) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    animation: pbShimmerSwipe 1.2s ease-out forwards;
    pointer-events: none;
    z-index: 5;
}




/* =========================================
   INPUT DIALOG SYSTEM
========================================= */

#input-dialog-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    max-height: 85vh;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
    pointer-events: auto;
}

#input-dialog-container.hidden {
    display: none;
}

#input-dialog-container::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox=\"0 0 200 200\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cfilter id=\"noiseFilter\"%3E%3CfeTurbulence type=\"fractalNoise\" baseFrequency=\"0.85\" numOctaves=\"3\" stitchTiles=\"stitch\"/%3E%3C/filter%3E%3Crect width=\"100%25\" height=\"100%25\" filter=\"url(%23noiseFilter)\"/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 1;
}

#input-dialog-header {
    position: relative;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2;
    border-left: 2px solid var(--type-color, #3498db);
}

#input-dialog-header::before {
    content: "";
    position: absolute;
    top: 0; left: -150%; width: 60%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.04) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    animation: pbShimmerSwipe 1.2s ease-out forwards;
    pointer-events: none;
}

#input-dialog-header-icon {
    font-size: 20px;
    color: var(--type-color, #3498db);
}

#input-dialog-header-title {
    color: var(--text-color);
    font-size: 16px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex: 1;
    text-align: left;
}

#input-dialog-close {
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s;
    z-index: 10;
}

#input-dialog-close:hover {
    color: #fff;
}

#input-dialog-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

#input-dialog-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    color: var(--text-color);
}

#input-dialog-body::-webkit-scrollbar { width: 4px; }
#input-dialog-body::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 4px; }
#input-dialog-body::-webkit-scrollbar-thumb { background: var(--type-color, rgba(255, 255, 255, 0.3)); border-radius: 4px; }
#input-dialog-body::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.5); }

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-label i {
    color: var(--item-color, rgba(255, 255, 255, 0.4));
    font-size: 12px;
}

.input-field {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px 14px;
    border-radius: 4px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.input-field:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--type-color, rgba(255,255,255,0.3));
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05); /* Soft fallback glow */
}

.input-field::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

select.input-field {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    cursor: pointer;
}

select.input-field option {
    background: #111;
    color: #fff;
}

/* Color Input Styling */
input[type="color"].input-field {
    padding: 2px 4px;
    height: 38px;
    cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 2px; }

/* Checkbox */
.input-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px 14px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.input-checkbox-wrapper:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.input-checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    margin: 0;
}

.input-checkbox:checked {
    background: var(--type-color, #3498db);
    border-color: var(--type-color, #3498db);
}

.input-checkbox:checked::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
}

.input-checkbox-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    user-select: none;
}

/* Slider */
.input-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

.input-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--type-color, #3498db);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s;
}

.input-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.input-slider-value {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    min-width: 32px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Divider */
.input-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
    margin: 4px 0;
}

#input-dialog-footer {
    padding: 14px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    z-index: 2;
}

.input-dialog-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.input-dialog-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.input-dialog-btn.submit-btn {
    background: var(--type-color, #3498db);
    border-color: var(--type-color, #3498db);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.input-dialog-btn.submit-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Animations */
.id-fade-in { animation: idFadeIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }
.id-fade-out { animation: idFadeOut 0.2s ease-in forwards; }

@keyframes idFadeIn {
    0% { opacity: 0; transform: translate(-50%, -46%); }
    100% { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes idFadeOut {
    0% { opacity: 1; transform: translate(-50%, -50%); }
    100% { opacity: 0; transform: translate(-50%, -54%); }
}

.input-dialog-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2px;
}/* =========================================
   NPC DIALOG SYSTEM
   ========================================= */

#npc-dialog-container {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 900px;
    background: rgba(15, 15, 20, 0.95);
    border-radius: 8px;
    color: white;
    font-family: 'Outfit', sans-serif;
    display: flex;
    flex-direction: column;
    padding: 20px;
    z-index: 100;
    pointer-events: auto;
}

#npc-dialog-header {
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

#npc-dialog-icon {
    font-size: 24px;
    color: var(--type-color, #3498db);
    margin-right: 15px;
}

#npc-dialog-name {
    font-size: 20px;
    font-weight: 600;
}

#npc-dialog-job {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 10px;
    flex-grow: 1;
}

#npc-dialog-text {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.9);
}

#npc-dialog-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.npc-dialog-option {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.npc-dialog-option:hover, .npc-dialog-option.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--type-color, #3498db);
}

.npc-dialog-option-key {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    margin-right: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.npc-dialog-option-text {
    font-size: 14px;
}

/* Animations */
.npc-fade-in { animation: npcFadeIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }
.npc-fade-out { animation: npcFadeOut 0.2s ease-in forwards; }

@keyframes npcFadeIn {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes npcFadeOut {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(20px); }
}
#npc-dialog-container.hidden {
    display: none !important;
}

/* =========================================
   ACTION PANEL SYSTEM
   ========================================= */

#action-panel-container {
    position: absolute;
    width: 400px;
    background: rgba(15, 15, 20, 0.95);
    border-radius: 8px;
    color: white;
    font-family: 'Outfit', sans-serif;
    display: flex;
    flex-direction: column;
    padding: 20px;
    z-index: 105;
    pointer-events: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#action-panel-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

#action-panel-icon {
    font-size: 22px;
    color: var(--type-color, #3498db);
    margin-right: 12px;
}

#action-panel-title {
    font-size: 18px;
    font-weight: 600;
}

#action-panel-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    line-height: 1.5;
}

#action-panel-progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-bottom: 20px;
    overflow: hidden;
}

#action-panel-progress-bar {
    height: 100%;
    width: 100%;
    background: var(--type-color, #3498db);
    transition: width 0.1s linear;
}

#action-panel-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.action-panel-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-panel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.action-panel-btn.accept-btn {
    background: var(--type-color, #2ecc71);
    border-color: var(--type-color, #2ecc71);
    color: #fff;
}

.action-panel-btn.accept-btn:hover {
    filter: brightness(1.1);
}

.action-panel-btn.decline-btn {
    background: rgba(231, 76, 60, 0.2);
    border-color: rgba(231, 76, 60, 0.5);
    color: #e74c3c;
}

.action-panel-btn.decline-btn:hover {
    background: rgba(231, 76, 60, 0.4);
}

#action-panel-container.hidden {
    display: none !important;
}

/* Animations */
.ap-fade-in { animation: apFadeIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }
.ap-fade-out { animation: apFadeOut 0.2s ease-in forwards; }

@keyframes apFadeIn {
    0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes apFadeOut {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}
/* Dynamic Positions for Action Panel */
#action-panel-container.pos-top-center { top: 15%; left: 50%; transform: translateX(-50%); }
#action-panel-container.pos-bottom-center { bottom: 15%; top: auto; left: 50%; transform: translateX(-50%); }
#action-panel-container.pos-center { top: 50%; left: 50%; transform: translate(-50%, -50%); }
#action-panel-container.pos-top-right { top: 15%; left: auto; right: 2%; transform: none; }
#action-panel-container.pos-bottom-right { bottom: 15%; top: auto; left: auto; right: 2%; transform: none; }
#action-panel-container.pos-top-left { top: 15%; left: 2%; transform: none; }
#action-panel-container.pos-bottom-left { bottom: 15%; top: auto; left: 2%; transform: none; }

/* Keep Animations Relative */
.ap-fade-in.pos-top-center, .ap-fade-in.pos-bottom-center, .ap-fade-in.pos-center { animation: apFadeInCenter 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }
.ap-fade-out.pos-top-center, .ap-fade-out.pos-bottom-center, .ap-fade-out.pos-center { animation: apFadeOutCenter 0.2s ease-in forwards; }

.ap-fade-in.pos-top-right, .ap-fade-in.pos-bottom-right, .ap-fade-in.pos-top-left, .ap-fade-in.pos-bottom-left { animation: apFadeInSide 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }
.ap-fade-out.pos-top-right, .ap-fade-out.pos-bottom-right, .ap-fade-out.pos-top-left, .ap-fade-out.pos-bottom-left { animation: apFadeOutSide 0.2s ease-in forwards; }

@keyframes apFadeInCenter { 0% { opacity: 0; margin-top: -20px; } 100% { opacity: 1; margin-top: 0; } }
@keyframes apFadeOutCenter { 0% { opacity: 1; margin-top: 0; } 100% { opacity: 0; margin-top: -20px; } }

@keyframes apFadeInSide { 0% { opacity: 0; margin-top: -20px; } 100% { opacity: 1; margin-top: 0; } }
@keyframes apFadeOutSide { 0% { opacity: 1; margin-top: 0; } 100% { opacity: 0; margin-top: -20px; } }

/* General UI hidden fix */
.hidden {
    display: none !important;
}
