:root {
    --bun-color: #e0a875;
    --bun-dark: #c68c5a;
    --meat-color: #8d4925;
    --lettuce-color: #7cb342;
    --lettuce-dark: #558b2f;
    --tomato-color: #e53935;
    --cheese-color: #fdd835;
    --floor-color: #f5f5f5;
    --counter-color: #8d6e63;
    --table-color: #a1887f;
    --entrance-color: #7cb342;
    --text-color: #333;
}

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

body {
    font-family: 'Hiragino Kaku Gothic Pro', 'ヒラギノ角ゴ Pro W3', 'メイリオ', Meiryo, 'MS Pゴシック', sans-serif;
    background-color: var(--bun-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    background: linear-gradient(to bottom, var(--meat-color), #5d2906);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2rem;
    position: relative;
    padding: 15px 20px;
    background: linear-gradient(to right, #8d4925, #c68c5a);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transform: perspective(500px) rotateX(5deg);
    border: 2px solid var(--cheese-color);
}

h1::before, h1::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--cheese-color), transparent);
}

h1::before {
    top: 5px;
    left: 0;
}

h1::after {
    bottom: 5px;
    left: 0;
}

.title-text {
    color: white;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    letter-spacing: 1px;
}

.title-icon {
    font-size: 1.8rem;
    display: inline-block;
    filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.5));
    animation: bounce 2s infinite alternate;
}

@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-5px); }
}

.shop-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

