﻿html,
        body{
            height:100%;
            font-family:
                "Segoe UI",
                system-ui,
                sans-serif;
            background:var(--bg);
            color:var(--text);
            min-height:100vh;
            overflow-x:hidden;
        }
        button,
        input,
        select,
        textarea{
            font:inherit;
        }
        button{
            cursor:pointer;
        }
        img{
            display:block;
        }
        .hidden{
		    display:none !important;
		}
		.header{
            position:relative;
            overflow:visible;
            background:
                linear-gradient(
                    135deg,
                    #1e3a5f 0%,
                    #2563eb 100%
                );
            color:#fff;
            padding:1rem 2rem;
        }
        .header::before{
            content:"";
            position:absolute;
            top:-50%;
            right:-10%;
            width:300px;
            height:300px;
            border-radius:50%;
            background:
                rgba(255,255,255,.05);
        }
        .header-inner{
            position:relative;
            max-width:1400px;
            margin:0 auto;
            display:flex;
            justify-content:space-between;
            align-items:center;
            gap:2rem;
        }

		.header-brand {
			display: flex;
			flex-direction: column;
		}
		.brand-title {
			display: flex;
			align-items: center;
			gap: 5px;
		}
		.brand-title img {
			width: 60px;
			height: 60px;
		}
		.brand-title h1 {
			margin: 0;
		}
		
		.header-brand p {
			margin: 4px 0 0 70px;
		}

        .header-auth{
            display:flex;
            align-items:center;
        }
        #auth-section{
            display:flex;
            align-items:center;
            gap:1rem;
            background:transparent;
            box-shadow:none;
            margin:0;
            padding:0;
        }

	#map-page-title {
		margin: 0 0 1rem;
		text-align: center;
		font-size: clamp(1.5rem, 4vw, 2.2rem);
		font-weight: 800;
		line-height: 1.2;
		color: var(--text);
	}

	#map-page-description {
		margin: 0 auto 1.5rem;
		max-width: 800px;
		text-align: center;
		font-size: 1rem;
		line-height: 1.6;
		color: #555;
	}

	/* =====================================================
	   About the Map
	===================================================== */

	.map-information {
		margin-top: 2rem;
		background: #ffffff;
		border: 1px solid var(--border);
		border-radius: 16px;
		padding: 1.5rem;
		box-shadow: var(--shadow);
	}

	.map-information h2 {
		margin: 0 0 1.25rem 0;
		font-size: 1.35rem;
		color: var(--text);
	}

	#map-about-content {
		color: var(--text);
		font-size: 1rem;
		line-height: 1.75;
	}

	#map-about-content p {
		display: block;
		margin: 0 0 1.25rem 0;
		padding: 0;
	}

	#map-about-content p:last-child {
		margin-bottom: 0;
	}

	/* =====================================================
	   About PuzzleWalker
	===================================================== */
	#site-logo {
		cursor: pointer;
	}
	.site-information {
		margin-top: 2rem;
		margin-bottom: 2rem;
		background: #ffffff;
		border: 1px solid var(--border);
		border-radius: 16px;
		padding: 1.5rem;
		box-shadow: var(--shadow);
	}

	.site-information h2 {
		margin: 0 0 1.25rem 0;
		font-size: 1.35rem;
		color: var(--text);
	}

	#about-puzzlewalker-content {
		color: var(--text);
		font-size: 1rem;
		line-height: 1.75;
	}

	#about-puzzlewalker-content p {
		display: block;
		margin: 0 0 1.25rem 0;
		padding: 0;
	}

	#about-puzzlewalker-content p:last-child {
		margin-bottom: 0;
	}

	.google-login-btn {
    width: 100%;
    min-height: 44px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 0 18px;

    background: #ffffff;
    color: #3c4043;

    border: 1px solid #dadce0;
    border-radius: 4px;

    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        box-shadow 0.15s ease;
}

.google-login-btn:hover {
    background-color: #f8f9fa;

    box-shadow:
        0 1px 2px rgba(60, 64, 67, 0.30),
        0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.google-login-btn:active {
    background-color: #f1f3f4;
}

.google-login-btn:focus-visible {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
}

.google-logo {
    flex: 0 0 18px;
}

/* ==================================================
   Action Buttons
   ================================================== */
.site-share-btn {
    border: none;
    background: transparent;
    color: inherit;
    padding: 6px 8px;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    opacity: 0.9;
}

.site-share-btn:hover {
    background: rgba(128, 128, 128, 0.12);
    opacity: 1;
}

.site-share-btn:active {
    transform: translateY(1px);
}


#favorite-puzzle-btn {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;

    height: 42px !important;
    min-height: 42px !important;

    padding: 0 !important;
    margin: 0 !important;

    flex: 0 0 42px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    border: none !important;
    background: transparent !important;

    cursor: pointer;
}

#favorite-puzzle-icon {
    display: block;

    width: auto;
    height: auto;

    font-size: 30px;
    line-height: 1;

    white-space: nowrap;
}

