/* ==========================================================================
   Restaurant Tracker — tema
   ========================================================================== */

:root,
[data-bs-theme="light"] {
    --rt-bg: #f7f4f0;
    --rt-surface: #ffffff;
    --rt-surface-2: #f4efe9;
    --rt-surface-3: #ebe4dc;
    --rt-border: rgba(41, 28, 18, 0.08);
    --rt-border-strong: rgba(41, 28, 18, 0.16);
    --rt-text: #1f1a16;
    --rt-muted: #7a6f66;
    --rt-accent: #f2542d;
    --rt-accent-2: #e2366f;
    --rt-accent-soft: rgba(242, 84, 45, 0.10);
    --rt-gradient: linear-gradient(135deg, #ff9a3d 0%, #f2542d 45%, #e2366f 100%);
    --rt-success: #16a34a;
    --rt-success-soft: rgba(22, 163, 74, 0.12);
    --rt-warning: #eab308;
    --rt-heart: #e2366f;
    --rt-violet: #7c5cff;
    --rt-sky: #0ea5e9;
    --rt-shadow: 0 1px 2px rgba(41, 28, 18, 0.04), 0 10px 30px -12px rgba(41, 28, 18, 0.14);
    --rt-shadow-lg: 0 30px 60px -20px rgba(41, 28, 18, 0.25);
    --rt-radius: 22px;
    --rt-radius-sm: 14px;
    --rt-glass: rgba(255, 255, 255, 0.72);

    --bs-body-bg: var(--rt-bg);
    --bs-body-color: var(--rt-text);
    --bs-border-color: var(--rt-border);
    --bs-secondary-color: var(--rt-muted);
    --bs-emphasis-color: var(--rt-text);
    --bs-link-color: var(--rt-accent);
    --bs-link-hover-color: var(--rt-accent-2);
    --bs-link-color-rgb: 242, 84, 45;
    --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-tertiary-bg: var(--rt-surface-2);
    --bs-secondary-bg: var(--rt-surface-2);
}

[data-bs-theme="dark"] {
    --rt-bg: #110e0c;
    --rt-surface: #1b1714;
    --rt-surface-2: #24201c;
    --rt-surface-3: #2f2924;
    --rt-border: rgba(255, 240, 225, 0.08);
    --rt-border-strong: rgba(255, 240, 225, 0.16);
    --rt-text: #f6efe8;
    --rt-muted: #a89d93;
    --rt-accent: #ff6a3d;
    --rt-accent-2: #ff4d8d;
    --rt-accent-soft: rgba(255, 106, 61, 0.14);
    --rt-success: #34d399;
    --rt-success-soft: rgba(52, 211, 153, 0.14);
    --rt-warning: #facc15;
    --rt-heart: #ff4d8d;
    --rt-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -12px rgba(0, 0, 0, 0.6);
    --rt-shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
    --rt-glass: rgba(27, 23, 20, 0.72);

    --bs-body-bg: var(--rt-bg);
    --bs-body-color: var(--rt-text);
    --bs-border-color: var(--rt-border);
    --bs-secondary-color: var(--rt-muted);
    --bs-emphasis-color: var(--rt-text);
    --bs-link-color: var(--rt-accent);
    --bs-link-hover-color: var(--rt-accent-2);
    --bs-link-color-rgb: 255, 106, 61;
    --bs-tertiary-bg: var(--rt-surface-2);
    --bs-secondary-bg: var(--rt-surface-2);
}

/* --- Base ---------------------------------------------------------------- */

html { scroll-behavior: smooth; }

body {
    background: var(--rt-bg);
    color: var(--rt-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: -20vh -10vw auto auto;
    width: 60vw;
    height: 60vh;
    background: radial-gradient(closest-side, rgba(255, 138, 61, 0.16), transparent);
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: "";
    position: fixed;
    inset: auto auto -20vh -10vw;
    width: 55vw;
    height: 55vh;
    background: radial-gradient(closest-side, rgba(226, 54, 111, 0.10), transparent);
    pointer-events: none;
    z-index: -1;
}

main { flex: 1; }

h1, h2, h3, h4, h5, h6, .display-font {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.text-muted, .text-body-secondary { color: var(--rt-muted) !important; }

.text-gradient {
    background: var(--rt-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

a { text-decoration: none; }

.min-w-0 { min-width: 0; }

::selection { background: var(--rt-accent); color: #fff; }

/* --- Navbar -------------------------------------------------------------- */

.rt-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--rt-glass);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid var(--rt-border);
}

.rt-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    color: var(--rt-text);
}

.rt-brand:hover { color: var(--rt-text); }

.rt-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--rt-gradient);
    display: grid;
    place-items: center;
    color: #fff;
    box-shadow: 0 8px 20px -6px rgba(242, 84, 45, .6);
    transform: rotate(-6deg);
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
}

.rt-brand:hover .rt-logo { transform: rotate(6deg) scale(1.05); }

.rt-nav {
    display: flex;
    gap: .25rem;
    background: var(--rt-surface-2);
    padding: .3rem;
    border-radius: 999px;
    border: 1px solid var(--rt-border);
}

.rt-nav a {
    color: var(--rt-muted);
    font-weight: 600;
    font-size: .9rem;
    padding: .45rem .95rem;
    border-radius: 999px;
    transition: all .2s;
    white-space: nowrap;
}

.rt-nav a:hover { color: var(--rt-text); }

.rt-nav a.active {
    background: var(--rt-surface);
    color: var(--rt-text);
    box-shadow: var(--rt-shadow);
}

.rt-nav a.active i { color: var(--rt-accent); }

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    background: var(--rt-surface-2);
    color: var(--rt-text);
    border: 1px solid var(--rt-border);
    transition: all .2s;
}

