/* ==========================================================================
   Band Setlist — mobile-first, Material-inspired dark theme
   ========================================================================== */

:root {
    --bg: #121212;
    --surface: #1e1e1e;
    --surface-2: #2a2a2e;
    --surface-3: #34343a;
    --outline: #3d3d43;
    --text: #ffffff;
    --text-dim: #b3b3b8;
    --accent: #ff4081;
    --accent-press: #e91e63;
    --accent-soft: rgba(255, 64, 129, 0.16);
    --on-accent: #ffffff;
    --danger: #ff5252;
    --danger-soft: rgba(255, 82, 82, 0.14);
    --ok: #69f0ae;
    --info: #40c4ff;

    --r-s: 8px;
    --r-m: 12px;
    --r-l: 16px;
    --r-xl: 24px;

    --elev-1: 0 1px 2px rgba(0, 0, 0, .45), 0 1px 3px 1px rgba(0, 0, 0, .3);
    --elev-2: 0 2px 6px 2px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .5);
    --elev-3: 0 8px 20px 4px rgba(0, 0, 0, .45), 0 3px 8px rgba(0, 0, 0, .5);

    --ab-h: 56px;          /* app bar height */
    --bn-h: 64px;          /* bottom nav height */
    --safe-b: env(safe-area-inset-bottom, 0px);

    --font: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
}

img { max-width: 100%; display: block; }

a { color: var(--info); text-decoration: none; }

h1 { font-size: 1.5rem; font-weight: 500; line-height: 1.25; margin: 0 0 4px; letter-spacing: 0; }
h2 { font-size: 1.05rem; font-weight: 500; margin: 0 0 12px; }
h3 { font-size: 1rem; font-weight: 500; margin: 0; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.dim { color: var(--text-dim); font-weight: 400; }

.stack { display: flex; flex-direction: column; gap: 16px; }

/* --- App bar ------------------------------------------------------------- */

.appbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--ab-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px;
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(var(--ab-h) + env(safe-area-inset-top, 0px));
    background: var(--surface);
    box-shadow: var(--elev-1);
}

.appbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: .02em;
}

.appbar__logo { width: 26px; height: 26px; color: var(--accent); }

.appbar__avatar { flex: none; }

/* --- Main ---------------------------------------------------------------- */

.main {
    padding: 16px 16px calc(var(--bn-h) + var(--safe-b) + 96px);
    max-width: 760px;
    margin: 0 auto;
}

.is-guest .main { padding-bottom: 48px; }

.page-head { margin: 4px 0 16px; }
.page-head__sub { margin: 0; color: var(--text-dim); }
.page-head p > .badge, .page-head p > .btn { margin-right: 8px; margin-top: 8px; }
.page-head h1 + p { margin-top: 4px; }

.section-h {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-dim);
    margin: 24px 0 10px;
}

