body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #2c7a2c;
    min-height: 100vh;
}

#game {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.1);
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
}

#game-info {
    display: flex;
    gap: 2rem;
}

#score, #timer {
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 4px;
    border: none;
    color: #1a5c1a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pause-btn {
    background: none;
    border: none;
    color: #1a5c1a;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.pause-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.pause-btn:active {
    background-color: rgba(255, 255, 255, 0.3);
}

#controls {
    display: flex;
    gap: 0.5rem;
}

#controls button:first-child {
    background-color: #4CAF50;
    color: white;
    font-weight: 600;
}

#controls button:first-child:hover {
    background-color: #43a047;
}

#game-board {
    width: 100%;
    max-width: calc(7 * var(--card-width, 100px) + 6 * 12px + 2rem);
    margin: 0 auto; /* Center the game area */
    padding: 1rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background-color: #ffffff;
    color: #000000;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #eeeeee;
}

.blank {
    background-color: #ffffff;
    width: var(--card-width, 100px);
    height: calc(var(--card-width, 100px) * 1.4);
    position: relative;
    perspective: 1000px;
    cursor: default;
}

.pile {
    width: var(--card-width, 100px);
    height: calc(var(--card-width, 100px) * 1.4);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    position: relative;
    min-height: calc(var(--card-width, 100px) * 1.4);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pile:hover:not(#tableau .pile) {
    border-color: rgba(255, 255, 255, 0.6);
    background-color: rgba(255, 255, 255, 0.1);
}

/* Foundation suit placeholders */
.foundation-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: calc(var(--card-width, 100px) * 0.38);
    color: rgba(255, 255, 255, 0.35);
    pointer-events: none;
    user-select: none;
}

.pile.foundation:has(.card) .foundation-placeholder {
    display: none;
}

/* Waste pile empty indicator */
#waste:not(:has(.card))::after {
    content: "←";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: calc(var(--card-width, 100px) * 0.35);
    color: rgba(255, 255, 255, 0.25);
    pointer-events: none;
}

/* Hover effect for face-up cards in tableau */
#tableau .pile .card.flipped:hover {
    transform: translateY(-8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 10;
}

/* Apply hover effect to all cards stacked above the hovered card */
#tableau .pile .card.flipped:hover ~ .card {
    transform: translateY(-8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 10;
}

.pile-group {
    display: flex;
    gap: 12px; /* Fixed gap that works well within constrained game area */
    margin-bottom: 20px;
}

#top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

#stock-waste {
    display: flex;
    gap: 12px; /* Fixed gap that works well within constrained game area */
}

#foundation {
    justify-content: flex-end;
}

#tableau {
    flex: 1;
    width: 100%;
}

#tableau .pile {
    flex: 1;
    min-width: 0;
    min-height: calc(var(--card-width, 100px) * 1.6);
    overflow: visible;
    border: none;
}

#tableau .pile .card {
    position: absolute;
    left: 0;
}

#tableau .pile .card:not(:first-child) {
    margin-top: 0;
}

/* Hint system styles */
.hint-source {
    box-shadow: 0 0 15px #FFD700, 0 0 25px #FFD700 !important;
    border: 2px solid #FFD700 !important;
    animation: pulse-hint 1.5s ease-in-out infinite;
}

.hint-target {
    background-color: rgba(255, 215, 0, 0.3) !important;
    border-color: #FFD700 !important;
    border-width: 3px !important;
    animation: pulse-target 1.5s ease-in-out infinite;
}

@keyframes pulse-hint {
    0%, 100% { 
        box-shadow: 0 0 15px #FFD700, 0 0 25px #FFD700;
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 20px #FFD700, 0 0 35px #FFD700, 0 0 45px #FFD700;
        transform: scale(1.05);
    }
}

@keyframes pulse-target {
    0%, 100% { 
        background-color: rgba(255, 215, 0, 0.3);
        border-color: #FFD700;
    }
    50% { 
        background-color: rgba(255, 215, 0, 0.6);
        border-color: #FFA500;
    }
}