.icon-btn:hover { background: var(--rt-surface-3); color: var(--rt-text); }

.user-chip {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .25rem .8rem .25rem .25rem;
    border-radius: 999px;
    background: var(--rt-surface-2);
    border: 1px solid var(--rt-border);
    color: var(--rt-text);
    font-weight: 600;
    font-size: .9rem;
}

.user-chip:hover, .user-chip:focus { color: var(--rt-text); background: var(--rt-surface-3); }
.user-chip::after { display: none; }

.dropdown-menu {
    --bs-dropdown-bg: var(--rt-surface);
    --bs-dropdown-border-color: var(--rt-border);
    --bs-dropdown-link-hover-bg: var(--rt-surface-2);
    --bs-dropdown-link-active-bg: var(--rt-accent);
    border-radius: var(--rt-radius-sm);
    box-shadow: var(--rt-shadow-lg);
    padding: .4rem;
}

.dropdown-item { border-radius: 10px; padding: .55rem .8rem; font-weight: 500; }
.dropdown-item i { width: 1.25rem; color: var(--rt-muted); }

/* --- Avatar -------------------------------------------------------------- */

.avatar {
    --size: 40px;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    object-fit: cover;
    display: inline-grid;
    place-items: center;
    background: var(--rt-gradient);
    color: #fff;
    font-weight: 800;
    font-size: calc(var(--size) * .4);
    flex-shrink: 0;
    text-transform: uppercase;
}

.avatar-sm { --size: 32px; }
.avatar-lg { --size: 96px; }
.avatar-xl { --size: 132px; }

.avatar-ring {
    padding: 4px;
    border-radius: 50%;
    background: var(--rt-gradient);
    display: inline-block;
}

.avatar-ring .avatar { border: 4px solid var(--rt-surface); }

/* --- Cards --------------------------------------------------------------- */

.rt-card {
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    border-radius: var(--rt-radius);
    box-shadow: var(--rt-shadow);
}

.rt-card-body { padding: 1.5rem; }

.rt-card-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1.1rem;
}

.rt-card-title .title-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--rt-accent-soft);
    color: var(--rt-accent);
    font-size: .95rem;
}

/* --- Page header / hero -------------------------------------------------- */

.page-header { margin: 2rem 0 1.5rem; }

.page-header h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); margin-bottom: .25rem; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--rt-accent);
    margin-bottom: .5rem;
}

.hero {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: 2rem;
    background: var(--rt-gradient);
    color: #fff;
    box-shadow: 0 30px 60px -25px rgba(226, 54, 111, .55);
    margin-top: 1.75rem;
}

.hero::before, .hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
}

.hero::before { width: 320px; height: 320px; right: -80px; top: -120px; }
.hero::after { width: 200px; height: 200px; right: 180px; bottom: -120px; }

