/* QRBAK menu — "Rossa" (classic) theme and the structural base every theme builds on.
   The light look is a faithful port of the original QRBAK menu. */

@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('/static/fonts/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('/static/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('/static/fonts/plus-jakarta-sans-cyrillic-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('/static/fonts/plus-jakarta-sans-vietnamese-wght-normal.woff2') format('woff2');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }

:root {
    --primary: #EF3B36;
    --primary-light: color-mix(in srgb, var(--primary) 10%, white);
    --bg-color: #F8F9FA;
    --card-bg: #FFFFFF;
    --text-dark: #1A1A1A;
    --text-gray: #757575;
    --text-light: #A0A0A0;
    --border-color: #F0F0F0;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 8px 24px color-mix(in srgb, var(--primary) 15%, transparent);
    --page-bg: #E2E8F0;
    --pressed-bg: #E2E8F0;
    --glass: rgba(255, 255, 255, 0.85);
    --glass-strong: rgba(255, 255, 255, 0.9);
    --overlay: rgba(0, 0, 0, 0.4);
    --kcal-bg: #F4F8F6;
    --kcal-text: #629680;
    --kcal-border: #CDE0D7;
    --btn-bg: #1A1A1A;
    --btn-text: #FFFFFF;
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Helvetica Neue', Arial, sans-serif;
    color-scheme: light;
}

/* Dark palette: chosen by the guest, or by the device when mode is "auto". */
html[data-mode="dark"] {
    --primary-light: color-mix(in srgb, var(--primary) 22%, #1C1F24);
    --bg-color: #121417;
    --card-bg: #1C1F24;
    --text-dark: #F3F4F6;
    --text-gray: #A7ADB6;
    --text-light: #7C838D;
    --border-color: #2A2E35;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
    --page-bg: #0B0D10;
    --pressed-bg: #2A2E35;
    --glass: rgba(28, 31, 36, 0.85);
    --glass-strong: rgba(28, 31, 36, 0.9);
    --overlay: rgba(0, 0, 0, 0.6);
    --kcal-bg: #1B2622;
    --kcal-text: #7FB89E;
    --kcal-border: #2C4038;
    --btn-bg: #F3F4F6;
    --btn-text: #121417;
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    html[data-mode="auto"] {
        --primary-light: color-mix(in srgb, var(--primary) 22%, #1C1F24);
        --bg-color: #121417;
        --card-bg: #1C1F24;
        --text-dark: #F3F4F6;
        --text-gray: #A7ADB6;
        --text-light: #7C838D;
        --border-color: #2A2E35;
        --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
        --page-bg: #0B0D10;
        --pressed-bg: #2A2E35;
        --glass: rgba(28, 31, 36, 0.85);
        --glass-strong: rgba(28, 31, 36, 0.9);
        --overlay: rgba(0, 0, 0, 0.6);
        --kcal-bg: #1B2622;
        --kcal-text: #7FB89E;
        --kcal-border: #2C4038;
        --btn-bg: #F3F4F6;
        --btn-text: #121417;
        color-scheme: dark;
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--font); -webkit-tap-highlight-color: transparent; }

body {
    background-color: var(--page-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Mobil Cihaz Konteyneri */
.app-container {
    width: 100%;
    max-width: 414px;
    height: 100vh;
    height: 100dvh; /* Safari mobil için dinamik yükseklik */
    max-height: 896px;
    background-color: var(--bg-color);
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Inside the website's phone mockup (?frame=phone on the showcase menu or a preview): the header grows by a
   status bar's height (a transparent top border, so the header's own colour runs up behind it, as on a real
   phone) and a status bar is drawn in --status-ink (the theme's text colour unless the theme sets it), so the
   camera never sits on the menu. */
html[data-frame="phone"] .header { border-top: 46px solid transparent; }
html[data-frame="phone"] .app-container::before {
    content: '9:41'; position: absolute; top: 16px; left: 0; z-index: 30; width: 124px;
    text-align: center; direction: ltr; pointer-events: none;
    font: 600 16px/1 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; letter-spacing: -0.01em; color: var(--status-ink, var(--text-dark));
}
html[data-frame="phone"] body::after {
    content: ''; position: fixed; top: 17px; right: 28px; z-index: 30; width: 68px; height: 13px; pointer-events: none;
    background: var(--status-ink, var(--text-dark));
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='68' height='13' viewBox='0 0 68 13'%3E%3Cg fill='%23000'%3E%3Crect x='0' y='8' width='3' height='4' rx='.8'/%3E%3Crect x='4.6' y='6' width='3' height='6' rx='.8'/%3E%3Crect x='9.2' y='3.5' width='3' height='8.5' rx='.8'/%3E%3Crect x='13.8' y='1' width='3' height='11' rx='.8'/%3E%3Cpath d='M30 2.6a10.6 10.6 0 0 1 7.4 3l1.2-1.3A12.4 12.4 0 0 0 30 .8a12.4 12.4 0 0 0-8.6 3.5l1.2 1.3a10.6 10.6 0 0 1 7.4-3zm0 3.6a6.9 6.9 0 0 1 4.8 1.9L36 6.8a8.7 8.7 0 0 0-12 0l1.2 1.3A6.9 6.9 0 0 1 30 6.2zm0 3.5a3.3 3.3 0 0 1 2.2.9L30 12.9l-2.2-2.3a3.3 3.3 0 0 1 2.2-.9z'/%3E%3Crect x='42.5' y='.5' width='22' height='12' rx='3.6' fill='none' stroke='%23000' stroke-opacity='.4'/%3E%3Crect x='44.5' y='2.5' width='18' height='8' rx='2'/%3E%3Cpath d='M66 4.5v4a2 2 0 0 0 0-4z' fill-opacity='.45'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / contain; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='68' height='13' viewBox='0 0 68 13'%3E%3Cg fill='%23000'%3E%3Crect x='0' y='8' width='3' height='4' rx='.8'/%3E%3Crect x='4.6' y='6' width='3' height='6' rx='.8'/%3E%3Crect x='9.2' y='3.5' width='3' height='8.5' rx='.8'/%3E%3Crect x='13.8' y='1' width='3' height='11' rx='.8'/%3E%3Cpath d='M30 2.6a10.6 10.6 0 0 1 7.4 3l1.2-1.3A12.4 12.4 0 0 0 30 .8a12.4 12.4 0 0 0-8.6 3.5l1.2 1.3a10.6 10.6 0 0 1 7.4-3zm0 3.6a6.9 6.9 0 0 1 4.8 1.9L36 6.8a8.7 8.7 0 0 0-12 0l1.2 1.3A6.9 6.9 0 0 1 30 6.2zm0 3.5a3.3 3.3 0 0 1 2.2.9L30 12.9l-2.2-2.3a3.3 3.3 0 0 1 2.2-.9z'/%3E%3Crect x='42.5' y='.5' width='22' height='12' rx='3.6' fill='none' stroke='%23000' stroke-opacity='.4'/%3E%3Crect x='44.5' y='2.5' width='18' height='8' rx='2'/%3E%3Cpath d='M66 4.5v4a2 2 0 0 0 0-4z' fill-opacity='.45'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / contain;
}

/* --- HEADER & ARAMA --- */
.header {
    background-color: var(--card-bg);
    padding: 24px 20px 16px;
    padding-top: max(24px, env(safe-area-inset-top));
    border-bottom: 1px solid var(--border-color);
    z-index: 10;
}

.top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.user-info { min-width: 0; }
.user-info .welcome { font-size: 0.85rem; color: var(--text-gray); font-weight: 500; }
.user-info .store-name { font-size: 1.1rem; color: var(--text-dark); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-logo { height: 40px; max-width: 190px; object-fit: contain; display: block; }

.table-badge {
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    max-width: 100%;
    transition: transform 0.15s ease;
}
.table-badge span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-badge svg { flex-shrink: 0; }
.table-badge:active { transform: scale(0.96); }
.table-badge.pulse { animation: badgePulse 1.2s ease 2; }
@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 35%, transparent); }
    50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--primary) 0%, transparent); }
}

.search-area {
    display: flex;
    gap: 12px;
}

.search-box {
    flex: 1;
    background-color: var(--bg-color);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    cursor: text;
}
.search-box:focus-within { border-color: var(--primary); background-color: var(--card-bg); box-shadow: var(--shadow-sm); }
.search-box input { border: none; background: transparent; width: 100%; font-size: 0.9rem; outline: none; color: var(--text-dark); -webkit-appearance: none; appearance: none; }
.search-box input::placeholder { color: var(--text-light); }
.search-box input::-webkit-search-cancel-button { display: none; }

.filter-btn {
    background-color: var(--bg-color);
    border: none;
    border-radius: 14px;
    width: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
}
.filter-btn:active { transform: scale(0.95); background-color: var(--pressed-bg); }
.filter-btn.has-filter::after { content: ''; position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); border: 2px solid var(--bg-color); }

/* --- ANA İÇERİK ALANI --- */
.content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Sol Menü (Kategoriler) */
.sidebar {
    width: 85px;
    flex-shrink: 0;
    background-color: var(--card-bg);
    padding: 16px 0;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.category {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 0;
    cursor: pointer;
    position: relative;
    outline: none;
}

/* Fotoğraflı Kategori İkonu Yapısı */
.cat-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    border: 2px solid transparent; /* Varsayılan çerçeve gizli */
    padding: 2px; /* Aktif olduğunda çerçevenin fotoğrafı ezmemesi için boşluk */
}

.cat-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}
.cat-letter { font-size: 0.95rem; font-weight: 800; color: var(--text-gray); }

