        @keyframes static-flicker {

            0%,
            100% {
                opacity: 1;
                transform: translate(0, 0);
            }

            10% {
                opacity: 0.95;
                transform: translate(-1px, 1px);
            }

            20% {
                opacity: 0.9;
                transform: translate(1px, -2px);
            }

            30% {
                opacity: 1;
                transform: translate(0px, 1px);
            }

            40% {
                opacity: 0.92;
                transform: translate(-2px, 0);
            }

            50% {
                opacity: 1;
                transform: translate(2px, 1px);
            }

            60% {
                opacity: 0.97;
                transform: translate(1px, -1px);
            }

            70% {
                opacity: 0.93;
                transform: translate(0, 2px);
            }

            80% {
                opacity: 1;
                transform: translate(-1px, 0);
            }

            90% {
                opacity: 0.96;
                transform: translate(2px, -1px);
            }
        }

        @keyframes sanity-pulse {

            0%,
            100% {
                box-shadow: 0 0 10px rgba(57, 255, 20, 0.4);
            }

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

        @keyframes low-sanity-flash {

            0%,
            100% {
                background-color: #39ff14;
            }

            50% {
                background-color: #ff1439;
            }
        }

        /* latin */
        @font-face {
            font-family: 'Creepster';
            font-style: normal;
            font-weight: 400;
            font-display: swap;
            src: url(https://fonts.gstatic.com/s/creepster/v13/AlZy_zVUqJz4yMrniH4Rcn35.woff2) format('woff2');
            unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
        }

        html {
            overflow-x: hidden;
        }

        body {
            background-color: #0a0a0a;
            color: #39ff14;
            font-family: Creepster, cursive;
            text-align: center;
            padding: 1em;
            margin: 0;
            min-height: 100vh;
            max-height: 100vh;
            overflow: hidden;
            animation: static-flicker 2s infinite;
            background-image: radial-gradient(#222 1px, transparent 1px);
            background-size: 5px 5px;
        }

        html {
            overflow: hidden;
        }

        h1 {
            font-size: 3em;
            text-shadow: 0 0 10px #39ff14, 0 0 20px #39ff14;
            margin: 0.2em 0;
            line-height: 1;
        }

        h2 {
            font-size: 1.5em;
            text-shadow: 0 0 8px #39ff14;
            margin: 0.5em 0;
        }

        h3 {
            font-size: 1.2em;
            text-shadow: 0 0 5px #39ff14;
            margin: 0.5em 0;
        }

        #game-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1em;
            max-width: 1000px;
            margin: 0 auto;
            justify-content: center;
        }

        .player-section {
            width: 100%;
            max-width: 800px;
        }

        /* Scoreboard Styling */
        #scoreboard {
            width: 100%;
            max-width: 600px;
            padding: 0.5em;
            background: rgba(0, 0, 0, 0.6);
            border: 1px solid #39ff14;
            border-radius: 8px;
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .sanity-row {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
        }

        .sanity-label {
            font-size: 1em;
            width: 100px;
            text-align: left;
            font-weight: bold;
        }

        .sanity-bar-container.compact {
            flex: 1;
            height: 15px;
            background: #111;
            border: 1px solid #39ff14;
            border-radius: 10px;
            overflow: hidden;
        }

        .sanity-bar {
            height: 100%;
            background: linear-gradient(90deg, #39ff14 0%, #ffff39 50%, #ff3939 100%);
            width: 100%;
            transition: width 0.5s ease;
        }

        .sanity-bar.sanity-pulse {
            animation: sanity-pulse 2s infinite;
        }

        .sanity-bar.sanity-critical {
            animation: low-sanity-flash 0.5s infinite;
        }

        .sanity-text {
            width: 2em;
            text-align: right;
        }

        .sanity-emoji {
            font-size: 1.2em;
        }

        /* Hand Styling */
        .hand {
            display: flex;
            justify-content: center;
            flex-wrap: wrap;
            gap: 5px;
            margin: 0.5em 0;
            min-height: 100px;
            align-items: center;
        }

        .card {
            width: 80px;
            height: 112px;
            cursor: pointer;
            border-radius: 6px;
            box-shadow: 0 0 5px rgba(57, 255, 20, 0.4);
            transition: all 0.2s ease;
        }

        .card:hover {
            transform: scale(1.05) translateY(-5px);
        }

        .card.discard {
            border-color: #ff1439;
            filter: grayscale(100%) brightness(0.6);
            transform: scale(0.95);
        }

        /* Controls Styling */
        .controls {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 1em;
            margin: 2em 0;
            flex-wrap: wrap;
        }

        #betting-controls {
            display: flex;
            align-items: center;
            gap: 0.5em;
        }

        /* Hide number input spinner arrows */
        #bet-amount::-webkit-inner-spin-button,
        #bet-amount::-webkit-outer-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        #bet-amount {
            -moz-appearance: textfield;
            appearance: textfield;
        }

        .bet-adjust {
            padding: 0.5em 0.8em !important;
            font-size: 1.2em;
            min-width: unset;
            background: #0a0a0a;
            border-color: #39ff14;
            font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
        }

        .bet-adjust:hover:not(:disabled) {
            background: #1a1a1a;
            transform: scale(1.1);
            border-color: #39ff14;
        }

        .bet-adjust:disabled {
            opacity: 0.3;
            cursor: not-allowed;
        }



        button {
            background: #111;
            color: #39ff14;
            border: 2px solid #39ff14;
            padding: 0.7em 1.5em;
            margin: 0.2em;
            cursor: pointer;
            text-shadow: 0 0 5px #39ff14;
            box-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
            font-weight: bold;
            font-family: monospace;
            font-size: 1em;
            border-radius: 5px;
            transition: all 0.3s ease;
        }

        button:hover:not(:disabled) {
            background: #39ff14;
            color: #111;
            box-shadow: 0 0 20px rgba(57, 255, 20, 0.6);
            transform: translateY(-2px);
        }

        button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            filter: grayscale(100%);
        }

        input[type="number"] {
            background: #111;
            color: #39ff14;
            border: 2px solid #39ff14;
            padding: 0.5em;
            font-size: 1em;
            font-family: monospace;
            border-radius: 5px;
            width: 80px;
            text-align: center;
            box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
        }

        input[type="number"]:focus {
            outline: none;
            box-shadow: 0 0 10px rgba(57, 255, 20, 0.6);
        }

        input[type="number"]:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* Result Display */
        #result {
            margin: 0.5em 0;
            font-size: 1.2em;
            font-weight: bold;
            text-shadow: 0 0 5px #39ff14;
            min-height: 1.5em;
        }

        /* Action Bar */
        #action-bar {
            display: flex;
            width: 100%;
            max-width: 800px;
            justify-content: space-between;
            align-items: center;
            background: #111;
            border-top: 2px solid #39ff14;
            padding: 10px 20px;
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            margin: 0 auto;
            border-radius: 10px 10px 0 0;
        }

        #pot-display-compact {
            font-size: 1.5em;
            font-weight: bold;
            color: #ffff39;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .controls {
            display: flex;
            gap: 10px;
            align-items: center;
        }

        button {
            padding: 0.5em 1em;
            font-size: 0.9em;
        }

        /* Responsive Design - Fit everything in viewport */
        @media (max-width: 768px) {

            html,
            body {
                height: 100%;
                overflow: hidden;
            }

            body {
                padding: 0;
                margin: 0;
                display: flex;
                flex-direction: column;
                height: 100vh;
                height: 100dvh;
                /* Dynamic viewport height for mobile browsers */
            }

            h1 {
                font-size: 1.5em;
                margin: 0.2em 0;
                flex-shrink: 0;
            }

            #game-container {
                flex: 1;
                display: flex;
                flex-direction: column;
                justify-content: space-between;
                height: 100%;
                padding: 0.3em;
                gap: 0.3em;
                overflow: hidden;
            }

            #scoreboard {
                flex-shrink: 0;
                gap: 3px;
                padding: 0.3em;
            }

            .sanity-row {
                gap: 5px;
            }

            .sanity-label {
                font-size: 0.7em;
                width: 70px;
            }

            .sanity-bar-container.compact {
                height: 12px;
            }

            .sanity-text {
                font-size: 0.8em;
                width: 2.5em;
            }

            .sanity-emoji {
                font-size: 1em;
            }

            /* Hands take available space */
            .hand {
                flex: 1;
                display: flex;
                align-items: center;
                justify-content: center;
                gap: 2px;
                min-height: 0;
            }

            .card {
                width: auto;
                height: 100%;
                max-height: 12vh;
                aspect-ratio: 5/7;
            }

            /* Result - compact single line */
            #result {
                flex-shrink: 0;
                font-size: 0.85em;
                padding: 0.3em;
                margin: 0;
                min-height: 1.8em;
                text-align: center;
                background: rgba(0, 0, 0, 0.5);
                border-radius: 4px;
            }

            /* Action Bar - inline, not fixed */
            #action-bar {
                position: relative !important;
                bottom: auto !important;
                left: auto !important;
                right: auto !important;
                flex-shrink: 0;
                flex-direction: row;
                flex-wrap: wrap;
                gap: 5px;
                padding: 0.4em;
                max-width: 100%;
                border-radius: 8px 8px 0 0;
                justify-content: center;
            }

            #pot-display-compact {
                font-size: 1em;
                gap: 5px;
            }

            .controls {
                display: flex;
                flex-wrap: wrap;
                justify-content: center;
                gap: 4px;
            }

            #betting-controls {
                display: flex;
                align-items: center;
                gap: 3px;
            }

            button {
                padding: 0.5em 0.8em;
                font-size: 0.85em;
                min-height: 36px;
            }

            input[type="number"] {
                font-size: 0.9em;
                padding: 0.4em;
                width: 50px;
                min-height: 36px;
            }

            #deal-btn {
                background: #39ff14;
                color: #111;
            }
        }

        /* Extra small screens */
        @media (max-width: 400px) {
            h1 {
                font-size: 1.2em;
            }

            .card {
                max-height: 10vh;
            }

            .sanity-label {
                font-size: 0.6em;
                width: 55px;
            }

            button {
                padding: 0.4em 0.6em;
                font-size: 0.75em;
                min-height: 32px;
            }

            input[type="number"] {
                width: 40px;
                font-size: 0.8em;
                min-height: 32px;
            }

            #result {
                font-size: 0.75em;
            }
        }

        /* Game Over Overlay */
        .overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.9);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1000;
            backdrop-filter: blur(5px);
            transition: opacity 0.5s ease;
        }

        .overlay.hidden {
            opacity: 0;
            pointer-events: none;
        }

        .overlay-content {
            text-align: center;
            border: 2px solid #ff1439;
            padding: 2em;
            background: #111;
            border-radius: 10px;
            box-shadow: 0 0 30px rgba(255, 20, 57, 0.4);
            animation: slow-pulse 3s infinite;
        }

        @keyframes slow-pulse {

            0%,
            100% {
                box-shadow: 0 0 30px rgba(255, 20, 57, 0.4);
            }

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

        .giant-emoji {
            font-size: 8em;
            margin-bottom: 0.2em;
            animation: melt 3s infinite alternate;
        }

        @keyframes melt {
            0% {
                transform: scale(1) translateY(0);
                filter: drop-shadow(0 0 10px #ff1439);
            }

            100% {
                transform: scale(1.1) translateY(10px) skewX(5deg);
                filter: drop-shadow(0 0 20px #ff1439) blur(1px);
            }
        }

        .overlay h2 {
            color: #ff1439;
            font-size: 3em;
            margin: 0;
            text-transform: uppercase;
        }

        .overlay p {
            color: #ddd;
            font-size: 1.2em;
        }

        #rebuy-btn {
            background: #ff1439;
            color: black;
            font-size: 1.5em;
            margin-top: 1em;
            border: none;
        }

        #rebuy-btn:hover {
            background: #ff5555;
            box-shadow: 0 0 20px #ff1439;
        }

        /* ESP Minigame Styles */
        .esp-content {
            max-width: 90vw;
        }

        .esp-content h2 {
            color: #9b59b6;
            text-shadow: 0 0 10px #9b59b6;
        }

        .esp-hand {
            margin: 0.5em 0;
            padding: 0.5em;
            background: rgba(155, 89, 182, 0.1);
            border-radius: 8px;
            border: 1px solid #9b59b6;
        }

        .esp-card {
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .esp-card:hover {
            transform: scale(1.1);
            box-shadow: 0 0 15px #9b59b6;
        }

        .esp-card.esp-selected {
            transform: scale(1.15) translateY(-10px);
            box-shadow: 0 0 20px #39ff14, 0 0 30px #39ff14;
            border: 3px solid #39ff14;
        }

        #esp-result {
            font-size: 1.1em;
            color: #9b59b6;
            min-height: 1.5em;
            margin: 0.5em 0;
        }

        .esp-controls {
            display: flex;
            gap: 1em;
            justify-content: center;
            margin-top: 1em;
        }

        #esp-guess-btn {
            background: #9b59b6;
            color: white;
            font-size: 1.2em;
        }

        #esp-guess-btn:hover:not(:disabled) {
            background: #8e44ad;
            box-shadow: 0 0 15px #9b59b6;
        }

        #esp-exit-btn {
            background: #333;
        }

        #esp-btn {
            background: #9b59b6;
            color: white;
        }

        #esp-btn:hover {
            background: #8e44ad;
            box-shadow: 0 0 15px #9b59b6;
        }

        /* Chat Box Styles */
        #chat-container {
            position: fixed;
            bottom: 80px;
            right: 10px;
            width: 280px;
            max-height: 200px;
            background: rgba(10, 10, 10, 0.9);
            border: 1px solid #666;
            border-radius: 8px;
            display: flex;
            flex-direction: column;
            font-family: monospace;
            z-index: 100;
        }

        #chat-header {
            background: #1a1a1a;
            color: #9b59b6;
            padding: 8px 12px;
            font-weight: bold;
            border-bottom: 1px solid #666;
            border-radius: 8px 8px 0 0;
            font-size: 0.9em;
        }

        #chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 8px;
            max-height: 150px;
        }

        .chat-message {
            margin-bottom: 8px;
            animation: fadeIn 0.3s ease;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

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

        .chat-message.a11ce101-0000-4000-8000-000000000666 {
            color: #9b59b6;
        }

        .chat-message.emote {
            font-style: italic;
            color: #666;
        }

        .chat-message .sender {
            font-weight: bold;
            margin-right: 5px;
        }

        .chat-message .text {
            word-wrap: break-word;
        }

        /* Mobile: smaller chat */
        @media (max-width: 768px) {
            #chat-container {
                width: 200px;
                max-height: 120px;
                bottom: auto;
                top: 10px;
                right: 5px;
                font-size: 0.8em;
            }

            #chat-messages {
                max-height: 80px;
            }
        }