/* Pips Puzzle Game - Studio Ghibli Style - Version 20250112i */

/* ===== STUDIO GHIBLI COLOR PALETTE ===== */
:root {
    /* Primary Ghibli Colors */
    --ghibli-sky-blue: #a3c5e0;
    --ghibli-warm-cream: #f1dbb6;
    --ghibli-soft-peach: #e3bba1;
    --ghibli-cherry-blossom: #f0a3b0;
    --ghibli-forest-green: #7d9b5f;
    --ghibli-deep-green: #5a7c47;
    --ghibli-sunset-orange: #d4975a;
    --ghibli-twilight-purple: #8b7ca3;
    
    /* Neutral Tones */
    --ghibli-paper-white: #faf8f4;
    --ghibli-soft-gray: #e8e4df;
    --ghibli-charcoal: #4a453f;
    --ghibli-ink-black: #2d2925;
    
    /* Magical Accents */
    --ghibli-magic-gold: #f4d03f;
    --ghibli-spirit-blue: #85c1e9;
    --ghibli-nature-moss: #98d982;
    
    /* Shadows and Effects */
    --ghibli-soft-shadow: rgba(74, 69, 63, 0.15);
    --ghibli-warm-shadow: rgba(212, 151, 90, 0.2);
    --ghibli-magic-glow: rgba(244, 208, 63, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Mobile Touch Optimization - Prevent default touch behaviors on game elements */
.dominoes-container,
.domino-slot {
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.domino {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Game board needs special handling for drag and drop */
.game-board,
.board-cell {
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Game board container should allow vertical scrolling */
.game-board-container {
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Allow scroll on the main container and body */
.game-container,
body {
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    font-family: 'Georgia', 'Times New Roman', 'Book Antiqua', 'Palatino', serif;
    background: linear-gradient(135deg, var(--ghibli-paper-white) 0%, var(--ghibli-warm-cream) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    color: var(--ghibli-charcoal);
    position: relative;
}

/* ===== HEADER STYLES ===== */
.main-header {
    background: linear-gradient(135deg, var(--ghibli-warm-cream), var(--ghibli-soft-peach));
    border-bottom: 2px solid var(--ghibli-forest-green);
    padding: 20px 0;
    margin: 0 auto 25px auto;
    max-width: 1200px;
    box-shadow: 0 4px 15px var(--ghibli-soft-shadow);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo-section .home-link {
    text-decoration: none;
    color: inherit;
}

.site-title {
    font-size: 2rem;
    color: var(--ghibli-charcoal);
    margin: 0;
    font-weight: bold;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.main-nav a {
    color: var(--ghibli-charcoal);
    text-decoration: none;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 20px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid transparent;
}

.main-nav a:hover {
    background: var(--ghibli-spirit-blue);
    color: white;
    border-color: var(--ghibli-sky-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--ghibli-magic-glow);
}

.main-nav a.active {
    background: linear-gradient(135deg, var(--ghibli-forest-green), var(--ghibli-deep-green));
    color: white;
    border-color: var(--ghibli-deep-green);
    box-shadow: 0 4px 15px var(--ghibli-warm-shadow);
}

.language-switcher {
    margin-left: 20px;
    position: relative;
}

.language-toggle {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--ghibli-forest-green);
    border-radius: 50%;
    padding: 10px;
    color: var(--ghibli-charcoal);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.language-toggle:hover {
    background: var(--ghibli-spirit-blue);
    color: white;
    border-color: var(--ghibli-sky-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--ghibli-magic-glow);
}

.language-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--ghibli-magic-glow);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--ghibli-paper-white);
    border: 2px solid var(--ghibli-forest-green);
    border-radius: 12px;
    box-shadow: 0 8px 25px var(--ghibli-soft-shadow);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: var(--ghibli-charcoal);
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-option:hover {
    background: var(--ghibli-soft-gray);
}

.language-option:first-child {
    border-radius: 10px 10px 0 0;
}

.language-option:last-child {
    border-radius: 0 0 10px 10px;
}

.language-option.active {
    background: var(--ghibli-forest-green);
    color: white;
}

.language-option.active:hover {
    background: var(--ghibli-deep-green);
}

/* ===== FOOTER STYLES ===== */
.main-footer {
    background: linear-gradient(135deg, var(--ghibli-soft-gray), var(--ghibli-warm-cream));
    border-top: 2px solid var(--ghibli-forest-green);
    padding: 40px 0;
    margin: 50px auto 0 auto;
    max-width: 1200px;
    box-shadow: 0 -4px 15px var(--ghibli-soft-shadow);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--ghibli-charcoal);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 15px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.5);
}

.footer-links a:hover {
    background: var(--ghibli-forest-green);
    color: white;
    transform: translateY(-2px);
}

.footer-text {
    color: var(--ghibli-charcoal);
    font-size: 0.9rem;
    margin-top: 20px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .main-nav {
        flex-direction: column;
        gap: 16px;
        width: 100%;
    }
    
    .main-nav a {
        font-size: 14px;
        padding: 8px 16px;
    }
    
    .language-switcher {
        margin-left: 0;
        order: -1;
    }
    
    .language-toggle {
        width: 40px;
        height: 40px;
        padding: 8px;
    }
    
    .language-dropdown {
        min-width: 160px;
        max-height: 250px;
    }
    
    .site-title {
        font-size: 1.5rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-links a {
        display: inline-block;
        width: auto;
    }
}

/* Magical floating particles background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(2px 2px at 20px 30px, var(--ghibli-magic-gold), transparent),
        radial-gradient(2px 2px at 40px 70px, var(--ghibli-spirit-blue), transparent),
        radial-gradient(1px 1px at 90px 40px, var(--ghibli-cherry-blossom), transparent),
        radial-gradient(1px 1px at 130px 80px, var(--ghibli-nature-moss), transparent),
        radial-gradient(2px 2px at 160px 30px, var(--ghibli-magic-gold), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    opacity: 0.4;
    pointer-events: none;
    z-index: -1;
    animation: magicalFloat 20s ease-in-out infinite;
}

@keyframes magicalFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(0.5deg); }
    66% { transform: translateY(5px) rotate(-0.5deg); }
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    overflow: visible;
    width: 100%;
    padding: 25px 20px;
}

.header {
    background: transparent;
    color: var(--ghibli-charcoal);
    padding: 15px;
    text-align: center;
    position: relative;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.header-nav {
    margin-bottom: 8px;
    text-align: center;
}

.page-title {
    text-align: center;
    margin-bottom: 20px;
    max-width: 1200px;
    margin: 0 auto 20px auto;
}

.page-title h1 {
    font-size: 1.8em;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--ghibli-forest-green);
    text-shadow: 2px 2px 4px var(--ghibli-soft-shadow);
    position: relative;
}


@keyframes sparkle {
    0%, 100% { opacity: 1; transform: rotate(0deg) scale(1); }
    50% { opacity: 0.7; transform: rotate(180deg) scale(1.1); }
}

.page-title p {
    display: none;
}

.archive-link {
    color: #007bff;
    text-decoration: underline;
    font-size: 0.9em;
    font-weight: 400;
    padding: 4px 8px;
    border: 1px solid #007bff;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.archive-link:hover {
    background: #007bff;
    color: white;
    text-decoration: none;
}

.header h1 {
    font-size: 1.5em;
    margin-bottom: 4px;
    font-weight: 600;
}

.header p {
    opacity: 0;
    font-size: 0.9em;
    height: 0;
    margin: 0;
    overflow: hidden;
}

.timer-container {
    margin-top: 15px;
}

.timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    padding: 6px 12px;
    border-radius: 8px;
}

#timer-display {
    font-family: 'Courier New', monospace;
    font-size: 1em;
    font-weight: bold;
    color: #666;
    letter-spacing: 1px;
}

.pause-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s ease;
    animation: pulse 2s infinite;
}

.pause-btn:hover {
    background: #357abd;
    transform: scale(1.1);
}

.pause-btn.paused {
    background: #e67e22;
    animation: none;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(74, 144, 226, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0);
    }
}

.game-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.puzzle-mode-selector {
    text-align: center;
    margin: 20px 0 10px 0;
}

.mode-title {
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 12px;
    color: #666;
}

.mode-dropdown-container {
    display: flex;
    justify-content: center;
    margin: 0 auto;
}

.mode-dropdown {
    background: white;
    color: #333;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 160px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
}

.mode-dropdown:hover {
    border-color: #4f46e5;
    background-color: #f8fafc;
}

.mode-dropdown:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.difficulty-selector {
    text-align: center;
    margin: 10px auto 20px auto;
    max-width: 1200px;
}

.difficulty-title {
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 12px;
    color: #666;
}

.difficulty-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    background: var(--ghibli-paper-white);
    border-radius: 25px;
    padding: 8px;
    max-width: 400px;
    margin: 0 auto;
    box-shadow: 0 2px 10px var(--ghibli-soft-shadow);
}

.btn-difficulty {
    background: linear-gradient(135deg, var(--ghibli-warm-cream), var(--ghibli-soft-peach));
    color: var(--ghibli-charcoal);
    border: 2px solid var(--ghibli-forest-green);
    flex: 1;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.btn-difficulty:hover {
    background: linear-gradient(135deg, var(--ghibli-soft-peach), var(--ghibli-cherry-blossom));
    transform: translateY(-1px);
    box-shadow: 0 4px 15px var(--ghibli-soft-shadow);
}

.btn-difficulty.active {
    background: linear-gradient(135deg, var(--ghibli-forest-green), var(--ghibli-deep-green));
    color: white;
    border-color: var(--ghibli-deep-green);
    box-shadow: 0 4px 15px var(--ghibli-warm-shadow);
}

.game-board-container {
    position: relative;
    margin: 24px auto 40px auto;
    overflow: visible;
    display: flex;
    justify-content: center;
    max-width: 1200px;
    align-items: center;
    width: 100%;
}

.game-board {
    position: relative;
    max-width: 100%;
    width: auto;
    height: auto;
    padding: 20px;
    overflow: visible;
}

.game-area {
    max-width: 100%;
    overflow: visible;
}

.board-cell {
    position: absolute;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 60px;
    height: 60px;
    z-index: 20;
}

.board-cell .actual-cell {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    transition: all 0.15s ease;
}

.board-cell.active .actual-cell {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
}

.board-cell.inactive {
    opacity: 0.05;
    pointer-events: none;
}

/* Ensure puzzle builder board cells can receive drop events */
#puzzle-builder .board-cell {
    pointer-events: auto !important;
}

.board-cell.inactive .actual-cell {
    background: transparent !important;
    border: none !important;
}

/* Ensure no domino content can be visible on inactive cells */
.board-cell.inactive .actual-cell * {
    display: none !important;
}

/* Make placed dominoes transparent so region colors show through */
.board-cell.occupied .actual-cell {
    background: rgba(248, 249, 250, 0.8);
    border: 1px solid rgba(233, 236, 239, 0.8);
}

.board-cell:hover:not(.occupied):not(.inactive) .actual-cell {
    background: #e3f2fd;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}



.region-svg {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 596px;
    height: 596px;
    z-index: 30;
    pointer-events: none;
    overflow: visible;
}

.condition-indicator {
    position: absolute;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 900;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3), 0 2px 6px rgba(0,0,0,0.2);
    z-index: 40;
    font-size: 18px;
    border: 4px solid white;
    transform: rotate(45deg);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
    font-family: 'Courier New', monospace, 'Arial', sans-serif;
}

.condition-indicator.region-1 { background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%); }
.condition-indicator.region-2 { background: linear-gradient(135deg, #fb7185 0%, #f43f5e 100%); }
.condition-indicator.region-3 { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.condition-indicator.region-4 { background: linear-gradient(135deg, #67e8f9 0%, #06b6d4 100%); }

.controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: 2px solid var(--ghibli-forest-green);
    border-radius: 25px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    background: linear-gradient(135deg, var(--ghibli-warm-cream), var(--ghibli-soft-peach));
    color: var(--ghibli-deep-green);
    box-shadow: 
        0 4px 15px var(--ghibli-soft-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px var(--ghibli-soft-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: var(--ghibli-deep-green);
}

.btn-primary {
    background: linear-gradient(135deg, var(--ghibli-sky-blue), var(--ghibli-spirit-blue));
    color: white;
    border-color: var(--ghibli-sky-blue);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--ghibli-spirit-blue), var(--ghibli-sky-blue));
    border-color: var(--ghibli-spirit-blue);
}

.btn-secondary {
    background: transparent;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-reveal {
    /* Inherit main button styling from .btn class */
}

.sound-control, .theme-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: #374151;
}

.theme-control select {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 0.85em;
    color: #374151;
    cursor: pointer;
    min-width: 120px;
}

.sound-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.sound-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.sound-toggle input:checked + .toggle-slider {
    background-color: #374151;
}

.sound-toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-slider:hover {
    background-color: #999;
}

.sound-toggle input:checked + .toggle-slider:hover {
    background-color: #1f2937;
}

.dominoes-container,
.sidebar-section {
    margin: 40px auto 0 auto;
    background: white;
    padding: 16px;
    border-radius: 12px;
    max-width: 1200px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    clear: both;
    overflow: visible;
}


.dominoes-title {
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
    color: #333;
}

.dominoes-instructions {
    font-size: 0.85em;
    font-weight: 400;
    margin-bottom: 16px;
    text-align: center;
    color: #666;
}

.game-controls {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.game-footer {
    margin: 40px auto 0 auto;
    padding: 30px 24px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    max-width: 1200px;
}

.game-description h2 {
    font-size: 1.3em;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}

.game-description h3 {
    font-size: 1.1em;
    color: #34495e;
    margin: 20px 0 10px 0;
    font-weight: 600;
}

.game-description p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.game-description ul {
    margin: 10px 0 20px 20px;
    color: #555;
}

.game-description li {
    margin-bottom: 6px;
    line-height: 1.5;
}

.footer-meta {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
    text-align: center;
    color: #6c757d;
    font-size: 0.9em;
}

.footer-meta p {
    margin-bottom: 5px;
}

.footer-meta small {
    font-size: 0.8em;
    opacity: 0.8;
}

.rule-symbol {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    margin: 0 4px;
    font-size: 1.1em;
}

.equals-symbol {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.not-equal-symbol {
    background: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ff9800;
}

.greater-symbol {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #2196f3;
}

.less-symbol {
    background: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #9c27b0;
}

.sum-symbol {
    background: #fce4ec;
    color: #c2185b;
    border: 1px solid #e91e63;
}

.no-symbol {
    background: #ffffff;
    color: #000000;
    border: 1px dashed #000000;
}

.dominoes-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-content: flex-start;
    min-height: 80px;
}

.domino-slot {
    position: relative;
    width: 106px;
    height: 50px;
    background: rgb(243, 244, 246);
    border: 1px solid rgb(209, 213, 219);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    padding: 2px;
    overflow: visible;
    /* Prevent slot from being draggable */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

.domino {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 60px;
    background: linear-gradient(145deg, var(--ghibli-paper-white) 0%, var(--ghibli-warm-cream) 100%);
    border: 3px solid var(--ghibli-forest-green);
    border-radius: 15px;
    display: flex;
    flex-direction: row;
    cursor: grab;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, width 0.2s ease, height 0.2s ease, flex-direction 0.2s ease;
    user-select: none;
    touch-action: none;
    box-shadow: 
        0 4px 15px var(--ghibli-soft-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    /* Ensure domino is draggable */
    -webkit-user-drag: element;
    -khtml-user-drag: element;
    -moz-user-drag: element;
    -o-user-drag: element;
    user-drag: element;
    /* Ensure domino can receive pointer events */
    pointer-events: auto;
    box-shadow:
        0 8px 16px rgba(0,0,0,0.15),
        0 4px 8px rgba(0,0,0,0.1),
        inset 2px 2px 4px rgba(255,255,255,0.8),
        inset -2px -2px 4px rgba(0,0,0,0.15),
        inset 0 0 0 1px rgba(255,255,255,0.3);
    z-index: 1;
    position: relative;
    overflow: hidden;
}

.domino::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(255,255,255,0.4) 0%,
        rgba(255,255,255,0.1) 50%,
        rgba(0,0,0,0.05) 100%);
    border-radius: 11px;
    pointer-events: none;
}

.domino:hover,
.domino.hover-scale {
    transform: translate(-50%, -50%) scale(1.05) translateZ(0);
    border-color: var(--ghibli-deep-green);
    box-shadow:
        0 8px 25px var(--ghibli-magic-glow),
        0 4px 15px var(--ghibli-soft-shadow),
        inset 0 2px 0 rgba(255,255,255,0.9);
        inset -3px -3px 6px rgba(0,0,0,0.2),
        inset 0 0 0 1px rgba(255,255,255,0.4);
}

/* For archive page dominoes without slots */
.domino[style*="position: relative"]:hover,
.domino[style*="position: relative"].hover-scale {
    transform: scale(1.05) translateZ(0);
}

.domino:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(0.98) translateZ(0);
    border-top-color: #d4d4d8;
    border-left-color: #d4d4d8;
    border-right-color: #ffffff;
    border-bottom-color: #ffffff;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.2),
        0 1px 2px rgba(0,0,0,0.15),
        inset -1px -1px 3px rgba(255,255,255,0.5),
        inset 1px 1px 3px rgba(0,0,0,0.25),
        inset 0 0 0 1px rgba(0,0,0,0.1);
}

.domino.dragging {
    transform: translate(-50%, -50%) rotate(3deg) scale(1.1) translateZ(0);
    opacity: 0.95;
    z-index: 1000;
    border-top-color: #ffffff;
    border-left-color: #ffffff;
    border-right-color: #737373;
    border-bottom-color: #404040;
    box-shadow:
        0 20px 40px rgba(0,0,0,0.3),
        0 10px 20px rgba(0,0,0,0.2),
        inset 4px 4px 8px rgba(255,255,255,1),
        inset -4px -4px 8px rgba(0,0,0,0.25),
        inset 0 0 0 1px rgba(255,255,255,0.5);
}

.domino.rotation-0 {
    width: 110px !important;
    height: 54px !important;
    flex-direction: row !important;
    border-color: rgb(75, 85, 99) !important;
    background: rgba(75, 85, 99, 0.05) !important;
}

.domino.rotation-90 {
    width: 54px !important;
    height: 110px !important;
    flex-direction: column !important;
    border-color: rgb(34, 139, 34) !important;
    background: rgba(34, 139, 34, 0.05) !important;
}

.domino.rotation-180 {
    width: 110px !important;
    height: 54px !important;
    flex-direction: row !important;
    border-color: rgb(220, 20, 60) !important;
    background: rgba(220, 20, 60, 0.05) !important;
}

.domino.rotation-270 {
    width: 54px !important;
    height: 110px !important;
    flex-direction: column !important;
    border-color: rgb(255, 140, 0) !important;
    background: rgba(255, 140, 0, 0.05) !important;
}

.domino-half {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 6px;
    margin: 3px;
    box-shadow:
        inset 1px 1px 2px rgba(255,255,255,0.5),
        inset -1px -1px 2px rgba(0,0,0,0.1);
}

.domino-half:first-child {
    margin-right: 1px;
    margin-bottom: 0;
}

.domino-half:last-child {
    margin-left: 1px;
    margin-top: 0;
}

.rotation-0 .domino-half:first-child {
    margin-right: 1px;
    margin-top: 0;
    margin-bottom: 0;
}

.rotation-0 .domino-half:last-child {
    margin-left: 1px;
    margin-top: 0;
    margin-bottom: 0;
}

.rotation-90 .domino-half:first-child {
    margin-right: 1px;
    margin-top: 0;
    margin-bottom: 0;
}

.rotation-90 .domino-half:last-child {
    margin-left: 1px;
    margin-top: 0;
    margin-bottom: 0;
}

.rotation-180 .domino-half:first-child {
    margin-right: 1px;
    margin-top: 0;
    margin-bottom: 0;
}

.rotation-180 .domino-half:last-child {
    margin-left: 1px;
    margin-top: 0;
    margin-bottom: 0;
}

.rotation-270 .domino-half:first-child {
    margin-right: 1px;
    margin-top: 0;
    margin-bottom: 0;
}

.rotation-270 .domino-half:last-child {
    margin-left: 1px;
    margin-top: 0;
    margin-bottom: 0;
}

.pip-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 100%;
    height: 100%;
    transform: scale(1);
    transform-origin: center center;
}

.pip {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pip-dot {
    width: 14px;
    height: 14px;
    background: radial-gradient(circle at 30% 30%,
        #374151 0%,
        #1f2937 70%,
        #111827 100%);
    border-radius: 50%;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.3),
        0 1px 2px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.1),
        inset 0 -1px 1px rgba(0,0,0,0.3);
    position: relative;
    opacity: 1 !important;
}

.pip-dot::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle,
        rgba(255,255,255,0.4) 0%,
        rgba(255,255,255,0.1) 70%,
        transparent 100%);
    border-radius: 50%;
    pointer-events: none;
    opacity: 1 !important;
}

.message {
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    margin: 16px 0;
    font-weight: 500;
}

.message.success {
    background: transparent;
    color: #374151;
    border: none;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.drop-indicator {
    position: absolute;
    background: rgba(139, 92, 246, 0.3);
    border: 1px dashed #8b5cf6;
    border-radius: 4px;
    pointer-events: none;
    z-index: 100;
}

/* Tablet responsive design for 7x7 game board */
@media (max-width: 800px) {
    .game-board-container {
        margin: 20px 0 30px 0;
    }
    
    body {
        padding: 10px;
    }
}

@media (max-width: 600px) {
    * {
        font-family: 'Georgia', 'Times New Roman', 'Book Antiqua', 'Palatino', serif !important;
    }

    body {
        font-family: 'Georgia', 'Times New Roman', 'Book Antiqua', 'Palatino', serif !important;
        padding: 16px;
        font-size: 0.95em;
    }

    .game-container {
        max-width: 100%;
        margin: 0 auto;
    }

    .header h1 {
        font-size: 1.4em;
        margin-bottom: 4px;
        font-weight: 600;
        font-family: 'Georgia', 'Times New Roman', 'Book Antiqua', 'Palatino', serif !important;
    }

    .header p {
        font-family: 'Georgia', 'Times New Roman', 'Book Antiqua', 'Palatino', serif !important;
    }

    .mode-title {
        font-size: 0.95em;
        font-weight: 600;
        margin-bottom: 8px;
        color: #666;
        font-family: 'Georgia', 'Times New Roman', 'Book Antiqua', 'Palatino', serif !important;
    }

    .puzzle-mode-selector {
        margin: 15px 0 8px 0;
    }

    .difficulty-selector {
        margin: 8px 0 15px 0;
    }

    .difficulty-title {
        font-size: 0.95em;
        font-weight: 600;
        margin-bottom: 8px;
        color: #666;
        font-family: 'Georgia', 'Times New Roman', 'Book Antiqua', 'Palatino', serif !important;
    }

    .mode-dropdown {
        font-size: 0.85em;
        padding: 6px 12px;
        padding-right: 28px;
        min-width: 140px;
        font-family: 'Georgia', 'Times New Roman', 'Book Antiqua', 'Palatino', serif !important;
    }

    .btn-difficulty {
        font-size: 0.85em;
        padding: 6px 12px;
        font-weight: 500;
        font-family: 'Georgia', 'Times New Roman', 'Book Antiqua', 'Palatino', serif !important;
    }

    .game-board-container {
        margin: 10px auto 20px auto;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    .game-board {
        padding: 8px;
        border-radius: 8px;
        margin: 0 auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .game-container {
        padding: 0 5px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    /* Improve dominoes container centering for 600px screens */
    .dominoes-container,
    .sidebar-section {
        margin: 35px auto;
        padding: 12px;
        width: 100%;
        max-width: min(1200px, calc(100vw - 10px));
        box-sizing: border-box;
    }
    
    .dominoes-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 14px !important;
        width: 100%;
    }
    
    body {
        padding: 10px 5px;
    }

    .domino-slot {
        width: var(--domino-slot-width, 79px) !important;
        height: var(--domino-slot-height, 41px) !important;
        border: 1px solid rgb(209, 213, 219);
        padding: 2px;
        overflow: visible;
    }

    .domino {
        width: var(--domino-width, 75px);
        height: var(--domino-height, 37px);
    }

    .domino.rotation-0,
    .domino.rotation-180 {
        width: var(--domino-width, 75px) !important;
        height: var(--domino-height, 37px) !important;
    }

    .domino.rotation-90,
    .domino.rotation-270 {
        width: var(--domino-height, 37px) !important;
        height: var(--domino-width, 75px) !important;
    }

    .game-content {
        padding: 16px;
    }

    .dominoes-title {
        font-size: 0.95em;
        font-weight: 600;
        margin-bottom: 8px;
        text-align: center;
        color: #333;
        font-family: 'Georgia', 'Times New Roman', 'Book Antiqua', 'Palatino', serif !important;
    }

    .dominoes-instructions {
        font-size: 0.8em;
        font-weight: 400;
        margin-bottom: 16px;
        text-align: center;
        color: #666;
        font-family: 'Georgia', 'Times New Roman', 'Book Antiqua', 'Palatino', serif !important;
    }

    .btn {
        padding: 10px 18px;
        font-size: 0.9em;
        font-weight: 600;
        font-family: 'Georgia', 'Times New Roman', 'Book Antiqua', 'Palatino', serif !important;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Better mobile button spacing */
    .btn-group {
        gap: 10px;
    }

    #timer-display {
        font-family: 'Courier New', monospace !important;
        font-size: 0.95em;
        font-weight: bold;
        color: #666;
        letter-spacing: 1px;
    }

    .condition-indicator {
        width: 60px;
        height: 60px;
        font-size: 20px;
        font-weight: 900;
        border: 3px solid white;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
        font-family: 'Courier New', monospace !important;
    }

    .game-description h2 {
        font-size: 1.2em;
        color: #2c3e50;
        margin-bottom: 15px;
        font-weight: 600;
        font-family: 'Georgia', 'Times New Roman', 'Book Antiqua', 'Palatino', serif !important;
    }

    .game-description h3 {
        font-size: 1.05em;
        color: #34495e;
        margin: 18px 0 10px 0;
        font-weight: 600;
        font-family: 'Georgia', 'Times New Roman', 'Book Antiqua', 'Palatino', serif !important;
    }

    .game-description p {
        color: #555;
        line-height: 1.6;
        margin-bottom: 15px;
        font-size: 0.95em;
        font-family: 'Georgia', 'Times New Roman', 'Book Antiqua', 'Palatino', serif !important;
    }

    .game-description li {
        margin-bottom: 6px;
        line-height: 1.5;
        font-size: 0.95em;
        font-family: 'Georgia', 'Times New Roman', 'Book Antiqua', 'Palatino', serif !important;
    }

    .game-description ul {
        font-family: 'Georgia', 'Times New Roman', 'Book Antiqua', 'Palatino', serif !important;
    }

    .footer-meta {
        font-size: 0.85em;
        font-family: 'Georgia', 'Times New Roman', 'Book Antiqua', 'Palatino', serif !important;
    }

    .footer-meta p, .footer-meta a, .footer-meta small {
        font-family: 'Georgia', 'Times New Roman', 'Book Antiqua', 'Palatino', serif !important;
    }

    .rule-symbol {
        font-family: 'Courier New', monospace !important;
        font-size: 1.05em;
    }

    .message {
        font-family: 'Georgia', 'Times New Roman', 'Book Antiqua', 'Palatino', serif !important;
    }

    .dominoes-container,
    .sidebar-section {
        margin-top: 50px; /* Increased margin to prevent overlap with scaled board */
    }

    .dominoes-container .pip-dot,
    .sidebar-section .pip-dot {
        width: 10px !important;
        height: 10px !important;
    }

    .domino-slot {
        width: 78px !important;
        height: 40px !important;
        border: 1px solid rgb(209, 213, 219);
        padding: 1px;
        overflow: visible;
    }
    
    /* Mobile ad adjustments */
    .adsbygoogle {
        max-width: 100%;
        margin: 0 auto;
    }
    
    /* Adjust banner ad for mobile */
    .adsbygoogle[style*="728px"] {
        width: 320px !important;
        height: 50px !important;
    }
}

/* Social Media Section */
.social-media-container {
    margin: 15px auto 0 auto;
    padding: 10px;
    width: 100%;
    max-width: 1200px;
    text-align: center;
}

.social-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    text-decoration: none;
    color: white;
    border-radius: 6px;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.email-link {
    background-color: #007acc;
}

.email-link:hover {
    background-color: #005999;
    transform: translateY(-1px);
}

.share-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.share-label {
    font-size: 13px;
    color: #666;
    margin-right: 2px;
}

.reddit-link {
    background-color: #FF4500;
    padding: 6px;
}

.reddit-link:hover {
    background-color: #E03D00;
    transform: translateY(-1px);
}

.twitter-link {
    background-color: #000000;
    padding: 6px;
}

.twitter-link:hover {
    background-color: #333333;
    transform: translateY(-1px);
}

.facebook-link {
    background-color: #1877F2;
    padding: 6px;
}

.facebook-link:hover {
    background-color: #166FE5;
    transform: translateY(-1px);
}

.whatsapp-link {
    background-color: #25D366;
    padding: 6px;
}

.whatsapp-link:hover {
    background-color: #22C55E;
    transform: translateY(-1px);
}

.social-link svg {
    flex-shrink: 0;
}

/* Simplified mobile responsiveness for social media */
@media (max-width: 600px) {
    .social-media-container {
        padding: 8px;
        margin-top: 12px;
    }
    
    .social-links {
        gap: 8px;
    }
    
    .share-buttons {
        gap: 4px;
    }
    
    .social-link {
        padding: 8px;
        font-size: 12px;
    }
    
    .share-label {
        font-size: 12px;
    }
}
    
    /* Mobile-first: Ensure consistent centering and spacing */
    body {
        padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
        margin: 0;
    }
    
    .game-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        min-height: 100vh;
        padding: 0;
        margin: 0 auto;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Center game board with pure flexbox */
    .game-board-container {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        max-width: 100vw;
        margin: clamp(8px, 2vw, 16px) auto;
        padding: 0 clamp(4px, 2vw, 12px);
        box-sizing: border-box;
        touch-action: pan-y;
    }
    
    .game-board {
        padding: clamp(2px, 1vw, 8px);
        margin: 0 auto;
        display: flex;
        justify-content: center;
        align-items: center;
        max-width: 100%;
    }
    
    /* Center dominoes section with flexbox */
    .dominoes-container,
    .sidebar-section {
        width: 100%;
        max-width: min(1200px, calc(100vw - 16px));
        margin: 15px auto;
        padding: 12px 8px;
        box-sizing: border-box;
        touch-action: pan-y;
    }
    
    /* Ensure dominoes grid centers properly */
    .dominoes-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 8px !important;
        width: 100%;
        margin: 0 auto;
    }

    .domino {
        touch-action: none;
        cursor: grab !important;
        width: var(--domino-width, 65px);
        height: var(--domino-height, 32px);
        transition: transform 0.2s ease, width 0.15s ease, height 0.15s ease, flex-direction 0.15s ease;
    }

    .domino.rotation-0,
    .domino.rotation-180 {
        width: var(--domino-width, 65px) !important;
        height: var(--domino-height, 32px) !important;
    }

    .domino.rotation-90,
    .domino.rotation-270 {
        width: var(--domino-height, 32px) !important;
        height: var(--domino-width, 65px) !important;
    }

    /* Improve mobile touch behavior */
    .domino:hover {
        transform: translate(-50%, -50%) translateZ(0) !important;
    }

    .domino:active,
    .domino.dragging {
        cursor: grabbing !important;
        transform: translate(-50%, -50%) scale(1.02) translateZ(0) !important;
        z-index: 1000 !important;
    }

    .domino-slot {
        width: var(--domino-slot-width, 69px) !important;
        height: var(--domino-slot-height, 36px) !important;
        border: 1px solid rgb(209, 213, 219);
        padding: 1px;
        overflow: visible;
    }
    
    /* Mobile button improvements for touch targets */
    .btn {
        padding: 12px 20px;
        font-size: 0.95em;
        min-height: 48px;
        min-width: 120px;
    }
    
    /* Button groups should wrap on mobile */
    .btn-group {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    /* Ensure header and other content don't interfere with centering */
    .header {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }
    
    /* Fix any content that might push game elements off center */
    .game-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
}

/* Puzzle Builder Specific Styles - Fixed domino slots */
#builder-dominoes-container .domino-slot {
    width: 70px !important;
    height: 36px !important;
    padding: 2px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Override global positioning for puzzle builder dominoes */
body #builder-dominoes-container .domino {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    cursor: grab !important;
    pointer-events: auto !important;
}

/* Override hover and active states for puzzle builder dominoes */
body #builder-dominoes-container .domino:hover,
body #builder-dominoes-container .domino.hover-scale {
    transform: scale(1.05) translateZ(0) !important;
    cursor: grab !important;
}

body #builder-dominoes-container .domino:active {
    transform: scale(0.98) translateZ(0) !important;
    cursor: grabbing !important;
}

body #builder-dominoes-container .domino.dragging {
    cursor: grabbing !important;
    opacity: 0.8 !important;
}

/* Domino value styling */
#builder-dominoes-container .domino .domino-value {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#builder-dominoes-container .domino .domino-half {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

/* Horizontal dominoes - halves side by side */
#builder-dominoes-container .domino.rotation-0 .domino-half,
#builder-dominoes-container .domino.rotation-180 .domino-half {
    width: 50%;
    height: 100%;
}

/* Vertical dominoes - halves stacked */
#builder-dominoes-container .domino.rotation-90 .domino-half,
#builder-dominoes-container .domino.rotation-270 .domino-half {
    width: 100%;
    height: 50%;
}

/* Puzzle Builder Specific Rotation Logic - Higher specificity to override globals */
body #builder-dominoes-container .domino.rotation-0 {
    width: 60px !important;
    height: 30px !important;
    flex-direction: row !important;
    border-color: rgb(75, 85, 99) !important;
    background: rgba(75, 85, 99, 0.05) !important;
}

