/* Меню */
.menu-btn {
    background: linear-gradient(to bottom, #f59e0b, #d97706);
    color: #1a1a1a;
    font-weight: bold;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 0 #92400e, 0 6px 10px rgba(0,0,0,0.3);
    transition: transform 0.1s;
    font-size: 1.1rem;
}
.menu-btn:hover { transform: translateY(-2px); }
.menu-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #92400e; }

/* Кухонные зоны */
.kitchen-zone {
    background: repeating-linear-gradient(
        45deg,
        rgba(255,255,255,0.03) 0px,
        rgba(255,255,255,0.03) 10px,
        rgba(0,0,0,0.05) 10px,
        rgba(0,0,0,0.05) 20px
    );
    border-top: 4px solid rgba(251, 191, 36, 0.4);
    overflow-y: auto;
}

.assemble-area {
    background: rgba(0,0,0,0.4);
    border: 2px dashed #fbbf24;
    border-radius: 12px;
    min-height: 60px;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
    align-items: center;
    justify-content: center;
}

.assemble-area .ing-chip {
    font-size: 2rem;
    animation: pop 0.2s;
}

.ingredients-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.ing-btn {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(251, 191, 36, 0.6);
    border-radius: 10px;
    padding: 8px 4px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.1s;
    position: relative;
}
.ing-btn:hover { transform: scale(1.05); background: rgba(255,255,255,0.2); }
.ing-btn:active { transform: scale(0.95); }
.ing-btn .ing-emoji { font-size: 2rem; display: block; }
.ing-btn .ing-count { font-size: 0.8rem; color: #fbbf24; }
.ing-btn.empty { opacity: 0.3; cursor: not-allowed; }

.action-btn {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 3px 0 rgba(0,0,0,0.4);
}
.action-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.4); }

/* Шаурмист */
.shaurmist-body {
    width: 140px;
    height: 180px;
    position: relative;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}
.shaurmist-hat {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
}
.shaurmist-face {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 4rem;
    background: #fbcd8f;
    border-radius: 50%;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #8b4513;
}
.shaurmist-stache {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    z-index: 2;
}
.shaurmist-belly {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 5rem;
}
.shaurmist-apron {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 100px;
    background: #5a5a5a;
    background-image:
        radial-gradient(circle at 30% 40%, rgba(139, 0, 0, 0.5) 0 8px, transparent 9px),
        radial-gradient(circle at 70% 60%, rgba(80, 40, 0, 0.6) 0 10px, transparent 11px),
        radial-gradient(circle at 50% 80%, rgba(0, 100, 0, 0.4) 0 6px, transparent 7px);
    border-radius: 10px 10px 30px 30px;
    z-index: -1;
}

.shaurmist-body.angry { animation: shake 0.4s; }
.shaurmist-body.hit { animation: hitSplash 0.5s; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px) rotate(-3deg); }
    75% { transform: translateX(8px) rotate(3deg); }
}
@keyframes hitSplash {
    0% { transform: scale(1); }
    50% { transform: scale(1.1) rotate(-5deg); filter: hue-rotate(90deg); }
    100% { transform: scale(1); }
}

.bubble {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: #c00;
    padding: 8px 14px;
    border-radius: 15px;
    font-weight: bold;
    white-space: nowrap;
    font-size: 0.9rem;
    animation: bubblePop 0.3s;
}
.bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: white;
    border-bottom: 0;
}

