/* The bar at the bottom of the phone (layouts/mobile-action-bar.blade.php): five places with a + in the middle, a strip
   for the tournament played today, and the + and More sheets. Replaces the boxed buttons of homepage.css. */

:root { --mbar-h: 4.5rem; }

.mobile-action-bar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
    gap: 0;
    height: calc(var(--mbar-h) + env(safe-area-inset-bottom));
    padding: 0 0.3rem env(safe-area-inset-bottom);
    background: #120d1c;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-action-bar__item {
    min-height: var(--mbar-h);
    gap: 0.25rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-muted, #9aa7bb);
    font: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
}
.mobile-action-bar__item i { font-size: 1.15rem; }
.mobile-action-bar__item.is-active { background: transparent; border: 0; color: #fff; }
.mobile-action-bar__item.is-active i { color: var(--accent-secondary, #d998ff); }
.mobile-action-bar__item.is-active::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent-primary, #8f5cff); }
.mobile-action-bar__item:focus-visible, .mobile-action-bar__plus:focus-visible { outline: 2px solid var(--accent-secondary, #d998ff); outline-offset: -2px; }

.mobile-action-bar__plus {
    justify-self: center;
    display: grid;
    place-items: center;
    width: 3.75rem;
    height: 3.75rem;
    margin-bottom: 0.9rem;
    border: 4px solid #0b0810;
    border-radius: 50%;
    background: #7a42ee;
    color: #fff;
    box-shadow: 0 8px 22px rgba(122, 66, 238, 0.55);
    cursor: pointer;
    transition: transform 0.15s ease;
}
.mobile-action-bar__plus i { font-size: 1.4rem; transition: transform 0.15s ease; }
.mobile-action-bar__plus[aria-expanded="true"] i { transform: rotate(45deg); }
.mobile-action-bar__plus:active { transform: scale(0.95); }

/* the strip of the tournament played today */
.mobile-live-strip { display: none; }

/* sheets */
.mobile-sheet { display: none; }

@media (max-width: 767.98px) {
    body.is-entry-flow .mobile-live-strip { display: none; }

    .mobile-live-strip {
        position: fixed;
        z-index: 9997;
        left: 0.6rem;
        right: 0.6rem;
        bottom: calc(var(--mbar-h) + env(safe-area-inset-bottom) + 0.5rem);
        display: flex;
        flex-direction: column;
        gap: 0.55rem;
        padding: 0.7rem 0.75rem;
        border-radius: 18px;
        background: #1f1830;
        border: 1px solid rgba(143, 92, 255, 0.6);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }
    .mobile-live-strip[hidden] { display: none; }
    .mobile-live-strip__main { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
    .mobile-live-strip__copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
    .mobile-live-strip__eyebrow { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent-secondary, #d998ff); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mobile-live-strip__copy b { font-size: 0.95rem; color: #fff; }
    .mobile-live-strip__close { flex: none; width: 2.75rem; height: 2.75rem; margin: -0.6rem -0.55rem 0 0; border: 0; background: transparent; color: #9aa7bb; font-size: 1.4rem; line-height: 1; cursor: pointer; }
    .mobile-live-strip__actions { display: flex; gap: 0.45rem; }
    .mobile-live-strip__primary { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.9rem; border-radius: 12px; background: #7a42ee; color: #fff; font-size: 0.9rem; font-weight: 800; text-decoration: none; }
    .mobile-live-strip__icon { flex: none; display: grid; place-items: center; width: 2.9rem; min-height: 2.9rem; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.14); background: #171220; color: #fff; text-decoration: none; }

    /* the page leaves room for the strip too */
    body:has(.mobile-live-strip:not([hidden])) { --mobile-action-bar-clearance: 10.5rem; }

    .mobile-sheet { position: fixed; z-index: 10000; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; }
    .mobile-sheet[hidden] { display: none; }
    .mobile-sheet__backdrop { position: absolute; inset: 0; border: 0; background: rgba(0, 0, 0, 0.62); cursor: default; }
    .mobile-sheet__panel { position: relative; display: flex; flex-direction: column; gap: 0.6rem; max-height: 85dvh; overflow-y: auto; padding: 1rem 0.9rem calc(1rem + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: #1f1830; border-top: 1px solid rgba(143, 92, 255, 0.5); }
    .mobile-sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 0 0.2rem 0.2rem; }
    .mobile-sheet__head h2 { margin: 0; font-size: 1.05rem; font-weight: 800; color: #fff; }
    .mobile-sheet__x { width: 2.75rem; height: 2.75rem; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.14); background: transparent; color: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; }

    .mobile-sheet__row { display: flex; align-items: center; gap: 0.9rem; min-height: 4rem; padding: 0 1rem; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.12); background: #171220; color: #fff; text-decoration: none; }
    .mobile-sheet__row i { flex: none; width: 1.6rem; text-align: center; font-size: 1.25rem; color: var(--accent-secondary, #d998ff); }
    .mobile-sheet__row span { display: flex; flex-direction: column; min-width: 0; }
    .mobile-sheet__row b { font-size: 1rem; }
    .mobile-sheet__row small { font-size: 0.8rem; color: #9aa7bb; }
    .mobile-sheet__row.is-primary { background: #7a42ee; border-color: rgba(143, 92, 255, 0.7); }
    .mobile-sheet__row.is-primary i, .mobile-sheet__row.is-primary small { color: #fff; }
    .mobile-sheet__row.is-primary small { opacity: 0.85; }

    .mobile-sheet__group { padding: 0.35rem 0.2rem 0; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-muted, #9aa7bb); }
    .mobile-sheet__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.55rem; }
    .mobile-sheet__tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.45rem; min-height: 5.2rem; padding: 0.5rem; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.12); background: #171220; color: #fff; font-size: 0.8rem; font-weight: 700; text-align: center; text-decoration: none; }
    .mobile-sheet__tile i { font-size: 1.3rem; color: var(--accent-secondary, #d998ff); }
    .mobile-sheet__tile.is-active { border-color: rgba(143, 92, 255, 0.7); background: #2a1c52; }

    body.has-mobile-sheet { overflow: hidden; }
}

body.life-tracker-mode .mobile-live-strip, body.life-tracker-mode .mobile-sheet { display: none !important; }

/* two tournaments today: which one are you playing? */
@media (max-width: 767.98px) {
    .mobile-live-strip__pick { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.1rem; }
    .mobile-live-strip__chip { flex: none; display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.5rem; max-width: 13rem; padding: 0 0.8rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.16); background: #171220; color: #c4d1e3; font: inherit; font-size: 0.8rem; font-weight: 700; white-space: nowrap; cursor: pointer; overflow: hidden; text-overflow: ellipsis; }
    .mobile-live-strip__chip small { font-size: 0.68rem; font-weight: 700; color: var(--accent-secondary, #d998ff); }
    .mobile-live-strip__chip.is-on { background: #2a1c52; border-color: rgba(143, 92, 255, 0.8); color: #fff; }
    .mobile-live-strip__panel { display: flex; flex-direction: column; gap: 0.55rem; }
    .mobile-live-strip__panel[hidden] { display: none; }
    body:has(.mobile-live-strip__pick) { --mobile-action-bar-clearance: 13.5rem; }
}
