
.fixture_card {
/*    min-width: 478px;*/
    /*
     * 500px, the same as every other .card on the site. It used to undercut that by 22px for no
     * reason anyone recorded, and those 22px were the difference between a team name column of
     * 112px and one of 123px - see .team below, which splits whatever is left over.
     */
    max-width: 500px;
    margin-bottom: 12px;
}

.fixture_date {
    font-size: 20px;
    text-align: center;
    color: var(--green800);
    margin: 10px 0 4px 0;
    background-color: var(--grey200);
    max-width: 140px;
    margin: auto;
    height: 40px;
/*    margin-left: 0px;*/
/*    margin-right: 0px;*/
    line-height: 28px;
    margin-bottom: -12px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    color: var(--grey800);
    box-shadow: 0px -5px 15px 0 var(--shadow);
}

.fixture_time {
    font-size: 16px;
    text-align: center;
/*    text-align: right;*/
    color: var(--grey500);
    margin: 4px 0px 2px 0px;
}

.fixture {
    display: flex;
    font-size: 20px;
    font-family: 'Roboto Condensed', sans-serif;
    margin: 0px auto 14px auto;
    width: 100%;
}

/* TEAMS */
.team {
    line-height: 32px;
}

/*
 * The two names split whatever the scoreline leaves, and never wrap.
 *
 * They used to be pinned at min-width:111px with the slack pushed out into the auto margins
 * below, so a name wider than that broke onto a second line and took the row from 41px to 73px -
 * shunting every fixture under it down the page. Nottingham Forest did it every week at 147px,
 * and Crystal Palace at 110px was one pixel of viewport away from doing the same, with
 * Bournemouth and Coventry City a few pixels behind it.
 *
 * flex:1 over min-width:0 hands each side half of what is left after .score-container's fixed
 * 210px - 123px on a full-width card, and less as the card narrows, rather than overflowing it.
 * Every name in Teams.js fits, current or relegated: the widest are Crystal Palace and Nott'm
 * Forest at 110px, against a column that bottoms out at 112px on the narrowest viewport this
 * layout still runs on. Forest is shortened in Teams.js because no width available on this card
 * would have fitted 'Nottingham Forest' at 20px.
 *
 * The ellipsis is the backstop for a promoted club with a longer name than any of those: one
 * clipped name is contained, where nowrap on its own would spill it across the +/- buttons. If it
 * ever fires, the fix is a shorter name in Teams.js, not a wider card.
 *
 * :not(.mob_team) because the compact rows below 502px carry both classes, and they are a centred
 * flex column whose colour bars are sized off the box - growing it would stretch them.
 */
.team:not(.mob_team) {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home_team {
    text-align: right;
    margin-right: 6px;
    margin-left: auto;
}

.away_team {
    text-align: left;
    margin-left: 6px;
    margin-right: auto;
}

.teamColor {
    height: 4px;
    position: relative;
    bottom: 2px;
    margin-bottom: -2px;
    width: 100%;
}
.mob_team {
    display: none;
    min-width: 46px;
    flex-direction: column;
    text-align: center;
    text-transform: uppercase;
    margin: auto;
}

.score-container {
    display: flex;
    max-width: 210px;
    min-width: 210px;
    height: 35px;
    margin: auto;
}
.score-container-started {
    text-align: center;
}

.control {
    display: flex;
    margin: 0px 6px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;  
    user-select: none;
}

.control_btn {
    cursor: pointer;
    width: 38px;
    height: 26px;
    font-size: 22px;
    background-color: var(--grey400);
    border-radius: 5px;
    color: var(--grey700);
    margin: auto 0;
    position: relative;
    z-index: 1;
    text-align: center;
    line-height: 24px;
    font-family: "Roboto, sans-serif";
    font-weight: 600;
    touch-action: manipulation;
}

.control_btn:hover {
    background-color: var(--green300);
    transform: scale(1.04);
/*    transition: transform 0.1s;*/
}
.control_btn:active {
    position: relative;
    top: 1px;
}

.control .control_btn:nth-child(1) {
    padding-right: 10px;
}
.control .control_btn:nth-last-child(1) {
    padding-left: 10px;
}

.prediction_circle {
    color: var(--grey900);
    text-align: center;
    line-height: 32px;
    font-size: 27px;
    font-family: 'Montserrat', sans-serif;
    background-color: white;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    
    z-index: 2;
    margin: auto -9px;
    box-shadow: 0px 2px 5px 0 rgba(0,0,0,0.5);
}

.predict_btn_container {
    margin: 4px 0 4px 0;
}

.predict_btn_container .btn {
    border-radius: 24px;
    line-height: 48px;
    height: 48px;
    box-shadow: 0 4px 6px 0 var(--shadow);
}

.mid_space_started {
    width: 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0 auto;
}

.match_status {
    color: var(--grey400);
    font-size: 17px;
    font-style: italic;
    position: relative;
    top: 4px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;  
    user-select: none;
}
.match_score {
    color: var(--grey300);
    font-size: 18px;
    font-weight: 700;
    position: relative;
    bottom: 1px;
}

.score-container-started .control:nth-child(1) .prediction_circle {
    margin: 0 0 0 29px;
}
.score-container-started .control:nth-last-child(1) .prediction_circle {
    margin: 0 29px 0 0;
}

/* Buttons */

#joker_btn {
    background-color: var(--yellow400);
    min-width: 80px;
    width: 24%;
}