body #builder-dominoes-container .domino.rotation-90 {
    width: 30px !important;
    height: 60px !important;
    flex-direction: column !important;
    border-color: rgb(34, 139, 34) !important;
    background: rgba(34, 139, 34, 0.05) !important;
}

body #builder-dominoes-container .domino.rotation-180 {
    width: 60px !important;
    height: 30px !important;
    flex-direction: row !important;
    border-color: rgb(220, 20, 60) !important;
    background: rgba(220, 20, 60, 0.05) !important;
}

body #builder-dominoes-container .domino.rotation-270 {
    width: 30px !important;
    height: 60px !important;
    flex-direction: column !important;
    border-color: rgb(255, 140, 0) !important;
    background: rgba(255, 140, 0, 0.05) !important;
}


/* Puzzle builder specific margin adjustments - copy of main game logic */
#builder-dominoes-container .rotation-0 .domino-half:first-child {
    margin-right: 1px;
    margin-top: 0;
    margin-bottom: 0;
}

#builder-dominoes-container .rotation-0 .domino-half:last-child {
    margin-left: 1px;
    margin-top: 0;
    margin-bottom: 0;
}

#builder-dominoes-container .rotation-90 .domino-half:first-child {
    margin-bottom: 1px;
    margin-right: 0;
    margin-left: 0;
}