.section-h .dim { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* --- Flash messages / toasts --------------------------------------------- */

.flash-stack:empty { display: none; }

.flash {
    margin: 12px 16px 0;
    padding: 12px 16px;
    border-radius: var(--r-m);
    background: var(--surface-2);
    border: 1px solid var(--outline);
    font-size: .92rem;
}

.flash--success { border-color: rgba(105, 240, 174, .5); }
.flash--error   { border-color: rgba(255, 82, 82, .6); }
.flash--info    { border-color: rgba(64, 196, 255, .5); }

.toasts {
    position: fixed;
    left: 50%;
    bottom: calc(var(--bn-h) + var(--safe-b) + 16px);
    transform: translateX(-50%);
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: max-content;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}

.is-guest .toasts { bottom: 24px; }

.toast {
    background: #e8e8ea;
    color: #1a1a1a;
    padding: 11px 18px;
    border-radius: var(--r-xl);
    box-shadow: var(--elev-3);
    font-size: .92rem;
    animation: toast-in .22s cubic-bezier(.2, 0, 0, 1);
}

.toast--error { background: #ffb4ab; color: #410002; }
.toast--success { background: #b9f6ca; color: #00381c; }

.toast.is-leaving { animation: toast-out .18s ease-in forwards; }

@keyframes toast-in  { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(8px); } }

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 22px;
    border-radius: 999px;
    border: none;
    background: none;
    font-size: .92rem;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
    transition: background-color .15s, box-shadow .15s, transform .08s;
    -webkit-tap-highlight-color: transparent;
    text-align: center;
}

.btn:active { transform: scale(.98); }

.btn--filled { background: var(--accent); color: var(--on-accent); }
.btn--filled:hover { background: var(--accent-press); box-shadow: var(--elev-1); }

.btn--tonal { background: var(--accent-soft); color: var(--accent); }
.btn--tonal:hover { background: rgba(255, 64, 129, .24); }

.btn--text { color: var(--accent); padding: 0 14px; }
.btn--text:hover { background: var(--accent-soft); }

.btn--outlined { border: 1px solid var(--outline); color: var(--text); }
.btn--outlined:hover { background: var(--surface-2); }

.btn--outlined-danger { border: 1px solid var(--danger); color: var(--danger); }
.btn--outlined-danger:hover { background: var(--danger-soft); }

.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding: 0 16px; font-size: .85rem; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--text-dim);
    cursor: pointer;
    transition: background-color .15s;
    -webkit-tap-highlight-color: transparent;
}

.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn--danger:hover { background: var(--danger-soft); color: var(--danger); }

.text-btn {
    border: none;
    background: none;
    color: var(--accent);
    font-size: .85rem;
    font-weight: 600;
    padding: 6px 8px;
    margin-left: -8px;
    border-radius: var(--r-s);
    cursor: pointer;
}

.text-btn:hover { background: var(--accent-soft); }
.text-btn--danger { color: var(--danger); }
.text-btn--danger:hover { background: var(--danger-soft); }

/* --- Text fields --------------------------------------------------------- */

.field { display: block; margin-bottom: 4px; }

.field__label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 6px;
    padding: 0 2px;
    border: none;
}

.field__help { display: block; font-size: .78rem; color: var(--text-dim); margin-top: 6px; }

.field__error { color: var(--danger); font-size: .85rem; margin: 8px 0 0; }

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--outline);
    border-radius: var(--r-s);
    color: var(--text);
    transition: border-color .15s, background-color .15s;
}

.field textarea { resize: vertical; min-height: 76px; line-height: 1.45; }

.field input::placeholder, .field textarea::placeholder { color: #8a8a90; }

.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface-3);
}

.field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23b3b3b8' d='M7.4 8.6 12 13.2l4.6-4.6L18 10l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 22px;
    padding-right: 40px;
}

fieldset.field { border: none; padding: 0; margin: 0 0 4px; }
fieldset.field legend { padding: 0; }

/* --- Avatars ------------------------------------------------------------- */

.avatar {
    --av: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--av);
    color: rgba(0, 0, 0, .78);
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: .02em;
    flex: none;
    user-select: none;
}

.avatar--xs { width: 24px; height: 24px; font-size: .68rem; }
.avatar--lg { width: 84px; height: 84px; font-size: 2rem; }

.appbar__avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }

/* --- Chips & badges ------------------------------------------------------ */

.chips { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 2px; }

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--outline);
    color: var(--text-dim);
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color .15s, color .15s, border-color .15s;
}

.chip:hover { background: var(--surface-2); color: var(--text); }

.chip.is-active {
    background: var(--accent-soft);
    border-color: transparent;
    color: var(--accent);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-dim);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .03em;
}

.badge--accent { background: var(--accent-soft); color: var(--accent); }
.badge--mine { background: var(--accent-soft); color: var(--accent); margin-left: 6px; }
.badge--count { margin-right: 8px; }

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

.cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }

.card {
    background: var(--surface);
    border-radius: var(--r-l);
    box-shadow: var(--elev-1);
    overflow: hidden;
    transition: transform .12s, box-shadow .12s;
}

