/* Fonts are enqueued by the plugin PHP (ldrdates-together-fonts) instead of a
   render-blocking @import chain here. */

:root {
    --puzzle-board-width: 600px;
    --puzzle-board-height: 600px;
    --puzzle-piece-width: 75px;
    --puzzle-piece-height: 75px;
    --puzzle-piece-width-rem: 4.6875rem;
    --puzzle-piece-height-rem: 4.6875rem;
    
    /* Modern Color Palette */
    --primary-color: #ff3366;
    --primary-gradient: linear-gradient(135deg, #ff3366 0%, #ff6b8b 100%);
    --accent-color: #e60049;
    --bg-dark-glass: rgba(15, 23, 42, 0.75);
    --card-glass: rgba(255, 255, 255, 0.88);
    --border-glass: rgba(255, 255, 255, 0.25);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --shadow-soft: 0 10px 30px -5px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 25px rgba(255, 51, 102, 0.35);
}

/* Page Reset & Lock */
html, body, body.jigsaw-together-standalone {
    overflow: hidden !important;
    height: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    touch-action: none !important;
    font-family: 'Outfit', 'Poppins', sans-serif;
}

.site-main, .entry-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.jigsaw-tg-container * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Main Container */
.jigsaw-tg-container {
    font-family: 'Outfit', 'Poppins', sans-serif;
    padding: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    touch-action: none !important;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
}

/* Background Canvas Particles */
.jigsaw-tg-bg-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Start Screen (Phase 1: Solid White Background) */
.jigsaw-tg-start-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    background: #ffffff;
    padding: 30px 20px;
    text-align: center;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

.jigsaw-tg-subtitle {
    color: #0f172a;
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 50px;
    line-height: 1.4;
    max-width: 900px;
    padding: 0 20px;
}

/* Interactive Heart Button with Pulse Ring */
.jigsaw-tg-heart-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.jigsaw-tg-heart-pulse {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255, 51, 102, 0.2);
    animation: heartPulseRing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    pointer-events: none;
}

@keyframes heartPulseRing {
    0% {
        transform: scale(0.85);
        opacity: 0.85;
    }
    50% {
        transform: scale(1.4);
        opacity: 0.2;
    }
    100% {
        transform: scale(0.85);
        opacity: 0.85;
    }
}

.jigsaw-tg-heart-button {
    height: 130px;
    cursor: pointer;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 12px 24px rgba(255, 51, 102, 0.4));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.jigsaw-tg-heart-button:hover {
    transform: scale(1.12) rotate(3deg);
}

/* General Button Components */
.jigsaw-tg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.jigsaw-tg-btn-primary {
    background: var(--primary-gradient);
    color: #ffffff !important;
    box-shadow: 0 8px 25px rgba(255, 51, 102, 0.4);
}

.jigsaw-tg-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 51, 102, 0.55);
}

.jigsaw-tg-btn-danger {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.jigsaw-tg-btn-danger:hover {
    background: #ef4444;
    color: #ffffff !important;
}

/* Game Page & Header Navbar */
.jigsaw-tg-game-page {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 5;
    background: transparent;
}

.jigsaw-tg-navbar {
    width: 100%;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    /* Above the scattered pieces' inline z-index range (10-29) and the
       remote-drag elevation (40) so pieces never cover the controls. */
    z-index: 50;
}

.jigsaw-tg-nav-left, .jigsaw-tg-nav-right, .jigsaw-tg-nav-center {
    display: flex;
    align-items: center;
    gap: 12px;
}

.jigsaw-tg-stat-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.04);
    padding: 8px 16px;
    border-radius: 12px;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.jigsaw-tg-stat-card svg {
    color: var(--primary-color);
}

.jigsaw-tg-difficulty-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.04);
    padding: 4px;
    border-radius: 30px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.jigsaw-tg-difficulty-selector label {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 8px 0 10px;
}

.jigsaw-tg-diff-btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: transparent;
    color: #475569;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.jigsaw-tg-diff-btn:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.06);
}

.jigsaw-tg-diff-btn.active {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.4);
}