#builder-dominoes-container .rotation-90 .domino-half:last-child {
    margin-top: 1px;
    margin-right: 0;
    margin-left: 0;
}

#builder-dominoes-container .rotation-180 .domino-half:first-child {
    margin-left: 1px;
    margin-top: 0;
    margin-bottom: 0;
}

#builder-dominoes-container .rotation-180 .domino-half:last-child {
    margin-right: 1px;
    margin-top: 0;
    margin-bottom: 0;
}

#builder-dominoes-container .rotation-270 .domino-half:first-child {
    margin-top: 1px;
    margin-right: 0;
    margin-left: 0;
}

#builder-dominoes-container .rotation-270 .domino-half:last-child {
    margin-bottom: 1px;
    margin-right: 0;
    margin-left: 0;
}

#builder-dominoes-container .pip-grid {
    width: 20px !important;
    height: 20px !important;
    gap: 1px !important;
}

#builder-dominoes-container .pip {
    width: 5px !important;
    height: 5px !important;
}

#builder-dominoes-container .pip-dot {
    width: 4px !important;
    height: 4px !important;
}

/* FINAL OVERRIDE - Puzzle Builder Domino Rotations - Maximum Specificity */
html body #puzzle-builder #builder-dominoes-container .domino.rotation-0 {
    width: 60px !important;
    height: 30px !important;
    flex-direction: row !important;
    border-color: rgb(75, 85, 99) !important;
    background: rgba(75, 85, 99, 0.05) !important;
}

