/* Garage menu (Play / Agency and the small buttons), test mode band and panel, "Your championship" card, full-height Garage, Agency photo header */
/* ===== Garage: main menu + JUGAR / AGENCIA tabs ===== */
.g-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.g-menu button { text-align: left; text-transform: none; letter-spacing: 0; font-family: var(--body); font-weight: 400; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--glass, var(--panel)); }
.g-menu button b { font-family: var(--display); font-weight: 700; font-size: 19px; text-transform: uppercase; letter-spacing: .03em; line-height: 1; }
.g-menu button span { font-size: 13px; color: var(--muted); }
.g-menu button:hover { border-color: rgba(255, 255, 255, .45); }
.g-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-menu button { min-width: 0; }
.g-menu button { min-height: 92px; justify-content: flex-end; padding: 16px 18px; border: 1px solid rgba(255, 255, 255, .22); border-left: 5px solid rgba(255, 255, 255, .55); background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); }
.g-menu button b { font-size: 22px; color: var(--fg); }
.g-menu button span { color: rgba(255, 255, 255, .72); }
.g-menu button:hover { border-left-color: var(--flag); background: rgba(255, 255, 255, .09); }
/* The two big buttons carry a photo, darkened toward the left so the text reads; the small buttons stay plain */
.g-menu .g-main { min-height: 190px; border: 0; border-left: 4px solid var(--flag); background: var(--panel); }
.g-menu .g-main[data-go="play"] { background: linear-gradient(90deg, rgba(0, 0, 0, .88) 0%, rgba(0, 0, 0, .15) 100%), url("../assets/portada/jugar-categorias.jpg") center 40% / cover no-repeat, var(--panel); }
.g-menu .g-main b { font-size: clamp(30px, 6vw, 46px); font-style: italic; font-weight: 800; color: #fff; }
.g-menu .g-main span { color: rgba(255, 255, 255, .9); }
.g-menu .g-main.alt[data-go="agency"] { background: linear-gradient(90deg, rgba(0, 0, 0, .88) 0%, rgba(0, 0, 0, .2) 100%), url("../assets/portada/agencia-pilotos.jpg") right 8% / cover no-repeat, var(--panel); }   /* v3 photo (very wide): the 4 helmets and torsos */
.g-menu .g-main:hover { filter: brightness(1.1); border-left-color: #fff; }
/* Test mode (only for Bernardo): a red band on top and a small floating panel */
#testBand { position: fixed; top: 0; left: 0; right: 0; z-index: 9998; background: #e5243b; color: #fff; font: 800 13px/26px var(--display, sans-serif); letter-spacing: .08em; text-transform: uppercase; text-align: center; cursor: pointer; }
body.fdm-test { margin-top: 34px; }
#testPanel { position: fixed; right: 12px; bottom: 12px; z-index: 9999; width: min(300px, calc(100vw - 24px)); padding: 12px; background: #111; color: #fff; border: 2px solid #e5243b; box-shadow: 0 10px 30px rgba(0,0,0,.6); font: 13px/1.4 var(--body, sans-serif); display: flex; flex-direction: column; gap: 8px; }
#testPanel .tm-h { display: flex; justify-content: space-between; align-items: center; } #testPanel .tm-h b { color: #ff6b7a; text-transform: uppercase; letter-spacing: .06em; }
#testPanel .tm-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#testPanel button { font-size: 12px; padding: 6px 8px; text-transform: none; letter-spacing: 0; }
#testPanel .tm-real { border-color: #e5243b; }
/* "Your championship" card on the Race screen: about 130 px on desktop, one column on the phone */
.chp { display: grid; grid-template-columns: minmax(160px, .8fr) minmax(0, 1.6fr) minmax(220px, 1fr); gap: 18px; align-items: center; padding: 10px 16px; background: var(--panel); border-left: 4px solid var(--flag); }
.chp-wait { grid-template-columns: 1fr; }
.chp-l { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chp-lab, .chp-box span { font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.chp-pos { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 42px; line-height: .95; color: var(--hi); }
.chp-pos small { font-size: 22px; color: var(--muted); }
.chp-wait { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 26px; line-height: 1.1; color: var(--hi); }
.chp-who { font-family: var(--body); font-size: 13px; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chp-c { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.chp-boxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chp-box { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; border: 1px solid var(--line); background: var(--glass); min-width: 0; }
.chp-box b { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 26px; line-height: 1; color: var(--hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chp-box span { font-size: 11px; line-height: 1.2; }
.chp-box.up b i { font-style: italic; color: var(--flag); }
.chp-box.up b { color: var(--flag); }
.chp-box.bad { border-color: rgba(229, 72, 77, .55); background: rgba(229, 72, 77, .08); } .chp-box.bad b { color: #e5484d; font-size: 18px; }
.chp-bar { height: 6px; background: rgba(255, 255, 255, .08); } .chp-bar i { display: block; height: 100%; background: var(--flag); }
.chp-sub { font-family: var(--body); font-size: 12px; color: var(--muted); }
.chp-r { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chp-mini { display: flex; flex-direction: column; }
.chp-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 0 6px; font-family: var(--body); font-size: 12.5px; line-height: 17px; }
.chp-row span:first-child { color: var(--muted); font-family: var(--display); font-weight: 600; }
.chp-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.chp-row b { font-family: var(--display); font-weight: 800; font-style: italic; }
.chp-row.mine { background: color-mix(in srgb, var(--flag) 18%, transparent); color: var(--hi); }
.chp-row.down span:first-child { color: #e5484d; }
.chp-all { align-self: flex-start; padding: 0; border: 0; background: none; line-height: 16px; font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--flag); cursor: pointer; }
.chp-all:hover { text-decoration: underline; }
@media (max-width: 760px) { .chp { grid-template-columns: 1fr; gap: 12px; } .chp-r { width: 100%; } }
/* Desktop: the Garage fills the window top to bottom (no scroll, no empty space below). The menu takes what is left under Missions. */
@media (min-width: 761px) {
  body:has(#screen-home:not([hidden])) { --home-pt: 20px; --home-pb: 32px; padding-block: var(--home-pt) var(--home-pb); }
  #screen-home { min-height: calc(100vh - var(--home-pt) - var(--home-pb) - 16px); }   /* 16px: the body's default 8px margin, top and bottom */
  #screen-home .g-menu { flex: 1 1 auto; min-height: 0; gap: 8px; grid-template-rows: minmax(140px, 2.35fr) minmax(74px, 1fr) minmax(74px, 1fr) minmax(74px, 1fr); }
  #screen-home .g-menu button, #screen-home .g-menu .g-main { min-height: 0; padding-block: 10px; }
  #screen-home .mis-btn { padding: 9px 16px; }
}
/* Short screens (1280x800): only the spaces between blocks shrink */
@media (min-width: 761px) and (max-height: 860px) {
  body:has(#screen-home:not([hidden])) { --home-pt: 8px; --home-pb: 6px; }
  #screen-home { gap: 5px; }
  #screen-home .g-menu { gap: 6px; }
}
/* Agency: a photo header (the four drivers walking), like its big button in the Garage */
#screen-agency > header { position: relative; min-height: 190px; flex-direction: column-reverse; flex-wrap: nowrap; justify-content: space-between; align-items: flex-start; padding: 24px 24px 18px; border-left: 4px solid var(--flag);
  background: linear-gradient(90deg, rgba(0, 0, 0, .92) 0%, rgba(0, 0, 0, .7) 30%, rgba(0, 0, 0, .15) 65%, rgba(0, 0, 0, .35) 100%), url("../assets/portada/agencia-pilotos.jpg") right 8% / cover no-repeat, #0b0b0b; }   /* v3 photo (very wide): the 4 helmets and torsos, none cut; the black one is the highest */
#screen-agency > header .back { align-self: flex-start; background: rgba(0, 0, 0, .65); border: 1px solid rgba(255, 255, 255, .55); color: #fff; }   /* top left, on the dark side of the photo: the drivers stand on the right */
#screen-agency > header .back:hover, #screen-agency > header .back:focus-visible { border-color: var(--flag); color: var(--flag); }
@media (max-width: 520px) { .g-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .g-menu .g-main b { font-size: 26px; } .g-menu button { min-height: 84px; padding: 12px; } .g-menu button b { font-size: 17px; } .g-menu button span { font-size: 12px; } .g-menu .g-main { min-height: 110px; } }
.g-tabs { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 0; border-bottom: 2px solid var(--line); }
.g-tabs button { border: 0; border-bottom: 4px solid transparent; margin-bottom: -2px; background: transparent; border-radius: 0; font-family: var(--display); font-style: italic; font-weight: 800; font-size: clamp(16px, 4.4vw, 34px); letter-spacing: .03em; text-transform: uppercase; padding: 12px 4px 10px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.g-tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--flag); background: transparent; }
.g-tabs button:hover { color: var(--fg); }
.g-pane { display: flex; flex-direction: column; gap: 16px; }
.g-pane .menu .tile[data-go="practice"]:not(.act) { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; min-height: 0; }
.g-pane .menu .tile[data-go="practice"]:not(.act) .tile-tag { margin: 0; }
.lineup { display: flex; flex-direction: column; gap: 12px; }
.lu-entry { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.lu-entry.active { border-left: 6px solid var(--flag); }
.lu-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lu-head h3 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 22px; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px; }
.lu-head .pos { font-family: var(--display); font-weight: 800; font-style: italic; font-size: 22px; color: var(--flag); }
.lu-head small { color: var(--muted); font-size: 14px; }
.lu-head .lu-btns { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.lu-head .lu-btns button { font-size: 14px; padding: 7px 12px; }
.lu-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 6px; }
.lu-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; font-size: 15px; }
.lu-row .r { grid-row: 1; grid-column: 1; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; color: var(--muted); }
.lu-row .n { grid-row: 2; grid-column: 1 / -1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lu-row .n b { font-family: var(--display); font-size: 17px; margin-left: 4px; }
.lu-row .c { grid-row: 3; grid-column: 1 / -1; justify-self: start; margin-top: 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 3px; white-space: nowrap; }
.lu-row .c.own { color: #3fc79a; border: 1px solid #3fc79a; }
.lu-row .c.rent { color: #f2c94c; border: 1px solid #f2c94c; }
.lu-row.empty .n { color: var(--muted); }
.lu-foot { font-size: 14px; color: var(--muted); }
.lu-foot b { color: var(--fg); }
.ag-top { display: flex; flex-direction: column; gap: 10px; }
.ag-sum { display: flex; gap: 10px; flex-wrap: wrap; }
.ag-sum div { padding: 10px 14px; border: 1px solid var(--line); border-radius: 4px; display: flex; flex-direction: column; min-width: 96px; }
.ag-sum b { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1; }
.ag-sum span { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ag-sum .st-team b { color: #3fc79a; } .ag-sum .st-lent b { color: #5b8def; } .ag-sum .st-free b { color: var(--fg); }
.st-chip { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 9px; border-radius: 3px; border: 1px solid; text-align: center; }
.st-chip.team { color: #3fc79a; } .st-chip.free { color: var(--muted); }
.ag-list { display: flex; flex-direction: column; gap: 6px; }
.ag-line { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; font-size: 14px; }
.ag-line b { font-weight: 700; }
.ag-line .paid { font-family: var(--display); font-weight: 800; font-size: 18px; color: #3fc79a; }
.ag-line .paid.zero { color: var(--muted); }
.ag-line.ag-face { flex-wrap: nowrap; align-items: flex-start; }   /* missing photos: the count stays on the right even when the names wrap */
.ag-line.ag-face > span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ag-line.ag-face > span:last-child { flex: none; }
#teamCards { display: flex; flex-direction: column; gap: 14px; }

