/* GTX Racelab Tips – Clean White Card Design */
.grl-section {
    font-family: sans-serif;
}

/* Header */
.grl-header { margin-bottom: 20px; }
.grl-title {
    font-size: 15px;
    font-weight: 100;
    letter-spacing: 1px;
    color: rgb(68, 77, 90);
    text-transform: uppercase;
    margin: 0;
}

/* ── Outer wrapper ── */
.grl-cards-outer {
    width: 100%;
    box-sizing: border-box;
    /* no overflow here on desktop */
}

/* ── Card strip — responsive grid on desktop ── */
.grl-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}

/* ── Card ── */
.grl-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    border: 1px solid #e8eaf0;
    min-height: 180px;
    box-sizing: border-box;
    width: 100%;
}

/* ── Card header row ── */
.grl-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

/* Badge */
.grl-badge-num {
    width: 38px; height: 38px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 800; color: #fff;
    flex-shrink: 0;
}
.grl-badge-silk {
    width: 38px; height: 38px;
    border-radius: 9px; object-fit: contain;
    background: #f0f2f5; flex-shrink: 0;
}

.grl-card-title-wrap { flex: 1; min-width: 0; }
.grl-horse-name {
    font-size: 15px; font-weight: 700; color: #0d1b3e;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.2;
}
.grl-race-label {
    font-size: 11px; color: #8a93a8; margin-top: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Comment ── */
.grl-comment-wrap {
    flex: 1;
    margin-bottom: 14px;
}
.grl-comment-empty { min-height: 0; }
.grl-comment-text {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.6;
    color: #3a4a6b;
}

/* ── Footer ── */
.grl-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 11px;
    border-top: 1px solid #f0f2f5;
    margin-top: auto;
}
.grl-brand-dot {
    font-size: 10px; font-weight: 700;
    color: #729370; letter-spacing: 0.8px;
}
.grl-slip-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: #0d1b3e;
    letter-spacing: 0.2px;
    padding: 0;
    transition: opacity .15s;
}
.grl-slip-btn:hover { opacity: 0.65; }

/* Loading / Empty / Error */
.grl-loading {
    display: flex; align-items: center; gap: 10px;
    padding: 40px 24px; color: #5a7099; font-size: 13px; width: 100%;
}
.grl-spinner {
    width: 20px; height: 20px;
    border: 2px solid rgba(0,0,0,.08); border-top-color: #b8960a;
    border-radius: 50%; animation: grl-spin .7s linear infinite; flex-shrink: 0;
}
@keyframes grl-spin { to { transform: rotate(360deg); } }
.grl-empty {
    width: 100%; text-align: center;
    padding: 40px 24px; color: #5a7099; font-size: 13px;
}
.grl-empty-icon { font-size: 28px; display: block; margin-bottom: 8px; }
.grl-error {
    margin-top: 10px; background: rgba(200,50,50,.08);
    border-radius: 8px; padding: 10px 16px;
    font-size: 12px; color: #c0392b;
}

/* ── Tablet: 2 columns ── */
@media (max-width: 900px) {
    .grl-cards { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

/* ── Mobile: horizontal snap carousel ── */
@media (max-width: 600px) {

    /*
     * grl-cards-outer = CLIP layer (overflow:hidden locks everything inside)
     * grl-cards       = SCROLL layer (overflow-x:scroll does the sliding)
     * Each card width = 100% of grl-cards-outer — never leaks outside
     */

    .grl-section {
        overflow: hidden; /* hard stop — nothing can escape the section */
    }

    .grl-cards-outer {
        overflow: hidden;           /* clips any card that is not in view   */
        width: 100%;
        box-sizing: border-box;
    }

    .grl-cards {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        grid-template-columns: unset;
        gap: 0;                      /* no gap — cards snap edge to edge     */
        width: 100%;
        overflow-x: scroll;          /* scroll lives HERE, inside clip layer  */
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        box-sizing: border-box;
    }
    .grl-cards::-webkit-scrollbar { display: none; }

    /* Card = exactly the outer container width, no more, no less */
    .grl-card {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        scroll-snap-align: start;
        padding: 14px 14px 12px;
        border-radius: 14px;
        /* small side margins so adjacent card peeks — remove if not wanted */
        box-sizing: border-box;
    }

    .grl-horse-name   { font-size: 14px; }
    .grl-comment-text { font-size: 12px; }
}
