﻿:root {
    --parchment: #f4e4bc;
    --dark-border: #4a3728;
    --ink: #2b1d12;
    --gold: #d4af37;
    --shadow: rgba(0, 0, 0, 0.2);
    --green: #2e7d32;
    --yellow: #fbc02d;
    --red: #c62828;
}

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

body {
    font-family: 'Crimson Pro', serif;
    background-color: #2b1d12;
    color: var(--ink);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

#game-container {
    background-color: var(--parchment);
    background-image: url('https://www.transparenttextures.com/patterns/parchment.png');
    width: 95vw;
    height: 95vh;
    max-width: 1000px;
    max-height: 800px;
    border: 8px double var(--dark-border);
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: relative;
}

/* Status Bar */
#status-bar {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    border-bottom: 2px solid var(--dark-border);
    font-size: 1.2rem;
    font-weight: bold;
    background: rgba(0,0,0,0.05);
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Main Area */
#main-area {
    flex: 1;
    display: flex;
    padding: 20px;
    gap: 20px;
    overflow: hidden;
}

#lab-grid-container {
    flex: 2;
    display: flex;
    justify-content: center;
    align-items: center;
}

#lab-grid {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    grid-template-rows: repeat(3, 100px);
    gap: 15px;
}

.tile {
    width: 100px;
    height: 100px;
    border: 2px dashed rgba(74, 55, 40, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    transition: all 0.3s ease;
}

.tile.filled {
    border: 3px solid var(--dark-border);
    background: rgba(255,255,255,0.2);
    box-shadow: 2px 2px 5px var(--shadow);
}

/* Card Panel */
#card-panel {
    flex: 1;
    border-left: 2px solid var(--dark-border);
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#card-display {
    width: 100%;
    height: 300px;
    border: 3px solid var(--dark-border);
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(255,255,255,0.1);
    transition: opacity 0.5s ease;
    box-shadow: inset 0 0 10px var(--shadow);
}

#card-title {
    font-family: 'Metamorphous', cursive;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

#card-text {
    font-size: 1.1rem;
    font-style: italic;
}

/* Controls */
#controls {
    padding: 20px;
    border-top: 2px solid var(--dark-border);
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(0,0,0,0.05);
}

#shop, #actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

button {
    padding: 10px 20px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid var(--dark-border);
    background: var(--parchment);
    transition: all 0.2s;
}

button:hover:not(:disabled) {
    background: var(--ink);
    color: var(--parchment);
    transform: translateY(-2px);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #999;
}

.shop-btn { border-style: solid; }
#safe-btn { border-color: var(--green); color: var(--green); }
#push-btn { border-color: var(--red); color: var(--red); }

#safe-btn:hover:not(:disabled) { background: var(--green); color: white; }
#push-btn:hover:not(:disabled) { background: var(--red); color: white; }

#resolve-btn, #recover-btn {
    align-self: center;
    background: var(--dark-border);
    color: var(--parchment);
}

.hidden { display: none !important; }

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.2s ease-in-out 3;
}

/* Overlay */
#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#overlay-content {
    background: var(--parchment);
    padding: 40px;
    border: 5px solid var(--dark-border);
    text-align: center;
    max-width: 400px;
}

#overlay-title { font-size: 2rem; margin-bottom: 20px; }
#overlay-message { margin-bottom: 30px; font-size: 1.2rem; }

