/* Unified card hierarchy: OVR → position/photo → name → stamina. */
.roster-card {
  min-height: 0;
  aspect-ratio: 2 / 3;
  border-width: 4px;
  border-radius: 12px 12px 31px 31px;
  background: linear-gradient(145deg, #172333, #07111e 55%, #1a2735);
}
.roster-card::before { inset: 8px; border-radius: 8px 8px 23px 23px; }
.roster-card.division-4, .player-card.division-4, .modal-player-card.division-4 { border-color: #238eea; box-shadow: 0 0 0 2px #58bdfd66, 0 11px 24px #000b; }
.roster-card.division-3, .player-card.division-3, .modal-player-card.division-3 { border-color: #e64d54; box-shadow: 0 0 0 2px #ff9a9666, 0 11px 24px #000b; }
.roster-card.division-2, .player-card.division-2, .modal-player-card.division-2 { border-color: #955ce7; box-shadow: 0 0 0 2px #c6a6ff66, 0 11px 24px #000b; }
.roster-card.division-1, .player-card.division-1, .modal-player-card.division-1 { border-color: #e5bd4b; box-shadow: 0 0 0 2px #ffe59a88, 0 11px 24px #000b; }
.collection-rating { top: 11px; left: 13px; right: auto; color: #fff0a6; font-size: 32px; line-height: 1; }
.collection-position { top: 51px; left: 13px; z-index: 3; width: 30px; height: 30px; background: #06111cbb; font-size: 11px; }
.collection-avatar { top: 47px; width: 122px; height: 137px; border: 2px solid #dceeff99; border-radius: 48% 48% 26% 26%; background-color: #10253a; box-shadow: 0 5px 16px #000b; overflow: hidden; }
.collection-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.collection-stars, .collection-condition { display: none; }
.collection-name { right: 9px; bottom: 49px; left: 9px; font-size: 17px; line-height: 1.15; text-align: center; }
.collection-stamina, .card-stamina, .modal-card-condition { position: absolute; overflow: hidden; border: 1px solid #ffffff55; background: #050d16; }
.collection-stamina { right: 10px; bottom: 16px; left: 10px; height: 20px; border-radius: 4px; }
.collection-stamina i, .card-stamina i, .modal-card-condition i { position: absolute; inset: 0 auto 0 0; display: block; opacity: .78; }
.collection-stamina b, .card-stamina b, .modal-card-condition b { position: absolute; inset: 0; display: grid; place-items: center; color: #f6fbff; font-size: 10px; text-shadow: 0 1px 2px #000; }
.stamina-green i { background: #18b66c; }.stamina-yellow i { background: #d5b72f; }.stamina-orange i { background: #e77b2e; }.stamina-red i { background: #d84548; }

/* Compact field cards retain the same information hierarchy. */
.player-card { border-width: 2px; overflow: hidden; }
.player-card .card-rating { top: 9px; bottom: auto; left: 9px; color: #fff09b; font-size: 19px; }
.player-card .card-position { top: 9px; right: 8px; left: auto; }
.player-card .card-avatar { top: 31px; left: 50%; width: 52px; height: 56px; overflow: hidden; border: 1px solid #dceeff99; background-color: #10253a; }
.player-card .card-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.player-card .card-name { right: 4px; bottom: 29px; left: 4px; font-size: 12px; }
.player-card .card-fatigue { display: none; }
.player-card .card-stamina { right: 7px; bottom: 8px; left: 7px; height: 14px; border-radius: 3px; }
.player-card .card-stamina b { font-size: 8px; }

/* The modal has a visibly larger portrait card, never a placeholder avatar when a photo exists. */
.modal-card-rating { top: 22px; right: auto; left: 23px; font-size: 60px; }
.modal-card-tier { top: 24px; left: 113px; }
.modal-card-position { top: 92px; left: 23px; z-index: 3; background: #07121ac9; }
.modal-card-avatar { top: 124px; width: 208px; height: 228px; overflow: hidden; border: 3px solid #e4f3ff99; border-radius: 50% 50% 30% 30%; background-color: #10253a; box-shadow: 0 8px 24px #000b; }
.modal-card-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.modal-card-stars { display: none; }
.modal-player-card strong { right: 18px; bottom: 61px; left: 18px; font-size: 25px; }
.modal-card-condition { right: 19px; bottom: 24px !important; left: 19px; height: 24px; border-radius: 5px; color: #fff; text-align: center; }
.modal-card-condition b { font-size: 12px; }

@media (max-width: 650px) {
  .collection-avatar { width: 98px; height: 112px; }
  .collection-name { font-size: 14px; }
}

/* Division colour is a complete card treatment, not only an outline. */
.roster-card.division-4, .player-card.division-4, .modal-player-card.division-4 { background: linear-gradient(145deg, #165a96 0%, #0b2f59 49%, #071c38 100%); }
.roster-card.division-3, .player-card.division-3, .modal-player-card.division-3 { background: linear-gradient(145deg, #8b2432 0%, #481624 49%, #260b14 100%); }
.roster-card.division-2, .player-card.division-2, .modal-player-card.division-2 { background: linear-gradient(145deg, #5c318f 0%, #321b5d 49%, #190d36 100%); }
.roster-card.division-1, .player-card.division-1, .modal-player-card.division-1 { background: linear-gradient(145deg, #8b6a20 0%, #4d3711 49%, #271b08 100%); }

/* Album cards: portrait dominates the card, with a larger name below it. */
.roster-card .card-tier { display: none; }
.roster-card .collection-rating { top: 14px; left: 15px; font-size: 39px; }
.roster-card .collection-position { top: 63px; left: 15px; min-width: 33px; width: auto; max-width: calc(100% - 30px); padding: 0 7px; background: #051424d9; font-size: 12px; }
.roster-card .collection-avatar { top: 57px; width: min(78%, 178px); height: min(58%, 196px); border-width: 3px; border-radius: 50% 50% 28% 28%; }
.roster-card .collection-name { right: 10px; bottom: 54px; left: 10px; font-size: 25px; font-weight: 950; }
.roster-card .collection-stamina { right: 12px; bottom: 17px; left: 12px; height: 24px; }
.roster-card .collection-stamina b { font-size: 12px; }

/* Field and bench cards are the same card treatment at a compact scale. */
.player-card { width: 104px; height: 154px; border-radius: 9px 9px 21px 21px; }
.player-card .card-rating { top: 10px; left: 10px; font-size: 25px; }
.player-card .card-position { top: 9px; right: 8px; left: auto; max-width: 64px; overflow: visible; color: #fff09b; font-size: 25px; line-height: 1; font-weight: 950; letter-spacing: -.5px; text-shadow: 0 2px 3px #000; white-space: nowrap; }
.player-card .card-position.long-position { max-width: 72px; font-size: 15px; letter-spacing: -1px; }
.player-card { clip-path: none; border-radius: 10px; }
.player-card .card-avatar { top: 39px; width: 73px; height: 78px; border-width: 2px; transform: translateX(-50%); }
.player-card .card-name { right: 3px; bottom: 33px; left: 3px; font-size: 14px; font-weight: 900; }
.player-card .card-stamina { right: 8px; bottom: 8px; left: 8px; height: 17px; }
.player-card .card-stamina b { font-size: 9px; }
.player-card .card-boost { display: none; }
.player-card.pos-CF, .player-card.pos-P, .player-card.pos-C { margin-left: -9px; }

/* Full-size cards need independent lanes on the field.  These coordinates keep
   every defensive card readable without overlap while retaining a real diamond. */
.field { height: 660px; }
.field .scoreboard { top: 2%; }
.field .pos-CF { left: calc(50% - 52px); top: 18%; }
.field .pos-LF { left: 12%; top: 24%; }
.field .pos-RF { right: 12%; top: 24%; }
.field .pos-SS { left: 27%; top: 33%; }
.field .pos-2B { right: auto; left: 61%; top: 33%; }
.field .pos-3B { left: 21%; top: 62%; }
.field .pos-1B { right: auto; left: 65%; top: 62%; }
.field .pos-P { left: calc(50% - 52px); top: 50%; }
.field .pos-C { left: calc(50% - 52px); top: 75%; bottom: auto; }
.player-card .card-rating, .player-card .card-position { top: 10px; height: 25px; line-height: 25px; }
.player-card[draggable="true"] { cursor: grab; }
.player-card.dragging { opacity: .42; cursor: grabbing; }
.player-card.drop-target { border-color: #ffdc69; box-shadow: 0 0 0 4px #ffdc6955, 0 11px 24px #000b; transform: translateY(-5px) scale(1.03); }

/* Keep the entire consented test photo visible inside a rectangular card window. */
.player-card .card-avatar,
.roster-card .collection-avatar,
.modal-card-avatar { border-radius: 5px; background: #e9f1f5; }
.player-card .card-avatar img,
.roster-card .collection-avatar img,
.modal-card-avatar img { width: 100%; height: 100%; padding: 2px; object-fit: contain; object-position: center; border-radius: 3px; background: #e9f1f5; }
.player-card .card-rating { top: 10px; left: 10px; font-size: 14px; }
.player-card .card-position { top: 10px; right: 9px; height: 18px; color: #fff09b; font-size: 14px; line-height: 18px; letter-spacing: 0; }
.player-card .card-position.long-position { font-size: 13px; }
.player-card .card-name { right: 8px; bottom: 33px; left: 8px; padding: 2px 3px; border-radius: 3px; background: rgba(255,255,255,.84); color: #07111a; font-size: 14px; font-weight: 950; text-shadow: none; }
.player-card,
.player-card:hover,
.player-card.selected { transform: none; transition: border-color .16s, box-shadow .16s, opacity .16s; }
.player-card.drop-target { transform: none; }

/* Large player profile card: rating and position share one header row. */
.modal-card-rating { top: 22px; left: 23px; right: auto; font-size: 58px; }
.modal-card-position { top: 35px; right: 24px; left: auto; width: auto; min-width: 46px; height: 38px; padding: 0 8px; border-radius: 6px; font-size: 25px; line-height: 38px; text-align: center; }
.modal-card-tier { top: 93px; left: 23px; }
.modal-card-avatar { top: 121px; width: 248px; height: 244px; border-radius: 5px; }
.modal-card-avatar img { padding: 3px; object-fit: contain; object-position: center; border-radius: 3px; }
.modal-player-card strong { bottom: 61px; color: #fff; }

@media (max-width: 900px) {
  .field { height: 610px; }
  .field .pos-SS { left: 24%; top: 31%; }
  .field .pos-2B { left: 61%; top: 31%; }
  .field .pos-3B { left: 16%; }
  .field .pos-1B { left: 72%; }
  .field .pos-P { top: 49%; }
  .field .pos-C { top: 76%; }
}

/* Bench is a horizontal card gallery: heading first, cards start from the left. */
.bench { display: block; padding: 15px 18px 17px; }
.bench > div:first-child { min-width: 0; margin: 0 0 10px; }
.bench > div:first-child h2 { margin-top: 3px; }
.bench-carousel { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 8px; align-items: center; }
.bench-cards { display: flex; gap: 12px; min-width: 0; padding: 5px 2px 8px; overflow-x: auto; scroll-behavior: smooth; scroll-snap-type: x mandatory; scrollbar-width: none; }
.bench-cards::-webkit-scrollbar { display: none; }
.bench-cards .bench-card { scroll-snap-align: start; }
.bench-arrow { width: 36px; height: 66px; border: 1px solid #57c9ec; border-radius: 8px; background: linear-gradient(145deg, #104869, #09273e); color: #dffaff; font-size: 38px; line-height: 1; cursor: pointer; box-shadow: 0 8px 18px #0007; }
.bench-arrow:hover { border-color: #ffe178; color: #ffe178; transform: translateY(-2px); }
@media (max-width: 650px) { .bench { padding: 13px; } .bench-carousel { grid-template-columns: 30px minmax(0, 1fr) 30px; gap: 5px; } .bench-arrow { width: 30px; height: 54px; font-size: 30px; } }

@media (max-width: 650px) {
  .roster-card .collection-avatar { width: min(76%, 142px); height: min(53%, 160px); }
  .roster-card .collection-name { font-size: 19px; }
}