.jigsaw-tg-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.04);
    color: #0f172a;
    border: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.jigsaw-tg-icon-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* Game Area Layout */
.jigsaw-tg-game-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 15px;
    width: 100%;
    height: calc(100vh - 70px);
    overflow: hidden;
    background: transparent;
}

.jigsaw-tg-board-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.jigsaw-tg-puzzle-container {
    position: relative;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 16px;
    border: 2px dashed rgba(0, 0, 0, 0.25);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(0, 0, 0, 0.08);
    transition: width 0.3s ease, height 0.3s ease;
}

/* Puzzle Piece Styling.
   Note: z-index is managed inline by JS (scatter range / drag elevation), and
   no transform transition is set here — it would fight GSAP's per-frame
   transform updates and make drags feel laggy. */
.jigsaw-tg-puzzle-piece {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    will-change: transform, left, top;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
    transition: filter 0.2s ease;
}

.jigsaw-tg-puzzle-piece:hover {
    filter: drop-shadow(0 8px 18px rgba(255, 51, 102, 0.4));
}

.jigsaw-tg-puzzle-piece:active {
    cursor: grabbing;
}

/* Drop Zone Highlight */
.jigsaw-tg-drop-zone {
    pointer-events: auto;
    transition: background 0.25s ease, opacity 0.25s ease;
}

.jigsaw-tg-drop-zone.hint-active {
    animation: hintPulse 1.2s ease-in-out infinite alternate;
}

@keyframes hintPulse {
    0% {
        box-shadow: inset 0 0 0 3px rgba(255, 51, 102, 0.4);
    }
    100% {
        box-shadow: inset 0 0 20px 5px rgba(255, 51, 102, 0.9);
    }
}

.jigsaw-tg-drop-zone.filled {
    background: transparent;
    pointer-events: none;
}

/* Floating Reference Drawer - Placed behind puzzle pieces (z-index: 2) */
.jigsaw-tg-reference-drawer {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(12px);
    z-index: 2;
    transition: width 0.2s ease, height 0.2s ease, opacity 0.3s ease, transform 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
}

.jigsaw-tg-reference-drawer.is-resizing,
.jigsaw-tg-reference-drawer.is-moving {
    transition: none !important;
}

.jigsaw-tg-reference-drawer.is-moving {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    z-index: 20;
}

.jigsaw-tg-reference-drawer.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9) translateY(-10px);
}

.jigsaw-tg-reference-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 600;
}