.hero > * { position: relative; z-index: 1; }

.hero h1 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); margin-bottom: .35rem; }
.hero p { opacity: .9; margin: 0; }

.hero-emoji {
    position: absolute;
    right: 2rem;
    bottom: -0.5rem;
    font-size: 7rem;
    line-height: 1;
    opacity: .9;
    transform: rotate(-12deg);
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .2));
    z-index: 0;
}

.level-pill {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .3);
    backdrop-filter: blur(10px);
    border-radius: 999px;
    padding: .4rem 1rem .4rem .4rem;
    color: #fff;
    font-weight: 600;
    margin-top: 1.25rem;
    transition: background .2s;
}

.level-pill:hover { color: #fff; background: rgba(255, 255, 255, .28); }

.level-badge {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    color: var(--rt-accent);
    display: grid;
    place-items: center;
    font-weight: 800;
}

.xp-bar {
    width: 120px;
    height: 6px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .3);
    overflow: hidden;
}

.xp-bar span { display: block; height: 100%; background: #fff; border-radius: 99px; }

/* --- KPI ----------------------------------------------------------------- */

.kpi {
    position: relative;
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    border-radius: var(--rt-radius);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--rt-shadow);
    height: 100%;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}

.kpi:hover { transform: translateY(-3px); box-shadow: var(--rt-shadow-lg); }

.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    margin-bottom: .85rem;
    color: var(--c, var(--rt-accent));
    background: color-mix(in srgb, var(--c, var(--rt-accent)) 14%, transparent);
}

.kpi-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.kpi-label { color: var(--rt-muted); font-size: .85rem; font-weight: 600; margin-top: .35rem; }
.kpi-sub { font-size: .75rem; color: var(--rt-muted); margin-top: .15rem; }

/* --- Buttons ------------------------------------------------------------- */

.btn { font-weight: 600; border-radius: 12px; padding: .6rem 1.1rem; }
.btn-sm { border-radius: 10px; padding: .4rem .75rem; }
.btn-lg { border-radius: 16px; padding: .8rem 1.4rem; }

.btn-primary, .btn-gradient {
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    background: var(--rt-gradient);
    background-size: 150% 150%;
    border: 0;
    box-shadow: 0 10px 24px -10px rgba(242, 84, 45, .7);
    transition: background-position .4s, transform .2s, box-shadow .2s;
}

.btn-primary:hover, .btn-gradient:hover {
    background-position: 100% 0;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px -10px rgba(242, 84, 45, .8);
}

.btn-primary:disabled { background: var(--rt-gradient); opacity: .5; }

.btn-soft {
    --bs-btn-color: var(--rt-text);
    --bs-btn-hover-color: var(--rt-text);
    --bs-btn-active-color: var(--rt-text);
    --bs-btn-bg: var(--rt-surface-2);
    --bs-btn-hover-bg: var(--rt-surface-3);
    --bs-btn-active-bg: var(--rt-surface-3);
    --bs-btn-border-color: var(--rt-border);
    --bs-btn-hover-border-color: var(--rt-border-strong);
    --bs-btn-active-border-color: var(--rt-border-strong);
}

.btn-soft-success {
    --bs-btn-color: var(--rt-success);
    --bs-btn-hover-color: #fff;
    --bs-btn-bg: var(--rt-success-soft);
    --bs-btn-hover-bg: var(--rt-success);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-bg: var(--rt-success);
    --bs-btn-active-color: #fff;
}

.btn-soft-danger {
    --bs-btn-color: #dc2626;
    --bs-btn-hover-color: #fff;
    --bs-btn-bg: rgba(220, 38, 38, .1);
    --bs-btn-hover-bg: #dc2626;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-bg: #b91c1c;
    --bs-btn-active-color: #fff;
}

.btn-white {
    --bs-btn-color: var(--rt-accent);
    --bs-btn-bg: #fff;
    --bs-btn-hover-bg: #fff;
    --bs-btn-hover-color: var(--rt-accent-2);
    --bs-btn-border-color: #fff;
    --bs-btn-active-bg: #fff;
    box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .3);
}

/* --- Forms --------------------------------------------------------------- */

.form-control, .form-select, .ts-control {
    background-color: var(--rt-surface-2) !important;
    border: 1.5px solid transparent !important;
    border-radius: 14px !important;
    padding: .75rem 1rem;
    color: var(--rt-text) !important;
    font-weight: 500;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}