/* Touch feedback animation */
@keyframes touch-ripple {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0;
    }
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
    /* Improve touch targets */
    .card {
        min-width: 45px;
        min-height: 63px;
    }
    
    /* Better button sizing for touch */
    button {
        min-height: 44px;
        min-width: 44px;
        padding: 0.6rem 1rem;
        font-size: 1rem;
        border-radius: 8px;
    }
    
    /* Compact single-row header on mobile */
    #game-header {
        padding: 0.4rem 0.6rem;
        flex-wrap: nowrap;
        gap: 0.5rem;
        align-items: center;
    }

    /* Stack score and timer vertically on the left */
    #game-info {
        flex: 0 0 auto;
        min-width: auto;
        flex-direction: column;
        gap: 0.25rem;
    }

    #score, #timer {
        padding: 0.2rem 0.5rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .pause-btn {
        font-size: 0.8rem;
        min-width: 22px;
        min-height: 22px;
    }

    /* 2×2 button grid takes the remaining space on the right */
    #controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.25rem;
        flex: 1;
    }

    #controls button {
        font-size: 0.8rem;
        padding: 0.3rem 0.4rem;
        min-height: 32px;
        min-width: 0;
    }
    
    /* Better pile spacing */
    .pile {
        min-height: calc(var(--card-width, 100px) * 1.4);
        border-width: 1px;
    }
    
    /* Improved tableau for mobile */
    #tableau .pile {
        min-height: calc(var(--card-width, 100px) * 1.6);
    }
    
    .pile-group {
        gap: 0.4vw; /* Smaller gaps for mobile */
    }
    
    /* Better foundation pile visibility */
    #foundation .pile {
        border-width: 2px;
        border-style: solid;
    }
    
    /* Touch-friendly waste pile */
    #waste {
        border-width: 2px;
    }
    
    /* Prevent text selection on mobile */
    #game {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Improve accessibility for mobile */
    button:focus,
    .card:focus {
        outline: 2px solid #4CAF50;
        outline-offset: 2px;
    }
    
    /* Better visual feedback for active states */
    button:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .card:active {
        transform: scale(1.02);
        transition: transform 0.1s ease;
    }
}

/* Card Animation Styles */
.card {
    transition-property: transform, opacity;
    transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Enhanced flip animation */
.card.flipping {
    animation: enhanced-flip 300ms ease-in-out;
}

@keyframes enhanced-flip {
    0% {
        transform: rotateY(0deg) scale(1);
    }
    50% {
        transform: rotateY(90deg) scale(1.05);
    }
    100% {
        transform: rotateY(180deg) scale(1);
    }
}

/* Card reveal animation (for stock pile) */
.card.revealing {
    animation: card-reveal 200ms ease-out;
}

@keyframes card-reveal {
    0% {
        transform: scale(0.9) rotateY(-10deg);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.05) rotateY(5deg);
        opacity: 0.9;
    }
    100% {
        transform: scale(1) rotateY(0deg);
        opacity: 1;
    }
}

/* Smooth movement for drag and drop */
.card.moving {
    transition: transform 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1000;
}

/* Auto-move animation (faster) */
.card.auto-moving {
    transition: transform 200ms ease-out;
    z-index: 1000;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .card,
    .card.flipping,
    .card.revealing,
    .card.moving,
    .card.auto-moving {
        transition: none !important;
        animation: none !important;
    }
}

/* Additional mobile adjustments */
@media (max-width: 768px) {
    #game-board {
        padding: 0.25rem; /* Even less padding */
    }

    .pile-group {
        gap: 0.3vw; /* Tighter gaps */
    }

    #stock-waste {
        gap: 0.3vw;
    }

    #top-row {
        flex-direction: row-reverse;
        gap: 6px; /* Smaller gap */
    }
}

/* SEO Content Section */
#game-info-section {
    max-width: 800px;
    margin: 60px auto 40px;
    padding: 40px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    color: #333;
    line-height: 1.7;
}

#game-info-section h1 {
    font-size: 2rem;
    color: #1a5c1a;
    margin-bottom: 1rem;
    border-bottom: 3px solid #2c7a2c;
    padding-bottom: 0.5rem;
}

#game-info-section h2 {
    font-size: 1.5rem;
    color: #1a5c1a;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

#game-info-section h3 {
    font-size: 1.2rem;
    color: #2c7a2c;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

#game-info-section p {
    margin-bottom: 1rem;
    text-align: justify;
}

#game-info-section ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

#game-info-section li {
    margin-bottom: 0.75rem;
}

#game-info-section strong {
    color: #1a5c1a;
}

.content-section {
    margin-bottom: 2rem;
}

.content-section:last-child {
    margin-bottom: 0;
}

/* Mobile styles for content section */
@media (max-width: 768px) {
    #game-info-section {
        margin: 40px 16px 24px;
        padding: 24px;
        border-radius: 8px;
    }

    #game-info-section h1 {
        font-size: 1.5rem;
    }

    #game-info-section h2 {
        font-size: 1.25rem;
    }

    #game-info-section h3 {
        font-size: 1.1rem;
    }

    #game-info-section p {
        text-align: left;
    }
}

