:root {
    --bg-color: #2c1e14;
    /* Dark wood */
    --panel-bg: #3e2b1f;
    --text-color: #e0d6c8;
    --accent-color: #d4af37;
    /* Gold/Brass */
    --tea-color: #8b0000;
    /* Deep red */
    --glass-color: rgba(255, 255, 255, 0.2);
    --font-heading: 'Rye', serif;
    --font-body: 'Roboto', sans-serif;
}

* {
    box-sizing: border-box;
    user-select: none;
    /* Prevent text selection on rapid clicks */
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.game-container {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle, #3e2b1f 0%, #1a110b 100%);
}

/* Header */
header {
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid var(--accent-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-family: var(--font-heading);
    margin: 0;
    color: var(--accent-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.stats-panel {
    display: flex;
    gap: 20px;
    font-size: 1.2rem;
    font-weight: bold;
}

.stat-item {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #5a4030;
}

.currency {
    color: var(--accent-color);
}

/* Main Layout */
main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Click Area */
.click-area {
    flex: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.tea-glass-container {
    width: 200px;
    height: 300px;
    cursor: pointer;
    position: relative;
    transition: transform 0.1s;
}

.tea-glass-container:active {
    transform: scale(0.95);
}

/* CSS Art for Tea Glass */
.tea-glass {
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, var(--glass-color), rgba(255, 255, 255, 0.1));
    border-radius: 10px 10px 40px 40px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.tea-liquid {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    height: 80%;
    background: linear-gradient(to bottom, #a00000, #500000);
    border-radius: 5px 5px 30px 30px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.tea-spoon {
    position: absolute;
    top: 20px;
    right: 30px;
    width: 10px;
    height: 250px;
    background: silver;
    transform: rotate(15deg);
    border-radius: 5px;
    opacity: 0.8;
}

.click-instruction {
    margin-top: 20px;
    font-style: italic;
    opacity: 0.7;
}

/* Click Feedback */
.floating-text {
    position: absolute;
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.5rem;
    pointer-events: none;
    animation: floatUp 1s ease-out forwards;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) scale(1.2);
        opacity: 0;
    }
}

.event-popup {
    position: absolute;
    color: #ffeb3b;
    /* Bright Yellow */
    font-weight: bold;
    font-size: 1.2rem;
    text-align: center;
    pointer-events: none;
    animation: floatUpSlow 3s ease-out forwards;
    text-shadow: 2px 2px 4px #000;
    width: 200px;
    z-index: 10;
}

@keyframes floatUpSlow {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    10% {
        transform: translateY(-20px) scale(1.1);
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-150px) scale(1);
        opacity: 0;
    }
}

/* Shop Panel */
.shop-panel {
    flex: 1;
    background-color: var(--panel-bg);
    border-left: 4px solid #2a1a12;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
}

.shop-panel h2 {
    font-family: var(--font-heading);
    color: var(--accent-color);
    border-bottom: 1px solid #5a4030;
    padding-bottom: 10px;
    margin-top: 0;
}

.shop-category h3 {
    font-size: 1rem;
    color: #a89f91;
    margin-bottom: 10px;
}

.shop-item {
    width: 100%;
    background: #2c1e14;
    border: 1px solid #5a4030;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    color: var(--text-color);
    text-align: left;
}

.shop-item:hover {
    background: #3a281c;
    border-color: var(--accent-color);
}

.shop-item:active {
    transform: scale(0.98);
}

.shop-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

.item-info {
    display: flex;
    flex-direction: column;
}

.item-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.item-desc {
    font-size: 0.8rem;
    opacity: 0.7;
}

.item-cost {
    font-weight: bold;
    color: #ff6b6b;
}

.item-count {
    background: var(--accent-color);
    color: #1a110b;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 10px;
}

/* Message Log */
.message-log {
    margin-top: auto;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 5px;
    height: 100px;
    overflow-y: auto;
    font-size: 0.9rem;
    font-family: monospace;
    border: 1px solid #5a4030;
}

.message-log p {
    margin: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
    }

    main {
        flex-direction: column;
    }

    .click-area {
        flex: 1;
        padding: 20px;
    }

    .shop-panel {
        flex: 1;
        border-left: none;
        border-top: 4px solid #2a1a12;
    }
}