/* ===========================================
   おうちレストラン - Home Restaurant
   =========================================== */
/* Mobile Responsive Fixes */
@media (max-width: 480px) {
    .game-header {
        padding: 60px 10px 10px;
    }
    .level-badge {
        font-size: 0.9rem;
        padding: 5px 10px;
    }
    .home-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        top: 10px;
        left: 10px;
    }
}

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

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Zen Maru Gothic', sans-serif;
    touch-action: none;
    user-select: none;
}

body {
    background: linear-gradient(180deg, #FFCC80 0%, #FFB74D 50%, #8D6E63 100%);
}

.home-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 9999;
}

#game-container {
    max-width: 500px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Customer Section */
.customer-section {
    padding: 60px 20px 15px;
    display: flex;
    align-items: flex-end;
    gap: 15px;
}

.customer {
    animation: customerBounce 2s ease-in-out infinite;
}

@keyframes customerBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.customer-icon {
    font-size: 5rem;
    display: block;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.2));
}

.speech-bubble {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 12px 18px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    position: relative;
    animation: bubblePop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.speech-bubble::before {
    content: '';
    position: absolute;
    left: -12px;
    bottom: 15px;
    border: 8px solid transparent;
    border-right-color: white;
}

@keyframes bubblePop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.order-content {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 1.3rem;
}

.order-count {
    background: #FF6B6B;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    font-weight: bold;
}

.order-text {
    font-size: 1rem;
    color: #666;
}

/* Plate Section */
.plate-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    gap: 15px;
}

.plate-container {
    position: relative;
}

.plate {
    width: 280px;
    height: 180px;
    max-width: 90vw;
    max-height: 55vw; /* Maintain aspect ratio roughly */
    background: white;
    border-radius: 50%;
    box-shadow:
        inset 0 5px 15px rgba(0, 0, 0, 0.1),
        0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    align-content: center;
    gap: 8px;
    padding: 25px;
    position: relative;
}

.plate.drop-target {
    box-shadow:
        inset 0 5px 15px rgba(0, 0, 0, 0.1),
        0 10px 30px rgba(0, 0, 0, 0.2),
        0 0 0 5px #4CAF50;
}

.plate-hint {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.plate-item {
    font-size: 2.8rem;
    cursor: pointer;
    animation: plateItemPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes plateItemPop {
    0% {
        transform: scale(0) translateY(-20px);
    }

    100% {
        transform: scale(1) translateY(0);
    }
}

.serve-button {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border: none;
    padding: 15px 35px;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #5D4037;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 0 #E69500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.serve-button:active {
    transform: translateY(5px);
    box-shadow: 0 0 0 #E69500;
}

.bell-icon {
    font-size: 1.5rem;
}

/* Feedback */
.feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 20px 35px;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: bold;
    z-index: 500;
    animation: feedbackPop 0.3s ease-out;
}

.feedback.hidden {
    display: none;
}

@keyframes feedbackPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Kitchen Section */
.kitchen-section {
    background: linear-gradient(180deg, #5D4037 0%, #4E342E 100%);
    padding: 20px;
    border-radius: 25px 25px 0 0;
    flex-shrink: 0;
    z-index: 100;
}

.kitchen-tray {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.food-item {
    width: 75px;
    height: 85px;
    background: white;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: grab;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
    transition: transform 0.1s;
}

.food-item:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.food-icon {
    font-size: 2.3rem;
}

.food-name {
    font-size: 0.65rem;
    color: #666;
    margin-top: 3px;
}

/* Drag Proxy */
.drag-proxy {
    position: fixed;
    font-size: 3.5rem;
    pointer-events: none;
    z-index: 9999;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    transition: none;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Register Modal */
.register-modal {
    background: #FFF9C4;
    border-radius: 30px;
    padding: 30px;
    text-align: center;
    width: 90%;
    max-width: 340px;
    border: 8px solid #FBC02D;
    animation: modalPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.register-title {
    font-size: 1.5rem;
    color: #F57F17;
    margin-bottom: 20px;
}

.total-display {
    background: #37474F;
    color: #00E676;
    padding: 15px;
    border-radius: 10px;
    font-family: monospace;
    font-size: 1.8rem;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.total-label {
    font-size: 0.8rem;
    color: #90A4AE;
}

.total-unit {
    font-size: 1rem;
}

.coin-input-area {
    min-height: 60px;
    background: white;
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 3px dashed #FBC02D;
    overflow-x: auto;
}

.current-payment {
    display: flex;
    gap: 5px;
}

.payment-coin {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.6rem;
    font-weight: bold;
    color: white;
}

.coin-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.coin-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.1s;
}

.coin-btn:active {
    transform: scale(0.9);
}

.coin-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 4px 0 rgba(0,0,0,0.2);
}

.coin-100 {
    background: #B0BEC5;
    border: 4px solid #90A4AE;
}

.coin-10 {
    background: #A1887F;
    border: 4px solid #8D6E63;
}

.coin-500 {
    background: #FFD54F;
    border: 4px solid #FFC107;
    color: #5D4037;
}

.register-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-pay {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 4px 0 #2E7D32;
    cursor: pointer;
}

.btn-clear {
    background: #FF9800;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 4px 0 #E65100;
    cursor: pointer;
}

.btn-pay:active, .btn-clear:active {
    transform: translateY(4px);
    box-shadow: none;
}

.success-modal {
    background: white;
    border-radius: 30px;
    padding: 35px;
    text-align: center;
    animation: modalPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalPop {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

.eating-anim {
    font-size: 4rem;
    animation: eating 0.4s ease-in-out infinite;
}

@keyframes eating {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

.success-modal h2 {
    font-size: 1.5rem;
    color: #FF6B6B;
    margin: 15px 0;
}

.stars {
    font-size: 2rem;
    margin-bottom: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5A5A 100%);
    color: white;
    border: none;
    padding: 15px 35px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
}