/* Site Footer */
#site-footer {
    background-color: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 1rem;
    margin-top: 2rem;
}

#footer-inner {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

#footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 0.5rem;
}

#footer-nav a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.82rem;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    transition: color 0.15s;
}

#footer-nav a:hover {
    color: white;
}

#footer-nav a:not(:last-child)::after {
    content: '·';
    margin-left: 0.5rem;
    color: rgba(255, 255, 255, 0.3);
}

#footer-copyright {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin: 0;
}
.card {
    width: var(--card-width, 100px);
    height: calc(var(--card-width, 100px) * 1.4);
    position: relative;
    perspective: 1000px;
    cursor: default;
}

.card.interactive {
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    border: 1px solid #cccccc80;
}

.card-front {
    background: white;
    transform: rotateY(180deg);
    padding: 5px;
    box-sizing: border-box;
}

.card-back {
    background-image: url(/assets/images/card-back3.524b7dbf6a50960d1f2b.png);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-sizing: border-box;
}

.card-corner {
    position: absolute;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1px;
    line-height: 1;
}

.top-left {
    top: 5px;
    left: 5px;
}

.bottom-right {
    bottom: 5px;
    right: 5px;
    transform: rotate(180deg);
    display: none;
}

.card-rank {
    font-size: calc(var(--card-width, 100px) * 0.2);
    font-weight: bold;
}

.card-suit {
    font-size: calc(var(--card-width, 100px) * 0.18);
}

.card[data-suit="hearts"] .card-suit,
.card[data-suit="diamonds"] .card-suit {
    color: red;
}

.card[data-suit="hearts"] .card-rank,
.card[data-suit="diamonds"] .card-rank {
    color: red;
}
.card-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 70%;
}


.face-card .card-suit.large {
    font-size: calc(var(--card-width, 100px) * 0.6);
}

/* Centered large suit symbol */
.card-front::after {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: calc(var(--card-width, 100px) * 0.42);
    line-height: 1;
    opacity: 0.85;
}

.card[data-suit="hearts"] .card-front::after {
    content: "♥";
    color: red;
}

.card[data-suit="diamonds"] .card-front::after {
    content: "♦";
    color: red;
}

.card[data-suit="clubs"] .card-front::after {
    content: "♣";
    color: black;
}

.card[data-suit="spades"] .card-front::after {
    content: "♠";
    color: black;
}

/* Mobile-specific card styling */
@media (max-width: 768px) {
    /* Keep top-left corner positioned as normal but adjust content */
    .card-corner.top-left {
        top: 4px;
        left: 4px;
    }
    
    /* Add small suit to top right */
    .card-front::before {
        position: absolute;
        top: 4px;
        right: 4px;
        font-size: calc(var(--card-width, 100px) * 0.25);
        line-height: 1;
    }
    
    /* Add centered large suit container */
    .card-front::after {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        font-size: calc(var(--card-width, 100px) * 0.65);
        line-height: 1;
    }
    
    /* Suit symbols for top right small display */
    .card[data-suit="hearts"] .card-front::before {
        content: "♥";
        color: red;
    }
    
    .card[data-suit="diamonds"] .card-front::before {
        content: "♦";
        color: red;
    }
    
    .card[data-suit="clubs"] .card-front::before {
        content: "♣";
        color: black;
    }
    
    .card[data-suit="spades"] .card-front::before {
        content: "♠";
        color: black;
    }
    
    /* Suit symbols for centered large display */
    .card[data-suit="hearts"] .card-front::after {
        content: "♥";
        color: red;
    }
    
    .card[data-suit="diamonds"] .card-front::after {
        content: "♦";
        color: red;
    }
    
    .card[data-suit="clubs"] .card-front::after {
        content: "♣";
        color: black;
    }
    
    .card[data-suit="spades"] .card-front::after {
        content: "♠";
        color: black;
    }
    
    /* Style the rank on mobile - slightly larger */
    .card-rank {
        font-size: calc(var(--card-width, 100px) * 0.34);
        font-weight: bold;
    }

    /* Show the suit inline with rank on mobile */
    .card-suit {
        font-size: calc(var(--card-width, 100px) * 0.28);
    }
}

/*# sourceMappingURL=klondike.f1df65443eaf37d239f2.css.map*/