* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        :root {
            --primary: yellow;
            --primary-dark: #5b4bc4;
            --primary-light: red;
            --secondary: #fd79a8;
            --success: #00b894;
            --danger: #d63031;
            --warning: #fdcb6e;
            --dark: #2d3436;
            --light: #f5f6fa;
            --card-bg: #b7e4c7;
            --text: black;
            --text-light: white;
            --border: black;
            --shadow-sm: 0 5px 20px rgba(0, 0, 0, 0.08);
            --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.12);
            --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.15);
            --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            --gradient-reverse: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
        }

        [data-theme="dark"] {
            --card-bg: #1d3557;
            --text: white;
            --text-light: white;
            --border: white;
        }

        body {
            font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            background:white;
            min-height: 100vh;
            padding: 10px 20px;
            transition: all 0.3s ease;
        }

        @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

        .game-wrapper {
            max-width: 1150px;
            width: 100%;
            margin: 0 auto;
        }

        /* ========== HEADER WITH TOOLS INSIDE (NO EXTRA SPACE) ========== */
        .premium-header {
            background: #52b788;
            backdrop-filter: blur(20px);
            border-radius: 75px;
            padding: 22px 50px;
            margin-bottom: 30px;
            border: 1px solid rgba(255,255,255,0.2);
            box-shadow: var(--shadow-lg);
        }

        .header-content {
            display: flex;
            align-items: right;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 15px;
        }

        .brand {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .brand-icon {
            font-size: 2.2rem;
            filter: drop-shadow(0 5px 10px rgba(0,0,0,0.2));
           
        }

        @keyframes subtleFloat {
            0%, 100% { transform: translateY(0px); }
            50% { transform: translateY(-5px); }
        }

        .brand-text {
            display: flex;
            flex-direction: column;
        }

        .brand-title {
            font-size: 1.4rem;
            font-weight: 800;
            color: black;
            letter-spacing: -0.5px;
            line-height: 1.2;
        }

        .brand-badge {
            font-size: 0.65rem;
            color: white;
            letter-spacing: 1px;
        }

        /* Header Tools - INSIDE HEADER */
        .header-tools {
            display: flex;
            gap: 10px;
        }

        .tool-btn {
            background: black;
            border: 1px solid rgba(255,255,255,0.3);
            font-size: 1.1rem;
            cursor: pointer;
            padding: 8px;
            border-radius: 50%;
            width: 38px;
            height: 38px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            color: white;
        }

        .tool-btn:hover {
            transform: scale(1.05);
            background: blue;
        }

        .header-stats {
            display: flex;
            gap: 15px;
        }

        .stat-chip {
            background: black;
            padding: 6px 14px;
            border-radius: 40px;
            text-align: center;
        }

        .stat-chip-label {
            font-size: 0.6rem;
            color: white;
            letter-spacing: 1px;
        }

        .stat-chip-value {
            font-size: 1rem;
            font-weight: 800;
            color: white;
        }

        /* ========== MAIN GAME CARD ========== */
        .game-card {
            background: var(--card-bg);
            border-radius: 40px;
            padding: 28px;
            box-shadow: var(--shadow-lg);
            margin-bottom: 30px;
            transition: all 0.3s ease;
        }

        /* Mode & Difficulty */
        .mode-selector {
            display: flex;
            gap: 12px;
            margin-bottom: 20px;
        }

        .mode-btn {
            flex: 1;
            padding: 16px;
            border: 2px solid var(--border);
            background: #d8f3dc;
            border-radius: 50px;
            font-weight: 800;
            cursor: pointer;
            transition: all 0.3s ease;
            color: black;
            font-family: inherit;
            font-size: 0.85rem;
        }

        .mode-btn.active {
            background: #669bbc;
            color: white;
            border-color: transparent;
        }

        .difficulty-selector {
            display: flex;
            gap: 10px;
            margin-bottom: 25px;
        }

        .diff-btn {
            flex: 1;
            padding: 10px;
            border: 2px solid var(--border);
            background: #d8f3dc;
            border-radius: 50px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            color: var(--text);
            font-family: inherit;
            font-size: 0.8rem;
        }

        .diff-btn.easy.active { background: green; color: white; border-color: #00b894; }
        .diff-btn.medium.active { background: yellow; color: #2d3436; border-color: #fdcb6e; }
        .diff-btn.hard.active { background: red; color: white; border-color: #d63031; }

        /* Scoreboard */
        .scoreboard {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
            margin-bottom: 25px;
        }

        .score-card {
            background: #d8f3dc;
            border-radius: 24px;
            padding: 14px 8px;
            text-align: center;
            border: 1px solid var(--border);
        }

        .score-label {
            font-size: 0.9rem;
            font-weight: 800;
            color: black;
            opacity: 0.7;
            margin-bottom: 5px;
        }

        .score-number {
            font-size: 1.8rem;
            font-weight: 800;
            background: blue;
            -webkit-background-clip: text;
            background-clip: text;
            color: blue;
        }

        /* Arena */
        .arena {
            background: white;
            border-radius: 32px;
            padding: 20px;
            margin-bottom: 25px;
            border: 1px solid var(--border);
        }

        .players-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 15px;
            margin-bottom: 20px;
        }

        .player-card {
            flex: 1;
            text-align: center;
        }

        .player-name {
            font-size: 0.9rem;
            font-weight: 900;
            margin-bottom: 10px;
            color: black;
        }

        .player-icon {
            font-size: 3.2rem;
            background: black;
            width: 95px;
            height: 95px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto;
            border-radius: 50%;
            box-shadow: var(--shadow-sm);
            transition: all 0.3s ease;
        }

        .vs-divider {
            font-size: 1rem;
            font-weight: 800;
            background: blue;
            padding: 8px;
            border-radius: 50%;
            width: 45px;
            height: 45px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
        }

        .result-message {
            text-align: center;
            font-size: 0.9rem;
            font-weight: 600;
            padding: 12px;
            border-radius: 50px;
            background: #64b5f6;
            color: white;
        }

        /* Action Buttons */
        .actions {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
            margin-bottom: 20px;
        }

        .action-btn {
            background: #00b4d8;
            border: 2px solid var(--border);
            border-radius: 28px;
            padding: 14px 10px;
            cursor: pointer;
            transition: all 0.2s ease;
            text-align: center;
        }

        .action-btn:active { transform: scale(0.96); }
        .action-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }

        .action-emoji { font-size: 4rem; }
        .action-name { font-weight: 900; color: white; font-size: 0.75rem; margin-top: 5px; }

        /* Control Buttons */
        .controls {
            display: flex;
            gap: 12px;
            margin-bottom: 20px;
        }

        .control-btn {
            flex: 1;
            padding: 12px;
            border: none;
            border-radius: 50px;
            font-weight: 700;
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s ease;
            font-family: inherit;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .btn-primary { background: #1e88e5; color: white; }
        .btn-danger { background: #d00000; color: white; }
        .btn-success { background: #6a994e; color: white; }

        /* History */
        .history-section {
            margin-top: 20px;
            padding-top: 18px;
            border-top: 2px solid var(--border);
        }

        .history-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }

        .history-title {
            font-weight: 900;
            color: black;
            font-size: 0.85rem;
        }

        .clear-history {
            background: none;
            border: none;
            color: red;
            cursor: pointer;
            font-size: 0.9rem;
        }

        .history-list {
            max-height: 130px;
            overflow-y: auto;
            gap: 8px;
            display: flex;
            flex-direction: column;
        }

        .history-item {
            background: white;
            padding: 8px 12px;
            border-radius: 16px;
            font-size: 0.75rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        /* ========== COMPACT HOW TO PLAY SECTION ========== */
        .howto-section {
            background: var(--card-bg);
            border-radius: 32px;
            padding: 24px;
            margin-bottom: 30px;
            box-shadow: var(--shadow-md);
        }

        .howto-header {
            text-align: center;
            margin-bottom: 20px;
        }

        .howto-title {
            font-size: 1.2rem;
            font-weight: 800;
            color: black;
            display: inline-flex;
            align-items: center;
            gap: 10px;
            background: var(--gradient);
            -webkit-background-clip: text;
            background-clip: text;
            color: black;
        }

        .howto-grid {
            display: flex;
            justify-content: center;
            gap: 15px;
            flex-wrap: wrap;
        }

        .howto-card {
            background: #d8f3dc;
            border-radius: 24px;
            padding: 12px 18px;
            text-align: center;
            min-width: 140px;
            transition: all 0.3s ease;
            border: 1px solid var(--border);
        }

        .howto-card:hover {
            transform: translateY(-3px);
            border-color: red;
        }

        .howto-icon {
            font-size: 1.6rem;
            margin-bottom: 8px;
        }

        .howto-card-title {
            font-size: 0.8rem;
            font-weight: 700;
            color: var(--text);
            margin-bottom: 5px;
        }

        .howto-desc {
            font-size: 0.7rem;
            color: black;
            line-height: 1.3;
        }

        .rule-highlight {
            background: #d8f3dc;
        }

        /* ========== LUXURY FOOTER ========== */
        .premium-footer {
            background: #1b4332;
            border-radius: 32px;
            padding: 25px 30px;
            border: 1px solid rgba(255,255,255,0.1);
        }

        .footer-flex {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 20px;
            margin-bottom: 20px;
        }

        .footer-brand {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .footer-brand span {
            font-size: 1.5rem;
        }

        .footer-brand p {
            font-weight: 700;
            color: white;
            font-size: 0.9rem;
        }

        .shortcuts-group {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .shortcut {
            background: white;
            padding: 5px 12px;
            border-radius: 30px;
            font-size: 0.7rem;
            font-family: monospace;
            color: black;
        }

        .footer-divider {
            height: 1px;
            background: red;
            margin: 15px 0;
        }

        .footer-bottom {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 15px;
        }

        .copyright-text {
            font-size: 0.75rem;
            color: white;
        }

        .footer-links {
            display: flex;
            gap: 15px;
        }

        .footer-links span {
            font-size: 0.7rem;
            color: white;
            cursor: pointer;
            transition: color 0.2s;
        }

        .footer-links span:hover {
            color: yellow;
        }

        /* Toast & Pause */
        .toast {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: black;
            backdrop-filter: blur(10px);
            color: white;
            padding: 10px 24px;
            border-radius: 50px;
            font-size: 0.8rem;
            z-index: 1100;
            animation: fadeUp 0.3s ease;
        }

        @keyframes fadeUp {
            from { opacity: 0; transform: translateX(-50%) translateY(20px); }
            to { opacity: 1; transform: translateX(-50%) translateY(0); }
        }

        .pause-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.85);
            backdrop-filter: blur(10px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            display: none;
        }

        .pause-menu {
            background: red;
            padding: 35px;
            border-radius: 40px;
            text-align: center;
        }

        @media (max-width: 650px) {
            body { padding: 20px 15px; }
            .game-card, .howto-section { padding: 18px; }
            .premium-header { padding: 12px 18px; }
            .brand-title { font-size: 1.1rem; }
            .brand-icon { font-size: 1.8rem; }
            .header-stats { gap: 8px; }
            .stat-chip { padding: 4px 10px; }
            .stat-chip-value { font-size: 0.85rem; }
            .tool-btn { width: 32px; height: 32px; font-size: 0.9rem; }
            .howto-card { min-width: 120px; padding: 10px 12px; }
            .player-icon { width: 65px; height: 65px; font-size: 2.5rem; }
            .vs-divider { width: 35px; height: 35px; font-size: 0.8rem; }
            .footer-flex { flex-direction: column; text-align: center; }
            .footer-bottom { flex-direction: column; text-align: center; }
        }