.cat-name { font-size: 0.7rem; color: var(--text-gray); font-weight: 600; text-align: center; padding: 0 4px; overflow-wrap: anywhere; }

/* Aktif Kategori Stilleri (Fotoğrafa Çerçeve) */
.category.active .cat-icon {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    background-color: var(--card-bg);
}
.category.active .cat-name { color: var(--text-dark); font-weight: 700; }

/* Aktif Kategori İşaretçisi */
.category.active::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background-color: var(--primary);
    border-radius: 0 4px 4px 0;
}
[dir="rtl"] .category.active::before { border-radius: 4px 0 0 4px; }
[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid var(--border-color); }

/* Sağ Alan (Ürünler) */
.menu-grid {
    flex: 1;
    min-width: 0;
    padding: 16px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    align-content: flex-start;
    background-color: var(--bg-color);
    scrollbar-width: none;
    overscroll-behavior: contain;
}
.menu-grid::-webkit-scrollbar { display: none; }

/* Ürün Kartı */
.product-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 10px;
    box-shadow: var(--shadow-sm);
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Metinlerin kartı yatayda taşırmasını engeller */
    cursor: pointer;
}

.img-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 12px;
    background-color: var(--bg-color);
}

.product-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-light); background: var(--bg-color); }

.badge {
    position: absolute;
    top: 8px;
    inset-inline-start: 8px;
    background: var(--glass);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    max-width: calc(100% - 16px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-info { display: flex; flex-direction: column; flex: 1; }

.product-title { font-size: 0.85rem; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-desc { font-size: 0.65rem; color: var(--text-light); margin-bottom: 12px; overflow: hidden; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-desc:empty { display: none; }

/* The facts on a card stay on one line: the template keeps at most two allergen icons next to the calories
   (three without) and adds "+N", menu.js moves icons that do not fit on a narrow card into that count, and
   the calorie chip only gives way as a last resort. The product sheet lists everything. */
.product-meta { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; flex-wrap: nowrap; min-width: 0; }
.product-meta:empty { display: none; }
.product-meta > * { flex-shrink: 0; }
.product-meta > .kcal-chip { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.meta-more { font-size: 0.7rem; font-weight: 700; line-height: 1; white-space: nowrap; color: var(--text-light); font-variant-numeric: tabular-nums; }
.kcal-chip { font-size: 0.65rem; background-color: var(--kcal-bg); color: var(--kcal-text); padding: 2px 6px; border-radius: 12px; border: 1px solid var(--kcal-border); font-weight: 700; white-space: nowrap; }

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.price { font-size: 0.95rem; font-weight: 800; color: var(--primary); }

.cat-heading { display: none; grid-column: 1 / -1; font-size: 0.95rem; font-weight: 800; color: var(--text-dark); } /* themes may show section titles */
.tagline { display: none; font-size: 0.72rem; color: var(--text-gray); font-weight: 500; margin-top: 2px; } /* themes may show the tagline */
.no-results { grid-column: 1 / -1; padding: 48px 16px; text-align: center; color: var(--text-light); font-size: 0.85rem; font-weight: 600; }

.menu-footnote { grid-column: 1 / -1; padding: 16px 0 24px; text-align: center; color: var(--text-light); font-size: 0.65rem; line-height: 1.4; }
.footnote-text { white-space: pre-line; }
.footnote-tools { margin-top: 12px; display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.link-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 0.68rem; font-weight: 600; color: var(--text-gray); padding: 4px 2px; }
.link-btn svg { flex-shrink: 0; }

/* --- QRBAK banner (ad slot under menus that are not on Pro) --- */
.qb-banner {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 7px 14px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.72rem;
    line-height: 1.25;
    z-index: 15;
}
.qb-banner-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--text-dark); color: var(--card-bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qb-banner-img { height: 30px; width: auto; max-width: 84px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.qb-banner-text { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text-gray); font-weight: 500; }
.qb-banner-text strong { color: var(--text-dark); font-weight: 700; }
.qb-banner-cta { flex-shrink: 0; background: var(--primary-light); color: var(--primary); font-weight: 700; padding: 6px 12px; border-radius: 16px; font-size: 0.7rem; white-space: nowrap; }

/* --- ALT NAVİGASYON (BOTTOM BAR) --- */
.bottom-nav {
    flex-shrink: 0;
    width: 100%;
    height: calc(70px + env(safe-area-inset-bottom));
    padding: 0 10px env(safe-area-inset-bottom);
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.03);
    z-index: 20;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-light);
    cursor: pointer;
    position: relative;
    flex: 1;
    min-width: 0;
    text-align: center;
}

.nav-item svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: 0.3s; }
.nav-item span { font-size: 0.65rem; font-weight: 600; transition: 0.3s; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }

.nav-item.active { color: var(--primary); }
.nav-item.active svg { fill: var(--primary-light); }
button.nav-item:active { transform: scale(0.95); color: var(--primary); }

/* --- PRODUCT MODAL --- */
.product-modal {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 100;
    display: none;
    flex-direction: column;
    justify-content: flex-end;
}
.product-modal.active { display: flex; }

.modal-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--overlay);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 101;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    position: relative;
    z-index: 102;
    background: var(--card-bg);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 25px rgba(0,0,0,0.1);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex; flex-direction: column;
    max-height: 90%;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom);
}
.modal-content.sheet { padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.close-modal {
    position: absolute;
    top: 16px; inset-inline-end: 16px;
    background: var(--glass-strong);
    color: var(--text-dark);
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; z-index: 10;
    box-shadow: var(--shadow-sm);
}

.modal-img-container {
    width: 100%;
    aspect-ratio: 16/10;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-color);
}
.modal-img-container img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.modal-img-container.no-img { display: none; }