.form-control::placeholder { color: var(--rt-muted); opacity: .75; }

.form-control:focus, .form-select:focus, .ts-wrapper.focus .ts-control {
    background-color: var(--rt-surface) !important;
    border-color: var(--rt-accent) !important;
    box-shadow: 0 0 0 4px var(--rt-accent-soft) !important;
}

.form-label { font-weight: 600; font-size: .88rem; margin-bottom: .45rem; }
.form-label i { color: var(--rt-accent); width: 1.1rem; }
.form-text { color: var(--rt-muted); }

.input-icon { position: relative; }
.input-icon > i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rt-muted);
    pointer-events: none;
}
.input-icon > .form-control { padding-left: 2.6rem; }

/* Tom Select */
.ts-wrapper.single .ts-control { padding: .75rem 2.5rem .75rem 1rem !important; box-shadow: none; background-image: none; }
.ts-wrapper.single .ts-control::after { border-color: var(--rt-muted) transparent transparent transparent !important; right: 1.1rem !important; }
.ts-control input { color: var(--rt-text) !important; }
.ts-control input::placeholder { color: var(--rt-muted) !important; }
.ts-dropdown {
    background: var(--rt-surface) !important;
    color: var(--rt-text) !important;
    border: 1px solid var(--rt-border) !important;
    border-radius: 16px !important;
    box-shadow: var(--rt-shadow-lg) !important;
    margin-top: 6px !important;
    overflow: hidden;
    padding: .35rem;
}
.ts-dropdown .optgroup-header {
    background: transparent !important;
    color: var(--rt-muted) !important;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .7rem .75rem .35rem;
}
.ts-dropdown .option, .ts-dropdown .create { border-radius: 10px; padding: .55rem .75rem; color: var(--rt-text); }
.ts-dropdown .active { background: var(--rt-accent-soft) !important; color: var(--rt-text) !important; }
.ts-dropdown .option .opt-region { color: var(--rt-muted); font-size: .8rem; }
.ts-dropdown-content { max-height: 280px; }
.ts-dropdown .create { color: var(--rt-accent) !important; font-weight: 600; }
.ts-dropdown .highlight { background: var(--rt-accent-soft) !important; color: var(--rt-accent); border-radius: 3px; }
.ts-dropdown .dropdown-input-wrap { padding: .25rem .25rem .4rem; }
.ts-dropdown .dropdown-input {
    background: var(--rt-surface-2) !important;
    border: 1.5px solid transparent !important;
    border-radius: 10px !important;
    color: var(--rt-text) !important;
    padding: .55rem .75rem !important;
    box-shadow: none !important;
}
.ts-dropdown .dropdown-input:focus { border-color: var(--rt-accent) !important; }
.plugin-dropdown_input .dropdown-input-wrap { border-bottom: 0 !important; }

/* Selezione cucina (chip) */
.cuisine-grid { display: flex; flex-wrap: wrap; gap: .45rem; }
.cuisine-grid input { display: none; }
.cuisine-grid label {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .8rem;
    border-radius: 999px;
    background: var(--rt-surface-2);
    border: 1.5px solid transparent;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    user-select: none;
}
.cuisine-grid label:hover { border-color: var(--rt-border-strong); }
.cuisine-grid input:checked + label {
    background: var(--rt-accent-soft);
    border-color: var(--rt-accent);
    color: var(--rt-accent);
}

/* Anteprima mappa */
.map-preview {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: var(--rt-surface-2);
    aspect-ratio: 16 / 10;
    max-width: 100%;
    border: 1px solid var(--rt-border);
}
.map-preview iframe { width: 100%; height: 100%; border: 0; }
.map-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--rt-muted);
    padding: 1rem;
}
.map-placeholder i { font-size: 2.2rem; margin-bottom: .6rem; color: var(--rt-accent); opacity: .6; }

/* --- Toolbar filtri ------------------------------------------------------ */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin: 2rem 0 1.25rem;
}

.search-box { position: relative; flex: 1 1 240px; min-width: 0; }
.search-box i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--rt-muted); }
.search-box input { padding-left: 2.6rem; background: var(--rt-surface) !important; border: 1px solid var(--rt-border) !important; }