html body #puzzle-builder #builder-dominoes-container .domino.rotation-90 {
    width: 30px !important;
    height: 60px !important;
    flex-direction: column !important;
    border-color: rgb(34, 139, 34) !important;
    background: rgba(34, 139, 34, 0.05) !important;
}

html body #puzzle-builder #builder-dominoes-container .domino.rotation-180 {
    width: 60px !important;
    height: 30px !important;
    flex-direction: row !important;
    border-color: rgb(220, 20, 60) !important;
    background: rgba(220, 20, 60, 0.05) !important;
}

html body #puzzle-builder #builder-dominoes-container .domino.rotation-270 {
    width: 30px !important;
    height: 60px !important;
    flex-direction: column !important;
    border-color: rgb(255, 140, 0) !important;
    background: rgba(255, 140, 0, 0.05) !important;
}

/* ===== USER AUTHENTICATION & AVATAR STYLES ===== */

/* Auth section */
.auth-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Sign-in button - standardized size */
.auth-button {
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    overflow: hidden;
    transition: transform 0.2s ease, filter 0.3s ease;
}

/* Force hide authenticated elements */
.auth-button.auth-hidden {
    display: none !important;
    visibility: hidden !important;
}

.auth-button:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.auth-button img {
    width: 40px;
    height: 40px;
    filter: brightness(1.1);
    transition: filter 0.3s ease;
}