.modal-body {
    padding: 24px 20px;
    display: flex; flex-direction: column;
}
.no-img + .modal-body { padding-top: 28px; padding-inline-end: 60px; }

.modal-title {
    font-size: 1.2rem; font-weight: 800;
    color: var(--text-dark); margin-bottom: 8px;
}
.sheet-title { margin-bottom: 20px; padding-inline-end: 44px; }

.modal-desc {
    font-size: 0.85rem; color: var(--text-gray);
    line-height: 1.5; margin-bottom: 16px;
    white-space: pre-line;
}

.modal-allergens { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }

.modal-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 20px; padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.modal-price {
    font-size: 1.4rem; font-weight: 800; color: var(--primary);
}

.modal-add-btn {
    background: var(--btn-bg); color: var(--btn-text);
    padding: 12px 24px; border: none; border-radius: 14px;
    font-size: 0.95rem; font-weight: 700; cursor: pointer;
    transition: 0.2s;
}
.modal-add-btn:active {
    transform: scale(0.95); background: var(--primary); color: #fff;
}
.sheet-apply { width: 100%; }

/* --- ALLERGEN BADGES --- */
.allergen-badge {
    background: #fef3c7;
    color: #d97706;
    padding: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid #fde68a;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}
.allergen-badge svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}
.allergen-text { display: none; }

.modal-allergens .allergen-badge {
    width: auto;
    height: auto;
    padding: 4px 10px;
    border-radius: 12px;
}
.modal-allergens .allergen-text {
    display: inline-block;
    margin-inline-start: 4px;
    font-size: 0.65rem;
    font-weight: 700;
}

/* --- SHEETS (filter, table) --- */
.sheet-section { margin-bottom: 20px; }
.sheet-section:last-of-type { margin-bottom: 24px; }
.sheet-label { font-size: 0.85rem; color: var(--text-dark); margin-bottom: 10px; font-weight: 700; }
.sheet-hint { font-size: 0.8rem; color: var(--text-gray); margin: -12px 0 16px; line-height: 1.45; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- FILTER CHIPS --- */
.filter-chip {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-gray);
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
}
.filter-chip svg {
    width: 16px;
    height: 16px;
    margin-inline-end: 6px;
    flex-shrink: 0;
}
.filter-chip.active {
    border-color: var(--primary) !important;
    background: var(--primary) !important;
    color: white !important;
}