.info-item {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* info-itemにボタンが入っている場合の特別なスタイル */
.info-item:has(.reset-button) {
    padding: 0;
}

.label {
    font-weight: bold;
    margin-right: 5px;
}

.satisfaction-meter {
    width: 100px;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin: 0 5px;
}

.satisfaction-fill {
    height: 100%;
    background: linear-gradient(to right, var(--tomato-color), var(--lettuce-color));
    width: 50%;
}

.reset-button {
    background-color: var(--tomato-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 15px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
    width: 100%;
    height: 100%;
}

.reset-button:hover {
    background-color: #c62828;
}

/* ゲームエリアスタイル */
.game-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-bottom: 20px;
}

.game-area {
    background-color: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    min-height: 600px;
    flex: 2;
}

.inventory-panel {
    background: linear-gradient(to bottom, var(--lettuce-color), var(--lettuce-dark));
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: white;
    flex: 1;
    min-width: 450px;
    max-width: 500px;
    display: flex;
    flex-direction: column;
}

.shop-layout {
    position: relative;
    height: 100%;
    background-color: var(--floor-color);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.staff-container {
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    z-index: 10;
}

.counter-top {
    width: 100%;
    height: 60px;
    background: linear-gradient(to bottom, var(--counter-color), #6d4c41);
    border-radius: 10px;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    margin-top: 60px;
    margin-bottom: 40px;
    position: relative;
}

.staff {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ffcc80;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    position: absolute;
}

.staff-left {
    left: 30%;
}

.staff-right {
    right: 30%;
}

.staff::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 10px;
    border-radius: 10px 10px 0 0;
    border: 2px solid #5d4037;
    border-bottom: none;
    bottom: 10px;
    background: transparent;
    transform: rotate(180deg);
}

.staff::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #5d4037;
    top: 10px;
    left: 12px;
    box-shadow: 10px 0 0 #5d4037;
}

.entrance-container {
    height: 40px;
    width: 200px;
    margin: 20px auto;
    margin-top: auto;
    position: relative;
    background-color: #f0f0f0;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.automatic-door {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.door {
    position: absolute;
    height: 100%;
    width: 50%;
    background-color: #90caf9;
    transition: transform 0.5s ease-in-out;
    z-index: 5;
}

.door-left {
    left: 0;
    transform-origin: left center;
}

.door-right {
    right: 0;
    transform-origin: right center;
}

.door-open .door-left {
    transform: translateX(-100%);
}

.door-open .door-right {
    transform: translateX(100%);
}

.tables-container {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tables-area {
    width: 100%;
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 80px;
    padding: 20px 80px;
}

.table {
    position: relative;
}

.table-surface {
    width: 80%;
    height: 60px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    position: relative;
    border: 1px solid #e0e0e0;
}

.table-surface::before {
    content: '';
    position: absolute;
    width: 90%;
    height: 90%;
    border: 1px dashed #e0e0e0;
    border-radius: 6px;
}

/* 顧客スタイル */
.customer {
    position: absolute;
    width: 30px;
    height: 30px;
    background-color: var(--bun-color);
    border-radius: 50%;
    z-index: 10;
    transition: left 0.5s, top 0.5s, background-color 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 顧客の顔 */
.customer::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 4px;
    background-color: #333;
    border-radius: 2px;
    bottom: 8px;
    transition: all 0.3s ease;
}

.customer::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: #333;
    border-radius: 50%;
    top: 8px;
    left: 8px;
    box-shadow: 10px 0 0 #333;
    transition: all 0.3s ease;
}

/* 笑顔 */
.customer.happy {
    background-color: #fff9c4; /* 薄い黄色 */
}

.customer.happy::before {
    border-radius: 10px;
    height: 6px;
    width: 12px;
    bottom: 6px;
    transform: translateY(0);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.customer.happy::after {
    transform: translateY(-2px);
}

/* 怒り顔 */
.customer.angry {
    background-color: var(--tomato-color);
}

.customer.angry::before {
    border-radius: 10px;
    height: 6px;
    width: 12px;
    bottom: 10px;
    transform: translateY(0);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.customer.angry::after {
    transform: translateY(-2px);
}

.customer-speech {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    border-radius: 10px;
    padding: 5px 10px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 20;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.customer-speech::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid white;
}

/* 在庫管理パネルスタイル */
.inventory-grid {
    display: grid;
    grid-template-columns: 2fr 0.6fr 0.8fr 1.4fr;
    gap: 4px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 6px;
    color: var(--text-color);
    margin-bottom: 10px;
    font-size: 0.85em;
    white-space: nowrap;
}

.inventory-container {
    flex: 1;
}

.message-area {
    text-align: center;
    min-height: 30px;
    margin-top: 15px;
    padding: 8px;
    color: #fff;
    font-weight: bold;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.message-area.error {
    background-color: rgba(255, 87, 87, 0.7);
}

.message-area.success {
    background-color: rgba(87, 255, 87, 0.7);
}

/* メッセージエリアのスタイル */
.message-area {
    margin-top: 15px;
    padding: 10px;
    min-height: 60px;
    width: 100%;
}

.message {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    animation: fadeIn 0.5s ease-in-out;
    background-color: rgba(255, 255, 255, 0.9); /* より不透明度を高めて見やすく */
}

.message.info {
    border-left: 4px solid #2196f3;
    color: #0d47a1;
}

.message.warning {
    border-left: 4px solid #ffc107;
    color: #ff6f00;
    font-weight: bold;
}

.message.error {
    border-left: 4px solid #f44336;
    color: #b71c1c;
    font-weight: bold;
}

/* 在庫切れメッセージ用のスタイル */
.message.stock-warning {
    background-color: #d84315;
    color: white;
    border: none;
    font-weight: normal;
    padding: 10px;
    text-align: center;
    border-radius: 10px;
    margin: 0;
    animation: none;
    width: 100%;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.game-timer {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 20px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.inventory-header {
    font-weight: bold;
    padding: 5px 0;
    border-bottom: 2px solid var(--lettuce-dark);
    text-align: center;
}

.product-name, .product-stock, .product-restock, .product-price {
    padding: 10px 5px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
}

.product-name {
    font-weight: bold;
}

.product-price {
    font-size: 0.75rem;
    line-height: 1.2;
    word-break: keep-all;
    overflow: hidden;
}

.level-locked {
    color: #999;
}

.level-required {
    font-size: 0.8rem;
    color: var(--tomato-color);
    margin-left: 5px;
}

/* コントロールパネルスタイル */
.control-panel {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.action-button, #restock-button {
    background-color: var(--cheese-color);
    color: var(--meat-color);
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
    width: 100%;
}

.action-button:hover, #restock-button:hover {
    background-color: #ffd54f;
}

.restock-button {
    padding: 5px 10px;
    background-color: var(--cheese-color);
    color: var(--meat-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: background-color 0.3s;
}

.restock-button:hover {
    background-color: #ffd54f;
}

.restock-button:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
}

/* ゲームオーバー画面 */
.game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-over-content {
    background: linear-gradient(to bottom, var(--meat-color), #5d2906);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    color: white;
    border: 5px solid var(--cheese-color);
}

.game-over-content h2 {
    color: var(--cheese-color);
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-over-content p {
    margin: 15px 0;
    font-size: 1.2rem;
}

.restart-button {
    background-color: var(--cheese-color);
    color: var(--meat-dark);
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.restart-button:hover {
    background-color: #ffd54f;
}

.final-score {
    font-size: 1.4rem;
    color: var(--cheese-color);
    font-weight: bold;
    margin: 20px 0;
}

.restart-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    background-color: #ffd54f;
}

.restart-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .shop-info {
        flex-direction: column;
        align-items: center;
    }
    
    .game-container {
        flex-direction: column;
    }
    
    .game-area, .inventory-panel {
        width: 100%;
    }
    
    .inventory-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .inventory-header:nth-child(3),
    .inventory-header:nth-child(4),
    .product-restock,
    .product-price {
        display: none;
    }
}