#save_btn {
    background-color: var(--green300);
    min-width: 220px;
    margin-left: auto;
    width: 60%;
}
#save_btn.disabled {
    opacity: 0.4;
    user-select: none;
}

.fixture_selectable {
    background-color: rgba(100,100,0,0.5);
    border: 2px solid rgba(100,100,0,0.5);
    border-radius: 12px;
}

.fixture_selectable:hover {
    border: 2px dashed var(--yellow700);
    cursor: pointer;
}

.x2 {
    background-color: var(--yellow800);
    border: 1px solid var(--yellow500);
    border-radius: 12px;
}

.predict-header {
    display: flex;
    position: relative;
    margin-bottom: -10px;
}
.predict-header h2 {
    margin-top: 0;
    font-weight: 700;
    font-size: 32px;
}
.underlined-h2 {
    display: flex;
    flex-direction: column;
}
.underline {
    width: 100%;
    height: 4px;
    background-color: var(--green900);
    position: relative;
    bottom: 27px;
}
.week_box {
    background-color: var(--green200);
    max-width: 68px;
    min-width: 68px;
    max-height: 68px;
    min-height: 68px;
    margin: auto 0 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    color: var(--green900);
    font-family: "Montserrat", sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 21px;
    padding: 12 0px;
    border-radius: 12px;
    box-shadow: inset 0 2px 3px 0 rgba(0,0,0,0.26);
}

#week_num {
    font-size: 32px;
    margin: 0;
    font-weight: 400;
}


@media screen and (max-width: 502px) {
    .main-container {
        padding-right: 4px;
        padding-left: 4px;
    }
    .team {
        display: none;
    }
    .mob_team {
        display: flex;   
    }
}

@media screen and (max-width: 360px) {
    .team {
        margin: 0;   
    }
    .fixture_card {
        padding-right: 4px;
        padding-left: 4px;
    }
    .mob_team {
        margin: auto;
    }
}
/* ---------------------------------------------------------------------------
   TEAM FORM - the last five results under each team name. @see TeamForm.js
   --------------------------------------------------------------------------- */

/*
 * Letters, not colour alone. Five 7px squares would have had no room for a glyph, and W/D/L
 * carries the meaning for anyone who cannot separate the green from the red - the colour is
 * there to make the shape of a run readable at a glance, not to be the only signal.
 *
 * line-height is set explicitly because .team carries 32px for the team name itself, which this
 * sits underneath and must not inherit.
 */
.team_form {
    font-family: "Roboto", sans-serif;
    font-size: 10px;
    line-height: 13px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    margin-top: -4px;      /* pulls up into the slack under the 32px name line */
    opacity: 0.95;
}

.tf {
    display: inline-block;
    width: 12px;
    text-align: center;
    border-radius: 2px;
    color: #fff;
    font-weight: 700;
    cursor: default;
    /* Every chip carries an age class below, and both of these exist to serve it. */
    transform-origin: bottom center;
    vertical-align: bottom;
}
.tf + .tf { margin-left: 1px; }

.tf_w { background-color: var(--green600); }
.tf_d { background-color: var(--grey500); }
.tf_l { background-color: var(--red500); }

/*
 * Recency, by size: the newest result is full size and each older one is a little smaller, so
 * the run reads as receding into the past from right to left.
 *
 * Two rules this keeps to:
 *
 * **Size means recency, opacity means season.** They are separate signals and must not be
 * conflated - .tf_prev already uses opacity to mark a result carried over from last season, and
 * a chip that was both faded and shrunk for two different reasons would say neither clearly.
 *
 * **transform, not font-size.** Scaling the box leaves the layout width at 12px, so the letters
 * stay on an even pitch and the run stays aligned with the team name above it; shrinking
 * font-size instead would reflow each chip to a different width and make the spacing sag toward
 * the older end. `transform-origin: bottom` sits them all on one baseline, which is what makes
 * the size difference read as a step rather than as a wobble.
 *
 * The steps are deliberately shallow - 4% apart, 16% end to end. Enough to notice in the shape
 * of the run, not enough to make the oldest letter hard to read.
 */
