:root {
    --primary-color: #ff6b6b;
    --secondary-color: #feca57;
    --bg-color: #f7f1e3;
    --counter-color: #d1ccc0;
    --font-main: 'Gaegu', cursive;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
    font-family: var(--font-main);
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#game-header {
    padding: 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
}

.score-board {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* 상점 뷰 */
#shop-view {
    flex: 1;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
    background: linear-gradient(to bottom, #87ceeb 60%, var(--bg-color) 60%);
    overflow: hidden;
}

#customer-queue {
    display: flex;
    gap: 20px;
    padding: 20px; /* 여백 추가 */
    z-index: 2;
    overflow-x: auto;
    width: 100%;
    justify-content: flex-start;
    align-items: flex-end; /* 아래쪽 정렬 */
    height: 250px; /* 높이 명시적으로 확보 */
}

.customer {
    cursor: pointer;
    text-align: center;
    animation: bounce 2s infinite;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.customer-char {
    font-size: 4rem;
    line-height: 1;
}

.speech-bubble {
    background: white;
    border-radius: 15px;
    padding: 8px 12px;
    margin-bottom: 15px; /* 캐릭터와의 간격 */
    position: relative;
    font-size: 1.2rem;
    border: 3px solid #333;
    white-space: nowrap;
    box-shadow: 0 4px 0 rgba(0,0,0,0.1);
}

/* 말풍선 꼬리 추가 */
.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 12px 10px 0;
    border-style: solid;
    border-color: #333 transparent transparent;
}

.counter-top {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 80px;
    background-color: var(--counter-color);
    border-top: 4px solid #aaa;
    z-index: 1;
}

/* 피자 제작 뷰 */
#make-view {
    position: absolute;
    inset: 0;
    background: white;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

#pizza-board {
    width: 300px;
    height: 300px;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pizza-base {
    width: 250px;
    height: 250px;
    background: #f1c40f;
    border-radius: 50%;
    border: 8px solid #d35400;
    position: relative;
    box-shadow: 0 10px 0 #e67e22;
}

.topping {
    position: absolute;
    font-size: 1.5rem;
    transform: translate(-50%, -50%);
}

#ingredient-shelf {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 400px;
}

.ing-btn {
    padding: 15px;
    font-size: 1.2rem;
    border: none;
    background: var(--secondary-color);
    border-radius: 15px;
    font-family: var(--font-main);
    cursor: pointer;
    box-shadow: 0 5px 0 #d35400;
}

.ing-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #d35400;
}

.action-btns {
    margin-top: 30px;
    display: flex;
    gap: 20px;
}

button.done { background: #2ecc71; color: white; }
button.cancel { background: #e74c3c; color: white; }

.action-btns button {
    padding: 10px 30px;
    font-size: 1.5rem;
    border: none;
    border-radius: 20px;
    font-family: var(--font-main);
}

/* 애니메이션 */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hidden { display: none !important; }

/* 토스트 메시지 */
#toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 20px 40px;
    border-radius: 50px;
    font-size: 2rem;
    z-index: 100;
}
