:root {
    --bg: #fffbf0;
    --bg-soft: #fff5d6;
    --text: #3a2a07;
    --text-muted: #8a7340;
    --accent: #e6a300;
    --accent-soft: #ffe896;
    --border: #f0e0a8;
    --shadow: 0 6px 18px rgba(160, 110, 0, 0.12);
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter",
                 "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 100vh;
}

.page {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 18px 40px;
}

/* --- Hero --- */

.hero { text-align: center; margin-bottom: 18px; }
.title {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.tag { margin: 4px 0 0; color: var(--text-muted); font-style: italic; font-size: 14px; }

/* --- Banana card --- */

.banana-card {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px 18px;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.banana-emoji {
    font-size: 110px;
    line-height: 1;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: breathe 4s ease-in-out infinite;
    transform-origin: 50% 80%;
}

@keyframes breathe {
    0%, 100% { transform: rotate(-3deg) scale(1.0); }
    50%      { transform: rotate(3deg) scale(1.05); }
}

.banana-status {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    min-height: 20px;
}

.banana-progress {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}
.banana-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #cfe862 0%, #f9d423 30%, #e2861a 70%, #5a3a14 100%);
    transition: width 600ms ease;
    width: 0%;
}

.primary-btn {
    background: var(--accent);
    color: #1f1503;
    border: none;
    border-radius: 14px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 100ms ease, opacity 100ms ease;
    min-width: 200px;
}
.primary-btn:active { transform: scale(0.97); }
.primary-btn:disabled { opacity: 0.4; cursor: default; }

.link-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
    padding: 4px;
}

/* --- Stats --- */

.stats {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
}
.stat {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.stat-emoji { font-size: 16px; }
.stat-num { font-size: 18px; font-weight: 800; }
.stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* --- The bowl --- */

.bowl-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 0 4px 10px;
}
.bowl-title { font-size: 16px; font-weight: 800; }
.bowl-count { color: var(--text-muted); font-size: 12px; }

.bowl-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bowl-row {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    gap: 10px;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
}
.bowl-row.me {
    background: var(--accent-soft);
    border-color: var(--accent);
}
.bowl-row .emoji { font-size: 22px; text-align: center; }
.bowl-row .name { font-weight: 700; }
.bowl-row .meta { color: var(--text-muted); font-size: 12px; }
.bowl-row .age { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.empty { color: var(--text-muted); text-align: center; font-style: italic; padding: 16px; }

/* --- Footer --- */

.footer {
    text-align: center;
    padding: 18px 0 4px;
    color: var(--text-muted);
    font-size: 11px;
    opacity: 0.6;
}

/* --- Toast --- */

.toast {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: var(--bg);
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: var(--shadow);
    z-index: 1000;
    pointer-events: none;
}

/* Stage tints over the banana */
.stage-green   .banana-emoji { filter: hue-rotate(50deg) saturate(0.85); }
.stage-yellow  .banana-emoji { /* default */ }
.stage-spotted .banana-emoji { filter: brightness(0.92) saturate(1.05); }
.stage-brown   .banana-emoji { filter: brightness(0.55) saturate(0.6) sepia(0.5); }
.stage-compost .banana-emoji { filter: grayscale(0.7) brightness(0.8); animation-duration: 8s; }
