* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Smooth scrolling support */
html {
    scroll-behavior: smooth;
}

html.lenis {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

html,
body {
    height: 100%;
    font-family:
        "Poppins",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 25%, #2a2a2a 50%, #1e1e1e 75%, #0f0f0f 100%);
    color: #ffffff;
    overflow-x: hidden;
    overflow-y: hidden;
    position: relative;

    /* Enhanced font rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1;
    font-kerning: auto;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(30, 30, 30, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(40, 40, 40, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.barrio-regular {
    font-family: "Barrio", system-ui;
    font-weight: 400;
    font-style: normal;
}

.glow-effect:hover::before {
    opacity: 0.3;
}

/* Floating particles animation */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* === Floating Combat Numbers === */
.floating-number {
    position: absolute;
    pointer-events: none;
    font-weight: 700;
    font-size: 18px;
    opacity: 0;
    transform: translate(-50%, 0) scale(0.8);
    transition:
        opacity 0.3s ease,
        transform 0.5s ease;
    z-index: 100000;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.floating-number.show {
    opacity: 1;
    transform: translate(-50%, -30px) scale(1);
}

.floating-number.fade {
    opacity: 0;
    transform: translate(-50%, -60px) scale(0.9);
}

.floating-number.damage {
    color: #ff5757;
}

.floating-number.heal {
    color: #33ff99;
}

/* === Turn Order Bar === */
#turnOrderBar {
    position: fixed;
    bottom: 128px;
    left: 50%;
    transform: translateX(-50%);
    gap: 4px;
    background: rgba(20, 20, 25, 0.85);
    padding: 4px 8px;
    border-radius: 20px;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.5);
    z-index: 5000;
    font-family: var(--font, sans-serif);
    opacity: 0;
    transition:
        opacity 1.5s ease,
        transform 1.5s ease;
}

#turnOrderBar.visible {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

#turnOrderBar .turn-slot {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px 3px 5px;
    border-radius: 16px;
    background: linear-gradient(135deg, #2a2a33, #1b1b22);
    font-size: 10px;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

#turnOrderBar .turn-slot .avatar {
    font-size: 22px;
}

#turnOrderBar .turn-slot.current {
    background: linear-gradient(135deg, #ffce54, #ff8e3c);
    color: #222;
    font-weight: 700;
    box-shadow:
        0 0 0 1px rgba(255, 200, 80, 0.6),
        0 0 8px -1px rgba(255, 160, 0, 0.7);
}

#turnOrderBar .turn-slot.next {
    background: linear-gradient(135deg, #3a3a46, #262630);
    animation: nextPulse 3.6s ease-in-out infinite;
}

@keyframes nextPulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 170, 60, 0);
    }

    50% {
        box-shadow: 0 0 0 3px rgba(255, 170, 60, 0.25);
    }
}

/* Turn order bar entrance/transition animations */
#turnOrderBar.visible {
    animation: turnBarIn 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes turnBarIn {
    from {
        transform: translateY(12px) scale(0.98);
        opacity: 0;
    }

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

/* When the turn changes, briefly flash the bar */
.turn-change-animate {
    animation: barPulse 820ms ease-out;
}

@keyframes barPulse {
    0% {
        transform: translateY(0) scale(1);
    }

    30% {
        transform: translateY(-6px) scale(1.02);
    }

    60% {
        transform: translateY(0) scale(1);
    }

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

/* Pulse/Glow for the current player's slot */
.turn-slot.current.active-pulse {
    animation: slotPulse 900ms cubic-bezier(0.2, 1, 0.22, 1);
    transform-origin: center center;
}

@keyframes slotPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    }

    35% {
        transform: scale(1.08);
        box-shadow: 0 6px 20px rgba(255, 200, 60, 0.12);
    }

    60% {
        transform: scale(1.02);
        box-shadow: 0 8px 28px rgba(255, 160, 40, 0.18);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* Slight avatar pop for current slot to emphasize turn */
.turn-slot.current .avatar {
    transition:
        transform 220ms ease,
        box-shadow 220ms ease;
}

.turn-slot.current.active-pulse .avatar {
    transform: scale(1.12);
    box-shadow: 0 6px 18px rgba(255, 160, 40, 0.18);
}

/* === Action Button Cooldowns === */
.action-btn {
    position: relative;
}

.action-btn.cooldown {
    filter: grayscale(0.6) brightness(0.7);
    cursor: not-allowed;
}

.action-btn .cd-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    background: linear-gradient(135deg, #ff5a5a, #d62222);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 12px;
    box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.6);
    font-weight: 600;
    animation: cdPop 0.3s ease;
}

/* Visual state when server is picking who goes first */
.action-bar.pick-in-progress .action-btn {
    opacity: 0.35 !important;
    pointer-events: none !important;
    filter: grayscale(0.6) contrast(0.8) !important;
    transform: none !important;
}

@keyframes cdPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

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

/* Adjust for very small screens */
@media (max-width: 600px) {
    #turnOrderBar {
        display: none !important;
        bottom: 70px;
        flex-wrap: wrap;
    }
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

.container {
    min-height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    max-width: 900px;
    margin: 0 auto;
    padding: 15px 20px 10px;
    position: relative;
    overflow: hidden;
}

.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px 0 20px;
    position: relative;
}