.jigsaw-tg-reference-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.jigsaw-tg-move-btn {
    background: rgba(241, 245, 249, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #475569;
    border-radius: 8px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: move;
    cursor: grab;
    touch-action: none;
    transition: all 0.15s ease;
    padding: 0;
    line-height: 1;
}

.jigsaw-tg-move-btn:hover,
.jigsaw-tg-move-btn:active,
.jigsaw-tg-reference-drawer.is-moving .jigsaw-tg-move-btn {
    background: #e2e8f0;
    color: #0f172a;
    cursor: grabbing;
}

.jigsaw-tg-close-btn {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}

.jigsaw-tg-close-btn:hover {
    color: #0f172a;
}

.jigsaw-tg-reference-image {
    width: clamp(140px, 40vw, 360px);
    height: clamp(140px, 40vh, 360px);
    max-width: 85vw;
    max-height: 70vh;
    min-width: 80px;
    min-height: 80px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: block;
}

/* Corner drag resizer for reference image */
.jigsaw-tg-reference-resize-handle {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: nwse-resize;
    color: #64748b;
    background: rgba(241, 245, 249, 0.9);
    border-top-left-radius: 10px;
    border-bottom-right-radius: 16px;
    touch-action: none;
    z-index: 10;
    transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.jigsaw-tg-reference-resize-handle:hover,
.jigsaw-tg-reference-resize-handle:active,
.jigsaw-tg-reference-drawer.is-resizing .jigsaw-tg-reference-resize-handle {
    color: #0f172a;
    background: rgba(226, 232, 240, 1);
    transform: scale(1.1);
}

/* Victory Overlay & Card */
.jigsaw-tg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    z-index: 998;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.jigsaw-tg-overlay.show {
    display: block;
    opacity: 1;
}

.jigsaw-tg-victory-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 20px;
}

.jigsaw-tg-victory-container.show {
    display: flex;
}

.jigsaw-tg-victory-card {
    background: var(--card-glass);
    border: 1px solid var(--border-glass);
    border-radius: 32px;
    padding: 36px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 1000;
    transform: scale(0.85);
    opacity: 0;
}

.jigsaw-tg-victory-badge {
    display: inline-block;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 16px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}

.jigsaw-tg-completed-frame {
    width: 100%;
    max-height: 220px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
}

.jigsaw-tg-completed-puzzle {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jigsaw-tg-victory-card h2 {
    color: var(--text-main);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.jigsaw-tg-victory-card p {
    color: var(--text-muted);
    font-size: 0.98rem;
    margin-bottom: 24px;
}

.jigsaw-tg-victory-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 28px;
}

.jigsaw-tg-stat-box {
    background: rgba(241, 245, 249, 0.8);
    padding: 12px 8px;
    border-radius: 14px;
    border: 1px solid rgba(203, 213, 225, 0.5);
}

.jigsaw-tg-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.jigsaw-tg-stat-value {
    display: block;
    font-size: 1.05rem;
    color: var(--text-main);
    font-weight: 700;
}

.jigsaw-tg-victory-actions {
    display: flex;
    justify-content: center;
}

/* Sparkles, Ribbons & Hearts Confetti Containers - Highest Z-Index in Front of Card */
.jigsaw-tg-sparkles, .jigsaw-tg-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999 !important;
    pointer-events: none;
    overflow: visible;
}

.jigsaw-tg-celebration-item {
    position: fixed !important;
    pointer-events: none !important;
    user-select: none !important;
    z-index: 9999999 !important;
    filter: drop-shadow(0 4px 10px rgba(255, 51, 102, 0.4));
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
    .jigsaw-tg-navbar {
        padding: 10px 16px;
    }

    .jigsaw-tg-stat-card {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .jigsaw-tg-diff-btn {
        padding: 4px 10px;
        font-size: 0.8rem;
    }

    .jigsaw-tg-icon-btn span {
        display: none;
    }

    .jigsaw-tg-reference-drawer {
        top: 10px;
        left: 10px;
        padding: 8px;
        max-width: 90vw;
    }

    .jigsaw-tg-reference-image {
        width: clamp(110px, 35vw, 180px);
        height: clamp(110px, 35vw, 180px);
    }
}

@media (max-width: 640px) {
    .jigsaw-tg-start-screen {
        padding: 20px 12px 60px 12px !important;
    }

    .jigsaw-tg-subtitle {
        font-size: 1.35rem !important;
        margin-bottom: 20px !important;
        padding: 0 10px !important;
    }

    .jigsaw-tg-mode-tabs {
        width: 100% !important;
        max-width: 320px !important;
        justify-content: center !important;
        margin-bottom: 20px !important;
    }

    .jigsaw-tg-tab-btn {
        padding: 8px 16px !important;
        font-size: 0.88rem !important;
    }

    .jigsaw-tg-coop-box-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .jigsaw-tg-coop-card {
        padding: 20px 16px !important;
        width: 100% !important;
    }

    .jigsaw-tg-code-input {
        font-size: 1.2rem !important;
        padding: 10px 12px !important;
    }

    .jigsaw-tg-navbar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .jigsaw-tg-nav-center {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .jigsaw-tg-start-card {
        padding: 28px 20px;
    }

    .jigsaw-tg-title {
        font-size: 1.7rem;
    }

    .jigsaw-tg-heart-button {
        height: 90px;
    }

    .jigsaw-tg-heart-pulse {
        width: 100px;
        height: 100px;
    }
}

/* ==========================================
   Co-Op Game Styling Additions
   ========================================== */

/* Mode Tabs */
.jigsaw-tg-mode-tabs {
    display: flex;
    gap: 10px;
    background: rgba(15, 23, 42, 0.06);
    padding: 6px;
    border-radius: 40px;
    margin-bottom: 30px;
}

.jigsaw-tg-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 30px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.jigsaw-tg-tab-btn:hover {
    color: #0f172a;
}

.jigsaw-tg-tab-btn.active {
    background: #ffffff;
    color: #ff3366;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.jigsaw-tg-mode-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 820px;
}

/* Co-Op Cards Grid */
.jigsaw-tg-coop-box-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    width: 100%;
    padding: 0 15px;
}

.jigsaw-tg-coop-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 51, 102, 0.15);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.jigsaw-tg-coop-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.jigsaw-tg-coop-card p {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Code Display & Buttons */
.jigsaw-tg-room-created-box {
    width: 100%;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.jigsaw-tg-code-display-wrapper {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 14px;
    text-align: center;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 260px;
}

.jigsaw-tg-code-label {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 1.5px;
    color: #94a3b8;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.jigsaw-tg-code-value {
    font-family: monospace, 'Courier New', Courier;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: #ff6b8b;
}

.jigsaw-tg-code-actions {
    display: flex;
    gap: 8px;

}

.jigsaw-tg-btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}

.jigsaw-tg-btn-sm:hover {
    background: #ff3366;
    color: #ffffff;
    border-color: #ff3366;
}

/* Pulse Status Indicator */
.jigsaw-tg-coop-pulse-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
    margin-top: 5px;
}

.jigsaw-tg-pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.jigsaw-tg-pulse-dot.waiting {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
    animation: pulseDotAnim 1.5s infinite;
}

.jigsaw-tg-pulse-dot.connected {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

@keyframes pulseDotAnim {
    0% { transform: scale(0.95); opacity: 0.6; }
    50% { transform: scale(1.25); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.6; }
}

/* Code Input Box */
.jigsaw-tg-join-input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 260px;
}

.jigsaw-tg-code-input {
    width: 100%;
    padding: 12px 16px;
    font-family: monospace, 'Courier New', Courier;
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 4px;
    text-transform: uppercase;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    outline: none;
    transition: all 0.25s ease;
}

.jigsaw-tg-code-input:focus {
    border-color: #ff3366;
    box-shadow: 0 0 0 3px rgba(255, 51, 102, 0.15);
}

.jigsaw-tg-error-msg {
    margin-top: 10px;
    color: #ef4444;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Navbar Co-Op Badge */
.jigsaw-tg-coop-nav-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 51, 102, 0.1);
    border: 1px solid rgba(255, 51, 102, 0.2);
}