.puzzle-favorite-control {
    display: flex;
    justify-content: flex-end;
    margin: .5rem 0 1rem;
}

.favorite-puzzle-btn:hover {
    transform: scale(1.12);
}

.favorite-puzzle-btn:active {
    transform: scale(0.95);
}

.favorite-puzzle-btn:disabled {
    cursor: default;
    opacity: 0.6;
}


.favorite-puzzle-btn.is-favorite #favorite-puzzle-icon {
    color: #e63946;
}

/* ==================================================
   Play Mode Selection
   ================================================== */

.play-mode-modal {
    width: min(760px, 92vw);
    max-width: 760px;
}

.play-mode-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.play-mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;

    width: 100%;
    min-height: 300px;
    box-sizing: border-box;

    padding: 1.25rem;

    border: 2px solid var(--border-color);
    border-radius: 16px;

    background: var(--card-bg);

    cursor: pointer;
    text-align: center;

    font: inherit;
    color: var(--text);

    transition:
        transform .15s ease,
        box-shadow .15s ease,
        border-color .15s ease;
}

.play-mode-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}

.play-mode-icon {
    font-size: 2.4rem;
    line-height: 1;
    margin-bottom: .65rem;
}

.play-mode-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: .65rem;
}

.play-mode-description {
    font-size: .9rem;
    line-height: 1.4;
    color: var(--text-muted);
    min-height: 2.6rem;
}

.play-mode-medal {
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 800;
}

.play-mode-medal.silver {
    color: #64748b;
}

.play-mode-medal.gold {
    color: #b7791f;
}

.play-mode-condition {
    margin-top: .4rem;
    font-size: .8rem;
    color: var(--text-muted);
}

.play-mode-card:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.public-puzzle-start {
align-content: center;
}
.share-stat {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
}

.share-stat > div {
    font-size: 25px;
    margin-bottom: 5px;
}

.share-stat strong {
    display: block;
    font-size: 16px;
}

.share-stat span {
    display: block;
    margin-top: 4px;
    font-size: 20px;
    font-weight: 700;
}

       .user-chip{
            display:flex;
            align-items:center;
            gap:.75rem;
        }
        .user-chip img{
            width:38px;
            height:38px;
            border-radius:50%;
            border:2px solid #fff;
        }
        .container{
            max-width:1400px;
            margin:0 auto;
            padding:1rem 1.5rem;
        }
        .btn{
            display:inline-flex;
            align-items:center;
            justify-content:center;
            gap:.5rem;
            border:none;
            border-radius:8px;
            padding:.65rem 1.2rem;
            font-size:.95rem;
            font-weight:500;
            transition:
                background .2s,
                transform .2s,
                border-color .2s;
        }
        .btn:hover{
            transform:translateY(-1px);
        }
        .btn-primary{
            background:var(--primary);
            color:#fff;
        }
        .btn-primary:hover{
            background:var(--primary-dark);
        }
        .btn-secondary{
            background:var(--bg);
            border:1px solid var(--border);
            color:var(--text);
        }
        .btn-secondary:hover{
            background:var(--border);
        }
        .btn-danger{
            background:#fee2e2;
            color:#991b1b;
        }
        .btn-danger:hover{
            background:#fecaca;
        }
        .maps-grid{
            display:grid;
            grid-template-columns:
                repeat(
                    auto-fill,
                    minmax(280px,1fr)
                );
            gap:1.5rem;
            margin-bottom:1.5rem;
        }
        .map-card{
            position:relative;
            overflow:hidden;
            background:var(--card);
            border:2px solid transparent;
            border-radius:16px;
            padding:1.5rem;
            cursor:pointer;
            transition:
                transform .3s,
                border-color .3s,
                box-shadow .3s;
            box-shadow:var(--shadow);
        }
        .map-card:hover{
            transform:translateY(-4px);
            border-color:var(--primary);
            box-shadow:var(--shadow-lg);
        }
        .map-card .badge{
            display:inline-block;
            margin-top:.75rem;
            margin-right:.5rem;
            padding:.25rem .75rem;
            border-radius:999px;
            font-size:.75rem;
            font-weight:600;
        }
        .badge-easy{
            background:#dcfce7;
            color:#166534;
        }
        .badge-medium{
            background:#fef9c3;
            color:#854d0e;
        }
        .badge-hard{
            background:#fee2e2;
            color:#991b1b;
        }
        .badge-expert{
            background:#e0e7ff;
            color:#3730a3;
        }

/* =========================================================
   Player Puzzle Lists
   ========================================================= */
.user-menu-container {
    position: relative;
    z-index: 999;
}

#player-solved-puzzles-list,
#player-favorite-puzzles-list {
    width: 100%;
}

/* =========================================================
   Player Menu
   ========================================================= */

/* =========================================================
   Player Menu
   ========================================================= */

#user-info {
    position: relative;
    z-index: 10000;
    overflow: visible;
}

