/* ELMANAGER: charcoal menus in the spirit of FIFA 14. Lime is the highlight (focus, hover, selected, primary);
   gold = titles and trophies, celeste = Libertadores and qualification, club color = small identity accents. */

:root {
  --bg0: #080808;
  --bg1: #151617;
  --panel: #1c1d1f;
  --panel-2: #242528;
  --panel-3: #2d2e32;
  --line: #34363a;
  --line-2: #4b4e54;
  --text: #f4f5f1;
  --dim: #b3b6ba;
  --faint: #7b7e84;
  --lime: #b4d335;
  --lime-hi: #c9e752;
  --lime-d: #94b01f;
  --on-lime: #10150a;
  --sky: #6cc4ff;
  --gold: #f5c542;
  --gold-d: #c9971a;
  --teal: #35c7b3;
  --red: #ff5a5f;
  --club: #b4d335;
  --club-rgb: 180, 211, 53;
  --gk: #f5c542;
  --def: #5aa7ee;
  --mid: #3ddc97;
  --fwd: #ff6b6b;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font-head: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg0); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  font: 400 16px/1.45 var(--font-body);
  background: var(--bg0);
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(118deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 30px),
    radial-gradient(900px 500px at 85% -10%, rgba(255, 255, 255, 0.07), transparent 65%),
    linear-gradient(180deg, #1a1b1d, #0b0b0c 55%, #070707);
}
body.modal-open { overflow: hidden; }

h1, h2, h3, h4 { margin: 0; font-family: var(--font-head); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.05; }
p { margin: 0; }
button { font: inherit; color: inherit; }
ul, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }
a { color: inherit; }
img { max-width: 100%; }

:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
::selection { background: var(--lime); color: var(--on-lime); }

.noscript { padding: 24px; text-align: center; }