.jigsaw-tg-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.jigsaw-tg-status-dot.online {
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.jigsaw-tg-status-dot.offline {
    background: #f59e0b;
}

.jigsaw-tg-code-pill {
    background: #ffffff;
    color: #ff3366;
    border: 1px solid rgba(255, 51, 102, 0.3);
    border-radius: 12px;
    padding: 2px 8px;
    font-family: monospace;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.jigsaw-tg-code-pill:hover {
    background: #ff3366;
    color: #ffffff;
}

/* Partner Cursor Overlay */
.jigsaw-tg-partner-cursor {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: transform 0.08s ease-out;
}

.jigsaw-tg-cursor-heart {
    filter: drop-shadow(0 2px 6px rgba(255, 51, 102, 0.5));
}

.jigsaw-tg-cursor-label {
    background: #ff3366;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    white-space: nowrap;
}

/* Piece locked by partner */
.piece-locked-by-partner {
    box-shadow: 0 0 15px 4px rgba(138, 43, 226, 0.8) !important;
    border: 2px solid #8a2be2 !important;
}

/* Name Input Field Styling */
.jigsaw-tg-coop-container-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.jigsaw-tg-name-field-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 51, 102, 0.2);
    border-radius: 30px;
    padding: 8px 18px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.jigsaw-tg-name-field-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

.jigsaw-tg-name-input {
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ff3366;
    width: 140px;
}

.jigsaw-tg-name-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}