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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f5f9;
    color: #1e2022;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
}

.game-container {
    width: 100%;
    max-width: 1000px;
    padding: 20px;
    margin: 0 auto;
    transform: translateY(-15vh); /* Use viewport height for more consistent positioning */
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

h1 {
    font-size: 2.5rem;
    font-weight: 500;
    color: #1e2022;
}

.game-controls {
    display: flex;
    gap: 20px;
    align-items: center;
}

button {
    background-color: #52616b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #3a4750;
}

.score-container, .time-container {
    font-size: 1.1rem;
}

.game-board {
    background-color: #c9d6df;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.top-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.stock-pile {
    display: flex;
    gap: 20px;
    position: relative;
}

.foundation-piles {
    display: flex;
    gap: 15px;
}

.tableau-piles {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.pile {
    width: 100px;
    height: 140px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(30, 32, 34, 0.4);
    position: relative;
}

.foundation, #waste {
    border: 2px dashed rgba(30, 32, 34, 0.4);
}

/* Empty pile highlight on dragover */
.pile.dragover {
    background-color: rgba(255, 255, 255, 0.3);
    border: 2px dashed rgba(30, 32, 34, 0.6);
}

/* Card flip animation */
@keyframes flipCard {
    0% {
        transform: translateX(0) rotateY(0deg);
        background-color: #52616b;
        background-image: linear-gradient(135deg, #52616b 25%, #3a4750 25%, #3a4750 50%, #52616b 50%, #52616b 75%, #3a4750 75%, #3a4750 100%);
        background-size: 20px 20px;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
        border: 3px solid #1e2022;
    }
    45% {
        transform: translateX(60px) rotateY(90deg);
        background-color: #52616b;
        background-image: linear-gradient(135deg, #52616b 25%, #3a4750 25%, #3a4750 50%, #52616b 50%, #52616b 75%, #3a4750 75%, #3a4750 100%);
        background-size: 20px 20px;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
        border: 3px solid #1e2022;
    }
    55% {
        transform: translateX(60px) rotateY(90deg);
        background-color: white;
        background-image: none;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(0, 0, 0, 0.1);
    }
    100% {
        transform: translateX(120px) rotateY(0deg);
        background-color: white;
        background-image: none;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(0, 0, 0, 0.1);
    }
}

.card-flipping {
    animation: flipCard 0.6s ease-in-out;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
}

.card-flipping span {
    transition: opacity 0.2s ease-in-out;
}

/* Temporary card for animation */
.temp-card {
    position: absolute;
    width: 100px;
    height: 140px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 500;
}

/* Card transition styles */
.card {
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    will-change: transform, opacity;
}

.updating-cards .card {
    transition: none;
}

/* Improve card appearance */
.card {
    width: 100px;
    height: 140px;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: absolute;
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 500;
    border: 1px solid rgba(0, 0, 0, 0.1);
    perspective: 1000px;
}

.card.selected {
    box-shadow: 0 0 0 3px #52616b, 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-5px);
}

.card.red {
    color: #e63946;
}

.card.black {
    color: #1e2022;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.card.facedown {
    background-color: #52616b;
    background-image: linear-gradient(135deg, #52616b 25%, #3a4750 25%, #3a4750 50%, #52616b 50%, #52616b 75%, #3a4750 75%, #3a4750 100%);
    background-size: 20px 20px;
    border: 3px solid #1e2022;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.card.dragging {
    opacity: 0.8;
    z-index: 1000;
}

.tableau .card {
    position: relative;
    margin-bottom: -110px;
}

.tableau .card:last-child {
    margin-bottom: 0;
}

#win-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.win-content {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
}

.win-content h2 {
    margin-bottom: 20px;
    color: #52616b;
}

.win-content p {
    margin-bottom: 30px;
}

.hidden {
    display: none;
}

/* Main Menu Styles */
.menu-container {
    width: 100%;
    max-width: 1000px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin: 0 auto;
    transform: translateY(-15vh); /* Use viewport height for more consistent positioning */
}

.menu-content {
    background-color: #c9d6df;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 80%;
    max-width: 500px;
}

.menu-content h1 {
    font-size: 3.5rem;
    margin-bottom: 0;
    color: #1e2022;
}

.menu-content h2 {
    font-size: 1.5rem;
    font-weight: 300;
    margin-top: 0;
    margin-bottom: 40px;
    color: #52616b;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-buttons button {
    padding: 15px 20px;
    font-size: 1.2rem;
}

/* Ensure hidden class works properly */
.hidden {
    display: none !important;
}

/* Card drawing animation */
@keyframes drawCard {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.card-drawing {
    animation: drawCard 0.3s ease-out;
} 