/* ═══════════════════════════════════════════════════════════════════ */
/* ANIMATIONS & KEYFRAMES - OPTIMIZED FOR PERFORMANCE */
/* ═══════════════════════════════════════════════════════════════════ */

@keyframes gradient-slow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-32px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(32px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounce-gentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.35; }
}

@keyframes emoji-pop {
    0% {
        transform: scale(0.7) rotate(-10deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.1) rotate(3deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(2.8);
        opacity: 0;
    }
}

@keyframes card-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes scene-enter {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes logo-pro-enter {
    0% {
        opacity: 0;
        transform: translateY(32px) scale(0.82);
        filter: blur(14px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes logo-float-pro {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    30% {
        transform: translateY(-7px) rotate(0.4deg);
    }
    70% {
        transform: translateY(-3px) rotate(-0.25deg);
    }
}

@keyframes ring-breathe {
    0%, 100% {
        opacity: 0.25;
        transform: scale(1);
    }
    50% {
        opacity: 0.55;
        transform: scale(1.025);
    }
}

@keyframes char-reveal {
    0% {
        opacity: 0;
        transform: translateY(0.45em);
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes ambient-drift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(-28px, 14px) scale(1.06);
    }
    66% {
        transform: translate(18px, -10px) scale(0.97);
    }
}

@keyframes under-glow {
    0%, 100% {
        opacity: 0.35;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1.15);
    }
}

@keyframes title-shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes orb-float {
    0% {
        transform: translateY(0px) translateX(0px) scale(1);
        opacity: 0;
    }
    10% { opacity: 1; }
    50% {
        transform: translateY(-38vh) translateX(var(--drift-x)) scale(0.85);
        opacity: 0.7;
    }
    90% { opacity: 0.3; }
    100% {
        transform: translateY(-76vh) translateX(calc(var(--drift-x) * 1.4)) scale(0.4);
        opacity: 0;
    }
}

.pro-orb {
    position: absolute;
    bottom: 0;
    pointer-events: none;
    will-change: transform, opacity;
    animation: orb-float linear infinite;
    opacity: 0;
    border-radius: 50%;
}

@keyframes card-slide-in {
    from {
        opacity: 0;
        transform: translateX(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes icon-spin-bounce {
    0% { transform: scale(0) rotate(-180deg); }
    60% { transform: scale(1.2) rotate(15deg); }
    80% { transform: scale(0.9) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

@keyframes float-icon {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-6px) rotate(5deg);
    }
    66% {
        transform: translateY(-3px) rotate(-3deg);
    }
}

@keyframes shimmer-card {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes page-slide-in {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes settings-in {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(16px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes sugg-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes profile-in {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(16px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes dual-box-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes cta-glow {
    0%, 100% {
        box-shadow: 0 4px 24px rgba(58, 111, 168, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.07);
    }
    50% {
        box-shadow: 0 8px 48px rgba(107, 63, 192, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    }
}

/* ═══════════════════════════════════════════════════════════════════ */
/* UTILITY CLASSES - PERFORMANCE OPTIMIZED */
/* ═══════════════════════════════════════════════════════════════════ */

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-slow 14s ease infinite;
}

.shimmer-text {
    background-size: 200% auto;
    animation: shimmer 4s linear infinite;
}

.animate-card-float {
    animation: card-float 4s ease-in-out infinite;
}

.animate-bounce-gentle {
    animation: bounce-gentle 3.5s ease-in-out infinite;
}

.animate-spin-slow {
    animation: spin-slow 30s linear infinite;
}

.animate-spin-slow-rev {
    animation: spin-slow 22s linear infinite reverse;
}

.glass-panel {
    background: rgba(14, 33, 50, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(70, 130, 180, 0.15);
}

.draggable {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.draggable:active {
    cursor: grabbing;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #1e3a5f;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4682B4;
}

.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.tilt-card {
    transform: rotate(-1.2deg);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.tilt-card:hover {
    transform: rotate(0deg) scale(1.02);
}

.tilt-card:active {
    transform: scale(0.98);
}

.tilt-card-r {
    transform: rotate(1deg);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.tilt-card-r:hover {
    transform: rotate(0deg) scale(1.02);
}

.tilt-card-r:active {
    transform: scale(0.98);
}

.ripple-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(70, 130, 180, 0.4);
    animation: ripple 2.4s ease-out infinite;
    pointer-events: none;
}

.tc-card {
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.tc-card:hover {
    transform: translateY(-2px);
}

.tc-card:active {
    transform: translateY(0);
}

.tc-card-animated {
    animation: card-slide-in 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.tc-icon-animated {
    animation: icon-spin-bounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.tc-pulse-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid currentColor;
    animation: pulse-ring 1.5s ease-out infinite;
    pointer-events: none;
}

.float-icon {
    animation: float-icon 3s ease-in-out infinite;
}

.scan-grid {
    background-image: linear-gradient(rgba(70, 130, 180, 0.025) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(70, 130, 180, 0.025) 1px, transparent 1px);
    background-size: 48px 48px;
}

#welcome-screen,
#tc-modal,
#app-main {
    will-change: auto;
}

#output-label {
    transition: color 0.3s ease;
}

#get-started-btn:hover #btn-arrow {
    transform: translateX(4px);
}

#btn-arrow {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#hero-title {
    background-image: linear-gradient(130deg, #e8f4ff 0%, #a8d0f8 30%, #d4beff 65%, #9fd8ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: title-shimmer 6s ease infinite;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* CATEGORY CARDS - ENHANCED INTERACTIONS */
/* ═══════════════════════════════════════════════════════════════════ */

.cat-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.cat-card:hover {
    transform: translateY(-4px) scale(1.02);
}

.cat-card:active {
    transform: scale(0.97);
}

/* ═══════════════════════════════════════════════════════════════════ */
/* DETAIL PAGE - SMOOTH TRANSITIONS */
/* ═══════════════════════════════════════════════════════════════════ */

#detail-page {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: #020d18;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
    opacity: 0;
    -webkit-overflow-scrolling: touch;
}

#detail-page.open {
    display: block;
    animation: page-slide-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ex-card {
    background: rgba(14, 33, 50, 0.6);
    border: 1px solid rgba(70, 130, 180, 0.12);
    border-radius: 16px;
    padding: 16px 18px;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.ex-card:hover {
    background: rgba(30, 58, 95, 0.5);
    border-color: rgba(70, 130, 180, 0.3);
    transform: translateY(-2px);
}

.ex-card:active {
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════ */
/* NAVIGATION & LOGO - INCREASED SIZE & BETTER SPACING */
/* ═══════════════════════════════════════════════════════════════════ */

nav {
    height: 60px !important;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo-img {
    width: 64px !important;
    height: 64px !important;
    transition: transform 0.3s ease;
}

.nav-logo-img:hover {
    transform: scale(1.05);
}

/* ═══════════════════════════════════════════════════════════════════ */
/* COMPACT HEADER & HERO SECTION - IMPROVED READABILITY */
/* ═══════════════════════════════════════════════════════════════════ */

main .pt-24 {
    padding-top: 80px !important;
}

header.max-w-3xl {
    margin-bottom: 2rem !important;
}

header h2 {
    font-size: clamp(2rem, 8vw, 3.5rem) !important;
    margin-bottom: 0.875rem !important;
    line-height: 1.1 !important;
    letter-spacing: -0.02em;
}

header p {
    font-size: 0.9375rem !important;
    line-height: 1.6 !important;
    max-width: 540px !important;
    color: rgba(209, 228, 251, 0.85);
}

header .inline-flex {
    margin-bottom: 0.875rem !important;
    padding: 6px 14px !important;
    font-size: 0.6875rem !important;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* AD PLACEMENT SLOTS - RESPONSIVE & SUBTLE */
/* ═══════════════════════════════════════════════════════════════════ */

.ad-banner-top {
    width: 100%;
    max-width: 728px;
    height: auto;
    min-height: 90px;
    margin: 1rem auto;
    background: rgba(14, 33, 50, 0.3);
    border: 1px solid rgba(70, 130, 180, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-banner-middle {
    width: 100%;
    max-width: 970px;
    height: auto;
    min-height: 90px;
    margin: 2rem auto;
    background: rgba(14, 33, 50, 0.3);
    border: 1px solid rgba(70, 130, 180, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-sidebar {
    width: 100%;
    max-width: 300px;
    height: auto;
    min-height: 250px;
    background: rgba(14, 33, 50, 0.3);
    border: 1px solid rgba(70, 130, 180, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 80px;
}

@media (max-width: 768px) {
    .ad-banner-top,
    .ad-banner-middle {
        min-height: 60px;
        max-width: 100%;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }
    
    .ad-sidebar {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════ */
/* SUGGESTION CHIPS - IMPROVED TOUCH TARGETS */
/* ═══════════════════════════════════════════════════════════════════ */

.sugg-chip-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 9999px;
    background: rgba(70, 130, 180, 0.1);
    border: 1px solid rgba(70, 130, 180, 0.22);
    color: rgba(147, 197, 253, 0.88);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    min-height: 32px;
}

.sugg-chip-item:hover {
    background: rgba(70, 130, 180, 0.24);
    border-color: rgba(70, 130, 180, 0.45);
    transform: scale(1.05);
}

.sugg-chip-item:active {
    transform: scale(0.98);
}

#sugg-area {
    animation: sugg-in 0.22s ease both;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* SETTINGS MODAL - ENHANCED ACCESSIBILITY */
/* ═══════════════════════════════════════════════════════════════════ */

#settings-modal {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 24px;
}

#settings-modal.open {
    display: flex;
}

#settings-box {
    animation: settings-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
    max-width: 440px;
    width: 100%;
    background: linear-gradient(145deg, #080f1f, #0e1a2e, #07121e);
    border: 1px solid rgba(70, 130, 180, 0.22);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(70, 130, 180, 0.06);
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* PROFILE MODAL - POLISHED UI */
/* ═══════════════════════════════════════════════════════════════════ */

#profile-modal {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 24px;
}

#profile-modal.open {
    display: flex;
}

#profile-box {
    animation: profile-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
    max-width: 420px;
    width: 100%;
    background: linear-gradient(145deg, #080f1f, #0e1a2e, #07121e);
    border: 1px solid rgba(70, 130, 180, 0.22);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(70, 130, 180, 0.06);
}

/* ═══════════════════════════════════════════════════════════════════ */
/* SETTINGS TOGGLE - SMOOTH ANIMATIONS */
/* ═══════════════════════════════════════════════════════════════════ */

.settings-toggle {
    width: 52px;
    height: 28px;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    position: relative;
    transition: background 0.3s ease;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.settings-toggle-knob {
    position: absolute;
    top: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-toggle.on {
    background: #4682B4;
}

.settings-toggle.off {
    background: #243648;
}

.settings-toggle.on .settings-toggle-knob {
    left: calc(100% - 25px);
}

.settings-toggle.off .settings-toggle-knob {
    left: 3px;
}

.settings-toggle:focus {
    outline: 2px solid rgba(70, 130, 180, 0.5);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* MANUAL TRANSLATE BUTTON - ENHANCED VISIBILITY */
/* ═══════════════════════════════════════════════════════════════════ */

#manual-translate-btn {
    display: none;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #4682B4, #7c3aed, #4682B4);
    background-size: 200%;
    animation: gradient-slow 3s ease infinite;
    color: white;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(70, 130, 180, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
}

#manual-translate-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 24px rgba(70, 130, 180, 0.5);
}

#manual-translate-btn:active {
    transform: scale(0.96);
}

#manual-translate-btn:focus {
    outline: 2px solid rgba(70, 130, 180, 0.6);
    outline-offset: 2px;
}

#manual-translate-btn.show {
    display: inline-flex;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* OUTPUT EMOJI SIZING & SPACING - OPTIMIZED RENDERING */
/* ═══════════════════════════════════════════════════════════════════ */

#main-output .emoji-output-text {
    font-size: 1.3em !important;
    line-height: 1.6 !important;
    letter-spacing: 0.02em !important;
    word-spacing: 0.35em !important;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
    display: inline-block;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    word-break: keep-all;
    overflow-wrap: break-word;
}

#main-output .emoji-output-text span {
    font-size: 1em !important;
    display: inline;
}

@media (max-width: 640px) {
    #main-output .emoji-output-text {
        font-size: 1.2em !important;
        line-height: 1.5 !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════ */
/* DUAL OUTPUT BOX - CLEAN LAYOUT */
/* ═══════════════════════════════════════════════════════════════════ */

#dual-output {
    display: none;
    flex-direction: column;
    gap: 14px;
    margin-top: 14px;
}

#dual-output.show {
    display: flex;
    animation: dual-box-in 0.35s ease both;
}

.dual-result-box {
    background: rgba(14, 33, 50, 0.7);
    border: 1px solid rgba(70, 130, 180, 0.18);
    border-radius: 16px;
    padding: 16px 18px;
}

.dual-result-box .emoji-output-text {
    font-size: 1.3em !important;
    line-height: 1.6 !important;
    letter-spacing: 0.02em !important;
    word-spacing: 0.35em !important;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* SOCIAL LINKS - BETTER TOUCH TARGETS */
/* ═══════════════════════════════════════════════════════════════════ */

.social-link-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid rgba(70, 130, 180, 0.18);
    background: rgba(14, 33, 50, 0.5);
    color: rgba(209, 228, 251, 0.85);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 52px;
}

.social-link-btn:hover {
    background: rgba(30, 58, 95, 0.6);
    border-color: rgba(70, 130, 180, 0.4);
    transform: translateY(-2px);
    color: white;
}

.social-link-btn:active {
    transform: scale(0.98);
}

.social-link-btn:focus {
    outline: 2px solid rgba(70, 130, 180, 0.5);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* EMOJI SIZE CONTROLS - RESPONSIVE SCALING */
/* ═══════════════════════════════════════════════════════════════════ */

.emoji-size-sm .emoji-output-text {
    font-size: 1.1em !important;
}

.emoji-size-md .emoji-output-text {
    font-size: 1.3em !important;
}

.emoji-size-lg .emoji-output-text {
    font-size: 1.6em !important;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* SPACING CONTROLS - REFINED VALUES */
/* ═══════════════════════════════════════════════════════════════════ */

.spacing-compact .emoji-output-text {
    letter-spacing: 0 !important;
    word-spacing: 0.25em !important;
}

.spacing-spacious .emoji-output-text {
    letter-spacing: 0.02em !important;
    word-spacing: 0.55em !important;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* AMBIGUITY BADGE - CLEAR VISUAL INDICATOR */
/* ═══════════════════════════════════════════════════════════════════ */

.ambiguity-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 9999px;
    background: rgba(251, 146, 60, 0.15);
    border: 1px solid rgba(251, 146, 60, 0.3);
    color: rgba(253, 186, 116, 0.9);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* MOBILE OPTIMIZATIONS - ENHANCED TOUCH EXPERIENCE */
/* ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    html {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        -webkit-tap-highlight-color: transparent;
    }
    
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    nav {
        height: 58px !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .nav-logo-img {
        width: 56px !important;
        height: 56px !important;
    }
    
    main .pt-24 {
        padding-top: 72px !important;
    }
    
    header h2 {
        font-size: 2.25rem !important;
        margin-bottom: 1rem !important;
    }
    
    header p {
        font-size: 0.875rem !important;
    }
    
    #main-output .emoji-output-text {
        font-size: 1.2em !important;
        line-height: 1.5 !important;
    }
    
    .emoji-size-sm .emoji-output-text {
        font-size: 1.05em !important;
    }
    
    .emoji-size-lg .emoji-output-text {
        font-size: 1.45em !important;
    }
    
    .sugg-chip-item {
        font-size: 0.7rem;
        padding: 6px 12px;
        min-height: 36px;
    }
    
    #settings-box,
    #profile-box {
        max-width: 95%;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    header h2 {
        font-size: 1.875rem !important;
    }
    
    #main-output .emoji-output-text {
        font-size: 1.15em !important;
    }
    
    .emoji-size-lg .emoji-output-text {
        font-size: 1.35em !important;
    }
    
    .social-link-btn {
        padding: 14px 16px;
        font-size: 0.8125rem;
        min-height: 48px;
    }
}

/* ═══════════════════════════════════════════════════════════════════ */
/* ENSURE CONSISTENT RENDERING ACROSS PLATFORMS */
/* ═══════════════════════════════════════════════════════════════════ */

#main-output {
    min-height: 140px;
    padding: 0.5rem;
}

#main-output .emoji-output-text {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    word-break: keep-all;
    overflow-wrap: break-word;
    hyphens: none;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* ACCESSIBILITY IMPROVEMENTS */
/* ═══════════════════════════════════════════════════════════════════ */

*:focus-visible {
    outline: 2px solid rgba(70, 130, 180, 0.6);
    outline-offset: 2px;
}

button:focus-visible,
.cat-card:focus-visible,
.ex-card:focus-visible,
.sugg-chip-item:focus-visible {
    outline: 2px solid rgba(70, 130, 180, 0.7);
    outline-offset: 3px;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* PERFORMANCE OPTIMIZATION - REDUCE REPAINTS */
/* ═══════════════════════════════════════════════════════════════════ */

.animate-card-float,
.animate-bounce-gentle,
.animate-spin-slow,
.animate-spin-slow-rev {
    will-change: transform;
}

.animate-gradient,
.shimmer-text,
#hero-title {
    will-change: background-position;
}

/* Remove will-change from static elements */
.tc-card,
.tilt-card,
.tilt-card-r,
.cat-card,
.ex-card,
.social-link-btn {
    will-change: auto;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* LOADING STATES - SMOOTH TRANSITIONS */
/* ═══════════════════════════════════════════════════════════════════ */

.loading {
    opacity: 0.6;
    pointer-events: none;
    cursor: wait;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: inherit;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* PRINT STYLES - CLEAN OUTPUT */
/* ═══════════════════════════════════════════════════════════════════ */

@media print {
    nav,
    .ad-banner-top,
    .ad-banner-middle,
    .ad-sidebar,
    #settings-modal,
    #profile-modal,
    .sugg-chip-item {
        display: none !important;
    }
    
    #main-output .emoji-output-text {
        color: #000;
        font-size: 1.5em !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════ */
/* REDUCED MOTION SUPPORT - ACCESSIBILITY */
/* ═══════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════ */
/* HIGH CONTRAST MODE - ACCESSIBILITY */
/* ═══════════════════════════════════════════════════════════════════ */

@media (prefers-contrast: high) {
    .cat-card,
    .ex-card,
    .social-link-btn,
    .sugg-chip-item {
        border-width: 2px;
    }
    
    #main-output .emoji-output-text {
        filter: contrast(1.2);
    }
}