.filter-pills {
    display: flex;
    gap: .35rem;
    padding: .3rem;
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    border-radius: 999px;
    overflow-x: auto;
    scrollbar-width: none;
    max-width: 100%;
}
.filter-pills::-webkit-scrollbar { display: none; }

.filter-pill {
    border: 0;
    background: transparent;
    color: var(--rt-muted);
    font-weight: 600;
    font-size: .85rem;
    padding: .45rem .9rem;
    border-radius: 999px;
    white-space: nowrap;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.filter-pill .count {
    font-size: .7rem;
    background: var(--rt-surface-2);
    padding: .1rem .45rem;
    border-radius: 99px;
}
.filter-pill:hover { color: var(--rt-text); }
.filter-pill.active { background: var(--rt-text); color: var(--rt-bg); }
.filter-pill.active .count { background: rgba(127, 127, 127, .3); color: inherit; }
.filter-pill.active .fa-heart { color: var(--rt-heart); }

.toolbar .form-select {
    width: auto;
    background-color: var(--rt-surface) !important;
    border: 1px solid var(--rt-border) !important;
    padding-top: .6rem;
    padding-bottom: .6rem;
    font-size: .88rem;
}

/* --- Card ristorante ----------------------------------------------------- */

.restaurant-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    border-radius: var(--rt-radius);
    box-shadow: var(--rt-shadow);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s;
    overflow: hidden;
    animation: rise .5s both;
}

.restaurant-card:hover { transform: translateY(-4px); box-shadow: var(--rt-shadow-lg); }

.rc-cover {
    position: relative;
    height: 96px;
    display: flex;
    align-items: flex-end;
    padding: 0 1.25rem;
    background:
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, .35), transparent 40%),
        linear-gradient(135deg, var(--c1), var(--c2));
}

.rc-emoji {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: var(--rt-surface);
    display: grid;
    place-items: center;
    font-size: 2rem;
    box-shadow: var(--rt-shadow);
    transform: translateY(28px);
    border: 4px solid var(--rt-surface);
}

.rc-status {
    position: absolute;
    top: .85rem;
    left: 1rem;
    font-size: .72rem;
    font-weight: 700;
    padding: .3rem .65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: #1f1a16;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    backdrop-filter: blur(6px);
}
.rc-status .dot { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; }
.rc-status.visited .dot { background: #16a34a; }

.heart-btn {
    position: absolute;
    top: .7rem;
    right: .8rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, .92);
    color: #b8aca2;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    transition: transform .2s, color .2s;
    backdrop-filter: blur(6px);
}
.heart-btn:hover { transform: scale(1.1); color: var(--rt-heart); }
.heart-btn.active { color: #e2366f; }
.heart-btn.pop { animation: heart-pop .45s cubic-bezier(.34, 1.56, .64, 1); }

.rc-body { padding: 2.2rem 1.25rem 1rem; flex: 1; }
.rc-title { font-size: 1.15rem; font-weight: 800; margin-bottom: .6rem; letter-spacing: -0.02em; }

.rc-address {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    padding: .6rem .75rem;
    margin: 0 -.75rem .6rem;
    border-radius: 12px;
    color: var(--rt-text);
    transition: background .2s;
}
.rc-address:hover { background: var(--rt-surface-2); color: var(--rt-text); }
.rc-address .pin {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--rt-accent-soft);
    color: var(--rt-accent);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: .85rem;
}
.rc-address .addr { font-size: .88rem; line-height: 1.3; font-weight: 600; }
.rc-address .city { font-size: .78rem; color: var(--rt-muted); }
.rc-address .go {
    margin-left: auto;
    color: var(--rt-muted);
    font-size: .75rem;
    opacity: 0;
    transform: translateX(-4px);
    transition: all .2s;
    align-self: center;
}
.rc-address:hover .go { opacity: 1; transform: none; color: var(--rt-accent); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .75rem;
    font-weight: 600;
    padding: .28rem .65rem;
    border-radius: 999px;
    background: var(--rt-surface-2);
    color: var(--rt-muted);
}

.rc-notes {
    font-size: .85rem;
    color: var(--rt-muted);
    margin: .75rem 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .85rem 1.25rem;
    border-top: 1px dashed var(--rt-border-strong);
}