.player-menu {
    position: absolute;

    top: calc(100% + 6px);
    right: 0;

    display: flex;
    flex-direction: column;

    width: 190px;
    padding: 6px;

    background: #ffffff;

    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;

    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.18);

    z-index: 10001;
}

.player-menu-item {
    display: flex;
    align-items: center;

    width: 100%;
    min-height: 44px;

    padding: 8px 14px;
    margin: 2px 0;

    border: none;
    border-radius: 6px;

    background: transparent;

    font-size: 15px;
    font-weight: 500;

    text-align: left;

    cursor: pointer;
    white-space: nowrap;
}

.player-menu-item:hover {
    background: rgba(0, 0, 0, 0.07);
}

.player-menu-item:active {
    background: rgba(0, 0, 0, 0.12);
}


/* =========================================================
   Favorite Puzzles
   ========================================================= */

.player-puzzle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    min-height: 48px;

    margin-bottom: 5px;
    padding: 6px 10px;

    border-radius: 6px;
    cursor: pointer;

    background: var(--panel-bg, #f5f5f5);

    transition:
        background-color 0.15s ease,
        transform 0.1s ease;
}

.player-puzzle-row:hover {
    background: var(--panel-hover-bg, #e9e9e9);
}

.player-puzzle-row-info {
    display: flex;
    align-items: center;

    min-width: 0;
    flex: 1;
}

.player-puzzle-icon {
    flex: 0 0 32px;
    width: 32px;

    font-size: 20px;
    text-align: center;
}

.player-puzzle-name {
    min-width: 0;
    margin-left: 8px;

    font-weight: 600;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Favorite heart */

.player-puzzle-favorite {
    flex: 0 0 36px;

    width: 36px;
    height: 36px;

    margin-left: 8px;
    padding: 0;

    border: none;
    background: transparent;

    color: red;
    font-size: 22px;
    line-height: 36px;
	
    cursor: pointer;
    border-radius: 50%;
}

.player-puzzle-favorite:hover {
    background: rgba(0, 0, 0, 0.08);
}


/* =========================================================
   Solved Puzzles
   ========================================================= */

.player-solved-puzzle-card {
    display: block;

    width: 100%;
    min-height: 52px;

    margin-bottom: 5px;
    padding: 7px 10px;

    border-radius: 6px;
    cursor: pointer;

    background: var(--panel-bg, #f5f5f5);

    transition:
        background-color 0.15s ease,
        transform 0.1s ease;
}

.player-solved-puzzle-card:hover {
    background: var(--panel-hover-bg, #e9e9e9);
}

.player-solved-puzzle-card:active {
    transform: scale(0.995);
}


/* Puzzle name */

.solved-puzzle-title {
    font-weight: 600;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Score / time / attempts / hints */

.solved-puzzle-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 3px 16px;

    margin-top: 3px;

    font-size: 12px;
    color: var(--text-muted);
}



.puzzle-img-preview {
    width: 100%;
    text-align: center;
}

.puzzle-img-preview img {
    display: inline-block;
    width: auto;
    height: auto;
}


/* =========================================================
   Empty states
   ========================================================= */

.player-empty-message,
.empty-state {
    padding: 25px 15px;

    text-align: center;
    color: var(--text-muted);
}

        .game-area{
            display:block;
            background:var(--card);
            border-radius:12px;
            padding:1rem;
            box-shadow:var(--shadow);
        }

        .game-header{
            display:flex;
            justify-content:space-between;
            align-items:center;
            flex-wrap:wrap;
            gap:1rem;
            margin-bottom:1.5rem;
        }

        .stats-bar{
            display:flex;
            gap:0.75rem;
        }
        .stat{
            text-align:center;
        }
        .stat-value{
            font-size:1.75rem;
            font-weight:700;
            color:var(--primary);
        }
        .stat-label{
            margin-top:.2rem;
            font-size:1.0rem;
            text-transform:uppercase;
            letter-spacing:.5px;
            color:var(--text-muted);
        }

        .controls{
            display:flex;
            flex-wrap:wrap;
            gap:.75rem;
            margin-bottom:1.5rem;
        }
        .game-board{
            display:flex;
            justify-content:center;
            align-items:stretch;
            gap:1.5rem;
        }
.drop-zone-container{
    flex:1 1 auto;
    min-width:0;
}        .drop-zone{
            position:relative;
            width:100%;
            aspect-ratio:.75;
            overflow:hidden;
            background:#f8fafc;
            border:2px dashed var(--border);
            border-radius:12px;
        }
        .drop-zone svg{
            width:100%;
            height:100%;
        }
        .target-path{
            fill:#e2e8f0;
            stroke:#94a3b8;
            stroke-width:1;
            transition:all .3s;
        }
        .target-path.highlight{
            fill:#bfdbfe!important;
            stroke:var(--primary)!important;
            stroke-width:2!important;
        }
        .target-path.correct{
            fill-opacity:1;
            stroke:#166534;
            stroke-width:1.5;
        }
        .target-path:hover{
            fill:#dbeafe;
        }
        .preview-overlay{
            position:absolute;
            inset:0;
            opacity:0;
            pointer-events:none;
            transition:opacity .3s;
        }
        .preview-overlay.active{
            opacity:.85;
        }
.pieces-tray-container{
    flex:0 0 clamp(240px,24%,320px);
}
        .pieces-tray{
            flex:1;
            display:flex;
            flex-wrap:wrap;
            align-content:flex-start;
            gap:.5rem;
            min-height:0;
            overflow-y:auto;
            overflow-x:hidden;
            padding:0.2rem;
            background:#f8fafc;
            border:2px solid var(--border);
            border-radius:12px;
        }
        .pieces-tray::-webkit-scrollbar{
            width:6px;
        }
        .pieces-tray::-webkit-scrollbar-track{
            background:#f1f5f9;
        }
        .pieces-tray::-webkit-scrollbar-thumb{
            background:#cbd5e1;
            border-radius:3px;
        }
.puzzle-piece {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 150px;
    height: 130px;
}
.piece-svg {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.piece-svg svg {
    width: 100%;
    height: 100%;
}
.piece-title {
    height: 22px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}
        .puzzle-piece:hover{
            transform:scale(1.05);
            filter:
                drop-shadow(
                    0 6px 12px rgba(0,0,0,.2)
                );
            z-index:10;
        }
        .puzzle-piece.dragging{
            position:fixed!important;
            z-index:10000;
            cursor:grabbing;
            opacity:.9;
            pointer-events:none;
            filter:
                drop-shadow(
                    0 10px 20px rgba(0,0,0,.3)
                );
        }
        .puzzle-piece svg{
            width:100%;
            height:100%;
            overflow:visible;
        }
        .puzzle-piece svg path{
            transition:fill .2s;
        }
        .puzzle-piece:hover svg path{
            filter:brightness(1.1);
        }
        .progress-container{
            margin-top:1.5rem;
        }
        .progress-bar-bg{
            width:100%;
            height:10px;
            overflow:hidden;
            background:#e2e8f0;
            border-radius:5px;
        }
        .progress-bar-fill{
            width:0;
            height:100%;
            background:
                linear-gradient(
                    90deg,
                    var(--primary),
                    var(--success)
                );
            border-radius:5px;
            transition:width .5s ease;
        }

/* =========================================================
   FEATURED PUZZLE CARDS
   ========================================================= */

.featured-puzzles-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
}


/* ---------------------------------------------------------
   Card
   --------------------------------------------------------- */

.featured-puzzle-card {
    display: flex;
    flex-direction: column;

    min-width: 0;

    background: #ffffff;

    border: 1px solid #d9dee7;
    border-radius: 12px;

    overflow: hidden;

    text-decoration: none;
    color: inherit;

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.08);

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.featured-puzzle-card:hover {
    transform: translateY(-3px);

    border-color: #b8c2d1;

    box-shadow:
        0 7px 18px rgba(0, 0, 0, 0.13);
}


/* ---------------------------------------------------------
   Thumbnail area
   --------------------------------------------------------- */

.featured-puzzle-preview {
    height: 175px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 10px;

    background: #ffffff;

    border-bottom: 1px solid #e5e9ef;

    overflow: hidden;
}

.featured-puzzle-thumbnail {
    display: block;

    max-width: 100%;
    max-height: 100%;

    width: auto;
    height: auto;

    object-fit: contain;
}


/* ---------------------------------------------------------
   Information
   --------------------------------------------------------- */

.featured-puzzle-info {
    display: flex;
    flex-direction: column;
    align-items: center;

    padding: 12px 10px 14px;

    text-align: center;
}


/* Puzzle name */

.featured-puzzle-title {
    width: 100%;

    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;

    text-align: center;

    color: #1f2937;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

    overflow: hidden;
}


/* Piece count */

.featured-puzzle-pieces {
    margin-top: 5px;

    font-size: 12px;
    line-height: 1.2;

    color: #6b7280;

    text-align: center;
}


/* Play */

.featured-puzzle-link {
    margin-top: 9px;

    font-size: 13px;
    font-weight: 600;

    color: #2563eb;

    text-align: center;
}


/* ---------------------------------------------------------
   Tablet
   --------------------------------------------------------- */

@media (max-width: 1100px) {

    .featured-puzzles-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}


.leaderboard{
            margin-top:1rem;
            background:var(--card);
            border-radius:16px;
            padding:1.5rem;
            box-shadow:var(--shadow);
        }
        .leaderboard-item{
            display:flex;
            align-items:center;
            margin-bottom:.5rem;
            padding:.875rem 1rem;
            border-radius:10px;
            transition:background .2s;
        }
        .leaderboard-item:hover{
            background:#f8fafc;
        }
        .leaderboard-item.gold{
            background:
                linear-gradient(
                    90deg,
                    #fef3c7 0%,
                    transparent 100%
                );
            border:1px solid #fde68a;
        }
        .leaderboard-item.silver{
            background:
                linear-gradient(
                    90deg,
                    #f1f5f9 0%,
                    transparent 100%
                );
        }
        .leaderboard-item.bronze{
            background:
                linear-gradient(
                    90deg,
                    #fef2f2 0%,
                    transparent 100%
                );
        }
.modal-stat {
    display: flex;
    align-items: center;
    gap: 8px;              /* Space between label and value */
    margin-bottom: 8px;
}
.modal-stat-label {
    font-weight: 600;
    white-space: nowrap;
}
.modal-stat-value {
    font-weight: 400;
}
		/* ---------- Leaderboard ---------- */
.leaderboard-summary{
    margin:0.75rem 0 1rem;
    font-size:.85rem;
    color:var(--text-muted);
}
.leaderboard-rank{
    width:44px;
    text-align:center;
    font-size:1.5rem;
    font-weight:700;
    flex-shrink:0;
}
.leaderboard-avatar{
    width:44px;
    height:44px;
    margin-right:12px;
    flex-shrink:0;
}
.leaderboard-avatar img{
    width:100%;
    height:100%;
    border-radius:50%;
    object-fit:cover;
    border:2px solid var(--border);
}
.leaderboard-info{
    flex:1;
    min-width:0;
}
.leaderboard-name{
    display:flex;
    align-items:center;
    gap:6px;
    font-weight:600;
    margin-bottom:3px;
}
.verified-badge{
    color:#2563eb;
    font-size:.85rem;
}
.leaderboard-details{
    font-size:.82rem;
    color:var(--text-muted);
}
.leaderboard-score{
    text-align:right;
    white-space:nowrap;
    margin-left:16px;
}
.leaderboard-score-value{
    color:#d97706;
    font-weight:700;
    font-size:1rem;
}
.leaderboard-score-label{
    font-size:.75rem;
    color:var(--text-muted);
}
        .modal-overlay{
            display:none;
            position:fixed;
            inset:0;
            justify-content:center;
            align-items:center;
            padding:1rem;
            background:rgba(0,0,0,.6);
            z-index:1000;
        }
        .modal-overlay.active{
            display:flex;
        }
        .modal{
            width:100%;
            max-width:480px;
            padding:2.5rem;
            text-align:center;
            background:#fff;
            border-radius:20px;
            box-shadow:
                0 25px 50px -12px rgba(0,0,0,.25);
            animation:
                modalPop .4s
                cubic-bezier(.34,1.56,.64,1);
        }
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    margin-bottom: 10px;
    padding: 12px 18px;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
        @keyframes modalPop{
            from{
                transform:scale(.7);
                opacity:0;
            }
            to{
                transform:scale(1);
                opacity:1;
            }
        }
        /* ==========================================================
           Hint Effects
           ========================================================== */
        .hint-piece{
            outline:4px solid #f59e0b;
            border-radius:10px;
            box-shadow:
                0 0 20px rgba(245,158,11,.9);
            z-index:100;
            animation:
                hintPiecePulse .6s infinite alternate;
        }
        @keyframes hintPiecePulse{
            from{
                transform:scale(1);
            }
            to{
                transform:scale(1.12);
            }
        }
        .hint-target{
            animation:
                hintTargetPulse .5s infinite alternate;
        }
        @keyframes hintTargetPulse{
            from{
                opacity:.35;
            }
            to{
                opacity:1;
            }
        }
        /* ==========================================================
           Tooltip
           ========================================================== */
        #map-tooltip{
            position:fixed;
            visibility:hidden;
            opacity:0;
            display:inline-block;
            padding:8px 12px;
            white-space:nowrap;
            font-size:14px;
            font-weight:600;
            color:#fff;
            background:
                rgba(30,41,59,.96);
            border-radius:8px;
            pointer-events:none;
            z-index:99999;
            transition:
                opacity .15s ease;
        }
        /* ==========================================================
           Startup Loader
           ========================================================== */
        .loading-screen{
            position:fixed;
            inset:0;
            display:flex;
            justify-content:center;
            align-items:center;
            background:var(--bg);
            z-index:999999;
            opacity:1;
            transition:
                opacity .25s ease;
        }
        .loading-screen.hide{
            opacity:0;
            pointer-events:none;
        }
        .loading-content{
            text-align:center;
        }
        .loading-logo{
            font-size:4rem;
            margin-bottom:1rem;
        }
        .loading-spinner{
            width:44px;
            height:44px;
            margin:1.5rem auto;
            border-radius:50%;
            border:4px solid #dbeafe;
            border-top:4px solid var(--primary);
            animation:
                loadingSpin .8s linear infinite;
        }
        @keyframes loadingSpin{
            to{
                transform:rotate(360deg);
            }
        }
.menu-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:1rem;
}
.browser-header{
    display:flex;
    align-items:center;
    gap:1rem;
    margin-bottom:1rem;
}
.breadcrumb{
    color:var(--text-muted);
    font-size:.95rem;
}
.menu-tree{
    list-style:none;
    padding-left:0;
}
.menu-tree ul{
    list-style:none;
    margin-left:20px;
    padding-left:15px;
    border-left:1px solid #ddd;
}
.menu-node{
    padding:6px 8px;
    margin:2px 0;
    border-radius:6px;
}
.menu-leaf{
    cursor:pointer;
}
.menu-leaf:hover{
    background:#eef6ff;
}
.browser-section-title{
    margin-top:4px;
    margin-bottom:0px;
    padding-bottom:0px;
    border-bottom:0px solid var(--border);
}
.browser-section{
    margin-top:8px;
    margin-bottom:4px;
    padding-bottom:4px;
    font-size:1.15rem;
    font-weight:700;
    border-bottom:1px solid #d8dfe8;
}
.browser-row{
    margin-bottom:4px;
}
.browser-division-grid{
    display:grid;
    grid-template-columns:
        repeat(auto-fit,minmax(320px,1fr));
    gap:8px 24px;
    margin-bottom:4px;
}
.browser-division-card{
    padding:2px 8px;
    border-radius:6px;
    transition:background .15s;
}
.browser-division-card:hover{
    background:#f7faff;
}
.browser-division-item{
    padding:2px 8px;
    border-radius:6px;
    text-decoration:none;
    transition:
        background .15s,
        color .15s,
        transform .15s;
}
.browser-division-item:hover{
    background:#eaf3ff;
    color:#0b63d9;
    transform:translateX(3px);
}
.browser-region{
    font-weight:600;
    margin-bottom:4px;
}
.browser-district-grid{
    display:grid;
    grid-template-columns:
        repeat(auto-fit,minmax(170px,1fr));
    gap:0px 24px;
    margin-bottom:3px;
}
.browser-district-item{
    display:block;
    padding:0px 8px;
    border-radius:6px;
    text-decoration:none;
    transition:
        background .15s,
        color .15s,
        transform .15s;
}
.browser-district-item:hover{
    background:#eaf3ff;
    color:#0b63d9;
    transform:translateX(3px);
}

.browser-region-row a,
.browser-row a{
    color:var(--primary);
    text-decoration:none;
    cursor:pointer;
}
.browser-region-row a:hover,
.browser-row a:hover{
    text-decoration:underline;
}

.recent-games-header{
    display:grid;
    grid-template-columns:
        180px   /* Player */
        260px   /* Map */
        1fr   /* Pieces/Attempts */
        90px    /* Stars */
        70px    /* Time */
        70px;   /* Ago */
    align-items:center;
    gap:12px;
    padding:6px 12px 8px;
    font-weight:700;
    font-size:0.9rem;
    color:#555;
    border-bottom:2px solid #dcdcdc;
    margin-bottom:4px;
}
.recent-games-row{
    display:grid;
    grid-template-columns:
        180px   /* Player */
        260px   /* Map */
        1fr   /* Pieces/Attempts */
        90px    /* Stars */
        70px    /* Time */
        70px;   /* Ago */
    align-items:center;
    gap:12px;
    padding:6px 12px;
    border-bottom:1px solid #eee;
}
.recent-player{
    display:flex;
    align-items:center;
    gap:10px;
    font-weight:600;
}
.recent-player img{
    width:32px;
    height:32px;
    border-radius:50%;
}
.recent-map{
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
}
.recent-stars{
    text-align:center;
}
.recent-time{
    text-align:right;
    font-variant-numeric:tabular-nums;
}
.recent-ago{
    text-align:right;
    color:#777;
    font-size:0.9rem;
}
.piece-label{
    font-weight:600;
    text-anchor:middle;
    dominant-baseline:middle;
    pointer-events:none;
    user-select:none;
    paint-order:stroke;
    stroke:#ffffff;
    stroke-width:1;
}
.modal{
    position:relative;
}
.modal-close{
    position:absolute;
    top:14px;
    right:16px;
    width:34px;
    height:34px;
    border:none;
    border-radius:50%;
    background:transparent;
    font-size:1.3rem;
    cursor:pointer;
    color:#666;
    transition:.2s;
}
.modal-close:hover{
    background:#f2f2f2;
    color:#111;
}

/* ==========================================================
   Browse Puzzles - Top-level menu
   ========================================================== */

.browser-top-menu {
    display:flex;
    flex-wrap:wrap;
    gap:.6rem;
    margin-bottom:0px;
}

.browser-top-menu-item {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:.65rem 1rem;

    border:1px solid var(--border);
    border-radius:8px;

    background:var(--card);
    color:var(--text);

    font-size:.95rem;
    font-weight:600;

    cursor:pointer;

    transition:
        background .15s,
        color .15s,
        border-color .15s,
        transform .15s;
}

.browser-top-menu-item:hover {
    background:#eaf3ff;
    color:#0b63d9;
    border-color:#bfdbfe;
    transform:translateY(-1px);
}

.browser-top-menu-item.active {
    background:var(--primary);
    color:#fff;
    border-color:var(--primary);
}

.browser-top-menu-item.active:hover {
    background:var(--primary-dark);
    color:#fff;
}

.auto-hint-marker {
    fill: none;
    stroke: #dc2626;
    stroke-width: 2.5;
    stroke-dasharray: 6 4;
    pointer-events: none;
    animation: autoHintPulse 1s ease-in-out infinite;
}

@keyframes autoHintPulse {
    0%, 100% {
        opacity: 0.55;
    }

    50% {
        opacity: 1;
    }
}

/* =========================================================
   Player Puzzle Tables
   ========================================================= */

.player-puzzle-table {
    width: 100%;
    margin-top: 12px;

    border: 1px solid var(--border);
    border-radius: 8px;

    overflow: hidden;

    background: var(--card);
}


/* ---------------------------------------------------------
   Table header
   --------------------------------------------------------- */

.player-puzzle-table-header {
    display: grid;

    grid-template-columns:
        minmax(200px, 1fr)
        120px
        90px
        90px
        90px
        70px;

    align-items: center;

    min-height: 40px;

    padding: 0 12px;

    background: var(--panel-bg, #f5f5f5);

    border-bottom: 1px solid var(--border);

    font-size: 12px;
    font-weight: 600;

    color: var(--text-muted);
}


/* ---------------------------------------------------------
   Solved puzzle rows
   --------------------------------------------------------- */

.player-puzzle-table.solved
.player-puzzle-table-row {

    display: grid;

    grid-template-columns:
        minmax(200px, 1fr)
        120px
        90px
        90px
        90px
        70px;

    align-items: center;

    min-height: 46px;

    padding: 0 12px;

    border-bottom: 1px solid var(--border);

    cursor: pointer;

    transition:
        background-color 0.15s ease;
}


.player-puzzle-table.solved
.player-puzzle-table-row:last-child {
    border-bottom: none;
}


.player-puzzle-table.solved
.player-puzzle-table-row:hover {
    background: var(--panel-hover-bg, #e9e9e9);
}


/* ---------------------------------------------------------
   Puzzle name
   --------------------------------------------------------- */

.player-puzzle-table-name {

    min-width: 0;

    padding-right: 10px;

    font-weight: 600;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


/* ---------------------------------------------------------
   Favorite puzzle table
   --------------------------------------------------------- */

.player-puzzle-table.favorites
.player-puzzle-table-header {

    grid-template-columns:
        minmax(200px, 1fr)
        50px;
}


.player-puzzle-table.favorites
.player-puzzle-table-row {

    display: grid;

    grid-template-columns:
        minmax(200px, 1fr)
        50px;

    align-items: center;

    min-height: 46px;

    padding: 0 12px;

    border-bottom: 1px solid var(--border);

    cursor: pointer;

    transition:
        background-color 0.15s ease;
}


.player-puzzle-table.favorites
.player-puzzle-table-row:last-child {
    border-bottom: none;
}


.player-puzzle-table.favorites
.player-puzzle-table-row:hover {
    background: var(--panel-hover-bg, #e9e9e9);
}


/* ---------------------------------------------------------
   Favorite heart
   --------------------------------------------------------- */

.player-puzzle-table
.player-puzzle-favorite {

    justify-self: end;

    width: 34px;
    height: 34px;

    margin: 0;
    padding: 0;

    border: none;

    background: transparent;

    color: red;

    font-size: 21px;

    line-height: 34px;

    cursor: pointer;

    border-radius: 50%;
}


.player-puzzle-table
.player-puzzle-favorite:hover {
    background: rgba(255, 0, 0, 0.08);
}


/* =========================================================
   Pagination
   ========================================================= */

.player-puzzle-pagination {

    display: flex;

    justify-content: center;
    align-items: center;

    gap: 12px;

    margin-top: 14px;
    margin-bottom: 6px;
}


.player-puzzle-page-button {

    min-width: 90px;

    padding: 7px 12px;

    border: 1px solid var(--border);

    border-radius: 6px;

    background: var(--card);

    color: var(--text);

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;
}


.player-puzzle-page-button:hover:not(:disabled) {
    background: var(--panel-hover-bg, #f5f5f5);
}


.player-puzzle-page-button:disabled {
    opacity: 0.45;
    cursor: default;
}


.player-puzzle-page-info {

    min-width: 90px;

    text-align: center;

    font-size: 13px;

    color: var(--text-muted);
}

/* =========================================================
   Mobile Devices
   ========================================================= */

@media (max-width: 768px) {

    /* -----------------------------------------------------
       General Layout
       ----------------------------------------------------- */

    .header-brand h1 {
        font-size: 1.5rem;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

	.brand-title img {
		width: 25px;
		height: 25px;
	}


    .container {
        padding: .25rem;
    }

    .puzzle-img-preview {
    width: 100%;
	}

	.puzzle-img-preview img {
        display: block;
        width: 100%;
        height: auto;
    }
	.game-board {
        flex-direction: column;
    }

	/* -----------------------------------------------------
	   Game Statistics
	   ----------------------------------------------------- */

    .stats-bar {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .stats-bar .stat:nth-child(1) {
        grid-column: span 2;
    }

    .stats-bar .stat:nth-child(2) {
        grid-column: span 2;
    }

    .stats-bar .stat:nth-child(3) {
        grid-column: span 2;
    }

    .stats-bar .stat:nth-child(4) {
        grid-column: 2 / span 2;
    }

    .stats-bar .stat:nth-child(5) {
        grid-column: 4 / span 2;
    }

	.stat {
		min-width: 0;
	}

	.stat-value {
		font-size: 1rem;
	}

	.stat-label {
		font-size: 0.75rem;
	}

	.controls {
        justify-content: center;
    }

    .modal {
        padding: 1rem;
    }


    /* -----------------------------------------------------
       Browser / Tree Menu
       ----------------------------------------------------- */

    .browser-top-menu {
        gap: 0.5rem;
    }

    .browser-top-menu-item {
        flex: 1 1 auto;
        min-width: 140px;
    }



    /* -----------------------------------------------------
       Player Puzzle List
       ----------------------------------------------------- */

    .player-puzzle-row {
        min-height: 46px;
        padding: 5px 8px;
    }

    .player-puzzle-icon {
        flex-basis: 30px;
        width: 30px;
        font-size: 18px;
    }

    .player-puzzle-name {
        margin-left: 6px;
    }

    .player-puzzle-favorite {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
        line-height: 34px;
    }


    /* -----------------------------------------------------
       Solved Puzzle Cards
       ----------------------------------------------------- */

    .player-solved-puzzle-card {
        min-height: 48px;
        padding: 6px 8px;
    }

    .solved-puzzle-meta {
        gap: 3px 10px;
        font-size: 11px;
    }


    /* -----------------------------------------------------
       Player Puzzle Tables
       ----------------------------------------------------- */

    .player-puzzle-table-header {
        display: none;
    }

    .player-puzzle-table.solved
    .player-puzzle-table-row,

    .player-puzzle-table.favorites
    .player-puzzle-table-row {

        grid-template-columns:
            1fr auto;

        min-height: 0;
        padding: 9px 10px;
    }

    .player-puzzle-table.solved
    .player-puzzle-table-row {
        gap: 3px 10px;
    }

    .player-puzzle-table.favorites
    .player-puzzle-table-row {
        gap: 3px 10px;
    }

    .player-puzzle-table-name {
        grid-column: 1 / -1;
        padding-right: 0;
    }

    .player-puzzle-table.solved
    .player-puzzle-table-row > div:not(
        .player-puzzle-table-name
    ) {

        font-size: 12px;
        color: var(--text-muted);
    }


    /* -----------------------------------------------------
       Player Puzzle Pagination
       ----------------------------------------------------- */

    .player-puzzle-pagination {
        gap: 8px;
    }

    .player-puzzle-page-button {
        min-width: 78px;
        padding: 7px 8px;
    }


    /* -----------------------------------------------------
       Map Information
       ----------------------------------------------------- */

    .map-information {
        padding: 1.1rem;
        border-radius: 12px;
    }

    .map-information h2 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    #map-about-content {
        font-size: 0.96rem;
        line-height: 1.7;
    }

    #map-about-content p {
        margin-bottom: 1.1rem;
    }


    /* -----------------------------------------------------
       Site Information
       ----------------------------------------------------- */

    .site-information {
        padding: 1.1rem;
        border-radius: 12px;
    }

    .site-information h2 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    #about-puzzlewalker-content {
        font-size: 0.96rem;
        line-height: 1.7;
    }

    #about-puzzlewalker-content p {
        margin-bottom: 1.1rem;
    }


    /* -----------------------------------------------------
       Play Mode
       ----------------------------------------------------- */

    .play-mode-options {
        grid-template-columns: 1fr;
    }

    .play-mode-card {
        min-height: 190px;
    }


    /* -----------------------------------------------------
       Featured Puzzles
       ----------------------------------------------------- */

    .featured-puzzles-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 12px;
    }

    .featured-puzzle-preview {
        height: 140px;
    }

    .featured-puzzle-info {
        padding: 10px 8px 12px;
    }

    .featured-puzzle-title {
        font-size: 14px;
    }


    /* -----------------------------------------------------
       Recent Activity
       ----------------------------------------------------- */

    .recent-games-header {
        display: none;
    }

    .recent-games-row {
        display: grid;

        grid-template-columns:
            1fr auto;

        grid-template-areas:
            "player ago"
            "map map"
            "stats stars"
            "time time";

        row-gap: 6px;
        height: auto;
    }

    .recent-player {
        grid-area: player;
    }

    .recent-map {
        grid-area: map;
        white-space: normal;
    }

    .recent-stats {
        grid-area: stats;
    }

    .recent-time {
        grid-area: time;
    }

    .recent-ago {
        grid-area: ago;
    }

   .site-share-btn {
        padding: 5px 7px;
        font-size: 1.05rem;
	}
}