.tf_age0 { transform: scale(1);    }
.tf_age1 { transform: scale(0.96); }
.tf_age2 { transform: scale(0.92); }
.tf_age3 { transform: scale(0.88); }
.tf_age4 { transform: scale(0.84); }

/* A result carried over from last season, shown only when there is current form beside it. */
.tf_prev { opacity: 0.45; }

/* A promoted side, with no Premier League record to show. */
.tf_none {
    color: var(--grey500);
    font-size: 12px;
    cursor: default;
}

/*
 * The wide layout puts the home side's name flush right and the away side's flush left, and the
 * form line inherits that from .home_team / .away_team - so each team's run reads outward from
 * the scoreline in the middle, the same way the names do.
 *
 * Below 502px .team is hidden and .mob_team shown, which is a centred flex column; the form line
 * becomes its third row under the short name and the colour bars, and needs its own top margin
 * back because .teamColor ends on a negative one.
 */
@media screen and (max-width: 502px) {
    .mob_team .team_form {
        margin-top: 3px;
    }
    .tf {
        width: 10px;
        font-size: 9px;
    }
}

/*
 * The show/hide control.
 *
 * Last thing on the page, under the SAVE button. It is a display preference, not part of making
 * a prediction, so it sits after the thing the page is actually for - and out of the way of the
 * header, where at 390px "PREDICTIONS" at 32px plus the 68px week box already fill the row.
 *
 * Right-aligned to line up with SAVE, which .predict_btn_container pushes right at 60% width.
 *
 * Rendered with .none in the markup and revealed by TeamForm - a control that cannot do
 * anything should not be on the page at all.
 */
.form_toggle_row {
    display: flex;
    justify-content: flex-end;
    margin: 10px 0 4px;
}

.form_toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 8px;
    border: none;
    border-radius: 999px;
    background-color: var(--grey300);
    color: var(--grey700);
    font-family: "Montserrat", sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: inset 0 1px 2px 0 rgba(0,0,0,0.18);
}

/* The dot is the state, the word is the label - so the control reads the same way the form
   letters do, by shape rather than by a sentence explaining what it does. */
.form_toggle .ft_dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--grey500);
}

.form_toggle.ft_on {
    background-color: var(--green300);
    color: var(--green900);
}
.form_toggle.ft_on .ft_dot { background-color: var(--green700); }

/* One class on the body hides every form line at once, so toggling costs no rebuild. */
body.form_off .team_form { display: none; }

/* ————————————————————————————————————————————————————————————————————————————
   The club prompt, shown once after a save. @see docs/supported_team.md §3

   A card in the page flow rather than a modal, deliberately: a save is one of the moments
   people leave, and a dialogue that must be answered turns a saved gameweek into a bounce.
   ———————————————————————————————————————————————————————————————————————————— */
.team_prompt {
    position: relative;
    margin: 14px 0 4px;
    padding: 14px 34px 12px 14px;
    border-radius: 8px;
    background-color: var(--grey100);
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.18);
    font-family: "Montserrat", sans-serif;
}

.team_prompt_title {
    color: var(--grey900);
    font-size: 14px;
    font-weight: 600;
}

.team_prompt_sub {
    margin-top: 3px;
    color: var(--grey700);
    font-size: 12px;
}

/* Wraps rather than scrolls: twenty clubs is a shape the eye can scan, and a scroller hides
   whichever club is off the end from somebody looking for exactly one name. */
.team_prompt_clubs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.team_prompt_club {
    padding: 5px 10px;
    border: none;
    border-radius: 999px;
    background-color: var(--grey300);
    color: var(--grey900);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.team_prompt_club:hover:not(:disabled) { background-color: var(--grey400); }
.team_prompt_club.chosen { background-color: var(--green300); color: var(--green900); }
.team_prompt button:disabled { opacity: 0.6; cursor: default; }

.team_prompt_actions { margin-top: 10px; }

/* Underlined text, not a button: declining is a real answer and must be reachable, but it should
   not compete with the twenty things we would rather they pressed. */
.team_prompt_none {
    padding: 0;
    border: none;
    background: none;
    color: var(--grey700);
    font-family: inherit;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}

.team_prompt_close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--grey600);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.team_prompt_close:hover { background-color: var(--grey200); }

.team_prompt_link {
    display: inline-block;
    margin-top: 6px;
    color: var(--green800);
    font-size: 12px;
    font-weight: 600;
}

/* ------------------------------------------------------------------- share --- */