/* Stelle */
.stars { display: inline-flex; gap: 2px; }
.stars .star {
    border: 0;
    background: none;
    padding: 0 1px;
    font-size: 1.05rem;
    color: var(--rt-surface-3);
    transition: transform .15s, color .15s;
    line-height: 1;
}
.stars .star.on { color: #fbbf24; }
.stars.interactive .star { cursor: pointer; }
.stars.interactive .star:hover { transform: scale(1.25); }
.stars.interactive:hover .star { color: #fbbf24; }
.stars.interactive .star:hover ~ .star { color: var(--rt-surface-3); }

/* --- Empty state --------------------------------------------------------- */

.empty-state { text-align: center; padding: 4rem 1rem; }
.empty-state .big-emoji { font-size: 4.5rem; display: inline-block; animation: float 3s ease-in-out infinite; }

/* --- Stat page ----------------------------------------------------------- */

.ring {
    --p: 0;
    --size: 150px;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background:
        radial-gradient(closest-side, var(--rt-surface) 78%, transparent 80% 100%),
        conic-gradient(var(--rt-accent) calc(var(--p) * 1%), var(--rt-surface-2) 0);
    display: grid;
    place-items: center;
    margin: 0 auto;
}
.ring-value { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.03em; }

.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 320px; }

.insight {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .9rem 0;
    border-bottom: 1px dashed var(--rt-border-strong);
}
.insight:last-child { border-bottom: 0; }
.insight .ic {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--rt-accent-soft);
    color: var(--rt-accent);
    flex-shrink: 0;
}
.insight .lbl { font-size: .78rem; color: var(--rt-muted); font-weight: 600; }
.insight .val { font-weight: 800; font-size: 1.05rem; }
.insight .det { font-size: .75rem; color: var(--rt-muted); }

.rank-item {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .7rem 0;
}
.rank-pos {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: .85rem;
    background: var(--rt-surface-2);
}
.rank-item:nth-child(1) .rank-pos { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #78350f; }
.rank-item:nth-child(2) .rank-pos { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #1f2937; }
.rank-item:nth-child(3) .rank-pos { background: linear-gradient(135deg, #fed7aa, #c2410c); color: #fff; }

.bar-row { margin-bottom: .9rem; }
.bar-row .bar-head { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; }
.bar-track { height: 10px; border-radius: 99px; background: var(--rt-surface-2); overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--rt-gradient); width: 0; transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.bar-fill.ghost { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--rt-accent) 25%, transparent); }

/* --- Achievements -------------------------------------------------------- */

.tier-bronze { --t1: #f0b27a; --t2: #b4632d; }
.tier-silver { --t1: #e5e7eb; --t2: #8b93a1; }
.tier-gold { --t1: #fde68a; --t2: #e39b0b; }
.tier-platinum { --t1: #c4b5fd; --t2: #5b8def; }

.achievement {
    position: relative;
    height: 100%;
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    border-radius: var(--rt-radius);
    padding: 1.35rem;
    box-shadow: var(--rt-shadow);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s;
    overflow: hidden;
    animation: rise .5s both;
}
.achievement:hover { transform: translateY(-4px); box-shadow: var(--rt-shadow-lg); }

.achievement.unlocked::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--t1), var(--t2));
}

.medal {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    color: #fff;
    background: linear-gradient(135deg, var(--t1), var(--t2));
    box-shadow: 0 12px 24px -10px var(--t2), inset 0 2px 0 rgba(255, 255, 255, .4);
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, .2);
}

.achievement.unlocked .medal::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
    background-size: 250% 100%;
    animation: shine 3.5s ease-in-out infinite;
}

.achievement.locked .medal {
    background: var(--rt-surface-2);
    color: var(--rt-muted);
    box-shadow: none;
    text-shadow: none;
}

.achievement.locked .ach-title { color: var(--rt-muted); }

.tier-tag {
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .2rem .55rem;
    border-radius: 99px;
    background: linear-gradient(135deg, var(--t1), var(--t2));
    color: #fff;
}
.achievement.locked .tier-tag { background: var(--rt-surface-2); color: var(--rt-muted); }

.ach-title { font-weight: 800; font-size: 1.05rem; margin: 1rem 0 .2rem; }
.ach-desc { color: var(--rt-muted); font-size: .85rem; margin-bottom: 1rem; }

.ach-progress { height: 8px; border-radius: 99px; background: var(--rt-surface-2); overflow: hidden; }
.ach-progress span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--t1), var(--t2)); }

