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

body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f0f0;
}

.game-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: bold;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
    aspect-ratio: 1/1; /* Make the board square */
}

.cell {
    aspect-ratio: 1; /* Make cells square */
    background-color: #f8f9fa;
    border: 1px solid #ccc;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.card {
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    perspective: 1000px;
}

/* Animation for matched cards */
@keyframes pulse {
    0% { transform: scale(1); background-color: #f0f0f0; }
    50% { transform: scale(1.15); background-color: #ffeb3b; }
    100% { transform: scale(1); background-color: #f0f0f0; }
}

@keyframes fadeOut {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.5); }
}

.card.matched {
    animation: pulse 0.5s ease-in-out 2;
    background-color: #ffeb3b;
}

.card.removing {
    animation: fadeOut 0.5s ease-in-out forwards;
}

/* Transaction Log Styles */
.transaction-log-container {
    margin-top: 20px;
    border-top: 1px solid #ddd;
    padding-top: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.transaction-log-container h3 {
    margin-bottom: 10px;
    color: #333;
}

.transaction-log {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    font-size: 0.9rem;
    background-color: #f9f9f9;
}

.log-entry {
    padding: 5px;
    margin: 2px 0;
    font-size: 0.9em;
    border-bottom: 1px solid #eee;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.token-plus {
    color: #27ae60;
    background-color: #fff3e0;
}

.log-entry.token-minus {
    color: #e74c3c;
    background-color: #ffebee;
}

.log-entry.score-plus {
    color: #2980b9;
    background-color: #e3f2fd;
}

.log-entry.match {
    color: #8e44ad;
    font-weight: bold;
    background-color: #e8f5e9;
}

.log-entry .timestamp {
    color: #666;
    margin-right: 8px;
    font-size: 0.8em;
}

.new-card-btn {
    width: 100%;
    padding: 10px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s;
}

.new-card-btn:hover:not(:disabled) {
    background-color: #d35400;
}

.new-card-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.footer {
    margin-top: 20px;
    text-align: center;
}