/**
 * "Share my predictions" and the desktop preview behind it. @see pages/predict/ShareCard.js
 *
 * The button is quiet on purpose. SAVE is the thing this page is for and it is a 48px green
 * slab; a second filled button under it would read as a second half of the same instruction.
 * This is an outline pill in the same green, which says "also available" rather than "next".
 *
 * Rendered with .none and revealed once there is a *saved* prediction on screen, so the page
 * nobody has touched yet does not offer to share an empty card and the half-filled one does not
 * offer to share a gameweek that is only on screen. @see ShareCard.refresh()
 */
.share_row {
    display: flex;
    justify-content: flex-end;
    /* 18px above: SAVE and this are different jobs, and the old 10px read as one stack of
       controls with the FORM pill closing in underneath. */
    margin: 18px 0 4px;
}

.share_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;             /* the touch target, whatever the label does */
    padding: 0 20px;
    border: 1px solid var(--green700);
    border-radius: 999px;
    /* Frosted, not white: a solid white pill on this page's fixed gradient reads as a raised
       control - louder than SAVE's pale slab, the opposite of what this button is. Fully
       transparent was tried and failed the other way: the green900 label measured 2.8:1
       against the teal end of the gradient, because the white fill was what had been carrying
       its legibility. At 45% the gradient shows through enough to seat the button on the page,
       and the label stays above 4.5:1 at both ends of the gradient. The hover and press washes
       are green300 with alpha so they read against white *and* teal. */
    background: rgba(255, 255, 255, 0.45);
    color: var(--green900);
    font-family: "Montserrat", sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.share_btn:hover { background: rgba(204, 223, 134, 0.55); }  /* green300 at 55% */
.share_btn:active { background: rgba(204, 223, 134, 0.8); }

.share_btn:focus-visible {
    outline: 3px solid var(--green400);
    outline-offset: 2px;
}

/* Only the page's own button carries the icon chip; the preview's pair are plain. The tight
   left padding is what seats the chip inside the pill's curve instead of floating in it. */
#share_btn { padding-left: 5px; }

/* The share icon on a filled disc. A bare glyph next to text is browser chrome; a chip is a
   designed thing, and it gives the busy spinner somewhere to happen that is not the label. */
.share_ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--green200);
    font-size: 15px;
    transition: background 0.15s;
}

.share_btn:hover .share_ico { background: var(--green300); }

.share_btn_primary {
    background: var(--green700);
    border-color: var(--green700);
    color: #fff;
}
.share_btn_primary:hover { background: var(--green800); border-color: var(--green800); }
.share_btn_primary:active { background: var(--green900); border-color: var(--green900); }

/* Drawing ten rows takes a moment on an old phone, and the press has no other effect until the
   share sheet opens - so the chip becomes a spinner for the wait. Under reduced motion it stays
   an icon and the label grows the old ellipsis instead. */
.share_btn.is_busy { cursor: default; }
.share_btn.is_busy .share_ico i { display: none; }
.share_btn.is_busy .share_ico::after {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid var(--green300);
    border-top-color: var(--green800);
    animation: share_spin 0.8s linear infinite;
}
@keyframes share_spin { to { transform: rotate(360deg); } }

.share_btn.is_failed {
    border-color: var(--yellow700);
    color: var(--grey800);
}
.share_btn.is_failed .share_ico { background: var(--yellow200); color: var(--yellow900); }
.share_btn.is_failed .share_ico i::before { content: '\f06a'; /* fa-exclamation-circle */ }
.share_btn.is_failed .share_label { font-size: 0; }
.share_btn.is_failed .share_label::after {
    content: 'Could not make the image';
    font-size: 15px;
}

@media (prefers-reduced-motion: reduce) {
    .share_btn, .share_ico { transition: none; }
    .share_btn.is_busy { opacity: 0.7; }
    .share_btn.is_busy .share_ico i { display: inline-block; }
    .share_btn.is_busy .share_ico::after { content: none; }
    .share_btn.is_busy .share_label::after { content: '\2026'; }
}

/* ----- the preview, desktop only in practice ----- */

.share_preview {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: auto;
}

/* The display above beats the browser's own [hidden] rule, so the attribute has to be honoured
   explicitly - without this the overlay is open from the moment the page loads. */
.share_preview[hidden] { display: none; }

.share_preview_inner {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    max-width: 420px;
    width: 100%;
    text-align: center;
}

.share_preview_inner h2 {
    font-size: 19px;
    margin: 0 0 14px;
    color: var(--grey900);
}

.share_preview_inner img {
    width: 100%;
    height: auto;
    border: 1px solid var(--grey200);
    border-radius: 8px;
    display: block;
    margin-bottom: 16px;
}

.share_preview_actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