.card:hover { box-shadow: var(--elev-2); }
.card:active { transform: scale(.99); }

.card__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: var(--text);
    min-height: 44px;
}

.card__thumb {
    width: 112px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--r-s);
    background: var(--surface-3);
    flex: none;
}

.card__info { flex: 1; min-width: 0; }

.card__title {
    font-size: .98rem;
    font-weight: 500;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.card__meta {
    margin: 0 0 6px;
    font-size: .8rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.card__rating { margin: 0; font-size: .84rem; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.card__rating strong { font-size: .95rem; color: var(--text); }

.card__chev { width: 22px; height: 22px; color: var(--text-dim); flex: none; }

.card--dim, .cards--dim .card { opacity: .72; }

/* Gig date block on gig cards */
.card__gigdate {
    width: 54px;
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    background: var(--accent-soft);
    border-radius: var(--r-m);
    color: var(--accent);
    line-height: 1.1;
}

.card__gigday { font-size: 1.35rem; font-weight: 700; }
.card__gigmon { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

/* --- Empty states -------------------------------------------------------- */

.empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-dim);
}

.empty svg { width: 56px; height: 56px; color: var(--outline); margin-bottom: 12px; }
.empty h1, .empty h2 { color: var(--text); margin-bottom: 6px; }
.empty--inline { padding: 24px 8px; }

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

.auth {
    display: flex;
    justify-content: center;
    padding-top: 24px;
}

.auth__card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border-radius: var(--r-xl);
    box-shadow: var(--elev-2);
    padding: 32px 24px 24px;
    text-align: center;
}

.auth__logo { width: 48px; height: 48px; color: var(--accent); margin-bottom: 8px; }
.auth__sub { color: var(--text-dim); margin: 0 0 24px; font-size: .92rem; }
.auth__card .stack { text-align: left; }
.auth__card .field__label { text-align: left; }
.auth__foot { margin: 20px 0 0; font-size: .88rem; color: var(--text-dim); }

/* --- FAB ----------------------------------------------------------------- */

.fab {
    position: fixed;
    right: 16px;
    bottom: calc(var(--bn-h) + var(--safe-b) + 16px);
    z-index: 50;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 56px;
    padding: 0 20px;
    border: none;
    border-radius: 16px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: .92rem;
    font-weight: 700;
    letter-spacing: .02em;
    box-shadow: var(--elev-2);
    cursor: pointer;
    transition: background-color .15s, box-shadow .15s, transform .1s;
    -webkit-tap-highlight-color: transparent;
}

.fab svg { width: 24px; height: 24px; }
.fab:hover { background: var(--accent-press); box-shadow: var(--elev-3); }
.fab:active { transform: scale(.96); }

/* --- Dialogs / bottom sheets --------------------------------------------- */

.sheet {
    border: none;
    padding: 8px 20px calc(20px + var(--safe-b));
    width: 100%;
    max-width: 520px;
    margin: auto auto 0;
    background: var(--surface);
    color: var(--text);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    box-shadow: var(--elev-3);
}

.sheet::backdrop { background: rgba(0, 0, 0, .65); }

.sheet[open] { animation: sheet-in .24s cubic-bezier(.2, 0, 0, 1); }

@keyframes sheet-in {
    from { transform: translateY(32px); opacity: 0; }
}

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

.sheet__head h2 { margin: 0; font-size: 1.2rem; }
.sheet__text { color: var(--text-dim); font-size: .9rem; margin: 4px 0 16px; }

.sheet__form { display: flex; flex-direction: column; gap: 14px; }

.sheet__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.sheet__divider { height: 1px; background: var(--outline); margin: 16px -20px; }

@media (min-width: 600px) {
    .sheet {
        margin: auto;
        border-radius: var(--r-xl);
        padding-bottom: 24px;
    }
    .sheet__divider { margin: 16px -20px; }
}

/* --- Song detail --------------------------------------------------------- */

.backlink {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-dim);
    font-size: .88rem;
    font-weight: 600;
    margin-bottom: 12px;
    min-height: 36px;
}