.level-card {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: 2rem;
    color: #fff;
    background:
        radial-gradient(circle at 90% 10%, rgba(255, 255, 255, .25), transparent 35%),
        linear-gradient(135deg, #2b1a4a 0%, #6d28d9 50%, #e2366f 100%);
    box-shadow: 0 30px 60px -25px rgba(109, 40, 217, .6);
}

.level-big {
    width: 110px;
    height: 110px;
    border-radius: 32px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .3);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}
.level-big .n { font-size: 2.8rem; font-weight: 800; line-height: 1; }
.level-big .l { font-size: .65rem; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }

.xp-track { height: 12px; border-radius: 99px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.xp-track span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #fde68a, #fff); box-shadow: 0 0 20px rgba(255, 255, 255, .7); }

.mini-medals { display: flex; flex-wrap: wrap; gap: .5rem; }
.mini-medals .medal { width: 44px; height: 44px; border-radius: 14px; font-size: 1rem; }

/* --- Auth ---------------------------------------------------------------- */

.auth-wrap {
    min-height: calc(100vh - 70px);
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 0;
}

.auth-art {
    position: relative;
    margin: 1.25rem;
    border-radius: 32px;
    background: var(--rt-gradient);
    color: #fff;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}

/* Decorazione: griglia di punti che sfuma + anelli concentrici */
.auth-art::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .22) 1px, transparent 1.5px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(160deg, #000 0%, transparent 55%);
    mask-image: linear-gradient(160deg, #000 0%, transparent 55%);
    pointer-events: none;
}

.auth-art::after {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    top: -140px;
    right: -160px;
    border-radius: 50%;
    background:
        radial-gradient(circle, transparent 38%, rgba(255, 255, 255, .10) 38.3%, transparent 38.8%),
        radial-gradient(circle, transparent 54%, rgba(255, 255, 255, .08) 54.3%, transparent 54.8%),
        radial-gradient(circle, rgba(255, 255, 255, .16) 0%, transparent 36%);
    pointer-events: none;
}

.auth-art > * { position: relative; z-index: 1; }

.auth-art-top {
    position: absolute;
    top: 2.5rem;
    left: 3rem;
    display: flex;
    align-items: center;
    gap: .7rem;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.auth-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .35);
    backdrop-filter: blur(8px);
}

.auth-art h2 { font-size: clamp(2rem, 3.5vw, 3.2rem); line-height: 1.05; max-width: 11em; text-wrap: balance; }

.auth-feature {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 16px;
    padding: .75rem 1rem;
    backdrop-filter: blur(8px);
    font-weight: 600;
    font-size: .92rem;
}

.auth-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}

.auth-form-inner { width: 100%; max-width: 420px; }

@media (max-width: 991.98px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-art { display: none; }
}

/* --- Toasts -------------------------------------------------------------- */

.toast-stack {
    position: fixed;
    top: 84px;
    right: 1rem;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    max-width: calc(100vw - 2rem);
    width: 380px;
}

