:root {
    --primary-color: #3b82f6;
    --secondary-color: #64748b;
    --bg-color: #f1f5f9;
    --card-size: 80px;
    --card-bg: #ffffff;
    --card-back: #1e293b;
    --text-color: #0f172a;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-container {
    width: 100%;
    max-width: 800px;
    height: 95vh;
    background: white;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

header {
    padding: 1rem;
    background: var(--bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    margin: 0;
    font-size: 1.5rem;
}

.status-bar {
    font-size: 1.2rem;
    font-weight: bold;
}

.status-bar span {
    margin-left: 1rem;
}

.game-area {
    flex: 1;
    position: relative;
    background-color: #e2e8f0;
    margin: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

/* Card Styles */
.card {
    width: var(--card-size);
    height: var(--card-size);
    position: absolute;
    border-radius: 50%;
    cursor: pointer;
    perspective: 1000px;
    user-select: none;
    transition: transform 0.2s;
}

.card:active {
    transform: scale(0.95);
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

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

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.card-front {
    background-color: var(--card-bg);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.card-back {
    background-color: var(--card-back);
    transform: rotateY(180deg);
}

/* Controls */
.controls {
    padding: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.primary-btn, .secondary-btn {
    padding: 0.5rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.secondary-btn {
    background-color: var(--secondary-color);
    color: white;
}

.primary-btn:hover, .secondary-btn:hover {
    opacity: 0.9;
}

/* Modals */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    min-width: 300px;
    text-align: center;
}

.modal-content label {
    display: block;
    margin: 1rem 0;
}

input[type=range] {
    width: 100%;
    margin-top: 0.5rem;
}