/* Table picker */
.table-search { margin-bottom: 16px; padding: 10px 14px; }
.table-zones { overflow-y: auto; margin: 0 -4px; padding: 0 4px 4px; }
.table-zone + .table-zone { margin-top: 18px; }
.table-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.table-chip { justify-content: center; text-align: center; padding: 12px 8px; border-radius: 14px; font-size: 0.8rem; font-weight: 700; color: var(--text-dark); min-width: 0; overflow-wrap: anywhere; }
.table-chip:active { transform: scale(0.96); }

/* Appearance & language */
.pref-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 20px; padding: 3px; }
.seg-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 16px; font-size: 0.72rem; font-weight: 600; color: var(--text-gray); }
.seg-btn.active { background: var(--card-bg); color: var(--text-dark); box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
.lang-pick { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 20px; border: 1px solid var(--border-color); background: var(--bg-color); color: var(--text-gray); }
.lang-pick select { border: none; background: transparent; font-size: 0.75rem; font-weight: 600; color: var(--text-dark); outline: none; max-width: 150px; }

/* --- TOAST NOTIFICATION --- */
.toast-notification {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--btn-bg);
    color: var(--btn-text);
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 200;
    white-space: nowrap;
    max-width: calc(100% - 32px);
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- DIALOG (confirmations and results) --- */
.qb-dialog { position: absolute; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 24px; }
.qb-dialog-backdrop { position: absolute; inset: 0; background: var(--overlay); animation: fadeIn 0.15s ease; }
.qb-dialog-card { position: relative; width: 100%; max-width: 340px; background: var(--card-bg); border-radius: 24px; padding: 28px 22px 22px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.25); animation: dialogIn 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes dialogIn { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.qb-dialog-icon { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; border: 3px solid currentColor; font-size: 1.9rem; font-weight: 700; line-height: 1; }
.qb-dialog-icon.question { color: #87adbd; }
.qb-dialog-icon.success { color: #10b981; }
.qb-dialog-icon.warning { color: #f8bb86; }
.qb-dialog-icon.info { color: #3fc3ee; }
.qb-dialog-icon.error { color: #f27474; }
.qb-dialog-title { font-size: 1.25rem; font-weight: 800; color: var(--text-dark); margin-bottom: 8px; }
.qb-dialog-text { font-size: 0.9rem; font-weight: 500; color: var(--text-gray); line-height: 1.5; }
.qb-dialog-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.qb-dialog-btn { border-radius: 12px; font-weight: 700; padding: 12px 24px; font-size: 0.9rem; color: #fff; background: var(--primary); min-width: 110px; }
.qb-dialog-btn.confirm { background: #10b981; }
.qb-dialog-btn.cancel { background: #d1d5db; color: #374151; }
.qb-dialog-btn:active { transform: scale(0.97); }

/* The venue is closed to guest requests (owner's switch): the menu stays readable. */
.closed-ribbon { flex-shrink: 0; position: relative; z-index: 31; background: #B91C1C; color: #fff; font-size: 0.75rem; line-height: 1.35; text-align: center; padding: 7px 14px; text-wrap: balance; }
.closed-ribbon b { display: block; font-size: 0.8125rem; font-weight: 700; }
.closed-ribbon span { opacity: 0.92; }
.preview-ribbon { flex-shrink: 0; background: #111827; color: #fff; font-size: 0.68rem; font-weight: 600; text-align: center; padding: 5px 10px; letter-spacing: 0.01em; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* --- CURRENCY SWITCHER, BASKET AND ORDERS --- */
/* One line: menu button, venue name, currency, table. When space runs short the name gives way
   (it wraps or ends in "…") and the buttons tighten; nothing covers the name or leaves the screen. */
.top-row { flex-wrap: nowrap; }
.top-row .user-info { flex: 1 1 0%; min-width: 0; }
.top-row .user-info .welcome { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the name takes a second line before it is cut (themes set their own) */
.top-row .user-info .store-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; }
.top-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; flex: 0 0 auto; max-width: 68%; min-width: 0; margin-inline-start: auto; justify-content: flex-end; }
/* the themes' "44%" was meant for the whole row; inside this group the group itself is the limit */
.top-row .top-actions .table-badge { flex-shrink: 1; min-width: 0; max-width: 100%; }
.cur-pick { display: inline-flex; align-items: center; border-radius: 20px; border: 1px solid var(--border-color); background: var(--bg-color); padding: 0 4px; flex-shrink: 0; }
.cur-pick select { border: none; background: transparent; font: inherit; font-size: 0.78rem; font-weight: 700; color: var(--text-dark); padding: 7px 6px; outline: none; max-width: 96px; }
.rate-note { margin-top: 6px; }

.price-row { gap: 8px; }
.add-btn {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary); color: #fff; box-shadow: var(--shadow-md);
    transition: transform 0.15s ease;
}
.add-btn:active { transform: scale(0.88); }

.basket-bar {
    flex-shrink: 0; display: flex; align-items: center; gap: 10px;
    margin: 0 12px 10px; padding: 12px 16px; border-radius: 16px;
    background: var(--btn-bg); color: var(--btn-text);
    font-size: 0.88rem; font-weight: 700; text-align: start;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18); z-index: 15;
}
.basket-bar.bump { animation: basketBump 0.35s ease; }
@keyframes basketBump { 40% { transform: scale(1.04); } }
.basket-count { min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 0.8rem; }
.basket-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.basket-total { white-space: nowrap; }
.order-bar { background: var(--card-bg); color: var(--text-dark); border: 1px solid var(--border-color); }
.order-dot { width: 10px; height: 10px; border-radius: 50%; background: #F59E0B; flex-shrink: 0; animation: orderPulse 1.6s ease infinite; }
.order-bar.st-accepted .order-dot, .order-bar.st-ready .order-dot, .order-bar.st-out .order-dot { background: #10B981; }
@keyframes orderPulse { 50% { opacity: 0.35; } }

.basket-list { list-style: none; margin: 0 0 12px; padding: 0; }
.basket-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-color); font-size: 0.85rem; color: var(--text-dark); }
.bl-name { flex: 1; min-width: 0; font-weight: 600; }
.bl-price { font-weight: 700; white-space: nowrap; min-width: 64px; text-align: end; }
.qty { display: inline-flex; align-items: center; gap: 2px; background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 18px; padding: 2px; }
.qty button { width: 28px; height: 28px; border-radius: 50%; font-size: 1rem; font-weight: 700; color: var(--text-dark); }
.qty button:active { background: var(--pressed-bg); }
.qty-n { min-width: 20px; text-align: center; font-weight: 700; font-size: 0.85rem; }
.basket-empty { margin: 0; }

.order-form { display: flex; flex-direction: column; gap: 12px; }
.order-kind { display: flex; width: 100%; }
.order-kind .seg-btn { flex: 1; justify-content: center; font-size: 0.8rem; padding: 9px 10px; }
.order-kind .seg-btn.active { background: var(--primary); color: #fff; }
.basket-bar:not([hidden]) ~ .toast-notification { bottom: 150px; }
.order-part { display: flex; flex-direction: column; gap: 12px; }
.order-part[hidden] { display: none; }
.order-field { display: flex; flex-direction: column; gap: 6px; font-size: 0.75rem; font-weight: 700; color: var(--text-gray); }
.order-field input, .order-field textarea, .order-field select {
    font: inherit; font-size: 0.92rem; font-weight: 500; color: var(--text-dark);
    background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 12px;
    padding: 11px 12px; width: 100%; outline: none; resize: vertical;
}
.order-field input:focus, .order-field textarea:focus, .order-field select:focus { border-color: var(--primary); }
.order-table { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 12px 14px; border-radius: 12px; background: var(--primary-light); color: var(--primary); font-weight: 700; font-size: 0.88rem; }
.order-info { margin: 0; }
.ts-box:empty { display: none; }
.basket-sum { border-top: 1px solid var(--border-color); padding-top: 10px; margin-bottom: 4px; }
.sum-row { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--text-gray); padding: 3px 0; }
.sum-row[hidden] { display: none; }
.sum-row.total { font-size: 1.05rem; font-weight: 800; color: var(--text-dark); }
.sum-approx { font-size: 0.75rem; color: var(--text-gray); text-align: end; }
.modal-add-btn.ghost { background: transparent; color: var(--text-gray); border: 1px solid var(--border-color); margin-bottom: 8px; }
.order-state { padding: 14px 16px; border-radius: 14px; font-weight: 700; font-size: 0.92rem; margin-bottom: 14px; background: #FEF3C7; color: #92400E; }
.order-state.st-accepted, .order-state.st-ready, .order-state.st-out { background: #D1FAE5; color: #065F46; }
.order-state.st-done { background: var(--bg-color); color: var(--text-dark); }
.order-state.st-rejected, .order-state.st-cancelled { background: #FEE2E2; color: #991B1B; }

/* --- MENU BUTTON: left of the venue name, opens the venue drawer --- */
.menu-burger {
    flex-shrink: 0; display: inline-grid; place-items: center; width: 40px; height: 40px; margin-inline-end: -2px;
    border-radius: 50%; border: 1px solid var(--border-color); background: var(--bg-color); color: var(--text-dark);
    transition: transform 0.15s ease, background-color 0.15s ease;
}
.menu-burger:active { transform: scale(0.94); }

/* --- VENUE DRAWER: a liquid-glass panel sliding in from the start edge --- */
.drawer-scrim {
    position: fixed; inset: 0; z-index: 900; background: rgb(0 0 0 / 0.32);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    opacity: 0; transition: opacity 0.35s ease;
}
.drawer-scrim.open { opacity: 1; }
.venue-drawer {
    --glass-edge: rgb(255 255 255 / 0.22);
    position: fixed; z-index: 901; inset-block: 10px; inset-inline-start: 10px;
    width: min(340px, calc(100vw - 44px)); overflow-y: auto; overscroll-behavior: contain;
    display: flex; flex-direction: column; gap: 18px;
    padding: 16px 14px calc(18px + env(safe-area-inset-bottom));
    border-radius: 28px; border: 1px solid var(--glass-edge);
    background:
        linear-gradient(150deg, rgb(255 255 255 / 0.20), rgb(255 255 255 / 0.04) 38%, rgb(255 255 255 / 0) 60%),
        color-mix(in srgb, var(--card-bg) 70%, transparent);
    -webkit-backdrop-filter: blur(28px) saturate(1.8); backdrop-filter: blur(28px) saturate(1.8);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35), inset 0 -1px 0 rgb(255 255 255 / 0.06), 0 30px 80px -24px rgb(0 0 0 / 0.5);
    color: var(--text-dark);
    transform: translateX(calc(-100% - 24px)); transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.25, 1);
}
[dir="rtl"] .venue-drawer { transform: translateX(calc(100% + 24px)); }
.venue-drawer.open { transform: none; }
.dr-head { display: flex; align-items: center; gap: 12px; padding: 2px 2px 0; }
.dr-logo { width: 52px; height: 52px; flex-shrink: 0; border-radius: 16px; object-fit: contain; background: var(--bg-color); border: 1px solid var(--border-color); }
.dr-initials { display: grid; place-items: center; background: var(--primary); border-color: transparent; color: #fff; font-weight: 800; font-size: 1.05rem; }
.dr-title { min-width: 0; flex: 1; }
.dr-name { font-size: 1.15rem; font-weight: 800; line-height: 1.2; color: var(--text-dark); overflow-wrap: anywhere; }
.dr-tag { margin-top: 2px; font-size: 0.8rem; color: var(--text-gray); }
.dr-x { flex-shrink: 0; align-self: flex-start; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--text-gray); background: color-mix(in srgb, var(--text-dark) 6%, transparent); }
.dr-rows { list-style: none; margin: 0; padding: 4px; display: grid; gap: 2px; border-radius: 20px; background: color-mix(in srgb, var(--card-bg) 55%, transparent); border: 1px solid var(--glass-edge); }
.dr-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; color: var(--text-dark); text-decoration: none; }
a.dr-row:active { background: color-mix(in srgb, var(--text-dark) 7%, transparent); }
.dr-row > .ic:last-child { flex-shrink: 0; color: var(--text-light); }
.dr-ico { flex-shrink: 0; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; color: var(--primary); background: color-mix(in srgb, var(--primary) 13%, transparent); }
.dr-txt { min-width: 0; flex: 1; display: grid; gap: 1px; font-size: 0.9rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.dr-txt small { font-size: 0.7rem; font-weight: 600; color: var(--text-gray); }
.dr-pass { margin-top: 3px; font-weight: 500; }
.dr-pass code { font: 600 0.85rem ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-dark); }
.dr-copy { flex-shrink: 0; padding: 7px 12px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; color: var(--primary); background: color-mix(in srgb, var(--primary) 13%, transparent); }
.dr-block { display: grid; gap: 8px; }
.dr-label { padding-inline: 4px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; color: var(--text-gray); }
.dr-socials { display: flex; flex-wrap: wrap; gap: 8px; }
.soc {
    display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--glass-edge); color: var(--text-dark);
    background: color-mix(in srgb, var(--card-bg) 55%, transparent);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25);
    transition: transform 0.15s ease, color 0.15s ease;
}
.soc:hover { color: var(--primary); }
.soc:active { transform: scale(0.92); }
.dr-seg { display: flex; border-radius: 999px; }
.dr-seg .seg-btn { flex: 1; justify-content: center; border-radius: 999px; padding: 9px 8px; font-size: 0.78rem; }
.dr-lang { display: flex; padding: 10px 14px; border-radius: 999px; }
.dr-lang select { flex: 1; max-width: none; font-size: 0.85rem; appearance: none; -webkit-appearance: none; }
.dr-lang .ic { color: var(--text-gray); }
@media (prefers-reduced-motion: reduce) { .venue-drawer, .drawer-scrim { transition: none; } }
/* square-cornered themes keep their corners */
[data-theme="noir"] .menu-burger, [data-theme="noir"] .cur-pick, [data-theme="noir"] .soc { border-radius: 2px; }
[data-theme="noir"] .venue-drawer { border-radius: 4px; } [data-theme="noir"] .dr-rows, [data-theme="noir"] .dr-row, [data-theme="noir"] .dr-ico, [data-theme="noir"] .dr-logo { border-radius: 2px; }
[data-theme="sumi"] .menu-burger, [data-theme="sumi"] .cur-pick, [data-theme="sumi"] .soc { border-radius: 0; }
[data-theme="sumi"] .venue-drawer, [data-theme="sumi"] .dr-rows, [data-theme="sumi"] .dr-row, [data-theme="sumi"] .dr-ico, [data-theme="sumi"] .dr-logo { border-radius: 0; }
[data-theme="smash"] .menu-burger { border: 2.5px solid var(--s-line); border-radius: 12px; background: var(--card-bg); }

/* phones: tighter buttons so the header stays on one line */
@media (max-width: 440px) {
    .top-row { gap: 10px; }
    .menu-burger { width: 38px; height: 38px; }
    .top-actions { gap: 6px; }
    .cur-pick { padding: 0 2px; }
    .cur-pick select { padding: 6px 3px; font-size: 0.74rem; }
    .top-row .top-actions .table-badge { padding-inline: 11px; gap: 5px; font-size: 0.8rem; }
}
@media (max-width: 380px) {
    .top-row .top-actions .table-badge svg { display: none; }
    .top-row .top-actions .table-badge { padding-inline: 12px; }
}

/* --- RESERVATIONS: a row in the venue drawer that opens the reservation sheet --- */
.dr-cta {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: start;
    border-radius: 20px; border: 1px solid var(--glass-edge); color: var(--text-dark);
    background: color-mix(in srgb, var(--primary) 10%, color-mix(in srgb, var(--card-bg) 55%, transparent));
    transition: transform 0.15s ease;
}
.dr-cta:active { transform: scale(0.98); }
.dr-cta .dr-ico { background: var(--primary); color: #fff; }
.dr-cta > .ic:last-child { flex-shrink: 0; color: var(--text-light); }
[dir="rtl"] .dr-cta > .ic:last-child { transform: scaleX(-1); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-pair > .order-field:only-child { grid-column: 1 / -1; }
.field-pair .order-field { min-width: 0; }
.order-field input[type="date"] { min-height: 45px; -webkit-appearance: none; appearance: none; }
.res-note { white-space: pre-line; }
.res-wait { text-align: center; }
.res-facts { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; margin: 0 0 18px; font-size: 0.9rem; }
.res-facts dt { color: var(--text-gray); font-weight: 600; }
.res-facts dd { margin: 0; font-weight: 700; color: var(--text-dark); text-align: end; overflow-wrap: anywhere; }

/* --- FEEDBACK: stars and a comment at the bottom of the venue drawer --- */
.dr-fb { padding: 14px; border-radius: 20px; border: 1px solid var(--glass-edge); background: color-mix(in srgb, var(--card-bg) 55%, transparent); }
.dr-fb .dr-label { padding: 0; font-size: 0.86rem; color: var(--text-dark); text-align: center; }
.fb-form, .fb-more { display: grid; gap: 10px; }
.fb-stars { display: flex; justify-content: center; gap: 2px; }
.fb-star { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: var(--text-light); transition: transform 0.12s ease, color 0.12s ease; }
.fb-star.on { color: #F5A524; }
.fb-star.on svg { fill: currentColor; }
.fb-star:active { transform: scale(0.86); }
.fb-more textarea {
    font: inherit; font-size: 0.9rem; font-weight: 500; color: var(--text-dark); background: var(--bg-color);
    border: 1px solid var(--border-color); border-radius: 12px; padding: 10px 12px; width: 100%; outline: none; resize: vertical;
}
.fb-more textarea:focus { border-color: var(--primary); }
.fb-hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; opacity: 0; }
.fb-msg { font-size: 0.8rem; font-weight: 600; line-height: 1.4; color: #B42318; text-align: center; }
html[data-mode="dark"] .fb-msg { color: #FCA5A5; }
.fb-note { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 0.72rem; color: var(--text-gray); }
.fb-done { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 4px 0; font-size: 0.88rem; font-weight: 600; line-height: 1.4; color: var(--text-dark); text-align: center; }
.fb-done .ic { flex-shrink: 0; color: #10B981; }
[data-theme="noir"] .dr-cta, [data-theme="noir"] .dr-fb { border-radius: 2px; }
[data-theme="sumi"] .dr-cta, [data-theme="sumi"] .dr-fb { border-radius: 0; }

/* --- RATE US ON GOOGLE: the G mark and five gold stars that bounce one after another --- */
.g-rate {
    display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 20px; text-decoration: none;
    border: 1px solid var(--glass-edge); background: color-mix(in srgb, var(--card-bg) 55%, transparent);
    transition: transform 0.15s ease;
}
.g-rate:active { transform: scale(0.98); }
.g-logo { flex-shrink: 0; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.2), inset 0 0 0 1px rgb(0 0 0 / 0.06); }
.g-stars { flex: 1; display: flex; justify-content: center; gap: 5px; min-width: 0; }
.g-star {
    flex-shrink: 1; min-width: 0; fill: #FBBC05; stroke: #F29900; stroke-width: 1; stroke-linejoin: round;
    transform-origin: 50% 58%; filter: drop-shadow(0 2px 4px rgb(251 188 5 / 0.45));
    animation: gStar 2.8s cubic-bezier(0.3, 1.5, 0.5, 1) infinite;
}
.g-star:nth-child(2) { animation-delay: 0.13s; }
.g-star:nth-child(3) { animation-delay: 0.26s; }
.g-star:nth-child(4) { animation-delay: 0.39s; }
.g-star:nth-child(5) { animation-delay: 0.52s; }
@keyframes gStar {
    0%, 46%, 100% { transform: none; filter: drop-shadow(0 2px 4px rgb(251 188 5 / 0.45)); }
    10% { transform: translateY(-5px) scale(1.34) rotate(-12deg); filter: drop-shadow(0 6px 10px rgb(251 188 5 / 0.8)) brightness(1.15); }
    20% { transform: translateY(1px) scale(0.92) rotate(5deg); }
    30% { transform: translateY(-1px) scale(1.08) rotate(-2deg); }
    38% { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .g-star { animation: none; } }
[data-theme="noir"] .g-rate, [data-theme="noir"] .g-logo { border-radius: 2px; }
[data-theme="sumi"] .g-rate, [data-theme="sumi"] .g-logo { border-radius: 0; }

/* --- TABLE GAMES: a slim bar at the top of the menu that opens the list of games --- */
.games-bar {
    grid-column: 1 / -1; position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px;
    width: 100%; min-height: 46px; padding: 7px 8px; padding-inline-start: 9px; border-radius: 16px; text-align: start;
    color: var(--text-dark); font-size: 0.76rem; font-weight: 650; line-height: 1.25;
    background: linear-gradient(115deg, color-mix(in srgb, var(--primary) 16%, var(--card-bg)), var(--card-bg) 58%, color-mix(in srgb, var(--primary) 9%, var(--card-bg)));
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border-color));
    box-shadow: var(--shadow-sm); transition: transform 0.16s ease;
}
.games-bar:active { transform: scale(0.98); }
.games-bar::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(105deg, transparent 32%, color-mix(in srgb, var(--primary) 22%, transparent) 48%, transparent 62%);
    transform: translateX(-110%); animation: gamesSheen 5s ease-in-out infinite;
}
@keyframes gamesSheen { 0%, 58% { transform: translateX(-110%); } 100% { transform: translateX(110%); } }
[dir="rtl"] .games-bar::after { animation-direction: reverse; }
.games-bar-ico {
    width: 30px; height: 30px; flex-shrink: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    background: var(--primary); color: #fff; box-shadow: 0 4px 10px color-mix(in srgb, var(--primary) 40%, transparent);
    animation: gamesWiggle 3.6s ease-in-out infinite;
}
@keyframes gamesWiggle { 0%, 70%, 100% { transform: none; } 76% { transform: rotate(-12deg) scale(1.08); } 84% { transform: rotate(10deg) scale(1.08); } 92% { transform: rotate(-5deg); } }
.games-bar-text { flex: 1; min-width: 0; text-wrap: balance; }
.games-bar-cta { flex-shrink: 0; padding: 7px 13px; border-radius: 11px; background: var(--btn-bg); color: var(--btn-text); font-size: 0.72rem; font-weight: 750; white-space: nowrap; }

/* The list of games: a sheet of liquid glass over the menu. The menu shows through,
   blurred and brightened; light plays on the sheet's rim and across its top. */
.games-pop { position: absolute; inset: 0; z-index: 400; display: flex; align-items: flex-end; justify-content: center; padding: 14px 10px calc(14px + env(safe-area-inset-bottom)); }
.games-scrim { position: absolute; inset: 0; background: rgba(12, 14, 22, 0.3); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); opacity: 0; transition: opacity 0.3s ease; }
.games-pop.is-on .games-scrim { opacity: 1; }
.games-sheet {
    --g-fill: linear-gradient(155deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.36) 42%, rgba(255, 255, 255, 0.54));
    --g-edge: rgba(255, 255, 255, 0.78);
    --g-rim: inset 0 1.5px 0 rgba(255, 255, 255, 0.96), inset 0 -1px 0 rgba(255, 255, 255, 0.4), inset 1px 0 0 rgba(255, 255, 255, 0.5), inset -1px 0 0 rgba(255, 255, 255, 0.3), inset 0 0 26px rgba(255, 255, 255, 0.3);
    --g-tile: rgba(255, 255, 255, 0.42);
    --g-tile-edge: rgba(255, 255, 255, 0.7);
    position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; gap: 12px;
    width: 100%; max-height: min(84%, 660px); padding: 18px 14px 14px; border-radius: 32px; color: var(--text-dark);
    background: var(--g-fill); border: 1px solid var(--g-edge);
    box-shadow: var(--g-rim), 0 26px 64px rgba(15, 20, 40, 0.34), 0 3px 10px rgba(15, 20, 40, 0.14);
    -webkit-backdrop-filter: blur(26px) saturate(190%) brightness(1.06); backdrop-filter: blur(26px) saturate(190%) brightness(1.06);
    transform: translate3d(0, 34px, 0) scale(0.92); opacity: 0; transform-origin: 50% 100%;
    transition: transform 0.5s cubic-bezier(0.34, 1.42, 0.64, 1), opacity 0.24s ease;
}
.games-pop.is-on .games-sheet { transform: none; opacity: 1; }
html[data-mode="dark"] .games-sheet {
    --g-fill: linear-gradient(155deg, rgba(74, 80, 102, 0.6), rgba(22, 25, 34, 0.5) 45%, rgba(52, 57, 76, 0.58));
    --g-edge: rgba(255, 255, 255, 0.22);
    --g-rim: inset 0 1.5px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 rgba(255, 255, 255, 0.1), inset 1px 0 0 rgba(255, 255, 255, 0.14), inset -1px 0 0 rgba(255, 255, 255, 0.08), inset 0 0 26px rgba(255, 255, 255, 0.06);
    --g-tile: rgba(255, 255, 255, 0.09);
    --g-tile-edge: rgba(255, 255, 255, 0.18);
}
@media (prefers-color-scheme: dark) {
    html[data-mode="auto"] .games-sheet {
        --g-fill: linear-gradient(155deg, rgba(74, 80, 102, 0.6), rgba(22, 25, 34, 0.5) 45%, rgba(52, 57, 76, 0.58));
        --g-edge: rgba(255, 255, 255, 0.22);
        --g-rim: inset 0 1.5px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 rgba(255, 255, 255, 0.1), inset 1px 0 0 rgba(255, 255, 255, 0.14), inset -1px 0 0 rgba(255, 255, 255, 0.08), inset 0 0 26px rgba(255, 255, 255, 0.06);
        --g-tile: rgba(255, 255, 255, 0.09);
        --g-tile-edge: rgba(255, 255, 255, 0.18);
    }
}
/* Light on the glass: a soft glow from the top corner and a band that crosses once when the sheet opens. */
.games-glare { position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(120% 60% at 18% -8%, rgba(255, 255, 255, 0.5), transparent 62%), radial-gradient(90% 50% at 100% 108%, color-mix(in srgb, var(--primary) 26%, transparent), transparent 70%); }
.games-glare::after { content: ''; position: absolute; top: -20%; bottom: -20%; width: 46%; inset-inline-start: -60%; transform: skewX(-18deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent); }
.games-pop.is-on .games-glare::after { animation: gamesGlare 1.1s 0.18s ease-out both; }
@keyframes gamesGlare { to { inset-inline-start: 130%; } }
.games-head { display: flex; align-items: flex-start; gap: 10px; padding-inline: 6px; }
.games-head-txt { flex: 1; min-width: 0; }
.games-head h2 { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.games-head p { margin-top: 3px; font-size: 0.78rem; color: var(--text-gray); text-wrap: balance; }
.games-x { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-dark);
    background: var(--g-tile); border: 1px solid var(--g-tile-edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5); transition: transform 0.15s ease; }
.games-x:active { transform: scale(0.9); }
.games-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: color-mix(in srgb, var(--text-dark) 8%, transparent); }
.games-tabs button { flex: 1; min-height: 36px; padding: 5px 8px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font-size: 0.76rem; font-weight: 700; color: var(--text-gray); transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease; }
.games-tabs button.on { background: var(--card-bg); color: var(--text-dark); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.games-tabs button:active { transform: scale(0.96); }
.games-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; align-content: start; padding: 2px 2px 6px; }
.games-list::-webkit-scrollbar { display: none; }
.games-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 5px 9px; border-radius: 20px; text-align: center; text-decoration: none; color: var(--text-dark);
    background: var(--g-tile); border: 1px solid var(--g-tile-edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 6px 14px rgba(15, 20, 40, 0.1);
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1); }
.games-item:active { transform: scale(0.93); }
.games-pop.is-on .games-item { animation: gamesItem 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: calc(var(--i) * 26ms + 90ms); }
@keyframes gamesItem { from { opacity: 0; transform: translate3d(0, 16px, 0) scale(0.86); } }
.games-art { width: 100%; aspect-ratio: 1; border-radius: 15px; overflow: hidden; background: color-mix(in srgb, var(--text-dark) 10%, transparent);
    box-shadow: 0 6px 14px rgba(15, 20, 40, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.22); }
.games-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.games-name { margin-top: 6px; font-size: 0.72rem; font-weight: 750; line-height: 1.15; text-wrap: balance; overflow-wrap: anywhere; }
.games-meta { font-size: 0.62rem; font-weight: 600; color: var(--text-gray); }
.games-join { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 12px; border-radius: 16px; text-decoration: none;
    font-size: 0.76rem; font-weight: 700; color: var(--text-dark); background: var(--g-tile); border: 1px solid var(--g-tile-edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45); }
[dir="rtl"] .games-join .ic:last-child { transform: scaleX(-1); }
@media (prefers-reduced-motion: reduce) {
    .games-bar::after, .games-bar-ico, .games-pop.is-on .games-item, .games-pop.is-on .games-glare::after { animation: none; }
    .games-sheet { transition: opacity 0.2s ease; transform: none; }
}