.rt-toast {
    display: flex;
    align-items: center;
    gap: .85rem;
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    border-radius: 18px;
    padding: .85rem 1rem;
    box-shadow: var(--rt-shadow-lg);
    animation: toast-in .45s cubic-bezier(.34, 1.56, .64, 1) both;
}
.rt-toast.hide { animation: toast-out .3s ease forwards; }
.rt-toast .t-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #fff;
    background: var(--rt-success);
}
.rt-toast.error .t-icon { background: #dc2626; }
.rt-toast .t-msg { font-size: .9rem; font-weight: 600; flex: 1; }
.rt-toast .t-close { border: 0; background: none; color: var(--rt-muted); padding: .25rem; }

.rt-toast.achievement {
    background: linear-gradient(135deg, #2b1a4a, #6d28d9 60%, #e2366f);
    color: #fff;
    border: 0;
}
.rt-toast.achievement .t-icon { width: 50px; height: 50px; border-radius: 16px; font-size: 1.3rem; background: linear-gradient(135deg, var(--t1), var(--t2)); }
.rt-toast.achievement .t-kicker { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; opacity: .8; font-weight: 700; }
.rt-toast.achievement .t-close { color: rgba(255, 255, 255, .7); }

/* --- Bottom nav (mobile) ------------------------------------------------- */

.bottom-nav {
    position: fixed;
    left: .75rem;
    right: .75rem;
    bottom: calc(.75rem + env(safe-area-inset-bottom));
    z-index: 1030;
    display: none;
    justify-content: space-around;
    align-items: center;
    background: var(--rt-glass);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border: 1px solid var(--rt-border);
    border-radius: 24px;
    padding: .45rem;
    box-shadow: var(--rt-shadow-lg);
}

.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    font-size: .65rem;
    font-weight: 600;
    color: var(--rt-muted);
    padding: .35rem 0;
    border-radius: 16px;
}
.bottom-nav a i { font-size: 1.1rem; }
.bottom-nav a.active { color: var(--rt-accent); }

.bottom-nav .fab {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: var(--rt-gradient);
    color: #fff;
    display: grid;
    place-items: center;
    margin-top: -1.8rem;
    box-shadow: 0 14px 28px -8px rgba(242, 84, 45, .8);
    padding: 0;
}
.bottom-nav .fab i { font-size: 1.35rem; }

@media (max-width: 991.98px) {
    .bottom-nav { display: flex; }
    body.has-bottom-nav { padding-bottom: 96px; }
    .toast-stack { top: 76px; left: 1rem; right: 1rem; width: auto; }
}

/* --- Footer -------------------------------------------------------------- */

.rt-footer { color: var(--rt-muted); font-size: .85rem; padding: 2.5rem 0 2rem; }

/* --- Share / public ------------------------------------------------------ */

.share-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--rt-surface-2);
    border-radius: 16px;
    padding: .4rem .4rem .4rem 1rem;
    border: 1.5px dashed var(--rt-border-strong);
}
.share-link input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--rt-text);
    font-weight: 600;
    font-size: .9rem;
    outline: none;
}

.qr-box {
    background: #fff;
    border-radius: 20px;
    padding: 1rem;
    display: inline-block;
    box-shadow: var(--rt-shadow);
}
.qr-box img, .qr-box canvas { display: block; }

.public-hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
}

.list-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--rt-border);
    color: var(--rt-text);
    transition: background .2s;
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--rt-surface-2); color: var(--rt-text); }
.list-row .emoji-tile {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    background: var(--rt-surface-2);
    flex-shrink: 0;
}
.list-row .go-maps {
    margin-left: auto;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--rt-accent-soft);
    color: var(--rt-accent);
}

/* --- Profile ------------------------------------------------------------- */

.profile-cover {
    height: 140px;
    border-radius: var(--rt-radius) var(--rt-radius) 0 0;
    background:
        radial-gradient(circle at 20% 120%, rgba(255, 255, 255, .3), transparent 40%),
        var(--rt-gradient);
}

.avatar-edit {
    position: relative;
    display: inline-block;
    margin-top: -70px;
}

.avatar-edit .cam {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--rt-text);
    color: var(--rt-bg);
    display: grid;
    place-items: center;
    border: 3px solid var(--rt-surface);
    cursor: pointer;
    transition: transform .2s;
}
.avatar-edit .cam:hover { transform: scale(1.1); }

.pw-strength { height: 6px; border-radius: 99px; background: var(--rt-surface-2); overflow: hidden; margin-top: .5rem; }
.pw-strength span { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .3s, background .3s; }

.info-row { display: flex; justify-content: space-between; padding: .7rem 0; border-bottom: 1px dashed var(--rt-border-strong); font-size: .9rem; }
.info-row:last-child { border-bottom: 0; }
.info-row span:first-child { color: var(--rt-muted); }
.info-row span:last-child { font-weight: 600; }

.pw-toggle {
    position: absolute;
    right: .5rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: none;
    color: var(--rt-muted);
    padding: .5rem;
}

/* --- Modal --------------------------------------------------------------- */

.modal-content {
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    border-radius: 26px;
    box-shadow: var(--rt-shadow-lg);
}

/* --- Animazioni ---------------------------------------------------------- */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-14px) rotate(4deg); } }
@keyframes heart-pop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
@keyframes shine { 0%, 60% { background-position: 150% 0; } 100% { background-position: -150% 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

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