 /* General Reset & Layout */
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            display: flex;
            flex-direction: column;
            align-items: center;
            min-height: 100vh;
            color: #333;
            padding: 20px 0;
        }

        /* Game Container */
        .game-container {
            background: rgba(255, 255, 255, 0.95);
            padding: 1.2rem;
            border-radius: 20px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            text-align: center;
            max-width: 550px;
            width: 90%;
            margin-bottom: 20px;
        }

        h1 {
            color: #4a4a4a;
            margin-bottom: 0.5rem;
            font-size: 1.6rem;
        }

        /* Stats Bar */
        .stats {
            display: flex;
            justify-content: space-between;
            margin-bottom: 0.8rem;
            font-size: 1rem;
            font-weight: bold;
            color: #555;
            background: #f0f2f5;
            padding: 8px 12px;
            border-radius: 10px;
        }

        /* Controls */
        .controls {
            display: flex;
            gap: 8px;
            justify-content: center;
            margin-bottom: 0.8rem;
            flex-wrap: wrap;
        }

        button {
            padding: 8px 16px;
            border: none;
            border-radius: 50px;
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.2s ease;
            font-weight: 600;
        }

        .btn-mode {
            background-color: #e0e0e0;
            color: #333;
        }

        .btn-mode:hover, .btn-mode.active {
            background-color: #667eea;
            color: white;
            transform: translateY(-2px);
            box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
        }

        .btn-restart {
            background-color: #ff6b6b;
            color: white;
            width: 100%;
            margin-top: 5px;
        }

        .btn-restart:hover {
            background-color: #fa5252;
        }

        /* Puzzle Grid */
        #game-board {
            display: grid;
            gap: 4px;
            background-color: #bbada0;
            padding: 4px;
            border-radius: 10px;
            margin: 0 auto;
            width: 100%;
            aspect-ratio: 1 / 1; 
        }

        .tile {
            background-color: #eee4da;
            color: #776e65;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.4rem;
            font-weight: bold;
            border-radius: 5px;
            cursor: pointer;
            user-select: none;
            transition: background-color 0.2s, transform 0.1s;
            box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
        }

        .tile:hover {
            background-color: #cdc1b4;
        }

        .tile.empty {
            background-color: transparent;
            cursor: default;
            box-shadow: none;
        }

        /* Score Card Section */
        .score-card {
            background: rgba(255, 255, 255, 0.9);
            width: 90%;
            max-width: 550px;
            padding: 1rem;
            border-radius: 15px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.2);
            margin-bottom: 25px;
            text-align: left;
        }

        .score-card h3 {
            color: #4a4a4a;
            margin-bottom: 10px;
            font-size: 1.1rem;
            border-bottom: 2px solid #eee;
            padding-bottom: 5px;
            display: flex;
            justify-content: space-between;
        }

        .score-list {
            list-style: none;
            padding: 0;
        }

        .score-list li {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 10px;
            background: #f9f9f9;
            margin-bottom: 5px;
            border-radius: 6px;
            font-size: 0.9rem;
            color: #555;
        }

        /* Score Layout Styles */
        .score-info-left {
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 1;
        }

        .player-name {
            font-weight: bold;
            color: #333;
            max-width: 120px; /* Prevent long names breaking layout */
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .score-details {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            font-size: 0.85rem;
            color: #666;
        }

        .score-list li span.rank {
            font-weight: bold;
            color: #667eea;
            font-size: 1.1rem;
            min-width: 25px;
        }

        .score-time {
            font-weight: bold;
            color: #667eea;
        }

        .btn-clear {
            font-size: 0.7rem;
            padding: 4px 10px;
            background: #eee;
            color: #666;
            cursor: pointer;
            border-radius: 10px;
        }
        .btn-clear:hover {
            background: #ddd;
        }

        /* Win Modal */
        #win-modal {
            display: none;
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.7);
            justify-content: center;
            align-items: center;
            z-index: 100;
        }

        .modal-content {
            background: white;
            padding: 2rem;
            border-radius: 15px;
            text-align: center;
            animation: popIn 0.3s ease;
            max-width: 90%;
        }

        @keyframes popIn {
            from { transform: scale(0.8); opacity: 0; }
            to { transform: scale(1); opacity: 1; }
        }

        .modal-content h2 {
            color: #667eea;
            margin-bottom: 10px;
        }

        /* Modal Buttons Wrapper */
        .modal-buttons {
            display: flex;
            gap: 10px;
            justify-content: center;
            margin-top: 15px;
        }

        /* Share Button Style */
        .btn-share {
            background-color: #2ecc71; /* Green */
            color: white;
            padding: 10px 20px;
            border-radius: 50px;
            cursor: pointer;
            font-size: 0.9rem;
            font-weight: 600;
            border: none;
            transition: all 0.2s;
        }

        .btn-share:hover {
            background-color: #27ae60;
            transform: translateY(-2px);
        }

        /* SEO Article Section */
        .seo-article {
            background: rgba(255, 255, 255, 0.98);
            width: 100%;
            max-width: 100%;
            padding: 2rem 5%;
            text-align: left;
            line-height: 1.7;
            color: #222;
            box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
        }

        .seo-article h2 {
            font-size: 1.6rem;
            color: #4a4a4a;
            margin-top: 1.2rem;
            margin-bottom: 0.6rem;
            border-bottom: 2px solid #667eea;
            display: inline-block;
            padding-bottom: 5px;
        }

        .seo-article h2:first-of-type {
            margin-top: 0;
        }

        .seo-article p {
            margin-bottom: 1rem;
            font-size: 1.05rem;
        }

        .seo-article strong {
            color: #444;
            background-color: #f0f2f5;
            padding: 2px 6px;
            border-radius: 4px;
        }

        @media (max-width: 600px) {
            h1 { font-size: 1.4rem; }
            .tile { font-size: 1.1rem; }
            .seo-article { padding: 1.5rem 20px; }
            .seo-article h2 { font-size: 1.3rem; }
            .seo-article p { font-size: 1rem; }
            .modal-buttons { flex-direction: column; }
            .btn-share, .btn-mode { width: 100%; }
        }