/* User profile dropdown */
.user-profile {
    position: relative;
    cursor: pointer;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    transition: all 0.2s ease;
    box-shadow: none;
}

.user-info:hover {
    background: none;
    transform: none;
    box-shadow: none;
}

/* User avatar - match unauth button size for consistency */
.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--ghibli-soft-gray);
    transition: border-color 0.2s ease;
    background: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.user-avatar:hover {
    border-color: var(--ghibli-sky-blue);
}

.user-name {
    font-weight: 600;
    color: var(--ghibli-charcoal);
    font-size: 14px;
    white-space: nowrap;
}

/* User dropdown menu */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--ghibli-paper-white);
    border: 1px solid var(--ghibli-soft-gray);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--ghibli-soft-shadow);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    margin-top: 6px;
}

.user-profile:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    color: var(--ghibli-charcoal);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
}

.dropdown-item:hover {
    background: var(--ghibli-soft-gray);
    color: var(--ghibli-ink-black);
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.sign-out-btn {
    border-top: 1px solid var(--ghibli-soft-gray);
    color: var(--ghibli-sunset-orange);
}

.sign-out-btn:hover {
    background: rgba(212, 151, 90, 0.1);
    color: var(--ghibli-sunset-orange);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .user-info {
        padding: 4px 8px;
        gap: 6px;
    }
    
    .user-avatar {
        width: 40px;
        height: 40px;
    }
    
    .user-name {
        font-size: 13px;
    }
    
    .auth-button img {
        width: 36px;
        height: 36px;
    }
}

/* ===== CAPYBARA EMPTY STATE MASCOT ===== */
.empty-state-mascot {
    width: 200px;
    height: auto;
    opacity: 0.8;
    margin: 0 auto 25px auto;
    display: block;
    /* Remove background and enhance the capybara */
    filter: 
        contrast(1.2) 
        brightness(1.1) 
        saturate(1.1) 
        sepia(0.1) 
        hue-rotate(5deg)
        drop-shadow(0 2px 8px rgba(0,0,0,0.1));
    transition: all 0.3s ease;
    /* Try to make background more transparent */
    mix-blend-mode: multiply;
}

.empty-state-mascot:hover {
    opacity: 0.9;
    transform: scale(1.08);
    filter: 
        contrast(1.3) 
        brightness(1.2) 
        saturate(1.2) 
        sepia(0.05) 
        hue-rotate(5deg)
        drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}