.backlink svg { width: 18px; height: 18px; }
.backlink:hover { color: var(--text); }

.player {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--r-l);
    overflow: hidden;
    box-shadow: var(--elev-1);
    margin-bottom: 16px;
}

.player img { width: 100%; height: 100%; object-fit: cover; }

.player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.player__hit {
    position: absolute;
    inset: 0;
    border: none;
    background: rgba(0, 0, 0, .25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .15s;
    -webkit-tap-highlight-color: transparent;
}

.player__hit:hover { background: rgba(0, 0, 0, .1); }

.player__play {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: var(--elev-3);
    transition: transform .12s, background-color .12s;
}

.player__play svg { width: 34px; height: 34px; margin-left: 3px; }
.player__hit:hover .player__play { transform: scale(1.06); background: var(--accent-press); }

.song__title { overflow-wrap: anywhere; margin-bottom: 8px; }

.song__by {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--text-dim);
    font-size: .86rem;
    margin: 0 0 20px;
}

.panel {
    background: var(--surface);
    border-radius: var(--r-l);
    padding: 18px 16px;
    margin-bottom: 16px;
    box-shadow: var(--elev-1);
}

.panel h2 { display: flex; align-items: baseline; gap: 6px; }

/* --- Rating -------------------------------------------------------------- */

.rate__form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.rate__btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--outline);
    background: var(--surface-2);
    color: var(--text-dim);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .12s, color .12s, border-color .12s, transform .1s;
    -webkit-tap-highlight-color: transparent;
}

.rate__btn:hover { border-color: var(--accent); color: var(--accent); }
.rate__btn:active { transform: scale(.92); }

.rate__btn.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    box-shadow: var(--elev-1);
}

.rate__clear {
    margin-left: auto;
    border: none;
    background: none;
    color: var(--text-dim);
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--r-s);
    min-height: 44px;
}

.rate__clear:hover { color: var(--danger); background: var(--danger-soft); }

.rate__summary { margin: 0 0 14px; font-size: .9rem; color: var(--text-dim); }
.rate__summary strong { font-size: 1.15rem; color: var(--text); margin-right: 2px; }
.rate__summary span { margin-right: 2px; }

.rate__breakdown {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.chip-rating {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px 5px 6px;
    background: var(--surface-2);
    border: 1px solid var(--outline);
    border-radius: 999px;
    font-size: .8rem;
    color: var(--text-dim);
}

.chip-rating strong { color: var(--text); font-weight: 700; }
.chip-rating.is-mine { border-color: var(--accent); color: var(--text); }

/* --- Comments ------------------------------------------------------------ */

.comment-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.comment-list:empty { display: none; }

.comment { display: flex; gap: 10px; }

.comment__body { flex: 1; min-width: 0; background: var(--surface-2); border-radius: 4px 14px 14px 14px; padding: 10px 13px; }

.comment__meta { margin: 0 0 3px; font-size: .8rem; color: var(--text-dim); display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.comment__meta strong { color: var(--text); font-size: .86rem; }

.comment__text { margin: 0; font-size: .93rem; overflow-wrap: anywhere; }

.comment__actions { margin: 6px -8px -4px; display: flex; gap: 4px; }

.comment__edit-area { display: flex; flex-direction: column; gap: 8px; }
.comment__edit-area textarea { min-height: 64px; }
.comment__edit-actions { display: flex; gap: 8px; justify-content: flex-end; }

.comment-form { display: flex; flex-direction: column; gap: 10px; }
.comment-form__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.comment-form__actions .field__error { margin: 0; }

.comments__empty { font-size: .9rem; }

.danger-zone { margin-top: 24px; }

/* --- Gigs / setlist ------------------------------------------------------ */

.badge + .btn { margin-left: 4px; }

.setlist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.setlist__item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: var(--r-m);
    padding: 8px 6px 8px 2px;
    box-shadow: var(--elev-1);
    position: relative;
    background-clip: padding-box;
    touch-action: pan-y;
}

.setlist__item.is-dragging {
    z-index: 10;
    box-shadow: var(--elev-3);
    background: var(--surface-3);
    border-color: var(--accent);
    cursor: grabbing;
}

.drag-handle {
    flex: none;
    width: 40px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--text-dim);
    cursor: grab;
    touch-action: none;
    border-radius: var(--r-s);
    -webkit-tap-highlight-color: transparent;
}

