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

:root {
    --bg: #1a1a2e;
    --surface: #16213e;
    --accent: #e94560;
    --text: #eee;
    --text-dim: #888;
    --gold: #f5c518;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

#app {
    max-width: 420px;
    margin: 0 auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* Top bar */
.top-bar {
    background: var(--surface);
    display: flex;
    align-items: center;
    border-bottom: 1px solid #ffffff10;
}

.global-banner {
    flex: 1;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.global-banner .gold {
    color: var(--gold);
    font-weight: 700;
}

.lang-btn {
    background: none;
    border: 1px solid #ffffff20;
    color: var(--text);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    margin-right: 10px;
    transition: background 0.2s;
}

.lang-btn:active {
    background: #ffffff10;
}

/* Main area */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 24px;
}

/* Khinkali */
.khinkali-zone {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.khinkali {
    position: relative;
    will-change: transform;
}

.khinkali:active {
    transform: scale(0.9);
}

.khinkali-body {
    width: 140px;
    height: 120px;
    background: linear-gradient(145deg, #f5e6d3, #e8d5b8);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: relative;
    box-shadow:
        0 8px 32px rgba(0,0,0,0.3),
        inset 0 -4px 8px rgba(0,0,0,0.1),
        inset 0 4px 8px rgba(255,255,255,0.2);
}

.khinkali-top {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 24px;
    background: linear-gradient(145deg, #e8d5b8, #d4c4a8);
    border-radius: 50% 50% 20% 20%;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.2);
}

.khinkali-top::before,
.khinkali-top::after {
    content: '';
    position: absolute;
    top: 4px;
    width: 8px;
    height: 16px;
    background: rgba(0,0,0,0.05);
    border-radius: 50%;
}

.khinkali-top::before { left: 4px; transform: rotate(-15deg); }
.khinkali-top::after { right: 4px; transform: rotate(15deg); }

/* Face */
.khinkali-face {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%);
    width: 80px;
    height: 50px;
}

.eyes {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 10px;
}

.eye {
    width: 10px;
    height: 10px;
    background: #4a3728;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s;
}

.eye::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
}

.mouth {
    width: 20px;
    height: 10px;
    margin: 0 auto;
    border-radius: 0 0 50% 50%;
    background: #4a3728;
    transition: all 0.3s;
}

/* Mood states */
.mood-happy .eye { height: 6px; border-radius: 50% 50% 0 0; }
.mood-happy .mouth { border-radius: 0 0 50% 50%; height: 8px; }

.mood-neutral .mouth { height: 3px; border-radius: 2px; width: 16px; }

.mood-worried .eye { height: 12px; }
.mood-worried .mouth { width: 14px; height: 8px; border-radius: 50%; background: none; border: 2px solid #4a3728; }

.mood-sad .eye {
    height: 10px;
    box-shadow: 0 12px 0 -4px rgba(100,150,255,0.5);
}
.mood-sad .mouth {
    width: 18px; height: 8px;
    border-radius: 50% 50% 0 0;
    transform: translateY(4px);
}

.mood-crying .eye {
    height: 4px;
    border-radius: 0 0 50% 50%;
    box-shadow: 0 8px 0 -2px rgba(100,150,255,0.7), 0 16px 0 -3px rgba(100,150,255,0.4);
}
.mood-crying .mouth {
    width: 24px; height: 12px;
    border-radius: 50%;
    background: #4a3728;
}

.mood-dead .eye {
    width: 14px; height: 14px;
    background: none;
    border: none;
}
.mood-dead .eye::after { display: none; }
.mood-dead .eye::before {
    content: '✕';
    font-size: 14px;
    color: #4a3728;
    position: absolute;
    top: -2px;
    left: 1px;
}
.mood-dead .mouth {
    width: 30px; height: 4px;
    border-radius: 2px;
    background: #4a3728;
    transform: rotate(-5deg);
}

.tap-hint {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: var(--text-dim);
    animation: pulse 2s ease-in-out infinite;
    white-space: nowrap;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Particles container — elements created/animated via JS */
.bite-particles {
    position: absolute;
    top: 50%;
    left: 50%;
    pointer-events: none;
}

/* Counter */
.counter {
    text-align: center;
}

.count-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.count-number {
    font-size: 72px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--gold), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.count-label {
    font-size: 16px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-top: 4px;
}

.mood-text {
    margin-top: 8px;
    font-size: 15px;
    color: var(--text-dim);
    font-style: italic;
    min-height: 20px;
}

/* Stats */
.stats {
    display: flex;
    gap: 16px;
    width: 100%;
    max-width: 320px;
}

.stat {
    flex: 1;
    background: var(--surface);
    border-radius: 16px;
    padding: 16px 8px;
    text-align: center;
    border: 1px solid #ffffff08;
}

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.stat-label {
    display: block;
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* Share button */
.share-btn {
    background: linear-gradient(135deg, #833ab4, #e94560, #f5c518);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(233, 69, 96, 0.3);
}

.share-btn:active {
    transform: scale(0.95);
}

/* Actions row */
.actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

/* Undo button */
.undo-btn {
    background: none;
    color: var(--text-dim);
    border: 1px solid #ffffff15;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.undo-btn:active {
    color: var(--accent);
}

/* Install button */
.install-btn {
    background: var(--surface);
    color: var(--text);
    border: 1px solid #ffffff15;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
}

.install-btn:active {
    transform: scale(0.95);
}

/* Install hint overlay */
.install-hint {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.install-hint-content {
    background: var(--surface);
    border-radius: 20px;
    padding: 24px;
    max-width: 300px;
    text-align: center;
    border: 1px solid #ffffff15;
}

.install-hint-content p {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.install-hint-close {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 32px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

/* Wobble/particles/+1 animations handled via Web Animations API in app.js */
