/* Page-specific styling for the Mark Six wheel. */

/* An author rule setting `display` beats the user-agent's `[hidden]` rule
   regardless of specificity, so elements carrying both -- the download button,
   which is .generate-btn and starts hidden -- would render anyway without
   this. */
[hidden] {
    display: none !important;
}

.m6-status {
    margin: 1rem 0;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    border-left: 3px solid var(--line-strong);
    background: var(--panel);
    font-size: 0.9rem;
}

.m6-status-ok {
    border-left-color: #4b9e5f;
}

.m6-status-error {
    border-left-color: #d14343;
}

.m6-bet {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.35rem 0;
}

.m6-bet-label {
    min-width: 4.2rem;
    font-size: 0.85rem;
    opacity: 0.7;
}

.m6-bet-numbers {
    display: flex;
    gap: 0.35rem;
}

.m6-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    height: 2.1rem;
    padding: 0 0.35rem;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    font-variant-numeric: tabular-nums;
    font-size: 0.95rem;
}

.m6-bet-invalid .m6-ball {
    border-color: #d14343;
    color: #d14343;
}

.m6-bet-reason {
    font-size: 0.8rem;
    color: #d14343;
}

.m6-download {
    display: inline-block;
    margin-top: 1rem;
    text-decoration: none;
}

.m6-notes p,
.m6-notes ul {
    font-size: 0.9rem;
    line-height: 1.6;
}

.m6-disclaimer {
    opacity: 0.7;
    font-style: italic;
}

/* On a narrow phone a bet row is label (4.2rem) + six 2.1rem balls + gaps,
   about 305px, which overflows a 320px screen. Stack the label above the
   numbers and let the balls shrink to fit instead of scrolling sideways. */
@media (max-width: 480px) {
    .m6-bet {
        display: block;
        margin: 0 0 var(--s2, 0.625rem);
    }

    .m6-bet-label {
        display: block;
        min-width: 0;
        margin-bottom: 0.25rem;
    }

    .m6-bet-numbers {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 0.3rem;
    }

    .m6-ball {
        min-width: 0;
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        padding: 0;
        font-size: 0.9rem;
    }

    .m6-bet-reason { display: block; margin-top: 0.25rem; }
}

/* --- ball colours ---------------------------------------------------------
   Mark Six numbers each carry a colour; the generator sends the mapping and
   the ball is filled with it. White text on all three (>=5.5:1). */

.m6-ball[data-colour] {
    color: #ffffff;
    border-color: transparent;
}

.m6-ball[data-colour="red"]   { background: var(--ball-red); }
.m6-ball[data-colour="blue"]  { background: var(--ball-blue); }
.m6-ball[data-colour="green"] { background: var(--ball-green); }

/* An invalid bet is marked by its reason text, not by recolouring the balls --
   their colour is data, not status. */
.m6-bet-invalid .m6-ball[data-colour] { outline: 2px solid #d14343; outline-offset: 1px; }