@keyframes bubblePop {
    from { transform: translateX(-50%) scale(0); }
    to { transform: translateX(-50%) scale(1); }
}
@keyframes pop {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* Конвейер */
.conveyor-item {
    position: absolute;
    bottom: 10px;
    font-size: 2.5rem;
    animation: slideRight 8s linear forwards;
}
.conveyor-item.from-p2 { animation: slideLeft 8s linear forwards; }

@keyframes slideRight {
    from { left: 0; }
    to { left: 100%; }
}
@keyframes slideLeft {
    from { right: 0; left: auto; }
    to { right: 100%; left: auto; }
}

/* Грязь */
.dirt-spot {
    position: absolute;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, #5c2c0d 0%, transparent 70%);
    opacity: 0.7;
    pointer-events: auto;
    cursor: pointer;
    border-radius: 50%;
}

/* Летящий помидор */
.flying-tomato {
    position: fixed;
    font-size: 2.5rem;
    z-index: 100;
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Уведомления */
.toast {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 12px 24px;
    border-radius: 20px;
    z-index: 1000;
    border: 2px solid #fbbf24;
    animation: toastIn 0.3s, toastOut 0.3s 1.7s forwards;
}
@keyframes toastIn { from { transform: translate(-50%, -30px); opacity: 0; } }
@keyframes toastOut { to { transform: translate(-50%, -30px); opacity: 0; } }

/* Order chip */
.order-chip {
    background: rgba(255,255,255,0.1);
    padding: 6px 10px;
    border-radius: 8px;
    display: flex;
    gap: 4px;
    align-items: center;
    border: 1px solid rgba(251, 191, 36, 0.5);
}
.order-chip.done { opacity: 0.4; text-decoration: line-through; }

/* Shop */
.shop-item {
    background: rgba(0,0,0,0.3);
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid transparent;
}
.shop-item:hover { border-color: #fbbf24; }
.shop-item .emoji { font-size: 2.5rem; }
.shop-item button {
    background: #fbbf24;
    color: #000;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: bold;
    margin-top: 6px;
    width: 100%;
}
.shop-item button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Punch animation */
.punched { animation: punched 0.5s; }
@keyframes punched {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-15px, 0) rotate(-5deg); filter: hue-rotate(60deg); }
    50% { transform: translate(15px, 5px) rotate(3deg); }
}

/* Themes (interior colors) */
body.theme-blue { background: linear-gradient(to bottom, #1e3a8a, #1e40af); }
body.theme-green { background: linear-gradient(to bottom, #14532d, #166534); }
body.theme-purple { background: linear-gradient(to bottom, #581c87, #6b21a8); }

/* Прячем кнопки/ингредиенты противника, чтобы человек не нажимал за бота/удалённого игрока */
body.mode-solo #zone2 .action-btn,
body.mode-solo #zone2 .ing-btn,
body.mode-host #zone2 .action-btn,
body.mode-host #zone2 .ing-btn,
body.mode-guest #zone1 .action-btn,
body.mode-guest #zone1 .ing-btn {
    pointer-events: none;
    opacity: 0.55;
    filter: grayscale(0.4);
}
body.mode-solo #zone2 .text-yellow-200::after { content: " 🤖"; }

/* Магазин: компактнее карточки на мобиле */
@media (max-width: 640px) {
    .shop-item { padding: 8px; }
    .shop-item .emoji { font-size: 2rem; }
}

/* Модалка магазина: фиксируем высоту по реальному viewport (учитывает мобильные тулбары) */
.shop-card {
    max-height: calc(100vh - 1rem);
    max-height: calc(100svh - 1rem);
    max-height: calc(100dvh - 1rem);
    margin: 0.5rem auto;
}
@media (min-width: 640px) {
    .shop-card {
        max-height: calc(100vh - 2rem);
        max-height: calc(100svh - 2rem);
        max-height: calc(100dvh - 2rem);
        margin: 1rem auto;
    }
}
.shop-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* === Twemoji local SVG render (для Win7/без emoji-шрифта) === */
img.tw-emoji {
    height: 1em;
    width: 1em;
    margin: 0 .05em 0 .1em;
    vertical-align: -0.1em;
    display: inline-block;
}
.ing-emoji img.tw-emoji,
.order-chip img.tw-emoji,
.ing-chip img.tw-emoji {
    height: 1.2em;
    width: 1.2em;
    vertical-align: -0.2em;
}
.shaurmist-hat img.tw-emoji,
.shaurmist-face img.tw-emoji,
.shaurmist-belly img.tw-emoji,
.shaurmist-stache img.tw-emoji {
    height: 1em;
    width: 1em;
    vertical-align: middle;
}
.shop-item .emoji img.tw-emoji {
    height: 2.4rem;
    width: 2.4rem;
}
h1 img.tw-emoji {
    height: 0.9em;
    width: 0.9em;
}