.title {
    font-family: "Rubik Distressed", cursive;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 400;
    background: linear-gradient(135deg, #404040, #444444, #525252, #333333, #2b2b2b);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: #ff800091;
    animation: gradientShift 4s ease-in-out infinite;
    text-shadow: 0 0 30px rgb(255 178 0);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

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

    50% {
        background-position: 100% 50%;
    }
}

.subtitle {
    font-family: "JetBrains Mono", "Inter", monospace;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.2);
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ================= Expandable Action Menu ================= */
.action-menu {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 1001;
}

.action-menu-toggle {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: linear-gradient(135deg, #404040, #606060);
    border: none;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.action-menu-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #505050, #707070);
}

.action-menu-toggle.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.action-menu-toggle.active:hover {
    background: linear-gradient(135deg, #ff5849, #d63031);
}

.action-menu-items {
    position: absolute;
    bottom: 54px;
    /* Show above the toggle button */
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.action-menu-items.expanded {
    opacity: 1;
    visibility: visible;
}

.action-menu-item {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    /* Make all buttons perfect circles */
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transform: scale(0.8);
}

.action-menu-items.expanded .action-menu-item {
    transform: scale(1);
}

.action-menu-item:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

/* Button colors */
.chaos-btn {
    background: linear-gradient(135deg, #d63031, #e17055);
    border-color: rgba(255, 150, 150, 0.3);
}

.poll-btn {
    background: linear-gradient(135deg, #0984e3, #00b894);
    border-color: rgba(150, 200, 255, 0.3);
}

.attachment-btn {
    background: linear-gradient(135deg, #00b894, #00cec9);
    border-color: rgba(150, 255, 200, 0.3);
}

.ready-btn {
    background: linear-gradient(135deg, #e17055, #fdcb6e);
    border-color: rgba(255, 200, 150, 0.3);
}

.ready-btn-menu {
    animation: readyPulse 1.5s ease-in-out infinite;
}

@keyframes readyPulse {
    0%,
    100% {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    }

    50% {
        box-shadow:
            0 6px 20px rgba(39, 174, 96, 0.8),
            0 0 25px rgba(46, 204, 113, 0.5);
    }
}

/* Special states for chaos mode button in menu */
.action-menu-item.enabled {
    background: linear-gradient(135deg, #7f8c8d, #95a5a6) !important;
}

.action-menu-item.disabled {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
}

/* Mobile optimization for action menu */
@media (max-width: 768px) {
    .action-menu {
        bottom: 4px;
        left: 4px;
    }

    .action-menu-toggle {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }

    .action-menu-item {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }

    /* Better mobile spacing */
    .input-row {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .action-menu-toggle {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .action-menu-items {
        gap: 4px;
        bottom: 48px;
        /* Adjusted for smaller toggle button */
    }

    .action-menu-item {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        /* Keep perfect circles */
        font-size: 16px;
        /* Bigger emojis on mobile */
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .action-menu-item i {
        font-size: 14px;
        /* Bigger FontAwesome icons */
    }

    /* Ensure mobile buttons keep desktop colors */
    .chaos-btn {
        background: linear-gradient(135deg, #d63031, #e17055) !important;
        border-color: rgba(255, 150, 150, 0.3) !important;
    }

    .poll-btn {
        background: linear-gradient(135deg, #0984e3, #00b894) !important;
        border-color: rgba(150, 200, 255, 0.3) !important;
    }

    .attachment-btn {
        background: linear-gradient(135deg, #00b894, #00cec9) !important;
        border-color: rgba(150, 255, 200, 0.3) !important;
    }

    .ready-btn {
        background: linear-gradient(135deg, #e17055, #fdcb6e) !important;
        border-color: rgba(255, 200, 150, 0.3) !important;
    }

    .text-input {
        min-height: 44px;
        /* Better touch target on mobile */
        font-size: 16px !important;
        /* Prevent zoom on iOS */
    }

    .send-btn {
        min-width: 44px;
        height: 44px;
    }
}

/* User Count HUD - Enhanced with user list */
.user-hud {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 12px 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 120px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.user-hud:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.user-hud-icon {
    font-size: 16px;
    color: #00ff88;
    animation: pulse 2s infinite;
}

.user-count {
    font-weight: 600;
    font-size: 14px;
    color: #ffffff;
}

.user-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

/* Online Users Panel */
.online-users-panel {
    position: fixed;
    top: 70px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px;
    z-index: 999;
    max-width: 250px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transform: translateY(-10px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.online-users-panel.show {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.online-users-header {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.online-users-header i {
    color: #00ff88;
}

.online-users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.online-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.online-user:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.online-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #404040, #606060);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.online-user-info {
    flex: 1;
    min-width: 0;
}

.online-user-nickname {
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.online-user-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

.online-indicator {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.nickname-section {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.nickname-container {
    position: relative;
    max-width: 320px;
    opacity: 30%;
    margin: 0 auto;
}

.nickname-container:hover {
    opacity: 1;
}

.nickname-row {
    display: flex;
    justify-content: center;
    align-items: center;
}

.nickname-input-group {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 25px;
    padding: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nickname-input-group:focus-within {
    border-color: rgba(100, 100, 100, 0.3);
    box-shadow:
        0 0 0 3px rgba(100, 100, 100, 0.1),
        0 8px 32px rgba(100, 100, 100, 0.2);
    transform: translateY(-2px);
}

.emoji-prefix {
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    margin-left: 6px;
    user-select: none;
}

.nickname-input {
    flex: 1;
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 15px;
    text-align: left;
    outline: none;
}

.nickname-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.emoji-picker-btn {
    padding: 6px 10px;
    background: rgba(100, 100, 100, 0.2);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: #ffffff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 3px;
    min-width: 32px;
    height: 32px;
    justify-content: center;
}

.emoji-picker-btn:hover {
    background: rgba(100, 100, 100, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(100, 100, 100, 0.2);
}

.emoji-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.emoji-modal.active {
    display: flex;
}

.emoji-modal-content {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 600px;
    overflow-y: auto;
}

.emoji-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.emoji-modal-title {
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.close-emoji-modal {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.close-emoji-modal:hover {
    opacity: 1;
}

.emoji-categories {
    margin-bottom: 20px;
}

.emoji-category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.emoji-category-tab {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    color: #ffffff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.emoji-category-tab:hover,
.emoji-category-tab.active {
    background: rgba(100, 100, 100, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 15px;
}

.emoji-option {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.emoji-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.messages-container {
    flex: 1;
    min-height: 0;
    margin-bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 120px;
    -webkit-overflow-scrolling: touch;
}

.message {
    background: rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 20px;
    border: solid 1px #005885;
    position: relative;
    overflow: hidden;
    animation: messageSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.message:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

@keyframes messageSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes explodeOut {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: brightness(1) contrast(1) hue-rotate(0deg);
        box-shadow: 0 0 0 rgba(255, 0, 0, 0);
    }

    15% {
        opacity: 1;
        transform: scale(1.05) rotate(2deg);
        filter: brightness(1.2) contrast(1.3) hue-rotate(45deg);
        box-shadow: 0 0 20px rgba(255, 50, 50, 0.8);
    }

    30% {
        opacity: 0.9;
        transform: scale(1.15) rotate(-3deg);
        filter: brightness(1.5) contrast(2) hue-rotate(90deg) saturate(200%);
        box-shadow:
            0 0 40px rgba(255, 100, 0, 0.9),
            inset 0 0 20px rgba(255, 255, 0, 0.3);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.3) rotate(8deg) translateY(-10px);
        filter: brightness(2) contrast(3) hue-rotate(180deg) saturate(300%) blur(1px);
        box-shadow:
            0 0 60px rgba(255, 0, 255, 1),
            0 0 100px rgba(255, 100, 100, 0.5),
            inset 0 0 30px rgba(255, 255, 255, 0.5);
    }

    70% {
        opacity: 0.4;
        transform: scale(1.8) rotate(-15deg) translateY(-20px) translateX(10px);
        filter: brightness(3) contrast(5) hue-rotate(270deg) saturate(500%) blur(3px);
        box-shadow:
            0 0 80px rgba(255, 255, 0, 1),
            0 0 120px rgba(255, 50, 50, 0.8),
            0 0 160px rgba(255, 0, 255, 0.6),
            inset 0 0 50px rgba(255, 255, 255, 0.7);
    }

    85% {
        opacity: 0.2;
        transform: scale(2.5) rotate(25deg) translateY(-40px) translateX(-15px);
        filter: brightness(5) contrast(10) hue-rotate(360deg) saturate(1000%) blur(8px);
        box-shadow:
            0 0 150px rgba(255, 255, 255, 1),
            0 0 200px rgba(255, 100, 0, 1),
            0 0 250px rgba(255, 0, 0, 0.8);
    }

    100% {
        opacity: 0;
        transform: scale(3) rotate(45deg) translateY(-60px) translateX(20px);
        filter: brightness(10) contrast(20) hue-rotate(720deg) saturate(2000%) blur(15px);
        box-shadow:
            0 0 200px rgba(255, 255, 255, 0.5),
            0 0 300px rgba(255, 255, 255, 0.3);
    }
}

@keyframes fadeOut {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: brightness(1) blur(0px) hue-rotate(0deg);
    }

    25% {
        opacity: 0.8;
        transform: scale(0.95) rotate(-2deg);
        filter: brightness(0.8) blur(1px) hue-rotate(45deg);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8) rotate(3deg);
        filter: brightness(0.5) blur(3px) hue-rotate(90deg) saturate(200%);
    }

    75% {
        opacity: 0.2;
        transform: scale(0.6) rotate(-5deg);
        filter: brightness(0.3) blur(8px) hue-rotate(180deg) contrast(150%);
    }

    100% {
        opacity: 0;
        transform: scale(0.3) rotate(10deg);
        filter: brightness(0) blur(15px) hue-rotate(360deg);
    }
}

@keyframes destroyGlitch {
    0% {
        transform: translateX(0) translateY(0) skewX(0deg);
        filter: hue-rotate(0deg) contrast(1) brightness(1);
        opacity: 1;
        box-shadow: 0 0 0 rgba(255, 0, 0, 0);
    }

    5% {
        transform: translateX(-8px) translateY(2px) skewX(-5deg);
        filter: hue-rotate(60deg) contrast(200%) brightness(150%) invert(0.2);
        opacity: 0.95;
        box-shadow:
            8px 0 0 rgba(255, 0, 0, 0.8),
            -8px 0 0 rgba(0, 255, 0, 0.8);
    }

    10% {
        transform: translateX(12px) translateY(-3px) skewX(8deg) skewY(-2deg);
        filter: hue-rotate(120deg) contrast(300%) brightness(200%) invert(0.5) saturate(300%);
        opacity: 0.9;
        box-shadow:
            -12px 0 0 rgba(0, 255, 255, 0.9),
            12px 0 0 rgba(255, 0, 255, 0.9);
    }

    15% {
        transform: translateX(-15px) translateY(5px) skewX(-10deg) skewY(3deg) scale(1.05);
        filter: hue-rotate(180deg) contrast(400%) brightness(250%) invert(0.8) saturate(500%);
        opacity: 0.85;
        box-shadow:
            15px 0 0 rgba(255, 255, 0, 1),
            -15px 0 0 rgba(255, 0, 0, 1),
            0 15px 0 rgba(0, 255, 0, 0.8);
    }

    25% {
        transform: translateX(20px) translateY(-8px) skewX(15deg) skewY(-5deg) scale(0.95);
        filter: hue-rotate(240deg) contrast(500%) brightness(300%) invert(1) saturate(800%) blur(1px);
        opacity: 0.75;
        box-shadow:
            -20px 0 0 rgba(0, 255, 255, 1),
            20px 0 0 rgba(255, 0, 255, 1),
            0 -20px 0 rgba(255, 255, 0, 1),
            0 20px 0 rgba(255, 0, 0, 0.9);
    }

    35% {
        transform: translateX(-25px) translateY(10px) skewX(-20deg) skewY(8deg) scale(1.1);
        filter: hue-rotate(300deg) contrast(600%) brightness(400%) invert(0.3) saturate(1000%) blur(2px);
        opacity: 0.6;
        box-shadow:
            25px 0 0 rgba(255, 255, 255, 1),
            -25px 0 0 rgba(0, 0, 0, 1),
            0 25px 0 rgba(255, 0, 0, 1),
            0 -25px 0 rgba(0, 255, 0, 1);
    }

    50% {
        transform: translateX(30px) translateY(-15px) skewX(25deg) skewY(-10deg) scale(0.8) rotate(5deg);
        filter: hue-rotate(360deg) contrast(800%) brightness(500%) invert(0.7) saturate(1500%) blur(4px);
        opacity: 0.4;
        box-shadow:
            -30px 0 0 rgba(255, 0, 255, 1),
            30px 0 0 rgba(0, 255, 255, 1),
            0 -30px 0 rgba(255, 255, 0, 1),
            0 30px 0 rgba(255, 0, 0, 1),
            15px 15px 0 rgba(0, 255, 0, 0.8);
    }

    65% {
        transform: translateX(-40px) translateY(20px) skewX(-30deg) skewY(15deg) scale(1.2) rotate(-8deg);
        filter: hue-rotate(480deg) contrast(1000%) brightness(600%) invert(1) saturate(2000%) blur(6px);
        opacity: 0.25;
        box-shadow:
            40px 0 0 rgba(255, 255, 255, 1),
            -40px 0 0 rgba(255, 0, 0, 1),
            0 40px 0 rgba(0, 255, 0, 1),
            0 -40px 0 rgba(0, 0, 255, 1);
    }

    80% {
        transform: translateX(50px) translateY(-25px) skewX(40deg) skewY(-20deg) scale(0.6) rotate(15deg);
        filter: hue-rotate(600deg) contrast(1200%) brightness(800%) invert(0.5) saturate(3000%) blur(10px);
        opacity: 0.1;
        box-shadow:
            -50px 0 0 rgba(255, 255, 255, 0.8),
            50px 0 0 rgba(255, 255, 255, 0.8);
    }

    95% {
        transform: translateX(-60px) translateY(35px) skewX(-50deg) skewY(30deg) scale(1.5) rotate(-25deg);
        filter: hue-rotate(720deg) contrast(1500%) brightness(1000%) invert(1) saturate(5000%) blur(15px);
        opacity: 0.05;
        box-shadow: 0 0 100px rgba(255, 255, 255, 0.5);
    }

    100% {
        transform: translateX(0) translateY(0) skewX(0deg) skewY(0deg) scale(0) rotate(0deg);
        filter: hue-rotate(0deg) contrast(1) brightness(0) blur(20px);
        opacity: 0;
        box-shadow: none;
    }
}

/* NEW EPIC DESTROY ANIMATIONS */
@keyframes nuclearMeltdown {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: brightness(1) contrast(1) hue-rotate(0deg);
        box-shadow: 0 0 0 rgba(255, 100, 0, 0);
        border-radius: 24px;
    }

    10% {
        opacity: 1;
        transform: scale(1.02) rotate(1deg);
        filter: brightness(1.2) contrast(1.5) hue-rotate(30deg);
        box-shadow: 0 0 20px rgba(255, 150, 0, 0.5);
        border-radius: 20px;
    }

    25% {
        opacity: 0.95;
        transform: scale(1.08) rotate(-2deg);
        filter: brightness(1.8) contrast(2.5) hue-rotate(60deg) saturate(200%);
        box-shadow:
            0 0 40px rgba(255, 100, 0, 0.8),
            inset 0 0 20px rgba(255, 200, 0, 0.3);
        border-radius: 15px;
    }

    40% {
        opacity: 0.9;
        transform: scale(1.15) rotate(3deg) translateY(-5px);
        filter: brightness(2.5) contrast(4) hue-rotate(120deg) saturate(400%);
        box-shadow:
            0 0 60px rgba(255, 50, 0, 1),
            0 0 80px rgba(255, 200, 0, 0.6),
            inset 0 0 30px rgba(255, 255, 100, 0.5);
        border-radius: 10px;
    }

    60% {
        opacity: 0.8;
        transform: scale(1.25) rotate(-5deg) translateY(-15px);
        filter: brightness(4) contrast(6) hue-rotate(180deg) saturate(600%) blur(2px);
        box-shadow:
            0 0 100px rgba(255, 0, 0, 1),
            0 0 120px rgba(255, 100, 0, 0.8),
            0 0 140px rgba(255, 255, 0, 0.6),
            inset 0 0 50px rgba(255, 255, 255, 0.7);
        border-radius: 5px;
    }

    80% {
        opacity: 0.5;
        transform: scale(1.8) rotate(10deg) translateY(-30px);
        filter: brightness(8) contrast(10) hue-rotate(300deg) saturate(1000%) blur(5px);
        box-shadow:
            0 0 200px rgba(255, 255, 255, 1),
            0 0 250px rgba(255, 100, 0, 1),
            0 0 300px rgba(255, 0, 0, 0.8);
        border-radius: 50px;
    }

    95% {
        opacity: 0.1;
        transform: scale(3) rotate(-20deg) translateY(-60px);
        filter: brightness(15) contrast(20) hue-rotate(540deg) saturate(2000%) blur(15px);
        box-shadow:
            0 0 400px rgba(255, 255, 255, 0.8),
            0 0 500px rgba(255, 200, 0, 0.6);
        border-radius: 100px;
    }

    100% {
        opacity: 0;
        transform: scale(4) rotate(30deg) translateY(-100px);
        filter: brightness(20) contrast(30) hue-rotate(720deg) saturate(3000%) blur(25px);
        box-shadow: none;
        border-radius: 200px;
    }
}

@keyframes disintegrate {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: brightness(1) blur(0px);
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
    }

    15% {
        opacity: 0.9;
        transform: scale(1.02);
        filter: brightness(1.3) blur(0.5px);
        clip-path: polygon(5% 0%, 95% 0%, 100% 90%, 0% 95%);
    }

    30% {
        opacity: 0.8;
        transform: scale(1.05);
        filter: brightness(1.6) blur(1px) contrast(1.5);
        clip-path: polygon(10% 5%, 90% 0%, 95% 85%, 5% 90%);
    }

    45% {
        opacity: 0.6;
        transform: scale(1.1);
        filter: brightness(2) blur(2px) contrast(2) saturate(150%);
        clip-path: polygon(15% 10%, 85% 5%, 90% 75%, 10% 80%);
    }

    60% {
        opacity: 0.4;
        transform: scale(1.2);
        filter: brightness(3) blur(4px) contrast(3) saturate(200%) hue-rotate(45deg);
        clip-path: polygon(25% 20%, 75% 15%, 80% 60%, 20% 65%);
    }

    75% {
        opacity: 0.2;
        transform: scale(1.4);
        filter: brightness(5) blur(8px) contrast(5) saturate(300%) hue-rotate(90deg);
        clip-path: polygon(35% 35%, 65% 30%, 70% 45%, 30% 50%);
    }

    90% {
        opacity: 0.05;
        transform: scale(1.8);
        filter: brightness(8) blur(15px) contrast(8) saturate(500%) hue-rotate(180deg);
        clip-path: polygon(45% 45%, 55% 45%, 55% 50%, 45% 50%);
    }

    100% {
        opacity: 0;
        transform: scale(2);
        filter: brightness(10) blur(25px);
        clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%);
    }
}

@keyframes quantumCollapse {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: brightness(1) hue-rotate(0deg) blur(0px);
        box-shadow: 0 0 0 rgba(100, 200, 255, 0);
    }

    10% {
        opacity: 1;
        transform: scale(1.01) rotate(5deg);
        filter: brightness(1.2) hue-rotate(60deg) blur(0.5px);
        box-shadow: 0 0 10px rgba(100, 200, 255, 0.3);
    }

    20% {
        opacity: 0.9;
        transform: scale(1.03) rotate(-10deg);
        filter: brightness(1.5) hue-rotate(120deg) blur(1px) contrast(1.5);
        box-shadow: 0 0 20px rgba(150, 100, 255, 0.6);
    }

    35% {
        opacity: 0.8;
        transform: scale(1.1) rotate(15deg);
        filter: brightness(2) hue-rotate(240deg) blur(2px) contrast(2) saturate(200%);
        box-shadow:
            0 0 30px rgba(255, 100, 200, 0.8),
            inset 0 0 10px rgba(100, 255, 200, 0.4);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.2) rotate(-25deg);
        filter: brightness(3) hue-rotate(360deg) blur(4px) contrast(3) saturate(400%);
        box-shadow:
            0 0 50px rgba(255, 200, 100, 1),
            0 0 70px rgba(100, 255, 100, 0.7),
            inset 0 0 20px rgba(255, 255, 255, 0.6);
    }

    65% {
        opacity: 0.4;
        transform: scale(1.5) rotate(40deg);
        filter: brightness(5) hue-rotate(480deg) blur(8px) contrast(5) saturate(800%);
        box-shadow:
            0 0 80px rgba(255, 255, 200, 1),
            0 0 100px rgba(200, 100, 255, 0.8),
            0 0 120px rgba(100, 255, 255, 0.6);
    }

    80% {
        opacity: 0.2;
        transform: scale(2) rotate(-60deg);
        filter: brightness(8) hue-rotate(720deg) blur(15px) contrast(8) saturate(1500%);
        box-shadow:
            0 0 150px rgba(255, 255, 255, 1),
            0 0 200px rgba(255, 200, 255, 0.8);
    }

    95% {
        opacity: 0.05;
        transform: scale(3) rotate(90deg);
        filter: brightness(15) hue-rotate(1080deg) blur(25px) contrast(15) saturate(3000%);
        box-shadow: 0 0 300px rgba(255, 255, 255, 0.6);
    }

    100% {
        opacity: 0;
        transform: scale(0.01) rotate(180deg);
        filter: brightness(20) blur(50px);
        box-shadow: none;
    }
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.avatar {
    width: 33px;
    height: 33px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: linear-gradient(135deg, #404040 0%, #606060 100%);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.avatar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

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

    100% {
        transform: translateX(100%);
    }
}

.username {
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-weight: 600;
    font-size: 16px !important;
    color: #ffffff;
    margin-right: auto;
    letter-spacing: -0.2px;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.timer {
    background: linear-gradient(135deg, #555555, #333333);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.view-count {
    background: linear-gradient(135deg, #404040, #606060);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.view-count:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.view-count i {
    font-size: 10px;
}

.destroy-btn {
    background: linear-gradient(135deg, #666666, #444444);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.destroy-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.destroy-btn:hover::before {
    left: 100%;
}

.destroy-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(255, 50, 50, 0.3);
    background: linear-gradient(135deg, #777777, #555555);
    color: #ffcccc;
}

.destroy-btn:active {
    transform: translateY(0) scale(0.95);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.6),
        0 0 25px rgba(255, 0, 0, 0.6);
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: #ffffff;
}

.destroy-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    animation: destructionPulse 0.5s ease-in-out infinite alternate;
}

@keyframes destructionPulse {
    0% {
        box-shadow: 0 0 10px rgba(255, 50, 50, 0.5);
        filter: brightness(1);
    }

    100% {
        box-shadow: 0 0 20px rgba(255, 100, 100, 0.8);
        filter: brightness(1.2);
    }
}

.message-text {
    font-family: "Kalam", cursive;
    font-size: 12px !important;
    font-weight: 400;
    text-indent: 20px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    word-wrap: break-word;
    margin-bottom: 16px;
    letter-spacing: 0.2px;
    font-feature-settings:
        "liga" 1,
        "calt" 1;

    /* Enhanced readability */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* FIXED: Original Image Sizing */
.message-media {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.message-media img,
.message-media video {
    max-width: 100%;
    max-height: 500px;
    height: auto;
    width: auto;
    border-radius: 16px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    object-fit: contain;
}

.message-media video {
    max-height: 400px;
}

.message-media img:hover,
.message-media video:hover {
    transform: scale(1.02);
    cursor: pointer;
}

.message-media img {
    cursor: zoom-in;
}

/* Audio Player Styles */
.message-media audio {
    width: 100%;
    max-width: 400px;
    height: 54px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    outline: none;
    transition: all 0.3s ease;
}

.message-media audio:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.message-media audio::-webkit-media-controls-panel {
    background-color: rgba(20, 20, 20, 0.9);
    border-radius: 12px;
}

.message-media audio::-webkit-media-controls-play-button {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-left: 8px;
}

.message-media audio::-webkit-media-controls-timeline {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 8px;
}

.message-media audio::-webkit-media-controls-current-time-display,
.message-media audio::-webkit-media-controls-time-remaining-display {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

.message-media audio::-webkit-media-controls-volume-slider {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* Audio Player Container with Icon */
.audio-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 100%;
    max-width: 450px;
    transition: all 0.3s ease;
}

.audio-container:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.audio-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #404040, #606060);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.audio-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.audio-controls audio {
    width: 100%;
    height: 32px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.audio-filename {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Link Preview Styles */
.link-preview {
    margin-top: 16px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.link-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.link-preview-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(45deg, #333, #555);
}

.link-preview-content {
    padding: 16px;
}

.link-preview-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-url {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 6px;
}

.link-preview-url i {
    font-size: 10px;
}

/* Message Reactions */
.message-reactions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.reaction {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.reaction:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.reaction.reacted {
    background: rgba(0, 255, 136, 0.2);
    border-color: rgba(0, 255, 136, 0.4);
    color: #00ff88;
}

.reaction-emoji {
    font-size: 14px;
}

.reaction-count {
    font-weight: 600;
    min-width: 12px;
    text-align: center;
}

.add-reaction {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
}

.add-reaction:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Reaction Picker */
.reaction-picker {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    z-index: 1000;
    display: none;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.reaction-picker.show {
    display: grid;
}

.reaction-option {
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
    text-align: center;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reaction-option:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.2);
}

/* Image Modal */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.image-modal.show {
    display: flex;
}

.image-modal img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Input Section Styles - ALWAYS VISIBLE AT BOTTOM - COMPACT */
.input-section {
    background: rgba(0, 0, 0, 0.205) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(3, 184, 255, 0.205);
    border-radius: 0 !important;
    border-bottom: none !important;
    padding: 8px 16px !important;
    /* Removed left padding since action menu is now inline */
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: auto !important;
    z-index: 999999 !important;
    transition: all 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    transform: translateZ(0) !important;
    /* Force hardware acceleration */
    will-change: auto;
    margin: 0 !important;
    float: none !important;
    clear: both !important;
    display: block !important;
}

.input-section.drag-over {
    border-color: #00ff88;
    box-shadow: 0 0 30px rgba(0, 89, 255, 0.3);
    background: rgba(0, 255, 136, 0.1);
}

.input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #404040, #606060);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.file-input-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
    background: linear-gradient(135deg, #505050, #707070);
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-icon {
    color: white;
    font-size: 16px;
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Poll Button Styles - COMPACT */
.poll-btn {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    border: none;
    color: white;
    min-width: 44px;
    height: 44px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    position: relative;
    overflow: hidden;
}

.poll-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.poll-btn:hover::before {
    left: 100%;
}

.poll-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(74, 144, 226, 0.4);
    background: linear-gradient(135deg, #5ba0f2, #4585c7);
}

.poll-btn:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

/* Apply poll button hover animation to all action menu buttons */
.chaos-btn,
.attachment-btn,
.ready-btn {
    position: relative;
    overflow: hidden;
}

.chaos-btn::before,
.attachment-btn::before,
.ready-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.chaos-btn:hover::before,
.attachment-btn:hover::before,
.ready-btn:hover::before {
    left: 100%;
}

.chaos-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(231, 76, 60, 0.4);
}

.attachment-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(46, 204, 113, 0.4);
}

.ready-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(155, 89, 182, 0.4);
}

.chaos-btn:active,
.attachment-btn:active,
.ready-btn:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

/* Chaos Mode Toggle Button */
.chaos-mode-toggle {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: none;
    color: white;
    min-width: 44px;
    height: 44px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    position: relative;
    overflow: hidden;
}

.chaos-mode-toggle.enabled {
    background: linear-gradient(135deg, #7f8c8d, #95a5a6);
    box-shadow: 0 4px 12px rgba(127, 140, 141, 0.4);
}

.chaos-mode-toggle.disabled {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.chaos-mode-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

.chaos-mode-toggle.enabled:hover {
    background: linear-gradient(135deg, #ff5849, #d63031);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(231, 76, 60, 0.6);
}

.chaos-mode-toggle.disabled:hover {
    background: linear-gradient(135deg, #95a5a6, #a5b3b4);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(127, 140, 141, 0.4);
}

.chaos-mode-toggle:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

/* Ready Button */
.ready-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border: none;
    color: white;
    min-width: 44px;
    height: 44px;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    position: relative;
    overflow: hidden;
    animation: readyPulse 1.5s ease-in-out infinite;
}

.ready-btn:hover {
    transform: translateY(-2px) scale(1.05);
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(46, 204, 113, 0.6);
}

.ready-btn:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
    animation: none;
}

@keyframes readyPulse {
    0%,
    100% {
        box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
    }

    50% {
        box-shadow:
            0 4px 12px rgba(46, 204, 113, 0.8),
            0 0 25px rgba(46, 204, 113, 0.5);
    }
}

/* Ready Phase Modal */
.ready-phase-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    /* Raised z-index so the modal appears above the fixed input bar (which uses very high z-index)
		 and ensure it receives pointer events so the READY button is clickable. */
    z-index: 1000001 !important;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.ready-phase-content {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    border: 3px solid #ff4444;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(255, 68, 68, 0.3);
    animation: slideInScale 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    /* make sure content is interactive */
}

/* Full-screen death overlay (darkens everything and centers image) */
.death-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000000 !important;
    transition: opacity 0.4s ease;
    opacity: 0;
}

.death-overlay.visible {
    display: flex;
    opacity: 1;
}

.death-overlay .death-inner {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.death-overlay .death-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(255, 0, 0, 0.12);
}

/* Strong override: ensure action images always center on screen (fixes accidental top-right placement) */
.action-image-overlay {
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: none !important;
    z-index: 2200000 !important;
    opacity: 0;
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

.action-image-overlay.visible {
    opacity: 1;
}

.action-image-overlay .action-image {
    max-width: 640px !important;
    max-height: 72vh !important;
    border-radius: 12px !important;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6) !important;
    object-fit: contain !important;
}

/* Keep inline action image overlay styles for non-death actions */
.action-image-overlay {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: transparent;
    z-index: 1500000;
    opacity: 0;
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
    pointer-events: none;
}

.action-image-overlay.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.action-image-overlay .action-image {
    max-width: 480px;
    max-height: 360px;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* Delete all chaos messages button used in overlays */
.delete-all-btn {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b, #ff4d4d);
    color: #fff;
    border: none;
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(255, 80, 80, 0.18);
    cursor: pointer;
}

.delete-all-btn:hover {
    transform: translateY(-2px);
}

.ready-phase-header h2 {
    color: #ff4444;
    font-size: 28px;
    margin: 0 0 15px 0;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
    font-weight: 700;
}

.ready-countdown {
    font-size: 72px;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    margin: 10px 0;
    animation: countdownPulse 1s ease-in-out infinite;
}

/* Disable pulsing/animations for ready-related chat messages (server emits ready actions as chaos-ready)
   This prevents the message cards from growing/shrinking when a Ready System message appears. */
.message.chaos-ready,
.message.chaos-ready * {
    animation: none !important;
    transition: none !important;
}

.message.chaos-ready .timer {
    animation: none !important;
}

.ready-phase-body p {
    color: #ffffff;
    font-size: 18px;
    margin: 20px 0;
    line-height: 1.5;
}

.ready-players-list {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin: 20px 0;
    min-height: 60px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ready-player-item {
    display: inline-block;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    margin: 5px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

.ready-phase-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border: none;
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.4);
    animation: readyButtonPulse 2s ease-in-out infinite;
}

.ready-phase-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(46, 204, 113, 0.6);
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.ready-phase-btn:active {
    transform: translateY(0) scale(0.95);
    animation: none;
}

.ready-phase-btn i {
    margin-right: 10px;
    font-size: 16px;
}

@keyframes slideInScale {
    0% {
        opacity: 0;
        transform: scale(0.7) translateY(-50px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes countdownPulse {
    0%,
    100% {
        transform: scale(1);
        color: #ffd700;
    }

    50% {
        transform: scale(1.1);
        color: #ff8c00;
        text-shadow: 0 0 30px rgba(255, 140, 0, 1);
    }
}

@keyframes readyButtonPulse {
    0%,
    100% {
        box-shadow: 0 8px 25px rgba(46, 204, 113, 0.4);
    }

    50% {
        box-shadow:
            0 8px 25px rgba(46, 204, 113, 0.8),
            0 0 30px rgba(46, 204, 113, 0.6);
    }
}

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

    100% {
        opacity: 1;
    }
}

.text-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 12px 16px;
    color: #ffffff;
    font-size: 15px;
    resize: none;
    outline: none;
    font-family: "Kalam", cursive;
    font-style: normal;
    min-height: 44px;
    max-height: 88px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
    font-weight: 400;
}

.text-input:focus {
    border-color: rgba(100, 100, 100, 0.3);
    box-shadow: 0 0 0 3px rgba(100, 100, 100, 0.1);
}

.text-input.paste-ready {
    border-color: rgba(0, 255, 136, 0.4);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
    background: rgba(0, 255, 136, 0.05);
}

.text-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.send-btn {
    background: linear-gradient(135deg, #00471273, #00f3496c);
    border: none;
    border-radius: 16px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.send-btn:hover {
    transform: translateY(-2px) rotate(5deg);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
    background: linear-gradient(135deg, #00f3496c, #00471273);
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:active {
    transform: scale(0.95);
    background: linear-gradient(135deg, #00f3495d, #0047128c);
}

.send-btn i {
    color: white;
    font-size: 16px;
}

.info-text {
    text-align: center;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 6px;
    line-height: 1.3;
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
}

/* Drag & Drop Overlay */
.drag-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 255, 136, 0.2);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: 4px dashed #00ff88;
    animation: dragPulse 1s ease-in-out infinite;
}

.drag-overlay.active {
    display: flex;
}

@keyframes dragPulse {
    0%,
    100% {
        border-color: #00ff88;
        background: rgba(0, 255, 136, 0.2);
    }

    50% {
        border-color: #00cc66;
        background: rgba(0, 255, 136, 0.3);
    }
}

.drag-icon {
    font-size: 80px;
    color: #00ff88;
    margin-bottom: 20px;
    animation: bounce 0.6s ease-in-out infinite alternate;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-10px);
    }
}

.drag-text {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    margin-bottom: 10px;
}

.drag-subtext {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

/* Nickname Info */
.nickname-info {
    margin-top: 6px;
    text-align: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
}

.nickname-info i {
    color: #00ff88;
}

.nickname-info strong {
    color: #ffffff;
    font-weight: 600;
}

.reset-profile-btn {
    background: rgba(255, 100, 100, 0.2);
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 6px;
    padding: 2px 6px;
    color: rgba(255, 100, 100, 0.9);
    font-size: 9px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-left: 4px;
}

.reset-profile-btn:hover {
    background: rgba(255, 100, 100, 0.3);
    border-color: rgba(255, 100, 100, 0.5);
    color: #ffffff;
    transform: scale(1.05);
}

.generate-username-btn {
    background: rgba(100, 200, 255, 0.2);
    border: 1px solid rgba(100, 200, 255, 0.3);
    border-radius: 6px;
    padding: 2px 6px;
    color: rgba(100, 200, 255, 0.9);
    font-size: 9px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-left: 4px;
}

.generate-username-btn:hover {
    background: rgba(100, 200, 255, 0.3);
    border-color: rgba(100, 200, 255, 0.5);
    color: #ffffff;
    transform: scale(1.05);
}

/* Upload Progress */
.upload-progress {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    z-index: 10000;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    min-width: 300px;
}

.upload-progress.active {
    display: flex;
}

.upload-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #00ff88;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.upload-text {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    pointer-events: none;
}

.toast {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 12px;
    min-width: 300px;
    max-width: 400px;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transform: translateX(-100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #404040, #606060);
    animation: toastProgress 5s linear;
}

@keyframes toastProgress {
    from {
        height: 100%;
    }

    to {
        height: 0%;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #404040, #606060);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #505050, #707070);
}

/* Typing Indicator - Toast Style */
#typingIndicator {
    position: fixed !important;
    bottom: 80px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px !important;
    padding: 8px 16px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 12px !important;
    font-style: normal !important;
    font-weight: 500 !important;
    z-index: 999998 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    max-width: 90vw;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    animation: typingSlideIn 0.3s ease-out;
    margin: 0 !important;
    display: none !important;
}

#typingIndicator.show {
    display: block !important;
}

@keyframes typingSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Typing indicator content styling */
#typingIndicator span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 8px;
}

#typingIndicator b {
    color: #ffffff;
    font-weight: 600;
}

@media (max-width: 768px) {
    .container {
        padding: 12px 16px 8px;
    }

    .header {
        padding: 12px 0 16px;
    }

    .title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .nickname-section {
        margin-bottom: 12px;
        gap: 10px;
    }

    .messages-container {
        padding-bottom: 140px;
    }

    .nickname-container {
        max-width: 280px;
    }

    .nickname-input {
        padding: 8px 12px;
        font-size: 14px;
    }

    .emoji-prefix {
        font-size: 18px;
        min-width: 32px;
        height: 32px;
    }

    .emoji-picker-btn {
        min-width: 28px;
        height: 28px;
        padding: 4px 6px;
    }

    .nickname-info {
        font-size: 10px;
        padding: 4px 8px;
        gap: 6px;
    }

    .generate-username-btn,
    .reset-profile-btn {
        font-size: 8px;
        padding: 1px 4px;
        gap: 2px;
    }

    .message {
        padding: 12px;
        font-size: 12px;
    }

    .message-content {
        font-size: 11px;
        line-height: 1.3;
    }

    .message-meta {
        font-size: 8px;
    }

    .username {
        font-size: 10px;
    }

    .timestamp {
        font-size: 8px;
    }

    /* Make ALL text smaller on mobile */
    body {
        font-size: 10px;
    }

    /* Override all large font sizes on mobile */
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        font-size: 10px !important;
    }

    .title {
        font-size: 11px !important;
    }

    .header {
        font-size: 10px !important;
    }

    /* Override specific large text elements */
    [style*="font-size: 72px"],
    [style*="font-size: 80px"],
    [style*="font-size: 60px"],
    [style*="font-size: 48px"],
    [style*="font-size: 36px"],
    [style*="font-size: 32px"],
    [style*="font-size: 28px"],
    [style*="font-size: 24px"],
    [style*="font-size: 22px"],
    [style*="font-size: 20px"],
    [style*="font-size: 18px"],
    [style*="font-size: 16px"],
    [style*="font-size: 15px"],
    [style*="font-size: 14px"] {
        font-size: 10px !important;
    }

    /* System messages and overlays */
    .ready-phase-header h2,
    .countdown-text,
    .winner-text,
    .victory-text,
    .death-text,
    .combat-result,
    .chaos-result,
    .message-content,
    .system-message,
    .game-message,
    .chaos-message {
        font-size: 10px !important;
        line-height: 1.1 !important;
    }

    /* Target common large text classes */
    .large,
    .big,
    .huge,
    .title-large,
    .winner,
    .victory,
    .result,
    [class*="winner"],
    [class*="victory"],
    [class*="champion"],
    [class*="result"] {
        font-size: 24px !important;
    }

    /* Only allow the tiniest text */
    [style*="font-size: 6px"],
    [style*="font-size: 7px"],
    [style*="font-size: 8px"] {
        font-size: inherit !important;
    }

    /* Combat action buttons mobile adjustments - FORCE VERTICAL STACKING */
    .combat-actions,
    .combat-modal-body .target-list {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
        padding: 6px !important;
        max-width: 100% !important;
        overflow-x: visible !important;
        grid-template-columns: none !important;
    }

    .target-item,
    .combat-action-btn {
        width: 100% !important;
        height: 36px !important;
        font-size: 10px !important;
        padding: 4px 8px !important;
        margin: 0 !important;
        border-radius: 6px !important;
        display: block !important;
    }

    /* Stack 2x3 on very small screens */
    @media (max-width: 360px) {
        .combat-actions,
        .combat-modal-body .target-list {
            gap: 3px;
        }

        .target-item,
        .combat-action-btn {
            font-size: 9px !important;
            height: 32px !important;
        }
    }

    /* Ensure combat buttons in any container are mobile-friendly */
    .combat-modal-body button,
    [class*="combat"] button,
    button[onclick*="combat"],
    button[onclick*="attack"],
    button[onclick*="heal"],
    button[onclick*="boost"],
    button[onclick*="block"],
    button[onclick*="poison"] {
        font-size: 9px !important;
        padding: 4px 6px !important;
        height: 44px !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
    }

    .input-section {
        padding: 6px 12px !important;
        border-radius: 0;
    }

    .input-row {
        gap: 6px;
    }

    .file-input-wrapper,
    .send-btn,
    .poll-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        border-radius: 14px;
    }

    .file-input-icon,
    .send-btn i {
        font-size: 14px;
    }

    .text-input {
        min-height: 38px;
        padding: 10px 12px;
        font-size: 14px;
        border-radius: 14px;
        max-height: 76px;
    }

    .info-text {
        font-size: 9px;
        margin-top: 4px;
    }

    #typingIndicator {
        bottom: 65px !important;
        font-size: 11px !important;
        padding: 6px 12px !important;
        border-radius: 16px !important;
    }

    .user-hud {
        top: 10px;
        right: 10px;
        padding: 8px 16px;
        min-width: 100px;
    }

    /* Mobile Audio Player Adjustments */
    .audio-container {
        flex-direction: column;
        text-align: center;
        padding: 12px;
        max-width: 100%;
    }

    .audio-icon {
        margin: 0 auto 8px auto;
    }

    .audio-controls {
        width: 100%;
    }

    .audio-controls audio {
        width: 100%;
    }

    .message-media audio {
        max-width: 100%;
        height: 48px;
    }

    /* Mobile Poll Adjustments */
    .poll-btn {
        min-width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .poll-modal-content {
        width: 95%;
        margin: 10px;
        max-height: 90vh;
    }

    .poll-modal-header h3 {
        font-size: 16px;
    }

    .poll-input-group input {
        padding: 10px 14px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .poll-option-input input {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .poll-modal-footer {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .cancel-btn,
    .create-btn {
        width: 100%;
        padding: 12px;
    }

    .drag-icon {
        font-size: 60px;
    }

    .drag-text {
        font-size: 20px;
    }

    .toast-container {
        top: 10px;
        left: 10px;
        right: 10px;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }

    .reaction-picker {
        grid-template-columns: repeat(5, 1fr);
    }

    .message-reactions {
        gap: 6px;
    }

    /* Hide turnOrderBar on mobile */
    #turnOrderBar {
        display: none !important;
    }

    /* Enhanced Input Section Mobile Alignment */
    .input-section {
        padding: 8px 6px !important;
        border-radius: 0;
        margin-top: 6px !important;
    }

    .input-row {
        gap: 8px !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        margin-bottom: 6px !important;
    }

    #txt {
        flex: 1 !important;
        min-width: 140px !important;
        max-width: calc(100vw - 140px) !important;
        font-size: 16px !important;
        /* Prevents zoom on iOS */
        padding: 8px 12px !important;
        border-radius: 8px !important;
        min-height: 40px !important;
    }

    #send {
        flex-shrink: 0 !important;
        min-width: 60px !important;
        max-width: 80px !important;
        padding: 8px 12px !important;
        font-size: 16px !important;
        border-radius: 8px !important;
        height: 40px !important;
    }

    .file-upload-wrapper {
        flex-shrink: 0 !important;
        margin-left: 6px !important;
    }

    #file {
        width: 45px !important;
        height: 40px !important;
        border-radius: 8px !important;
    }

    .input-row button {
        white-space: nowrap !important;
        text-align: center !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 40px !important;
    }

    /* Ensure proper spacing for touch targets */
    .input-row > * {
        margin: 0 !important;
    }
}

/* Dark mode enhancements */
.glow-effect {
    position: relative;
}

.glow-effect::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #4040403d, #606060, #505050, #55555550, #3333333b);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.glow-effect:hover::before {
    opacity: 0.3;
}

/* Floating particles animation */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* ThpaceGL Canvas Background */
#thpace-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    display: block;
}

/* Poll Modal Styles */
.poll-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

.poll-modal.show {
    display: flex;
}

.poll-modal-content {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }

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

.poll-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.poll-modal-header h3 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.poll-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.poll-modal-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.poll-input-group {
    margin-bottom: 20px;
}

.poll-input-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.poll-input-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.poll-input-group input:focus {
    border-color: rgba(74, 144, 226, 0.5);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    background: rgba(255, 255, 255, 0.08);
}

.poll-input-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.poll-options-container {
    margin-bottom: 24px;
}

.poll-option-input {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.poll-option-input input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.poll-option-input input:focus {
    border-color: rgba(74, 144, 226, 0.5);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.remove-option {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: rgba(255, 100, 100, 0.8);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-option:hover {
    background: rgba(255, 0, 0, 0.3);
    color: rgba(255, 150, 150, 1);
}

.add-option-btn {
    background: rgba(74, 144, 226, 0.2);
    border: 1px dashed rgba(74, 144, 226, 0.4);
    color: rgba(74, 144, 226, 0.8);
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-option-btn:hover {
    background: rgba(74, 144, 226, 0.3);
    border-color: rgba(74, 144, 226, 0.6);
    color: rgba(74, 144, 226, 1);
}

.poll-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.create-btn {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    border: none;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.create-btn:hover {
    background: linear-gradient(135deg, #5ba0f2, #4585c7);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
    transform: translateY(-1px);
}

.create-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Poll Display Styles */
.poll-container {
    margin-top: 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
}

.poll-container:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.poll-question {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 16px;
    line-height: 1.4;
}

.poll-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.poll-option {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.poll-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(74, 144, 226, 0.3);
    transform: translateY(-1px);
}

.poll-option.voted {
    border-color: rgba(74, 144, 226, 0.5);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.poll-option-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.poll-option-text {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
}

.poll-option-votes {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 600;
}

.poll-option-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(74, 144, 226, 0.2), rgba(74, 144, 226, 0.1));
    border-radius: 12px;
    transition: width 0.6s ease;
    z-index: 1;
}

.poll-voters {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.poll-voters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.poll-voter {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 4px;
}

.poll-stats {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.poll-total-votes {
    font-weight: 600;
}

.poll-created-by {
    font-style: italic;
}

/* Combat System Styles */
.combat-hud {
    position: fixed;
    bottom: 120px;
    margin-left: 20px;
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #ff4444;
    border-radius: 12px;
    padding: 15px;
    backdrop-filter: blur(10px);
    z-index: 1000;
    min-width: 280px;
    /* Increased min-width for longer usernames */
    max-width: 350px;
    /* Add max-width to prevent excessive stretching */
    box-shadow: 0 8px 32px rgba(255, 68, 68, 0.3);
    transition: all 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    /* Smoother transitions */
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .combat-hud {
        position: fixed !important;
        bottom: 155px !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        background: rgba(20, 20, 20, 0.9) !important;
        border: none !important;
        border-top: 2px solid #ff4444 !important;
        border-radius: 0 !important;
        padding: 12px !important;
        z-index: 1000 !important;
        min-width: auto !important;
        max-width: none !important;
        width: 100vw !important;
        font-size: 14px !important;
    }

    /* Hide ALL extra elements - keep ONLY all-health-display */
    .combat-hud h4,
    .combat-hud .health-section-title,
    .combat-hud .combat-rankings,
    .combat-hud .leaderboard,
    .combat-hud .combat-scoreboard,
    .combat-hud .turn-info,
    .combat-hud .combat-hud-toggle,
    .combat-hud .combat-actions,
    .combat-hud .health-section,
    .combat-hud .health-label,
    .combat-hud .myHealthFill,
    .combat-hud .my-health,
    .combat-hud .health-bar,
    .combat-hud .health-display,
    .combat-hud .player-health,
    .combat-hud .combat-status,
    .combat-hud .health-container {
        display: none !important;
    }

    /* ONLY show the all-health-display */
    .combat-hud .all-health-display {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        border: none !important;
    }

    /* Health section - full width layout */
    .combat-hud .health-section {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        background: transparent !important;
        border: none !important;
    }

    /* Player health items - clean horizontal layout */
    .player-health-item {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 6px 0 !important;
        margin-bottom: 6px !important;
        width: 100% !important;
        background: transparent !important;
        border: none !important;
    }

    /* Player avatar - visible but compact */
    .player-avatar {
        font-size: 18px !important;
        width: 24px !important;
        height: 24px !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
    }

    /* Player name - bigger and readable */
    .player-health-name {
        min-width: 90px !important;
        max-width: 140px !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        color: #fff !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    /* Health bar - takes remaining space */
    .player-health-bar {
        flex: 1 !important;
        height: 24px !important;
        font-size: 12px !important;
        border-radius: 6px !important;
        background: rgba(40, 40, 40, 0.8) !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        position: relative !important;
    }

    /* Health bar text - centered and readable */
    .player-health-text {
        font-size: 11px !important;
        font-weight: 600 !important;
        color: #fff !important;
        line-height: 24px !important;
        text-align: center !important;
    }

    /* Health fill styling */
    .health-fill {
        border-radius: 6px !important;
    }

    /* Override font size enforcement */
    .combat-hud *,
    .combat-hud h4 * {
        font-size: inherit !important;
    }

    /* Mobile Action Bar Styling */
    .action-bar {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: space-evenly !important;
        gap: 8px !important;
        padding: 12px !important;
        margin: 8px 0 !important;
    }

    .action-btn {
        flex: 1 1 calc(25% - 8px) !important;
        min-width: 70px !important;
        max-width: 90px !important;
        height: 40px !important;
        font-size: 12px !important;
        padding: 6px 10px 8px !important;
        border-radius: 8px !important;
        gap: 4px !important;
        line-height: 1.1 !important;
        text-align: center !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
        transition: all 0.25s ease;
    }

    .action-btn .label {
        font-size: 10px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

/* Extra small mobile screens - ultra-minimal health bars only */
@media (max-width: 480px) {
    .combat-hud {
        padding: 8px !important;
        bottom: 145px !important;
        font-size: 12px !important;
    }

    /* Hide everything except all-health-display */
    .combat-hud .health-section,
    .combat-hud .health-label,
    .combat-hud .myHealthFill,
    .combat-hud .my-health,
    .combat-hud .health-bar,
    .combat-hud .health-display,
    .combat-hud .player-health,
    .combat-hud .combat-status,
    .combat-hud .health-container {
        display: none !important;
    }

    /* ONLY show the all-health-display */
    .combat-hud .all-health-display {
        display: block !important;
    }

    /* Smaller avatars for tiny screens */
    .player-avatar {
        font-size: 16px !important;
        width: 20px !important;
        height: 20px !important;
    }

    /* Compact names */
    .player-health-name {
        min-width: 70px !important;
        max-width: 100px !important;
        font-size: 12px !important;
    }

    /* Slightly smaller health bars */
    .player-health-bar {
        height: 20px !important;
    }

    .player-health-text {
        font-size: 10px !important;
        line-height: 20px !important;
    }

    /* Tighter spacing */
    .player-health-item {
        gap: 8px !important;
        padding: 4px 0 !important;
        margin-bottom: 4px !important;
    }

    /* Hide combat scoreboard on mobile */
    .combat-scoreboard {
        display: none !important;
    }

    #turnOrderBar {
        display: none !important;
    }

    .action-bar {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: space-evenly !important;
        gap: 6px !important;
        padding: 1px !important;
        margin: -9px 0 !important;
    }

    .action-btn {
        flex: 1 1 calc(25% - 6px) !important;
        min-width: 60px !important;
        max-width: 75px !important;
        height: 36px !important;
        font-size: 10px !important;
        padding: 4px 2px !important;
        border-radius: 4px !important;
        text-align: center !important;
    }

    .action-btn .label {
        font-size: 9px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

/* Input Section Mobile Alignment Improvements */
.input-section {
    padding: 8px 4px !important;
    margin-top: 8px !important;
}

.input-row {
    gap: 4px !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    margin-bottom: 4px !important;
}

#txt {
    flex: 1 !important;
    min-width: 120px !important;
    max-width: calc(100vw - 120px) !important;
    font-size: 14px !important;
    padding: 6px 8px !important;
    border-radius: 6px !important;
}

#send {
    flex-shrink: 0 !important;
    min-width: 50px !important;
    max-width: 70px !important;
    padding: 6px 10px !important;
    font-size: 14px !important;
    border-radius: 6px !important;
}

.file-upload-wrapper {
    flex-shrink: 0 !important;
    margin-left: 4px !important;
}

#file {
    width: 40px !important;
    height: 32px !important;
    border-radius: 6px !important;
}

.input-row button {
    white-space: nowrap !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Combat modal adjustments */
.combat-modal-body .target-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 1px !important;
    padding: 1px !important;
}

.target-item {
    width: 100% !important;
    height: 16px !important;
    font-size: 5px !important;
    padding: 1px 2px !important;
}

/* Turn info mobile adjustments */
.turn-info {
    font-size: 5px !important;
    padding: 1px !important;
    margin: 1px 0 !important;
}

.turn-info .current-player {
    font-size: 6px !important;
}

/* Additional combat HUD mobile improvements */
.combat-hud-toggle {
    padding: 0px !important;
    font-size: 5px !important;
}

.combat-hud-content {
    font-size: 4px !important;
}

/* Combat HUD Toggle Button */
.combat-hud-toggle {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
    margin-left: auto;
    /* Push to the right */
    font-size: 12px;
}

.combat-hud-toggle:hover {
    background: rgba(255, 107, 107, 0.1);
}

/* Collapsible content for combat HUD */
.combat-hud-content {
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.combat-hud-content.collapsed {
    display: none;
}

/* Combat HUD collapsed state styling */
.combat-hud.collapsed-hud {
    min-width: 180px;
    /* Smaller when collapsed */
}

/* Toggle icon animation */
.combat-hud-toggle i {
    transition: transform 0.3s ease;
}

.combat-hud-toggle i.fa-chevron-down {
    transform: rotate(180deg);
}

/* Adjust health section title to be flex container */
.combat-hud .health-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #ff6b6b;
    margin-bottom: 12px;
    font-size: 14px;
    border-bottom: 1px solid #ff4444;
    padding-bottom: 8px;
}

.my-health-bar {
    margin-bottom: 10px;
}

.health-label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #ff6b6b;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

.health-bar {
    position: relative;
    background: rgba(50, 50, 50, 0.8);
    border-radius: 20px;
    height: 25px;
    border: 1px solid #555;
    overflow: hidden;
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 20px;
    transition:
        width 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.3s ease;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

/* Enhanced health bar animations */
.health-fill.damage-animation {
    animation: damage-flash 0.6s ease-out;
}

.health-fill.heal-animation {
    animation: heal-glow 0.8s ease-out;
}

@keyframes damage-flash {
    0% {
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
        transform: scale(1);
    }

    25% {
        box-shadow:
            0 0 30px rgba(255, 87, 34, 0.8),
            inset 0 0 20px rgba(255, 87, 34, 0.3);
        transform: scale(1.02);
    }

    50% {
        box-shadow:
            0 0 40px rgba(255, 23, 68, 0.9),
            inset 0 0 25px rgba(255, 23, 68, 0.4);
        transform: scale(0.98);
    }

    100% {
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
        transform: scale(1);
    }
}

@keyframes heal-glow {
    0% {
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
        transform: scale(1);
    }

    30% {
        box-shadow:
            0 0 25px rgba(76, 255, 80, 0.8),
            inset 0 0 15px rgba(76, 255, 80, 0.3);
        transform: scale(1.03);
    }

    60% {
        box-shadow:
            0 0 35px rgba(0, 255, 127, 0.9),
            inset 0 0 20px rgba(0, 255, 127, 0.4);
        transform: scale(1.01);
    }

    100% {
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
        transform: scale(1);
    }
}

.health-fill.medium {
    background: linear-gradient(90deg, #ff9800, #ffc107);
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
}

.health-fill.low {
    background: linear-gradient(90deg, #ff5722, #f44336);
    box-shadow: 0 0 10px rgba(255, 87, 34, 0.5);
    animation: pulse-health 1s infinite;
}

.health-fill.critical {
    background: linear-gradient(90deg, #d32f2f, #b71c1c);
    box-shadow: 0 0 10px rgba(211, 47, 47, 0.7);
    animation: pulse-health 0.5s infinite;
}

/* Poisoned health bar - toxic purple */
.health-fill.poisoned {
    background: linear-gradient(90deg, #8e24aa, #6a1b9a) !important;
    box-shadow: 0 0 15px rgba(142, 36, 170, 0.8) !important;
    animation: poison-pulse 1s infinite;
}

@keyframes poison-pulse {
    0%,
    100% {
        box-shadow:
            0 0 15px rgba(142, 36, 170, 0.6),
            inset 0 0 10px rgba(156, 39, 176, 0.3);
    }

    50% {
        box-shadow:
            0 0 25px rgba(142, 36, 170, 0.9),
            inset 0 0 15px rgba(156, 39, 176, 0.5);
    }
}

@keyframes pulse-health {
    0%,
    100% {
        box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 68, 68, 0.8);
    }
}

.health-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.combat-status {
    color: #ffd700;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    padding: 5px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Healing / Reset system messages */
.message.healing-reset-message {
    background: linear-gradient(135deg, rgba(30, 60, 30, 0.85), rgba(20, 40, 20, 0.9));
    border: 1px solid rgba(90, 200, 120, 0.5);
    box-shadow:
        0 0 8px rgba(90, 220, 120, 0.5),
        0 0 16px rgba(40, 120, 60, 0.3) inset;
    position: relative;
    animation: none !important;
    /* remove any inherited entrance/pulse animations */
}

.message.healing-reset-message .nickname {
    color: #7cff9c;
    text-shadow: 0 0 4px rgba(100, 255, 140, 0.6);
}

.message.healing-reset-message .text {
    color: #dfffe7;
}

.message.healing-reset-message .ttl {
    background: linear-gradient(135deg, #2e5f2e, #1d3a1d) !important;
    border: 1px solid rgba(120, 255, 160, 0.3);
}

/* Subtle ambient glow (no pulsing) */
.message.healing-reset-message::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    box-shadow: 0 0 10px 3px rgba(90, 220, 120, 0.28);
    /* slightly softer static glow */
    opacity: 0.5;
    pointer-events: none;
}

/* Ensure internal elements inherit no pulsing */
.message.healing-reset-message .health-fill,
.message.healing-reset-message .timer,
.message.healing-reset-message .ttl {
    animation: none !important;
}

/* All Players Health Display */
.all-health-display {
    background: rgba(30, 30, 30, 0.95);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #333;
}

.health-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
    font-size: 14px;
    border-bottom: 1px solid #444;
    padding-bottom: 8px;
}

.player-health-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(50, 50, 50, 0.5);
    border-radius: 8px;
    border-left: 3px solid #666;
    transition: all 0.3s ease;
    min-height: 35px;
    /* Ensure consistent height */
    word-wrap: break-word;
    /* Handle long text */
}

.player-health-item.current-turn {
    border-left-color: #4caf50;
    background: rgba(76, 175, 80, 0.15);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
    animation: turn-pulse 2s infinite;
}

@keyframes turn-pulse {
    0%,
    100% {
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
    }
}

.player-health-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    /* Allow flex item to shrink */
}

.player-health-name {
    font-weight: 600;
    color: #fff;
    font-size: 13px;
    min-width: 60px;
    /* Reduced min-width */
    max-width: 140px;
    /* Add max-width to prevent excessive stretching */
    white-space: nowrap;
    /* Prevent line breaks */
    overflow: hidden;
    /* Hide overflow */
    text-overflow: ellipsis;
    /* Add ellipsis for long names */
    flex-shrink: 0;
    /* Prevent shrinking below min-width */
}

.player-health-bar {
    position: relative;
    background: #2a2a2a;
    height: 18px;
    border-radius: 9px;
    overflow: hidden;
    border: 1px solid #444;
    flex: 1;
    min-width: 80px;
    /* Ensure minimum width for HP bar */
    max-width: 120px;
}

.player-health-text {
    font-size: 11px;
    color: #ccc;
    font-weight: 500;
    min-width: 50px;
    text-align: right;
}

.combat-status.current-turn {
    color: #4caf50;
    background: rgba(76, 175, 80, 0.15);
    border-color: rgba(76, 175, 80, 0.5);
    animation: turn-indicator 1.5s infinite;
}

.combat-status.waiting-turn {
    color: #ffa726;
    background: rgba(255, 167, 38, 0.1);
    border-color: rgba(255, 167, 38, 0.3);
    animation: waiting-pulse 2s infinite;
}

@keyframes waiting-pulse {
    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}

@keyframes turn-indicator {
    0%,
    100% {
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
        transform: scale(1.02);
    }
}

@keyframes pulse-combat {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.combat-scoreboard {
    position: fixed;
    bottom: 120px;
    right: 20px;
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #ffd700;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    z-index: 999;
    min-width: 280px;
    max-width: 320px;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.2);
    transition: all 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.scoreboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
    font-weight: 600;
    cursor: pointer;
}

.scoreboard-header i {
    margin-right: 8px;
}

.scoreboard-toggle {
    background: none;
    border: none;
    color: #ffd700;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.scoreboard-toggle:hover {
    background: rgba(255, 215, 0, 0.1);
}

.scoreboard-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
}

.scoreboard-content.collapsed {
    display: none;
}

.combat-btn {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    height: 40px;
    min-width: 40px;
    width: auto;
    padding: 0 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 68, 68, 0.3);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    gap: 6px;
}

.combat-btn:hover {
    background: linear-gradient(135deg, #ff6666, #ff0000);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 68, 68, 0.4);
}

.combat-btn:active {
    transform: translateY(0);
}

.combat-btn.disabled {
    background: linear-gradient(135deg, #666666, #444444);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: 0 2px 8px rgba(100, 100, 100, 0.2);
}

.combat-btn.disabled:hover {
    background: linear-gradient(135deg, #666666, #444444);
    transform: none;
    box-shadow: 0 2px 8px rgba(100, 100, 100, 0.2);
}

.combat-btn.not-turn {
    background: linear-gradient(135deg, #666666, #444444);
    cursor: not-allowed;
    opacity: 0.4;
    box-shadow: 0 2px 8px rgba(100, 100, 100, 0.2);
    pointer-events: none;
}

.combat-btn.not-turn:hover {
    background: linear-gradient(135deg, #666666, #444444);
    transform: none;
    box-shadow: 0 2px 8px rgba(100, 100, 100, 0.2);
}

/* Icon-specific styling */
.combat-btn .fa-skull {
    color: #ff4444;
    animation: skull-glow 2s infinite;
}

.combat-btn .fa-times {
    color: #888888;
    opacity: 0.7;
}

.combat-btn .fa-fist-raised {
    color: #ffffff;
}

@keyframes skull-glow {
    0%,
    100% {
        text-shadow: 0 0 5px #ff4444;
    }

    50% {
        text-shadow:
            0 0 15px #ff4444,
            0 0 20px #ff4444;
    }
}

.combat-btn.chaos-ready {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    animation: chaos-pulse 2s infinite;
}

.combat-btn.chaos-ready:hover {
    background: linear-gradient(135deg, #ffed4a, #f59e0b);
}

.combat-btn.time-warning {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    animation: time-warning-pulse 1s infinite;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.6);
}

.combat-btn.time-warning:hover {
    background: linear-gradient(135deg, #ff5252, #ff3838);
    box-shadow: 0 0 25px rgba(255, 107, 107, 0.8);
}

@keyframes time-warning-pulse {
    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 107, 107, 0.6);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 30px rgba(255, 107, 107, 0.9);
        transform: scale(1);
    }
}

@keyframes chaos-pulse {
    0%,
    100% {
        box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    }

    50% {
        box-shadow: 0 6px 25px rgba(255, 215, 0, 0.6);
        transform: scale(1.05);
    }
}

.combat-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.combat-btn:hover::before {
    left: 100%;
}

/* ===================== */
/* Action Bar (New System) */
/* ===================== */
.action-bar {
    display: flex;
    align-items: stretch;
    gap: 6px;
    background: linear-gradient(135deg, rgba(50, 50, 50, 0.65), rgba(30, 30, 30, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 6px 8px;
    backdrop-filter: blur(6px);
    max-width: 100%;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Wrapper that positions the action bar just above the fixed input section */
.chaos-action-bar-wrapper {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 76px;
    /* leave space for input-section (approx its height + padding) */
    z-index: 999998;
    /* just beneath input section */
    display: flex;
    justify-content: center;
    pointer-events: none;
    /* wrapper ignores events so bar receives them */
}

.chaos-action-bar-wrapper .action-bar {
    pointer-events: auto;
    /* re-enable events on the bar itself */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    animation: fadeSlideUp 0.35s ease;
}

@keyframes fadeSlideUp {
    0% {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* RPS Action Bar Styles */
.rps-action-bar-wrapper {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 130px;
    /* Above the chaos action bar */
    z-index: 999999;
    /* Above chaos bar */
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.rps-action-bar {
    background: linear-gradient(135deg, #2d1b69, #5b2c87);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(180, 150, 255, 0.3);
    pointer-events: auto;
    animation: fadeSlideUp 0.4s ease;
    max-width: 600px;
    width: 90%;
}

.rps-game-info {
    text-align: center;
    margin-bottom: 15px;
}

.rps-game-info h3 {
    color: #ffffff;
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.rps-game-info p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-size: 0.9rem;
}

.rps-moves {
    display: flex;
    justify-content: space-around;
    gap: 15px;
}

.rps-action-btn {
    background: linear-gradient(135deg, #4a4a58, #5a5a68);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 120px;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.rps-action-btn:hover {
    background: linear-gradient(135deg, #6a6a78, #7a7a88);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.rps-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
}

.rps-action-btn.selected {
    background: linear-gradient(135deg, #4caf50, #45a049);
    border-color: rgba(76, 175, 80, 0.8);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
}

.rps-btn-icon {
    font-size: 2rem;
    margin-bottom: 5px;
    transition: transform 0.2s ease;
}

.rps-action-btn:hover .rps-btn-icon {
    transform: scale(1.2) rotate(5deg);
}

.rps-btn-label {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .rps-action-bar {
        padding: 15px;
        bottom: 140px;
    }

    .rps-moves {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .rps-action-btn {
        max-width: 200px;
        min-height: 70px;
        flex-direction: row;
        padding: 12px 20px;
    }

    .rps-btn-icon {
        font-size: 1.8rem;
        margin-bottom: 0;
        margin-right: 10px;
    }

    .rps-btn-label {
        font-size: 0.9rem;
    }
}

.action-bar::-webkit-scrollbar {
    display: none;
}

.action-btn {
    position: relative;
    background: linear-gradient(135deg, #222, #111);
    color: #eee;
    font-size: 12px !important;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 1px -2px 0px !important;
    border-radius: 21px !important;
    cursor: pointer;
    min-width: 70px;
    text-align: center;
    line-height: 3.1 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.action-btn:hover {
    background: linear-gradient(135deg, #333, #191919);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
    transform: translateY(-2px);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn[data-action="attack"] {
    border-color: #ff5252;
}

.action-btn[data-action="heal"] {
    border-color: #4caf50;
}

.action-btn[data-action="boost"] {
    border-color: #ff9800;
}

.action-btn[data-action="block"] {
    border-color: #00bcd4;
}

.action-btn[data-action="poison"] {
    border-color: #8e24aa;
    background: linear-gradient(135deg, rgba(142, 36, 170, 0.2), rgba(74, 20, 140, 0.15));
}

.action-btn[data-action="stun"] {
    border-color: #ffc107;
}

.action-btn[data-action="taunt"] {
    border-color: #9c27b0;
}

.action-btn[data-action="coinflip"] {
    border-color: #ffcdd2;
    background: linear-gradient(135deg, #2a1f1f, #120b0b);
}

/* Enhanced action button effects */
.action-btn[data-action="attack"]:hover {
    box-shadow:
        0 0 20px rgba(255, 69, 0, 0.6),
        inset 0 0 15px rgba(255, 69, 0, 0.1);
    background: linear-gradient(135deg, rgba(255, 69, 0, 0.2), rgba(178, 34, 34, 0.15));
}

.action-btn[data-action="heal"]:hover {
    box-shadow:
        0 0 20px rgba(76, 175, 80, 0.6),
        inset 0 0 15px rgba(76, 175, 80, 0.1);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(56, 142, 60, 0.15));
}

.action-btn[data-action="boost"]:hover {
    box-shadow:
        0 0 20px rgba(255, 152, 0, 0.6),
        inset 0 0 15px rgba(255, 152, 0, 0.1);
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.2), rgba(251, 140, 0, 0.15));
}

.action-btn[data-action="block"]:hover {
    box-shadow:
        0 0 20px rgba(0, 188, 212, 0.6),
        inset 0 0 15px rgba(0, 188, 212, 0.1);
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.2), rgba(0, 151, 167, 0.15));
}

.action-btn[data-action="poison"]:hover {
    box-shadow:
        0 0 20px rgba(142, 36, 170, 0.6),
        inset 0 0 15px rgba(142, 36, 170, 0.1);
    animation: poison-drip 2s infinite;
}

.action-btn[data-action="stun"]:hover {
    box-shadow:
        0 0 20px rgba(255, 193, 7, 0.6),
        inset 0 0 15px rgba(255, 193, 7, 0.1);
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 160, 0, 0.15));
}

.action-btn[data-action="taunt"]:hover {
    box-shadow:
        0 0 20px rgba(156, 39, 176, 0.6),
        inset 0 0 15px rgba(156, 39, 176, 0.1);
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.2), rgba(123, 31, 162, 0.15));
}

.action-btn[data-action="coinflip"]:hover {
    box-shadow:
        0 0 20px rgba(255, 205, 210, 0.6),
        inset 0 0 15px rgba(255, 205, 210, 0.1);
    animation: coinflip-sparkle 1s infinite;
}

/* Poison dripping effect */
@keyframes poison-drip {
    0%,
    100% {
        box-shadow:
            0 0 20px rgba(142, 36, 170, 0.6),
            inset 0 0 15px rgba(142, 36, 170, 0.1);
    }

    25% {
        box-shadow:
            0 0 20px rgba(142, 36, 170, 0.6),
            inset 0 0 15px rgba(142, 36, 170, 0.1),
            0 5px 10px rgba(142, 36, 170, 0.4);
    }

    50% {
        box-shadow:
            0 0 20px rgba(142, 36, 170, 0.6),
            inset 0 0 15px rgba(142, 36, 170, 0.1),
            0 10px 15px rgba(142, 36, 170, 0.6);
    }

    75% {
        box-shadow:
            0 0 20px rgba(142, 36, 170, 0.6),
            inset 0 0 15px rgba(142, 36, 170, 0.1),
            0 15px 20px rgba(142, 36, 170, 0.3);
    }
}

/* Coinflip sparkle effect */
@keyframes coinflip-sparkle {
    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 205, 210, 0.6);
    }

    50% {
        box-shadow:
            0 0 20px rgba(255, 205, 210, 0.6),
            0 0 30px rgba(255, 215, 0, 0.4),
            0 0 40px rgba(192, 192, 192, 0.3);
    }
}

/* Chaos message style for coinflip outcomes */
.chaos-message.chaos-coinflip {
    background: linear-gradient(135deg, rgba(120, 0, 0, 0.55), rgba(40, 0, 0, 0.85));
    border-color: #ff9090;
}

.chaos-message.chaos-coinflip .message-text {
    color: #ffb3b3;
}

/* Screen border flash effects for action feedback */
.border-flash-damage {
    box-shadow: inset 0 0 100px rgba(255, 0, 0, 0.4) !important;
    animation: borderFlashRed 0.8s ease-out;
}

.border-flash-heal {
    box-shadow: inset 0 0 100px rgba(0, 255, 0, 0.4) !important;
    animation: borderFlashGreen 0.8s ease-out;
}

.border-flash-poison {
    box-shadow: inset 0 0 100px rgba(128, 0, 128, 0.4) !important;
    animation: borderFlashPurple 0.8s ease-out;
}

.border-flash-attack {
    box-shadow: inset 0 0 100px rgba(255, 85, 85, 0.4) !important;
    animation: borderFlashRed 0.8s ease-out;
}

.border-flash-boost {
    box-shadow: inset 0 0 100px rgba(255, 174, 66, 0.4) !important;
    animation: borderFlashOrange 0.8s ease-out;
}

.border-flash-stun {
    box-shadow: inset 0 0 100px rgba(255, 215, 0, 0.4) !important;
    animation: borderFlashYellow 0.8s ease-out;
}

.border-flash-block {
    box-shadow: inset 0 0 100px rgba(51, 197, 255, 0.4) !important;
    animation: borderFlashBlue 0.8s ease-out;
}

.border-flash-coinflip {
    box-shadow: inset 0 0 100px rgba(255, 179, 179, 0.4) !important;
    animation: borderFlashPink 0.8s ease-out;
}

@keyframes borderFlashRed {
    0%,
    100% {
        box-shadow: inset 0 0 0 rgba(255, 0, 0, 0) !important;
    }

    50% {
        box-shadow: inset 0 0 100px rgba(255, 0, 0, 0.6) !important;
    }
}

@keyframes borderFlashGreen {
    0%,
    100% {
        box-shadow: inset 0 0 0 rgba(0, 255, 0, 0) !important;
    }

    50% {
        box-shadow: inset 0 0 100px rgba(0, 255, 0, 0.6) !important;
    }
}

@keyframes borderFlashPurple {
    0%,
    100% {
        box-shadow: inset 0 0 0 rgba(128, 0, 128, 0) !important;
    }

    50% {
        box-shadow: inset 0 0 100px rgba(128, 0, 128, 0.6) !important;
    }
}

@keyframes borderFlashOrange {
    0%,
    100% {
        box-shadow: inset 0 0 0 rgba(255, 174, 66, 0) !important;
    }

    50% {
        box-shadow: inset 0 0 100px rgba(255, 174, 66, 0.6) !important;
    }
}

@keyframes borderFlashYellow {
    0%,
    100% {
        box-shadow: inset 0 0 0 rgba(255, 215, 0, 0) !important;
    }

    50% {
        box-shadow: inset 0 0 100px rgba(255, 215, 0, 0.6) !important;
    }
}

@keyframes borderFlashBlue {
    0%,
    100% {
        box-shadow: inset 0 0 0 rgba(51, 197, 255, 0) !important;
    }

    50% {
        box-shadow: inset 0 0 100px rgba(51, 197, 255, 0.6) !important;
    }
}

@keyframes borderFlashPink {
    0%,
    100% {
        box-shadow: inset 0 0 0 rgba(255, 179, 179, 0) !important;
    }

    50% {
        box-shadow: inset 0 0 100px rgba(255, 179, 179, 0.6) !important;
    }
}

/* Action image overlay for center screen effects */
.action-image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 200000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.action-image-overlay.visible {
    opacity: 1;
}

.action-image {
    max-width: 200px;
    max-height: 200px;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.5));
    animation: actionImagePop 1.5s ease-out;
}

@keyframes actionImagePop {
    0% {
        transform: scale(0.5) rotate(-15deg);
        opacity: 0;
    }

    20% {
        transform: scale(1.2) rotate(5deg);
        opacity: 1;
    }

    40% {
        transform: scale(0.9) rotate(-2deg);
        opacity: 1;
    }

    60% {
        transform: scale(1.05) rotate(1deg);
        opacity: 1;
    }

    80% {
        transform: scale(0.98) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.8;
    }
}

/* Player status effect indicators */
.player-health-item.poisoned {
    border: 2px solid #8bc34a;
    background: rgba(139, 195, 74, 0.1);
    animation: poisonPulse 2s infinite;
}

.player-health-item.stunned {
    border: 2px solid #ffc107;
    background: rgba(255, 193, 7, 0.1);
    animation: stunPulse 1s infinite;
}

@keyframes poisonPulse {
    0%,
    100% {
        box-shadow: 0 0 5px rgba(139, 195, 74, 0.3);
    }

    50% {
        box-shadow: 0 0 15px rgba(139, 195, 74, 0.8);
    }
}

@keyframes stunPulse {
    0%,
    100% {
        box-shadow: 0 0 5px rgba(255, 193, 7, 0.3);
    }

    50% {
        box-shadow: 0 0 15px rgba(255, 193, 7, 0.8);
    }
}

.action-btn.cooldown {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.4);
}

.action-btn.not-turn {
    opacity: 0.35;
    cursor: not-allowed;
}

.action-btn.dead {
    opacity: 0.25;
    cursor: not-allowed;
}

.action-btn .label {
    white-space: nowrap;
}

.action-btn .cd-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    background: rgba(0, 0, 0, 0.75);
    padding: 2px 5px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
}

.action-btn .desc {
    font-size: 9px;
    opacity: 0.65;
}

.status-badges {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.status-badge {
    font-size: 9px;
    padding: 2px 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.rage {
    border-color: #ff9800;
    color: #ffb74d;
}

.status-badge.shield {
    border-color: #00bcd4;
    color: #4dd0e1;
}

.status-badge.poison {
    border-color: #8bc34a;
    color: #aed581;
}

.status-badge.stunned {
    border-color: #ffc107;
    color: #ffd54f;
    animation: pulse 1s infinite;
}

@media (max-width: 900px) {
    .action-bar {
        flex-wrap: nowrap;
    }
}

/* Combat Modal Styles */
.combat-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.combat-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    border: 2px solid #ff4444;
    border-radius: 16px;
    padding: 0;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(255, 68, 68, 0.3);
}

.combat-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid rgba(255, 68, 68, 0.3);
    background: rgba(255, 68, 68, 0.1);
}

.combat-modal-header h3 {
    color: #ff6b6b;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.combat-modal-close {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 18px;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.combat-modal-close:hover {
    background: rgba(255, 68, 68, 0.2);
    transform: rotate(90deg);
}

.combat-modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.combat-info {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.combat-info p {
    color: #ffd700;
    margin: 0;
    font-weight: 500;
}

.target-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.target-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: rgba(40, 40, 40, 0.6);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.target-item:hover {
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
    transform: translateX(5px);
}

.target-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.target-avatar {
    font-size: 24px;
}

.target-details {
    display: flex;
    flex-direction: column;
}

.target-name {
    color: white;
    font-weight: 600;
    margin-bottom: 2px;
}

.target-health {
    color: #ff6b6b;
    font-size: 12px;
}

.target-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.target-wins {
    color: #ffd700;
    font-size: 12px;
    font-weight: 500;
}

.target-status {
    color: #888;
    font-size: 11px;
}

.target-status.in-combat {
    color: #ff4444;
    font-weight: 600;
}

.no-targets {
    text-align: center;
    padding: 30px;
    color: #888;
    font-style: italic;
}

/* Combat ranking item styles */
.ranking-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: rgba(40, 40, 40, 0.4);
    border-radius: 8px;
    border-left: 4px solid #ffd700;
}

.ranking-rank {
    font-weight: bold;
    color: #ffd700;
    width: 30px;
}

.ranking-player {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.ranking-avatar {
    font-size: 18px;
}

.ranking-name {
    color: white;
    font-weight: 500;
}

.ranking-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.ranking-wins {
    color: #4caf50;
    font-weight: 600;
    font-size: 14px;
}

.ranking-streak {
    color: #ff9800;
    font-size: 11px;
}

/* Status effects */
.status-effects {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.status-effect {
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-effect.poison {
    background: #4caf50;
    color: white;
}

.status-effect.stun {
    background: #ffeb3b;
    color: black;
}

.status-effect.rage {
    background: #f44336;
    color: white;
}

.status-effect.shield {
    background: #2196f3;
    color: white;
}

/* Death/Kill Message Styling */
.death-message {
    font-family: "Creepster", "Impact", "Arial Black", sans-serif !important;
    font-size: 1.3em !important;
    font-weight: 900 !important;
    color: #ff1744 !important;
    text-shadow:
        0 0 10px #ff1744,
        0 0 20px #ff1744,
        0 0 30px #ff1744,
        2px 2px 4px rgba(0, 0, 0, 0.8) !important;
    background: linear-gradient(45deg, #1a0000, #330000) !important;
    border: 2px solid #ff1744 !important;
    border-radius: 24px !important;
    padding: 24px !important;
    margin-bottom: 20px !important;
    animation: death-pulse 2s ease-in-out infinite !important;
    box-shadow:
        0 0 20px rgba(255, 23, 68, 0.3),
        inset 0 0 20px rgba(255, 23, 68, 0.1) !important;
}

@keyframes death-pulse {
    0%,
    100% {
        box-shadow:
            0 0 20px rgba(255, 23, 68, 0.3),
            inset 0 0 20px rgba(255, 23, 68, 0.1);
    }

    50% {
        box-shadow:
            0 0 30px rgba(255, 23, 68, 0.6),
            inset 0 0 30px rgba(255, 23, 68, 0.2);
    }
}

.death-message .message-text {
    color: #ff1744 !important;
    font-weight: 900 !important;
}

/* Chaos Message Styling */
.chaos-message {
    border-radius: 24px !important;
    padding: 24px !important;
    margin-bottom: 20px !important;
    font-size: 0.9em !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.3s ease !important;
    border-left: 4px solid #666 !important;
}

.chaos-message:hover {
    transform: translateX(4px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.chaos-message .chaos-icon {
    font-size: 1.1em;
    margin-right: 4px;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

/* Attack Chaos Messages - Red Theme */
.chaos-message.chaos-attack {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.15), rgba(183, 28, 28, 0.1)) !important;
    border-left-color: #f44336 !important;
    color: #ffcdd2 !important;
}

.chaos-message.chaos-attack .message-text {
    color: #ffcdd2 !important;
}

.chaos-message.chaos-attack .chaos-icon {
    color: #f44336;
}

/* Heal Chaos Messages - Green Theme */
.chaos-message.chaos-heal {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(46, 125, 50, 0.1)) !important;
    border-left-color: #4caf50 !important;
    color: #c8e6c9 !important;
}

.chaos-message.chaos-heal .message-text {
    color: #c8e6c9 !important;
}

.chaos-message.chaos-heal .chaos-icon {
    color: #4caf50;
}

/* Boost Chaos Messages - Orange Theme */
.chaos-message.chaos-boost {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.15), rgba(230, 81, 0, 0.1)) !important;
    border-left-color: #ff9800 !important;
    color: #ffe0b2 !important;
}

.chaos-message.chaos-boost .message-text {
    color: #ffe0b2 !important;
}

.chaos-message.chaos-boost .chaos-icon {
    color: #ff9800;
}

/* Special Chaos Messages - Purple Theme */
.chaos-message.chaos-special {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.15), rgba(106, 27, 154, 0.1)) !important;
    border-left-color: #9c27b0 !important;
    color: #e1bee7 !important;
}

.chaos-message.chaos-special .message-text {
    color: #e1bee7 !important;
}

.chaos-message.chaos-special .chaos-icon {
    color: #9c27b0;
}

/* Curse Chaos Messages - Dark Purple Theme */
.chaos-message.chaos-curse {
    background: linear-gradient(135deg, rgba(103, 58, 183, 0.15), rgba(69, 39, 160, 0.1)) !important;
    border-left-color: #673ab7 !important;
    color: #d1c4e9 !important;
}

.chaos-message.chaos-curse .message-text {
    color: #d1c4e9 !important;
}

.chaos-message.chaos-curse .chaos-icon {
    color: #673ab7;
}

/* Block Chaos Messages - Blue Shield Theme */
.chaos-message.chaos-block {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.15), rgba(13, 71, 161, 0.1)) !important;
    border-left-color: #2196f3 !important;
    color: #bbdefb !important;
}

.chaos-message.chaos-block .message-text {
    color: #bbdefb !important;
}

.chaos-message.chaos-block .chaos-icon {
    color: #2196f3;
}

/* Poison Chaos Messages - Purple Toxic Theme */
.chaos-message.chaos-poison {
    background: linear-gradient(135deg, rgba(142, 36, 170, 0.15), rgba(74, 20, 140, 0.1)) !important;
    border-left-color: #8e24aa !important;
    color: #e1bee7 !important;
}

.chaos-message.chaos-poison .message-text {
    color: #e1bee7 !important;
}

.chaos-message.chaos-poison .chaos-icon {
    color: #8e24aa;
}

/* Stun Chaos Messages - Electric Yellow Theme */
.chaos-message.chaos-stun {
    background: linear-gradient(135deg, rgba(255, 235, 59, 0.15), rgba(245, 127, 23, 0.1)) !important;
    border-left-color: #ffeb3b !important;
    color: #fff9c4 !important;
}

.chaos-message.chaos-stun .message-text {
    color: #fff9c4 !important;
}

.chaos-message.chaos-stun .chaos-icon {
    color: #ffeb3b;
}

/* Taunt Chaos Messages - Sassy Purple Theme */
.chaos-message.chaos-taunt {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.15), rgba(106, 27, 154, 0.1)) !important;
    border-left-color: #9c27b0 !important;
    color: #e1bee7 !important;
}

.chaos-message.chaos-taunt .message-text {
    color: #e1bee7 !important;
}

.chaos-message.chaos-taunt .chaos-icon {
    color: #9c27b0;
}

/* Death Messages - Dark Red Dramatic Theme */
.chaos-message.chaos-death,
.death-message {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.25), rgba(69, 0, 0, 0.15)) !important;
    border-left-color: #8b0000 !important;
    color: #ffcccb !important;
    box-shadow: 0 4px 16px rgba(139, 0, 0, 0.4) !important;
}

.chaos-message.chaos-death .message-text,
.death-message .message-text {
    color: #ffcccb !important;
    font-weight: bold !important;
}

.chaos-message.chaos-death .chaos-icon {
    color: #8b0000;
}

/* Compact styling for chaos messages */
.chaos-message .message-header {
    margin-bottom: 4px !important;
}

.chaos-message .avatar {
    width: 24px !important;
    height: 24px !important;
    font-size: 12px !important;
}

.chaos-message .username {
    font-size: 15px !important;
    font-weight: 900 !important;
}

.chaos-message .message-meta {
    font-size: 0.9em !important;
}

.chaos-message .message-meta .timer,
.chaos-message .message-meta .view-count {
    opacity: 0.7;
}

/* Epic Divine Justice Styling */
.divine_justice {
    background: linear-gradient(
        135deg,
        rgba(255, 215, 0, 0.3) 0%,
        rgba(255, 140, 0, 0.2) 25%,
        rgba(255, 69, 0, 0.2) 50%,
        rgba(220, 20, 60, 0.2) 75%,
        rgba(139, 0, 139, 0.3) 100%
    ) !important;
    border: 2px solid #ffd700 !important;
    border-radius: 15px !important;
    box-shadow:
        0 0 30px rgba(255, 215, 0, 0.5),
        inset 0 0 20px rgba(255, 140, 0, 0.3) !important;
    animation: divine-pulse 2s infinite alternate !important;
    position: relative !important;
    overflow: hidden !important;
}

.divine_justice::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ffd700, #ff8c00, #ff4500, #dc143c, #8b008b);
    border-radius: 15px;
    z-index: -1;
    animation: divine-border-rotate 3s linear infinite;
}

.divine_justice .message-text {
    color: #ffd700 !important;
    text-shadow:
        0 0 10px rgba(255, 215, 0, 0.8),
        0 0 20px rgba(255, 140, 0, 0.6),
        0 0 30px rgba(255, 69, 0, 0.4) !important;
    font-weight: bold !important;
    font-size: 1.1em !important;
}

.divine_justice .username {
    color: #ff8c00 !important;
    text-shadow: 0 0 10px rgba(255, 140, 0, 0.8) !important;
    font-weight: bold !important;
}

@keyframes divine-pulse {
    0% {
        box-shadow:
            0 0 30px rgba(255, 215, 0, 0.5),
            inset 0 0 20px rgba(255, 140, 0, 0.3);
    }

    100% {
        box-shadow:
            0 0 50px rgba(255, 215, 0, 0.8),
            inset 0 0 30px rgba(255, 140, 0, 0.5);
    }
}

@keyframes divine-border-rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Epic Healing System Styling */
.healing_system {
    background: linear-gradient(
        135deg,
        rgba(0, 255, 127, 0.3) 0%,
        rgba(50, 205, 50, 0.2) 25%,
        rgba(34, 139, 34, 0.2) 50%,
        rgba(0, 128, 0, 0.2) 75%,
        rgba(0, 100, 0, 0.3) 100%
    ) !important;
    border: 2px solid #00ff7f !important;
    border-radius: 15px !important;
    box-shadow:
        0 0 30px rgba(0, 255, 127, 0.5),
        inset 0 0 20px rgba(50, 205, 50, 0.3) !important;
    position: relative !important;
    overflow: hidden !important;
}

.healing_system::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #00ff7f, #32cd32, #228b22, #008000, #006400);
    border-radius: 15px;
    z-index: -1;
    animation: healing-border-rotate 4s linear infinite;
}

.healing_system .message-text {
    color: #00ff7f !important;
    text-shadow:
        0 0 10px rgba(0, 255, 127, 0.8),
        0 0 20px rgba(50, 205, 50, 0.6),
        0 0 30px rgba(34, 139, 34, 0.4) !important;
    font-weight: bold !important;
    font-size: 1.1em !important;
}

.healing_system .username {
    color: #32cd32 !important;
    text-shadow: 0 0 10px rgba(50, 205, 50, 0.8) !important;
    font-weight: bold !important;
}

@keyframes healing-pulse {
    0% {
        box-shadow:
            0 0 30px rgba(0, 255, 127, 0.5),
            inset 0 0 20px rgba(50, 205, 50, 0.3);
    }

    100% {
        box-shadow:
            0 0 50px rgba(0, 255, 127, 0.8),
            inset 0 0 30px rgba(50, 205, 50, 0.5);
    }
}

@keyframes healing-border-rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ================= Winner Overlay ================= */
.winner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(
        circle at center,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.92) 40%,
        rgba(0, 0, 0, 0.95) 70%,
        rgba(0, 0, 0, 0.97) 100%
    );
    backdrop-filter: blur(8px) saturate(160%);
    z-index: 30000;
    opacity: 0;
    transform: scale(0.95);
    transition:
        opacity 0.6s ease,
        transform 0.6s cubic-bezier(0.25, 0.9, 0.25, 1.2);
}

.winner-overlay.show {
    opacity: 1;
    transform: scale(1);
}

.winner-inner {
    text-align: center;
    position: relative;
    padding: 50px 70px 60px;
    border-radius: 40px;
    background: linear-gradient(145deg, #1b1405 0%, #2a1d08 40%, #201707 100%);
    box-shadow:
        0 0 0 2px rgba(255, 215, 0, 0.2),
        0 0 40px rgba(255, 200, 0, 0.15),
        0 20px 80px -30px rgba(0, 0, 0, 0.8),
        inset 0 0 25px rgba(255, 200, 0, 0.1);
    overflow: hidden;
}

.winner-inner::before,
.winner-inner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: conic-gradient(from 0deg, rgba(255, 215, 0, 0.05), rgba(255, 255, 255, 0.15), rgba(255, 215, 0, 0.05));
    opacity: 0.6;
    mix-blend-mode: overlay;
    animation: winner-rotate 8s linear infinite;
}

.winner-inner::after {
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 200, 0.15), transparent 60%),
        radial-gradient(circle at 70% 65%, rgba(255, 200, 100, 0.12), transparent 65%);
    animation: pulseGlow 4s ease-in-out infinite;
    opacity: 1;
}

.winner-trophy {
    font-size: clamp(3.5rem, 8vw, 6rem);
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.6));
    animation: trophyFloat 3.5s ease-in-out infinite;
}

.winner-heading {
    font-family: "Rubik Distressed", cursive;
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    letter-spacing: 2px;
    margin-top: 10px;
    background: linear-gradient(120deg, #ffe9a1, #fff5d6, #ffd262, #ffedb7, #ffe9a1);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation:
        gradientShift 6s ease-in-out infinite,
        shinePass 5s linear infinite;
    text-shadow:
        0 0 15px rgba(255, 215, 0, 0.4),
        0 0 30px rgba(255, 200, 0, 0.25);
}

.winner-name {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-top: 20px;
    letter-spacing: 1.5px;
    background: linear-gradient(135deg, #fff, #ffe9b5 20%, #b8860b 45%, #f6d26a 55%, #b8860b 65%, #fff 80%);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation:
        metalSheen 7s linear infinite,
        namePop 0.8s ease-out;
    position: relative;
    padding: 4px 18px;
}

.winner-name::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    mix-blend-mode: overlay;
    opacity: 0.4;
    animation: nameSheen 3s linear infinite;
}

.winner-sub {
    font-size: 0.95rem;
    margin-top: 24px;
    color: rgba(255, 230, 180, 0.8);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 500;
    opacity: 0;
    animation: fadeIn 0.9s 0.4s forwards;
}

@keyframes trophyFloat {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-14px) scale(1.04);
    }
}

@keyframes winner-rotate {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulseGlow {
    0%,
    100% {
        opacity: 0.7;
        filter: blur(0px);
    }

    50% {
        opacity: 1;
        filter: blur(2px);
    }
}

@keyframes metalSheen {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

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

    60% {
        transform: translateX(120%);
    }

    100% {
        transform: translateX(120%);
    }
}

@keyframes namePop {
    0% {
        transform: scale(0.6) translateY(40px);
        opacity: 0;
    }

    60% {
        transform: scale(1.05) translateY(-4px);
        opacity: 1;
    }

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

/* Clear-fade used when deleting chaos messages: slow fade + collapse */
.clear-fade {
    opacity: 0 !important;
    transform: translateY(6px) !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    transition:
        opacity 2s ease,
        transform 2s ease,
        height 2s ease,
        margin 2s ease,
        padding 2s ease !important;
}

/* Stronger centering override for any action-image-overlay duplicates */
.action-image-overlay {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: none !important;
    z-index: 9999999 !important;
    opacity: 0;
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

.action-image-overlay.visible {
    opacity: 1 !important;
}

@keyframes shinePass {
    0% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.2);
    }

    100% {
        filter: brightness(1);
    }
}

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

@media (max-width: 640px) {
    .winner-inner {
        padding: 40px 30px 50px;
    }

    .winner-name {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }
}

/* === Winner Message Styling === */

/* First-pick modal (quick wheel animation) */
.first-pick-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    z-index: 4000000 !important;
}

.first-pick-inner {
    width: 420px;
    height: 420px;
    background: linear-gradient(135deg, #111, #222);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
}

.wheel {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    transform-origin: 50% 50%;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.wheel .slice {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 50%, 100% 50%, 100% 0, 50% 0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #111;
    font-size: 12px;
    text-align: center;
    padding: 6px;
}

.wheel-pointer {
    position: absolute;
    top: calc(50% - 160px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.first-pick-label {
    margin-top: 12px;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.winner-message {
    background: linear-gradient(45deg, #ffd700b3, #ffed4e7d, #ffc10700, #ff8f00a1) !important;
    background-size: 400% 400% !important;
    animation:
        winnerGlow 3s ease-in-out infinite,
        winnerShine 2s ease-in-out infinite !important;
    border: 3px solid #ffd700 !important;
    box-shadow:
        0 0 30px rgba(255, 215, 0, 0.8),
        0 0 60px rgba(255, 215, 0, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.2) !important;
    position: relative !important;
    overflow: hidden !important;
    margin: 20px 0 !important;
}

.winner-message::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: winnerShineMove 2s ease-in-out infinite;
    pointer-events: none;
}

.winner-message .message-text {
    font-size: 27px !important;
    font-weight: 900 !important;
    color: #1a1a1a !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3) !important;
    text-align: center !important;
    padding: 15px !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
}

.winner-message .username {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
}

.winner-message .avatar {
    font-size: 24px !important;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8)) !important;
}

@keyframes winnerGlow {
    0%,
    100% {
        background-position: 0% 50%;
        box-shadow:
            0 0 30px rgba(255, 215, 0, 0.8),
            0 0 60px rgba(255, 215, 0, 0.4),
            inset 0 0 20px rgba(255, 255, 255, 0.2);
    }

    50% {
        background-position: 100% 50%;
        box-shadow:
            0 0 40px rgba(255, 215, 0, 1),
            0 0 80px rgba(255, 215, 0, 0.6),
            inset 0 0 30px rgba(255, 255, 255, 0.3);
    }
}

@keyframes winnerShine {
    0%,
    100% {
        filter: brightness(1) saturate(1);
    }

    50% {
        filter: brightness(1.2) saturate(1.3);
    }
}

@keyframes winnerShineMove {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }

    50% {
        transform: translateX(0%) translateY(0%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

@media (max-width: 600px) {
    .winner-message .message-text {
        font-size: 14px !important;
        padding: 0cqh !important;
    }
}

/* New Feature Button Styles */
.action-menu-item.rps-btn {
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
}

.action-menu-item.word-btn {
    background: linear-gradient(135deg, #9c88ff, #a855f7);
}

.action-menu-item.mood-btn {
    background: linear-gradient(135deg, #ffd700, #ffed4a);
}

.action-menu-item.achievements-btn {
    background: linear-gradient(135deg, #ff8c00, #ffd700);
}

.action-menu-item.trivia-btn {
    background: linear-gradient(135deg, #4ade80, #22d3ee);
}

.action-menu-item.compliment-btn {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
}

/* Mood Picker Modal */
.mood-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.mood-picker-modal {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    min-width: 300px;
    animation: slideUp 0.3s ease;
}

.mood-picker-modal h3 {
    margin-bottom: 20px;
    color: #fff;
    font-size: 1.4em;
}

.mood-options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.mood-option {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 15px;
    font-size: 2em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mood-option:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.mood-cancel {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mood-cancel:hover {
    background: rgba(255, 0, 0, 0.3);
}

/* Compliment Picker Modal */
.compliment-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.compliment-picker-modal {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    min-width: 350px;
    max-width: 500px;
    animation: slideUp 0.3s ease;
}

.compliment-picker-modal h3 {
    margin-bottom: 15px;
    color: #fff;
    font-size: 1.4em;
}

.compliment-picker-modal p {
    margin-bottom: 20px;
    color: #ccc;
}

.user-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.user-option {
    display: block;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid transparent;
    color: #fff;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.user-option:hover {
    background: rgba(255, 105, 180, 0.2);
    border-color: rgba(255, 105, 180, 0.3);
    transform: translateX(5px);
}

.compliment-cancel {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.compliment-cancel:hover {
    background: rgba(255, 0, 0, 0.3);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }

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

/* Mobile responsiveness for new modals */
@media (max-width: 600px) {
    .mood-picker-modal,
    .compliment-picker-modal {
        margin: 20px;
        min-width: auto;
        max-width: calc(100% - 40px);
    }

    .mood-options {
        grid-template-columns: repeat(3, 1fr);
    }

    .mood-option {
        font-size: 1.5em;
        padding: 12px;
    }
}

/* =============================================== */
/* Rock Paper Scissors Game Modal */
/* =============================================== */

.rps-game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rps-game-modal.show {
    opacity: 1;
}

.rps-modal-content {
    background: linear-gradient(135deg, #2c2c34, #3a3a44);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.rps-game-modal.show .rps-modal-content {
    transform: scale(1);
}

.rps-modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.rps-modal-header h2 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.8rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.rps-modal-header p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
    font-weight: 600;
}

.rps-players {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 10px;
    color: #ffffff;
    font-weight: 500;
    line-height: 1.6;
}

.rps-modal-body {
    text-align: center;
}

.rps-modal-body h3 {
    color: #ffffff;
    margin-bottom: 25px;
    font-size: 1.3rem;
}

.rps-move-buttons {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-bottom: 20px;
}

.rps-move-btn {
    background: linear-gradient(135deg, #4a4a58, #5a5a68);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 120px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.rps-move-btn:hover {
    background: linear-gradient(135deg, #6a6a78, #7a7a88);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.rps-move-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.rps-move-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.rps-move-btn:hover::before {
    left: 100%;
}

.rps-move-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    transition: transform 0.2s ease;
}

.rps-move-btn:hover .rps-move-icon {
    transform: scale(1.2) rotate(5deg);
}

.rps-move-label {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.rps-instruction {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    margin-top: 15px;
    font-style: italic;
    line-height: 1.4;
}

/* RPS Join Button styles for messages */
.rps-join-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 10px 5px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.rps-join-btn:hover {
    background: linear-gradient(135deg, #ff8e8e, #ff6b6b);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.rps-join-btn:active {
    transform: translateY(0);
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .rps-modal-content {
        padding: 20px;
        margin: 20px;
    }

    .rps-move-buttons {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .rps-move-btn {
        max-width: 200px;
        min-height: 80px;
        flex-direction: row;
        padding: 15px 20px;
    }

    .rps-move-icon {
        font-size: 2rem;
        margin-bottom: 0;
        margin-right: 15px;
    }

    .rps-move-label {
        font-size: 1rem;
    }
}

/* ============================================================
   🔥 BADASS FIRE TITLE ANIMATIONS 🔥
   ============================================================ */

.fire-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: default;
    font-family: "Barrio", cursive !important;
    color: rgb(255, 115, 0) !important;
    position: relative;
}

.fire-text-wrapper {
    position: relative;
    display: inline-block;
    padding: 0 10px;
}

.fire-text {
    font-family: inherit;
    font-size: 3rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: rgb(255, 115, 0) !important;
    line-height: 1;
    position: relative;
    z-index: 2;
    display: inline-block;
    font-weight: 800;
    margin: 0;
    min-width: 50px;
    outline: none;
    vertical-align: middle;
    text-shadow:
        0 1px 0 rgba(0, 0, 0, 0.9),
        0 3px 16px rgba(255, 0, 0, 0.85),
        0 0 14px rgba(255, 0, 0, 0.75),
        0 0 9px rgba(255, 165, 0, 0.85),
        4px -5px 6px rgba(255, 255, 0, 0.75),
        -4px -10px 10px rgba(255, 255, 0, 0.6),
        0 -10px 22px rgba(255, 255, 0, 0.55);
    animation: Blazing 2s infinite alternate linear;
}

@keyframes Blazing {
    0% {
        text-shadow:
            0 1px 0 rgba(0, 0, 0, 0.9),
            0 3px 14px rgba(255, 0, 0, 0.7),
            0 0 12px rgba(255, 0, 0, 0.6),
            0 0 8px rgba(255, 165, 0, 0.7),
            4px -5px 5px rgba(255, 255, 0, 0.55),
            -4px -10px 8px rgba(255, 255, 0, 0.45),
            0 -10px 18px rgba(255, 255, 0, 0.35);
    }
    50% {
        text-shadow:
            0 1px 0 rgba(0, 0, 0, 0.9),
            0 3px 20px rgba(255, 0, 0, 0.9),
            0 0 20px rgba(255, 0, 0, 0.8),
            0 0 12px rgba(255, 165, 0, 0.9),
            4px -5px 7px rgba(255, 255, 0, 0.8),
            -4px -10px 11px rgba(255, 255, 0, 0.65),
            0 -10px 26px rgba(255, 255, 0, 0.6);
    }
    100% {
        text-shadow:
            0 1px 0 rgba(0, 0, 0, 0.9),
            0 3px 16px rgba(255, 0, 0, 0.85),
            0 0 14px rgba(255, 0, 0, 0.75),
            0 0 9px rgba(255, 165, 0, 0.85),
            4px -5px 6px rgba(255, 255, 0, 0.75),
            -4px -10px 10px rgba(255, 255, 0, 0.6),
            0 -10px 22px rgba(255, 255, 0, 0.55);
    }
}

/* Fire glow behind text */
.fire-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140%;
    height: 300%;
    background: radial-gradient(
        ellipse at center bottom,
        rgba(255, 69, 0, 0.5) 0%,
        rgba(255, 140, 0, 0.3) 30%,
        rgba(255, 200, 0, 0.1) 50%,
        transparent 70%
    );
    filter: blur(25px);
    opacity: 0.6;
    z-index: 1;
    pointer-events: none;
    animation: glow-pulse 1.5s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
    0% {
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Floating embers container */
.fire-embers {
    position: absolute;
    top: -30px;
    left: -10%;
    width: 120%;
    height: 80px;
    pointer-events: none;
    z-index: 3;
    overflow: visible;
}

/* Individual ember particles */
.ember {
    position: absolute;
    bottom: 0;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #ffed4a 0%, #ff6b00 50%, transparent 100%);
    border-radius: 50%;
    opacity: 0.7;
    animation: ember-rise 2s ease-out infinite;
    box-shadow: 0 0 6px 2px rgba(255, 107, 0, 0.8);
}

.ember:nth-child(odd) {
    width: 3px;
    height: 3px;
    background: radial-gradient(circle, #fff 0%, #ffed4a 50%, transparent 100%);
}

.ember:nth-child(3n) {
    width: 5px;
    height: 5px;
    animation-duration: 2.5s;
}

@keyframes ember-rise {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.9;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-50px) translateX(calc(10px - 20px * var(--random, 0.5))) scale(0);
        opacity: 0;
    }
}

/* Ember particles behind the chili */
.loading-embers-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    pointer-events: none;
}

.loading-ember {
    position: absolute;
    bottom: 20%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #ffed4a 0%, #ff6b00 50%, transparent 100%);
    border-radius: 50%;
    opacity: 0;
    animation: loading-ember-rise 2s ease-out infinite;
    box-shadow: 0 0 8px 2px rgba(255, 107, 0, 0.9);
}

.loading-ember:nth-child(1) {
    left: 30%;
    animation-delay: 0s;
}
.loading-ember:nth-child(2) {
    left: 40%;
    animation-delay: 0.15s;
}
.loading-ember:nth-child(3) {
    left: 50%;
    animation-delay: 0.3s;
}
.loading-ember:nth-child(4) {
    left: 60%;
    animation-delay: 0.45s;
}
.loading-ember:nth-child(5) {
    left: 70%;
    animation-delay: 0.6s;
}
.loading-ember:nth-child(6) {
    left: 35%;
    animation-delay: 0.75s;
}
.loading-ember:nth-child(7) {
    left: 45%;
    animation-delay: 0.9s;
}
.loading-ember:nth-child(8) {
    left: 55%;
    animation-delay: 1.05s;
}
.loading-ember:nth-child(9) {
    left: 65%;
    animation-delay: 1.2s;
}
.loading-ember:nth-child(10) {
    left: 38%;
    animation-delay: 1.35s;
}
.loading-ember:nth-child(11) {
    left: 52%;
    animation-delay: 1.5s;
}
.loading-ember:nth-child(12) {
    left: 62%;
    animation-delay: 1.65s;
}

.loading-ember:nth-child(odd) {
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #fff 0%, #ffed4a 50%, transparent 100%);
}

.loading-ember:nth-child(3n) {
    width: 8px;
    height: 8px;
    animation-duration: 2.5s;
}

@keyframes loading-ember-rise {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.9;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-80px) translateX(calc(20px - 40px * var(--random, 0.5))) scale(0);
        opacity: 0;
    }
}

.loading-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    letter-spacing: 0.05em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.loading-dots::after {
    content: "";
    animation: loading-dots 1.5s steps(4, end) infinite;
}

@keyframes loading-dots {
    0% {
        content: "";
    }
    25% {
        content: ".";
    }
    50% {
        content: "..";
    }
    75% {
        content: "...";
    }
    100% {
        content: "";
    }
}

/* Animated fire icons */
.fire-icon-left,
.fire-icon-right {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 8px rgba(255, 107, 0, 0.8));
    transform-origin: center bottom;
}

.fire-icon-left {
    animation: chili-bounce 1s ease-in-out infinite;
}

.fire-icon-right {
    animation: fire-flicker-icon 0.5s ease-in-out infinite alternate;
}

@keyframes chili-bounce {
    0%,
    100% {
        transform: rotate(-5deg) scale(1);
    }
    50% {
        transform: rotate(5deg) scale(1.1);
    }
}

@keyframes fire-flicker-icon {
    0% {
        transform: scale(1) rotate(-5deg);
        filter: drop-shadow(0 0 8px rgba(255, 107, 0, 0.8));
    }
    100% {
        transform: scale(1.15) rotate(5deg);
        filter: drop-shadow(0 0 15px rgba(255, 69, 0, 1)) drop-shadow(0 0 30px rgba(255, 107, 0, 0.8));
    }
}

/* Hover intensification - CSS fallback */
.fire-title:hover .fire-text {
    /* Keep the Blazing animation; avoid extra blur from drop-shadows */
    filter: none;
}

.fire-title:hover .fire-glow {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1.2);
}

.fire-title:hover .ember {
    opacity: 1;
}

/* Responsive fire title */
@media (max-width: 768px) {
    .fire-text {
        font-size: 1.5rem;
    }

    .fire-icon-left,
    .fire-icon-right {
        font-size: 1.4rem;
    }

    .fire-embers {
        height: 40px;
        top: -15px;
    }
}