/* ---------- Screens ---------- */
.screen { width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px 16px calc(28px + var(--safe-b)); }
.screen-in { animation: screen-in 0.35s ease-out both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.empty { text-align: center; color: var(--faint); font-size: 14px; padding: 18px 0; }

/* Section titles carry the small lime bar. */
.page-title, .section-title, .panel-title, .card-title, .sheet-title { display: flex; align-items: center; }
.page-title::before, .section-title::before, .panel-title::before, .card-title::before, .sheet-title::before {
  content: '';
  flex: 0 0 auto;
  width: 5px;
  height: 0.85em;
  margin-right: 10px;
  background: var(--lime);
}
.page-title { font-size: 34px; }
.section-title { margin: 4px 0 12px; font-size: 18px; letter-spacing: 0.12em; color: var(--dim); }
.panel-title { margin-bottom: 12px; font-size: 22px; }

/* ---------- Panels, badges, buttons ---------- */
.panel { position: relative; padding: 16px; background: var(--panel); border: 1px solid var(--line); }

.badge, .prob {
  display: inline-block;
  padding: 3px 10px;
  font: 700 13px/1.2 var(--font-head);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--line-2);
  white-space: nowrap;
}
.badge-ok, .badge-lime { color: var(--on-lime); background: var(--lime); border-color: var(--lime); }
.badge-sky { color: #04101f; background: var(--sky); border-color: var(--sky); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid var(--line-2);
  cursor: pointer;
  color: var(--text);
  background: var(--panel-3);
  font: 700 17px/1 var(--font-head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, transform 0.12s ease, opacity 0.15s ease;
}
.btn-in { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-txt { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; }
.btn-txt small { font: 600 12px/1 var(--font-body); letter-spacing: 0.02em; text-transform: none; opacity: 0.8; }
.btn .ico { width: 20px; height: 20px; }
.btn-primary { color: var(--on-lime); background: var(--lime); border-color: var(--lime); }
.btn-ghost { background: transparent; }
.btn-danger { color: #ff9ea1; background: rgba(255, 90, 95, 0.12); border-color: rgba(255, 90, 95, 0.55); }
.btn-block { display: flex; width: 100%; }
.btn-xl { min-height: 58px; padding: 0 32px; font-size: 21px; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary:disabled { color: var(--faint); background: var(--panel-3); border-color: var(--line-2); opacity: 0.7; }
.btn:focus-visible { color: var(--on-lime); background: var(--lime); border-color: var(--lime); outline-color: #fff; outline-offset: 2px; }
.btn-danger:focus-visible { color: #fff; background: var(--red); border-color: var(--red); }
.btn:active:not(:disabled) { color: var(--on-lime); background: var(--lime-d); border-color: var(--lime-d); transform: translateY(1px); }
@media (hover: hover) {
  .btn:hover:not(:disabled) { color: var(--on-lime); background: var(--lime); border-color: var(--lime); }
  .btn-primary:hover:not(:disabled) { background: var(--lime-hi); border-color: var(--lime-hi); }
  .btn-danger:hover:not(:disabled) { color: #fff; background: var(--red); border-color: var(--red); }
}

.ico { display: inline-flex; width: 22px; height: 22px; flex: 0 0 auto; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--text);
  background: #101112;
  border: 1px solid var(--line-2);
  border-radius: 0;
  font: 500 16px var(--font-body);
}
.input::placeholder { color: var(--faint); }
.input:focus-visible { outline: 0; border-color: var(--lime); box-shadow: inset 0 0 0 1px var(--lime); }
.field-label { display: block; margin: 18px 0 8px; font: 700 14px var(--font-head); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.slider { width: 100%; height: 34px; margin: 6px 0 0; accent-color: var(--lime); }
.budget-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--faint); }
.budget-out { font: 700 28px var(--font-head); color: var(--lime); }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg-btn { min-height: 46px; color: var(--text); background: var(--panel-3); border: 1px solid var(--line-2); font: 700 17px var(--font-head); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.seg-btn.is-active, .seg-btn:active, .seg-btn:focus-visible { color: var(--on-lime); background: var(--lime); border-color: var(--lime); }
.seg-btn:focus-visible { outline-color: #fff; outline-offset: 2px; }
@media (hover: hover) { .seg-btn:hover { color: var(--on-lime); background: var(--lime); border-color: var(--lime); } }
.diff-note { margin-top: 8px; min-height: 40px; font-size: 13px; color: var(--dim); }

.chip-row { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  color: var(--text);
  background: var(--panel-3);
  border: 1px solid var(--line-2);
  font: 700 14px var(--font-head);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
}
.chip.is-active, .chip:active, .chip:focus-visible { color: var(--on-lime); background: var(--lime); border-color: var(--lime); }
.chip:focus-visible { outline-color: #fff; outline-offset: 2px; }
@media (hover: hover) { .chip:hover { color: var(--on-lime); background: var(--lime); border-color: var(--lime); } }

.info-bar { padding: 10px 12px; margin-bottom: 12px; font-size: 14px; color: var(--dim); background: rgba(255, 255, 255, 0.045); border-left: 3px solid var(--line-2); }
.info-bar.good { color: var(--lime); border-color: var(--lime); background: rgba(180, 211, 53, 0.1); }

/* ---------- Modals ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.78); animation: fade 0.2s both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  max-height: 92dvh;
  background: var(--panel);
  border-top: 3px solid var(--lime);
  animation: sheet-up 0.26s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-lg { max-width: 820px; }
.sheet-grab { width: 44px; height: 4px; margin: 8px auto 0; background: var(--line-2); }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 18px; border-bottom: 1px solid var(--line); }
.sheet-ico { display: inline-flex; color: var(--lime); }
.sheet-title { flex: 1; font-size: 24px; }
.sheet-close { width: 48px; height: 48px; display: grid; place-items: center; color: var(--dim); background: none; border: 0; cursor: pointer; }
.sheet-close:hover, .sheet-close:focus-visible { color: var(--lime); }
.sheet-body { flex: 1; min-height: 0; padding: 14px 18px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-foot { display: flex; gap: 12px; padding: 12px 18px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--bg1); }
.sheet-foot .btn { flex: 1; }
.dialog-text { color: var(--dim); font-size: 16px; }
@media (min-width: 720px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { max-height: min(88dvh, 860px); border: 1px solid var(--line-2); border-top: 3px solid var(--lime); animation: sheet-pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
  .sheet-grab { display: none; }
}
@keyframes sheet-pop { from { transform: scale(0.97) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-b));
  z-index: 400;
  max-width: min(92vw, 520px);
  padding: 12px 20px;
  color: var(--text);
  text-align: center;
  background: var(--panel-3);
  border: 1px solid var(--line-2);
  border-left: 4px solid var(--lime);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Title screen ---------- */
.title-screen { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100dvh; max-width: none; padding: 40px 20px 70px; overflow: hidden; text-align: center; }
.stadium-fx { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.light { position: absolute; top: -2%; width: min(34vw, 420px); min-width: 200px; height: 80%; background: linear-gradient(180deg, rgba(235, 240, 255, 0.3), rgba(235, 240, 255, 0.04) 70%, transparent); clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%); transform-origin: 50% 0; animation: sway 9s ease-in-out infinite alternate; opacity: 0.85; }
.light.l1 { left: -4%; --r: -16deg; }
.light.l2 { left: 22%; --r: -6deg; animation-delay: -3s; }
.light.l3 { right: 22%; --r: 6deg; animation-delay: -5s; }
.light.l4 { right: -4%; --r: 16deg; animation-delay: -7s; }
@keyframes sway { from { transform: rotate(calc(var(--r) - 3deg)); opacity: 0.6; } to { transform: rotate(calc(var(--r) + 3deg)); opacity: 0.95; } }
.pitch-floor {
  position: absolute; left: 50%; bottom: -8%; width: 150%; height: 52%;
  transform: translateX(-50%) perspective(720px) rotateX(62deg);
  transform-origin: 50% 100%;
  background: repeating-linear-gradient(90deg, rgba(140, 180, 40, 0.14) 0 8%, rgba(90, 130, 30, 0.12) 8% 16%);
  border: 3px solid rgba(255, 255, 255, 0.18);
  -webkit-mask-image: linear-gradient(to top, #000 35%, transparent);
  mask-image: linear-gradient(to top, #000 35%, transparent);
}
.pf-circle { position: absolute; left: 50%; top: 50%; width: 24%; aspect-ratio: 1; border: 3px solid rgba(255, 255, 255, 0.18); border-radius: 50%; transform: translate(-50%, -50%); }
.pf-line { position: absolute; left: 0; right: 0; top: 50%; border-top: 3px solid rgba(255, 255, 255, 0.18); }
.pf-box { position: absolute; left: 30%; right: 30%; bottom: 0; height: 26%; border: 3px solid rgba(255, 255, 255, 0.18); border-bottom: 0; }
.title-body { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; max-width: 640px; }
.title-body > * { animation: rise 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.title-body > :nth-child(2) { animation-delay: 0.08s; }
.title-body > :nth-child(3) { animation-delay: 0.16s; }
.title-body > :nth-child(4) { animation-delay: 0.24s; }
.title-body > :nth-child(5) { animation-delay: 0.32s; }
.kicker { font: 700 15px var(--font-head); letter-spacing: 0.32em; text-transform: uppercase; color: var(--lime); }
.wordmark { font-size: clamp(58px, 17vw, 150px); font-weight: 800; font-style: italic; letter-spacing: 0.01em; line-height: 0.88; transform: skewX(-7deg); text-shadow: 0 6px 40px rgba(180, 211, 53, 0.22); }
.wm-el { color: var(--lime); }
.wm-rest { color: #fff; }
.wordmark::after { content: ''; display: block; height: 6px; margin-top: 10px; background: linear-gradient(90deg, var(--lime), transparent); }
.title-desc { max-width: 520px; font-size: 17px; color: var(--dim); }
.title-actions { display: flex; flex-direction: column; gap: 12px; width: min(100%, 360px); margin-top: 6px; }
.title-actions .btn { width: 100%; justify-content: flex-start; }
.cafe { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; color: var(--dim); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line-2); }
.cafe:hover, .cafe:focus-visible { color: var(--lime); border-color: var(--lime); }
.title-foot { position: absolute; left: 0; right: 0; bottom: calc(18px + var(--safe-b)); z-index: 1; font-size: 13px; color: var(--faint); }

/* ---------- Club select ---------- */
.setup-grid { display: grid; gap: 18px; }
.setup-main .input { margin-bottom: 12px; }
.club-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.club-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 92px; padding: 10px 4px; color: var(--dim); background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s; }
.ct-ring { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%); border: 2px solid var(--c, var(--line-2)); }
.ct-ring .crest { width: 32px; height: 32px; }
.ct-name { max-width: 100%; padding: 0 4px; overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.club-tile.is-selected, .club-tile:active, .club-tile:focus-visible { color: var(--on-lime); background: var(--lime); border-color: var(--lime); }
.club-tile:focus-visible { outline-color: #fff; outline-offset: 2px; }
.club-tile.is-selected .ct-ring, .club-tile:focus-visible .ct-ring { background: #fff; border-color: var(--on-lime); }
@media (hover: hover) {
  .club-tile:hover { color: var(--on-lime); background: var(--lime); border-color: var(--lime); }
  .club-tile:hover .ct-ring { background: #fff; border-color: var(--on-lime); }
}
.crest { width: 24px; height: 24px; object-fit: contain; flex: 0 0 auto; }
.crest-lg { width: 52px; height: 52px; }
.crest-xl { width: 68px; height: 68px; }
.flag { width: 20px; height: 14px; object-fit: cover; flex: 0 0 auto; background: var(--panel-3); }
.club-summary { min-height: 150px; }
.cs-empty { padding: 22px 0; color: var(--faint); }
.cs-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.cs-name { font-size: 28px; }
.cs-nick { color: var(--dim); }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.kv dt { font: 700 12px var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.kv dd { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.sticky-cta { position: sticky; bottom: 0; z-index: 2; padding: 14px 0 calc(6px + var(--safe-b)); margin-top: 8px; background: linear-gradient(to top, var(--panel) 65%, transparent); }
@media (min-width: 1024px) {
  .setup-grid { grid-template-columns: minmax(0, 1fr) 410px; align-items: start; }
  .setup-side { position: sticky; top: 16px; }
  .club-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
}

/* ---------- Hub ---------- */
.hub-head { margin-bottom: 18px; border-left: 4px solid var(--club); }
.hub-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.hub-club { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hub-id { min-width: 0; }
.hub-club-name { font-size: 30px; overflow-wrap: anywhere; }
.hub-dt { color: var(--dim); font-size: 14px; }
.hub-season { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hub-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.hub-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); }
.hub-stat .ico { width: 18px; height: 18px; color: var(--lime); }
.hs-val { font: 700 clamp(18px, 5.2vw, 26px)/1 var(--font-head); white-space: nowrap; }
.hs-lab { font: 700 12px var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.hub-stat.is-warn .hs-val { color: var(--red); }
.hub-grid { display: grid; gap: 18px; }
.hub-main { min-width: 0; }

.task-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  min-height: 136px;
  padding: 14px;
  text-align: left;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s ease, background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.tile-num { position: absolute; right: 10px; bottom: -12px; font: 800 86px/1 var(--font-head); color: rgba(255, 255, 255, 0.05); pointer-events: none; }
.tile .badge { position: absolute; top: 12px; left: 14px; }
.tile-ico { display: inline-flex; margin-top: 30px; color: var(--lime); }
.tile-ico .ico { width: 34px; height: 34px; }
.tile-name { font: 700 clamp(19px, 5.6vw, 24px)/1 var(--font-head); letter-spacing: 0.05em; text-transform: uppercase; }
.tile-sub { font-size: 13px; color: var(--dim); overflow-wrap: anywhere; }
.tile.is-current { grid-column: 1 / -1; border-color: var(--lime); animation: current-pulse 2.2s ease-in-out infinite; }
@keyframes current-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(180, 211, 53, 0); } 50% { box-shadow: 0 0 0 3px rgba(180, 211, 53, 0.28); } }
.tile.is-done .badge { color: var(--on-lime); background: var(--lime); border-color: var(--lime); }
.tile.is-locked { opacity: 0.45; cursor: not-allowed; }
.tile.is-locked .tile-ico { color: var(--faint); }
/* The focused / hovered / pressed tile fills with lime, like the FIFA menus. */
.tile:not(.is-locked):focus-visible, .tile:not(.is-locked):active { color: var(--on-lime); background: var(--lime); border-color: var(--lime); }
.tile:focus-visible { outline-color: #fff; outline-offset: 2px; }
@media (hover: hover) { .tile:not(.is-locked):hover { color: var(--on-lime); background: var(--lime); border-color: var(--lime); transform: translateY(-3px); } }
.tile:not(.is-locked):hover .tile-ico, .tile:not(.is-locked):focus-visible .tile-ico, .tile:not(.is-locked):active .tile-ico,
.tile:not(.is-locked):hover .tile-sub, .tile:not(.is-locked):focus-visible .tile-sub, .tile:not(.is-locked):active .tile-sub { color: var(--on-lime); }
.tile:not(.is-locked):hover .tile-num, .tile:not(.is-locked):focus-visible .tile-num, .tile:not(.is-locked):active .tile-num { color: rgba(0, 0, 0, 0.12); }
.tile:not(.is-locked):hover .badge, .tile:not(.is-locked):focus-visible .badge, .tile:not(.is-locked):active .badge { color: #fff; background: var(--on-lime); border-color: var(--on-lime); }
.hub-anim .tile { animation: rise 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) both; animation-delay: calc(var(--i) * 80ms + 120ms); }
.hub-anim .tile.is-current { animation: rise 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) both, current-pulse 2.2s ease-in-out 1s infinite; animation-delay: calc(var(--i) * 80ms + 120ms), 0s; }

.sim-bar { position: sticky; bottom: 0; z-index: 5; margin-top: 16px; padding: 12px 0 calc(10px + var(--safe-b)); background: linear-gradient(to top, var(--bg0) 62%, transparent); }
.sim-bar-row { display: flex; gap: 12px; }
.sim-bar-row .btn { flex: 1; }
.sim-hint { margin-top: 8px; text-align: center; font-size: 13px; color: var(--faint); }

.season-panel { align-self: start; }
.comp-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.comp-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--panel-2); border: 1px solid var(--line); }
.comp-list .ico { width: 20px; height: 20px; color: var(--gold); }
.cl-name { flex: 1; font-weight: 600; }
.panel-sub { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); }
.panel-sub h4 { margin-bottom: 8px; font-size: 16px; color: var(--lime); letter-spacing: 0.1em; }
.note-line { margin-bottom: 6px; font-size: 14px; color: var(--dim); }
.note-line strong { color: var(--text); }
.note-line.gold { color: var(--gold); font-weight: 600; }
.money-list > div { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; color: var(--dim); }
.money-list dd { font-weight: 600; color: var(--text); }
.money-list .total { margin-top: 4px; border-top: 1px solid var(--line-2); font-weight: 700; }
.money-list .total dd { color: var(--lime); font: 700 20px var(--font-head); }
@media (min-width: 1024px) {
  .hub-grid { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .task-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile.is-current { grid-column: auto; }
  .season-panel { position: sticky; top: 16px; }
}

/* ---------- Task sheets ---------- */
.attempts { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 14px; color: var(--dim); }
.pips { display: flex; gap: 6px; }
.pip { width: 12px; height: 12px; background: var(--lime); }
.pip.used { background: var(--line-2); }
.choice-grid { display: grid; gap: 8px; }
@media (min-width: 720px) { .choice-grid { grid-template-columns: 1fr 1fr; } }
.choice { display: flex; flex-direction: column; gap: 6px; min-height: 76px; padding: 12px 14px; text-align: left; color: var(--text); background: var(--panel-2); border: 1px solid var(--line-2); cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s; }
.choice.is-selected, .choice:not(:disabled):active, .choice:focus-visible { color: var(--on-lime); background: var(--lime); border-color: var(--lime); }
.choice:focus-visible { outline-color: #fff; outline-offset: 2px; }
@media (hover: hover) { .choice:not(:disabled):hover { color: var(--on-lime); background: var(--lime); border-color: var(--lime); } }
.choice:disabled { opacity: 0.45; cursor: not-allowed; }
.cc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cc-name { font: 700 19px var(--font-head); letter-spacing: 0.05em; text-transform: uppercase; }
.cc-detail { font-size: 13px; color: var(--dim); }
.choice.is-selected .cc-detail, .choice:focus-visible .cc-detail, .choice:active .cc-detail { color: rgba(16, 21, 10, 0.78); }
@media (hover: hover) { .choice:not(:disabled):hover .cc-detail { color: rgba(16, 21, 10, 0.78); } }
.prob.hi { color: var(--on-lime); background: var(--lime); border-color: var(--lime); }
.prob.mid { color: #2a1a00; background: var(--gold); border-color: var(--gold); }
.prob.lo { color: #2b0507; background: var(--red); border-color: var(--red); }

.list-group { position: sticky; top: -14px; z-index: 1; margin: 10px 0 2px; padding: 6px 2px; font-size: 14px; letter-spacing: 0.12em; color: var(--lime); background: var(--panel); }
.list { display: flex; flex-direction: column; }

.prow {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 6px 8px;
  text-align: left;
  color: var(--text);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.prow:last-child { border-bottom: 0; }
.prow.is-selected { background: rgba(180, 211, 53, 0.14); box-shadow: inset 4px 0 0 var(--lime); }
.prow.is-disabled { opacity: 0.4; cursor: not-allowed; }
.prow:focus-visible { outline-offset: -3px; background: var(--panel-3); }
.prow:not(:disabled):active { background: rgba(180, 211, 53, 0.2); }
@media (hover: hover) { .prow:not(:disabled):hover { background: var(--panel-3); } }
.pr-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pr-text { display: flex; flex-direction: column; min-width: 0; }
.pr-n { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-m { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-club { display: none; font-size: 13px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-price { min-width: 70px; text-align: right; font: 700 14px var(--font-head); letter-spacing: 0.03em; color: var(--dim); white-space: nowrap; }
.pr-check { width: 22px; color: var(--lime); }
.pr-check .ico { width: 20px; height: 20px; }
.pos { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 24px; padding: 0 6px; font: 700 13px var(--font-head); letter-spacing: 0.04em; color: #06101f; }
.pos.line-GK { background: var(--gk); }
.pos.line-DEF { background: var(--def); }
.pos.line-MID { background: var(--mid); }
.pos.line-FWD { background: var(--fwd); }
.ovr { display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding: 0 5px; font: 700 16px var(--font-head); background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line-2); }
.ovr.tier-gold { color: #2a1a00; background: var(--gold); border-color: var(--gold); }
.ovr.tier-silver { color: #101112; background: #d4d7dc; border-color: #d4d7dc; }

.budget-chip { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; margin-bottom: 10px; font-size: 14px; color: var(--dim); background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--lime); }
.budget-chip strong { font: 700 20px var(--font-head); color: var(--lime); }
.budget-chip .warn { color: var(--red); font-weight: 700; }
.market-head { display: none; }
.signed-box { margin-top: 16px; padding-top: 6px; border-top: 1px solid var(--line-2); }
@media (min-width: 720px) {
  .market .prow { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) 54px 44px 92px; }
  .market .pr-club { display: block; }
  .market .x-club { display: none; }
  .market-head { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) 54px 44px 92px; gap: 10px; padding: 4px 8px; font: 700 12px var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
  .market-head span:nth-child(5) { text-align: right; }
  .market-head span:last-child { display: none; }
}

/* ---------- Formation / pitch ---------- */
.formation-layout { display: grid; gap: 12px; }
.fl-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.fl-actions .btn { flex: 1; }
.formation-tabs { flex-wrap: nowrap; }
.fl-hint { display: none; }
.fl-side .info-bar, .fl-actions { margin-bottom: 8px; }
.fl-side .chip-row { padding-bottom: 6px; }
.pitch-box { display: flex; justify-content: center; }
.pitch {
  position: relative;
  container-type: inline-size;
  width: min(100%, calc((100dvh - 405px) * 0.6476));
  min-width: 230px;
  aspect-ratio: 68 / 105;
  color: rgba(255, 255, 255, 0.62);
  background: repeating-linear-gradient(0deg, #1e6237 0 10%, #19552f 10% 20%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12), 0 12px 34px rgba(0, 0, 0, 0.5);
}
.pitch-art { position: absolute; inset: 0; pointer-events: none; }
.pitch-lines { display: block; width: 100%; height: 100%; }
.slot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.slot-chip {
  display: grid;
  place-items: center;
  width: clamp(32px, 10.5cqw, 48px);
  aspect-ratio: 1;
  font: 700 clamp(12px, 3.8cqw, 18px) var(--font-head);
  color: #fff;
  background: rgba(6, 10, 6, 0.72);
  border: 2px dashed rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  transition: transform 0.15s;
}
.slot.is-filled .slot-chip { color: #06101f; background: var(--lc); border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.slot.line-GK { --lc: var(--gk); }
.slot.line-DEF { --lc: var(--def); }
.slot.line-MID { --lc: var(--mid); }
.slot.line-FWD { --lc: var(--fwd); }
.slot-name { max-width: 24cqw; padding: 0 5px; overflow: hidden; font: 700 clamp(10px, 2.9cqw, 13px) var(--font-body); color: #fff; text-overflow: ellipsis; white-space: nowrap; background: rgba(6, 10, 6, 0.66); }
.slot-name:empty { display: none; }
.slot:focus-visible { outline: 0; }
.slot:focus-visible .slot-chip { border-color: var(--lime); box-shadow: 0 0 0 3px var(--lime); }
@media (hover: hover) { .slot:hover .slot-chip { transform: scale(1.1); border-color: var(--lime); } }
.slot.is-active .slot-chip { animation: chip-pulse 0.9s ease-in-out infinite; }
@keyframes chip-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(180, 211, 53, 0.9); } 50% { box-shadow: 0 0 0 9px rgba(180, 211, 53, 0); } }
.picker-remove { margin-bottom: 10px; }
@media (min-width: 720px) {
  .formation-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 18px; }
  .fl-hint { display: block; }
  .formation-tabs { flex-wrap: wrap; overflow: visible; }
  .pitch { width: min(100%, calc((100dvh - 260px) * 0.6476)); }
}

/* ---------- Results ---------- */
.reveal { animation: rise 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) both; animation-delay: calc(var(--i, 0) * 140ms + 100ms); }
.res-hero { margin-bottom: 16px; padding-bottom: 20px; border-left: 4px solid var(--club); }
.res-hero.tone-gold { border-left-color: var(--gold); }
.res-hero.tone-sky { border-left-color: var(--sky); }
.res-hero.tone-bad { border-left-color: var(--red); }
.rh-top { display: flex; align-items: center; gap: 14px; }
.rh-club { font-size: 28px; }
.rh-year { color: var(--dim); font-size: 14px; }
.rh-main { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 14px 0 10px; }
.rh-pos { display: flex; align-items: baseline; gap: 12px; }
.rh-num { font: 800 clamp(76px, 22vw, 130px)/0.85 var(--font-head); color: var(--text); }
.rh-lab { font: 700 16px var(--font-head); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.tone-gold .rh-num { color: var(--gold); }
.tone-sky .rh-num { color: var(--sky); }
.tone-bad .rh-num { color: var(--red); }
.grade { padding: 6px 18px; font: 700 20px var(--font-head); letter-spacing: 0.08em; text-transform: uppercase; background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line-2); }
.grade-gold { color: #2a1a00; background: var(--gold); border-color: var(--gold); }
.grade-sky { color: #04101f; background: var(--sky); border-color: var(--sky); }
.grade-good { color: #04201b; background: var(--teal); border-color: var(--teal); }
.grade-bad { color: #2b0507; background: var(--red); border-color: var(--red); }
.rh-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.rh-stats div { display: flex; flex-direction: column; padding: 8px 10px; background: var(--panel-2); border: 1px solid var(--line); }
.rh-stats strong { font: 700 clamp(18px, 5vw, 24px)/1.1 var(--font-head); white-space: nowrap; }
.rh-stats span { font: 700 11px var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.banner-bad { margin-top: 14px; padding: 10px 14px; font: 700 20px var(--font-head); letter-spacing: 0.05em; text-transform: uppercase; color: #fff; background: rgba(255, 90, 95, 0.22); border-left: 4px solid var(--red); }
.summary-title { margin: 14px 0 4px; font-size: 30px; }
.stamps { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.stamp {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  font: 700 19px var(--font-head);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #2a1a00;
  background: linear-gradient(135deg, #ffe48a, var(--gold) 55%, var(--gold-d));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3), 0 4px 14px rgba(245, 197, 66, 0.25);
  transform: rotate(-3deg);
  animation: stamp 0.55s cubic-bezier(0.2, 1.6, 0.4, 1) both;
  animation-delay: var(--d, 0.9s);
}
.stamp .ico { width: 22px; height: 22px; }
.stamp-sky { color: #04101f; background: linear-gradient(135deg, #b9e3ff, var(--sky) 55%, #3d9ad6); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3), 0 4px 14px rgba(108, 196, 255, 0.25); }
.stamp-red { color: #fff; background: linear-gradient(135deg, #ff7a7e, var(--red) 55%, #c62f34); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25); }
@keyframes stamp { from { opacity: 0; transform: rotate(-3deg) scale(2.4); } to { opacity: 1; transform: rotate(-3deg) scale(1); } }

.cards { display: grid; gap: 16px; }
.card { min-width: 0; }
.card-title { margin-bottom: 12px; font-size: 22px; letter-spacing: 0.08em; }
.card-stack { display: flex; flex-direction: column; gap: 12px; }
.card > * + * { margin-top: 12px; }
.card > .card-title + * { margin-top: 0; }
.big-line { font: 700 22px/1.2 var(--font-head); letter-spacing: 0.03em; }
.sub-line { color: var(--dim); font-size: 14px; }
.mini-title { margin: 14px 0 6px; font-size: 15px; color: var(--dim); letter-spacing: 0.1em; }
.mini-title.bad { color: var(--red); }
.mini-title.good { color: var(--lime); }
.stage-tag { display: inline-block; padding: 2px 14px; background: rgba(255, 255, 255, 0.09); border: 1px solid var(--line-2); }
.stage-tag.is-gold { color: #2a1a00; background: var(--gold); border-color: var(--gold); }
.champ-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--dim); }
.champ-line .ico { width: 18px; height: 18px; color: var(--gold); }
.champ-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.champ-list li:last-child { border-bottom: 0; }
.cl-comp { color: var(--dim); }
.team { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team.is-mine { color: var(--text); font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 6px 12px; font-size: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.chip-bad { border-left: 3px solid var(--red); }
.chip-good { border-left: 3px solid var(--lime); }
.next-card { padding-bottom: 20px; }
.next-card .stamp { margin-bottom: 12px; }
.next-card.tone-sky { border-left: 4px solid var(--sky); }
.next-card.tone-bad { border-left: 4px solid var(--red); }
.next-card.tone-bad .big-line { color: var(--red); }
.next-card.tone-sky .big-line { color: var(--sky); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
table.standings { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.standings th, .standings td { padding: 8px 7px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--line); }
.standings thead th { font: 700 12px var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); background: var(--bg1); }
.standings tbody tr:last-child > * { border-bottom: 0; }
.standings .sticky-col { position: sticky; left: 0; z-index: 1; min-width: 150px; text-align: left; font-weight: 600; background: var(--panel); }
.standings .rank { display: inline-block; width: 24px; color: var(--faint); font-weight: 700; }
.standings .pts { font: 700 16px var(--font-head); }
.standings tr.is-mine > * { background: rgba(180, 211, 53, 0.16); }
.standings tr.is-mine .sticky-col { background: color-mix(in srgb, var(--panel) 82%, var(--lime)); }
.standings .team .crest { width: 20px; height: 20px; }
.zone-lib > .sticky-col { box-shadow: inset 4px 0 0 var(--sky); }
.zone-sud > .sticky-col { box-shadow: inset 4px 0 0 var(--teal); }
.zone-rel > .sticky-col { box-shadow: inset 4px 0 0 var(--red); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--dim); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend li::before { content: ''; width: 12px; height: 12px; background: var(--c); }
.legend .zone-lib { --c: var(--sky); }
.legend .zone-sud { --c: var(--teal); }
.legend .zone-rel { --c: var(--red); }
.history .sticky-col { min-width: 70px; }
.history td { padding: 10px 10px; }
.history .titles-cell { min-width: 160px; white-space: normal; text-align: left; }
.history tr.zone-lib > * { background: rgba(245, 197, 66, 0.07); }
.history tr.zone-lib > .sticky-col { box-shadow: inset 4px 0 0 var(--gold); }
@media (max-width: 419px) { .c-gep { display: none; } .standings .sticky-col { min-width: 132px; } }
@media (min-width: 1024px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .span-2 { grid-column: 1 / -1; } }

/* ---------- Simulation overlay ---------- */
.sim-overlay { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, 0.88); animation: fade 0.2s both; }
.sim-card { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(100%, 440px); padding: 28px 24px; text-align: center; }
.sim-ball { display: inline-flex; color: var(--lime); animation: spin 1.1s linear infinite; }
.sim-ball .ico { width: 54px; height: 54px; }
@keyframes spin { to { transform: rotate(360deg); } }
.sim-title { font-size: 28px; }
.sim-stage { min-height: 22px; color: var(--dim); }
.sim-bar-track { width: 100%; height: 10px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.sim-fill { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--lime-d), var(--lime-hi)); transition: width 0.06s linear; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* Market: player interest in joining the user club */
.market .interest-no { opacity: 0.55; }
.market .interest-no .pr-m { color: var(--red); }
.market .interest-maybe .pr-m { color: var(--gold); }