.drag-handle:hover { background: var(--surface-3); color: var(--text); }
.drag-handle:active { cursor: grabbing; }
.drag-handle svg { width: 20px; height: 20px; }

.setlist__num {
    flex: none;
    width: 22px;
    text-align: center;
    font-size: .85rem;
    font-weight: 700;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

.setlink {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    padding: 4px 0;
    min-width: 44px;
}

.setlist__thumb { width: 56px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--surface-3); flex: none; }

.setlist__info { min-width: 0; display: flex; flex-direction: column; }

.setlist__title {
    font-size: .92rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.setlist__meta { font-size: .78rem; }

.setlist__actions { display: flex; flex: none; }
.setlist__actions .icon-btn { width: 40px; height: 44px; }

/* Pool picker */
.pool { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 480px; overflow-y: auto; }

.pool__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--r-m);
    background: var(--surface-2);
}

.pool__item[hidden] { display: none; }

.pool__thumb { width: 56px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; flex: none; background: var(--surface-3); }

.pool__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.pool__title {
    font-size: .9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pool__meta { font-size: .78rem; }

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

.profile-avatar { display: flex; justify-content: center; margin: 4px 0 8px; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }

.swatch { cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }

.swatch__dot {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--sw);
    border: 3px solid transparent;
    box-shadow: 0 0 0 1px var(--outline);
    transition: transform .12s, box-shadow .12s;
}

.swatch input:checked + .swatch__dot {
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text);
    transform: scale(1.05);
}

.swatch input:focus-visible + .swatch__dot { outline: 2px solid var(--accent); outline-offset: 3px; }

.invite-box {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--outline);
    border-radius: var(--r-m);
    padding: 8px;
    margin: 12px 0;
}

.invite-box input {
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: .82rem;
    padding: 6px;
    text-overflow: ellipsis;
}

.invite-box input:focus { outline: none; }

.stats {
    list-style: none;
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.stats li {
    flex: 1;
    background: var(--surface-2);
    border-radius: var(--r-m);
    padding: 14px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stats strong { font-size: 1.4rem; color: var(--accent); }
.stats span { font-size: .75rem; color: var(--text-dim); }

/* --- Bottom navigation --------------------------------------------------- */

.bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    height: calc(var(--bn-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    background: var(--surface);
    box-shadow: 0 -1px 3px rgba(0, 0, 0, .4);
}

.bottomnav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-dim);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-decoration: none;
    max-width: 120px;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s;
}

.bottomnav__item svg {
    width: 24px;
    height: 24px;
    padding: 3px 16px;
    box-sizing: content-box;
    border-radius: 999px;
    transition: background-color .15s;
}

.bottomnav__item.is-active { color: var(--accent); }
.bottomnav__item.is-active svg { background: var(--accent-soft); }

/* --- Misc ---------------------------------------------------------------- */

.noscript {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 100;
    background: #ffb4ab;
    color: #410002;
    padding: 12px 16px;
    font-size: .88rem;
    text-align: center;
}

/* --- Responsive ---------------------------------------------------------- */

@media (min-width: 600px) {
    .main { padding-left: 24px; padding-right: 24px; }
    .card__thumb { width: 168px; }
    h1 { font-size: 1.7rem; }
    .fab { right: 24px; }
}

@media (min-width: 900px) {
    .main { max-width: 820px; }
    .card__thumb { width: 200px; }
    .rate__btn { width: 52px; height: 52px; }
}

/* --- Reduced motion ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
