:root {
    --primary-color: #8b5cf6;
    /* Violet */
    --secondary-color: #a78bfa;
    --accent-color: #facc15;
    --background-color: #f3f4f6;
    --text-color: #4c1d95;
}

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

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

#game-container {
    width: 100%;
    max-width: 800px;
    height: 100vh;
    max-height: 600px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

#game-header {
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    color: white;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.game-title {
    font-size: 1.5rem;
    font-weight: bold;
}

.icon-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
}

.btn-primary-small {
    background-color: #22c55e;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
}

#game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #eff6ff;
    position: relative;
    overflow: hidden;
}

.request-panel {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.villager {
    font-size: 3rem;
    margin-right: 10px;
}

.bubble {
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.bubble::after {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    margin-top: -10px;
    border-width: 10px;
    border-style: solid;
    border-color: transparent white transparent transparent;
}

.village {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 40px;
    padding-bottom: 20px;
    border-bottom: 5px solid #22c55e;
    /* Grass */
}

.house {
    width: 120px;
    height: 100px;
    background: #fde047;
    /* Yellow house */
    position: relative;
    display: flex;
    justify-content: center;
    box-shadow: 5px 0 10px rgba(0, 0, 0, 0.1);
}

.roof {
    position: absolute;
    top: -60px;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-bottom: 60px solid #3b82f6;
    /* Blue Roof */
}

.mailbox-container {
    position: absolute;
    bottom: 0;
    right: -40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mailbox-label {
    font-weight: bold;
    background: white;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.mailbox {
    width: 50px;
    height: 40px;
    background: #64748b;
    border-radius: 5px 5px 0 0;
    border-bottom: 5px solid #334155;
    /* Pole */
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 0.8rem;
    overflow: hidden;
}

.mailbox.filled {
    background: #22c55e;
}

.values-tray {
    height: 80px;
    background: #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.value-item {
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: grab;
    font-weight: bold;
    font-family: monospace;
}

.value-item:active {
    cursor: grabbing;
}

.controls {
    padding: 20px;
    display: flex;
    justify-content: center;
    background: white;
}

.hidden {
    display: none !important;
}

/* Modal */
.modal {
    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;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    width: 320px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 15px;
}

.btn-secondary {
    background-color: transparent;
    color: #64748b;
    border: 2px solid #cbd5e1;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 10px;
}