/* Handball Dynasty v39.7.0
   Definitive logo sizing and dashboard-aligned Tagesplan. */

/* League fixtures: never allow natural logo dimensions to drive card height. */
.lg350-schedule .lg350-fixtures article > div .club-with-logo,
.lg14-match-grid article > div .club-with-logo {
  display:grid!important;
  grid-template-columns:44px minmax(0,1fr)!important;
  align-items:center!important;
  gap:10px!important;
  min-width:0!important;
}
.lg350-schedule .lg350-fixtures article > div .club-with-logo.away,
.lg14-match-grid article > div .club-with-logo.away {
  grid-template-columns:minmax(0,1fr) 44px!important;
}
.lg350-schedule .lg350-fixtures .club-with-logo img,
.lg350-schedule .lg350-fixtures .club-with-logo img[class],
.lg14-match-grid .club-with-logo img,
.lg14-match-grid .club-with-logo img[class] {
  display:block!important;
  width:44px!important;
  height:44px!important;
  min-width:44px!important;
  min-height:44px!important;
  max-width:44px!important;
  max-height:44px!important;
  flex:0 0 44px!important;
  object-fit:contain!important;
  object-position:center!important;
  padding:3px!important;
  margin:0!important;
  border:1px solid #e4e9e6!important;
  border-radius:10px!important;
  background:#fff!important;
  transform:none!important;
}
.lg350-schedule .club-with-logo.away img,
.lg14-match-grid .club-with-logo.away img {grid-column:2!important;grid-row:1!important}
.lg350-schedule .club-with-logo.away > span,
.lg14-match-grid .club-with-logo.away > span {grid-column:1!important;grid-row:1!important}

/* National cup and Europe fixture cards. */
.cup354-match-grid .cup392-team,
.eu3813-match-card .cup392-team {grid-template-columns:40px minmax(0,1fr)!important}
.cup354-match-grid .cup392-team.away,
.eu3813-match-card .cup392-team.away {grid-template-columns:minmax(0,1fr) 40px!important}
.cup354-match-grid .cup392-team img,
.cup354-match-grid .cup392-team img[class],
.eu3813-match-card .cup392-team img,
.eu3813-match-card .cup392-team img[class] {
  display:block!important;width:40px!important;height:40px!important;
  min-width:40px!important;min-height:40px!important;max-width:40px!important;max-height:40px!important;
  object-fit:contain!important;padding:3px!important;margin:0!important;border-radius:9px!important;
  transform:none!important;
}

/* Season calendar: compact identity marks only. */
.cal360-event .cal360-team {display:grid!important;grid-template-columns:34px minmax(0,1fr)!important;align-items:center!important;gap:8px!important}
.cal360-event .cal360-team.away {grid-template-columns:minmax(0,1fr) 34px!important}
.cal360-event .cal360-team img,
.cal360-event .cal360-team img[class],
.cal360-event .cal360-team .club-logo {
  display:block!important;width:34px!important;height:34px!important;
  min-width:34px!important;min-height:34px!important;max-width:34px!important;max-height:34px!important;
  flex:0 0 34px!important;object-fit:contain!important;object-position:center!important;
  padding:2px!important;margin:0!important;border-radius:8px!important;background:#fff!important;
  transform:none!important;
}
.cal360-event .cal360-team.away img {grid-column:2!important;grid-row:1!important}
.cal360-event .cal360-team.away b {grid-column:1!important;grid-row:1!important}

/* Statistics: logos are supportive icons, never main imagery. */
.lg1405-stat-page .stat-club-line img,
.lg1405-stat-page .stat-club-line img[class],
.lg1405-stat-table .person .stat-club-line img,
.hd-summary-player .stat-club-line img {
  display:inline-block!important;width:18px!important;height:18px!important;
  min-width:18px!important;min-height:18px!important;max-width:18px!important;max-height:18px!important;
  flex:0 0 18px!important;object-fit:contain!important;padding:0!important;margin:0 3px 0 0!important;
  border:0!important;border-radius:4px!important;background:transparent!important;transform:none!important;
}
.lg1405-summary-grid .stat-team-title img,
.lg1405-summary-grid img.stat-summary-logo,
.lg1405-team-fairplay img,
.lg1405-team-fairplay img[class] {
  display:inline-block!important;width:26px!important;height:26px!important;
  min-width:26px!important;min-height:26px!important;max-width:26px!important;max-height:26px!important;
  flex:0 0 26px!important;object-fit:contain!important;padding:1px!important;margin:0!important;
  border-radius:6px!important;background:#fff!important;transform:none!important;
}
.lg1405-stat-table .person > img.hd-rank-portrait {
  width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;
  max-width:34px!important;max-height:34px!important;object-fit:cover!important;border-radius:9px!important;
}

/* Tagesplan follows the dashboard's light, calm visual hierarchy. */
body.command main {background:#f5f7f6!important}
body.command .mc390.mc393-unified {max-width:1680px!important;padding:28px 26px 48px!important}
body.command .mc393-day-hero {
  min-height:286px!important;
  grid-template-columns:minmax(0,1fr) 330px!important;
  padding:36px 48px!important;
  border:1px solid #e3e8e5!important;
  border-radius:20px!important;
  background:linear-gradient(90deg,rgba(255,255,255,.99) 0%,rgba(255,255,255,.94) 43%,rgba(245,248,247,.48) 62%,rgba(8,24,38,.42) 100%),url('../img/v38/dashboard-arena-hero.webp') center/cover no-repeat!important;
  box-shadow:0 14px 34px rgba(16,33,58,.08)!important;
}
body.command .mc393-day-hero .mc390-hero-copy {max-width:660px!important}
body.command .mc393-day-hero h1 {font-size:38px!important;color:#10213a!important;margin-bottom:12px!important}
body.command .mc393-day-hero p {font-size:15px!important;line-height:1.55!important;color:#6d7c8d!important}
body.command .mc393-day-hero .mc390-club-logo {
  width:210px!important;height:210px!important;max-width:210px!important;max-height:210px!important;
  object-fit:contain!important;filter:drop-shadow(0 18px 24px rgba(9,26,42,.22))!important;
}
body.command .mc390-kpis {margin:16px 0!important;border-radius:16px!important}
body.command .mc390-kpis a {min-height:88px!important;padding:15px 18px!important}
body.command .mc390-tabs {max-width:760px!important;margin:0 auto 16px!important}
body.command .mc390-section {padding:20px!important}
body.command .mc390-section>header h2 {font-size:23px!important}
body.command .mc390-task-grid {grid-template-columns:repeat(3,minmax(0,1fr))!important}
body.command .mc390-task {
  display:grid!important;grid-template-columns:40px minmax(0,1fr)!important;
  align-content:start!important;min-height:190px!important;padding:15px!important;background:#fff!important;
}
body.command .mc390-task-actions {grid-column:1/-1!important;display:grid!important;grid-template-columns:1fr 1fr!important;margin-top:auto!important}

@media(max-width:1100px){
  body.command .mc390-task-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:760px){
  .lg350-schedule .lg350-fixtures article > div .club-with-logo,.lg14-match-grid article > div .club-with-logo{grid-template-columns:34px minmax(0,1fr)!important}
  .lg350-schedule .lg350-fixtures article > div .club-with-logo.away,.lg14-match-grid article > div .club-with-logo.away{grid-template-columns:minmax(0,1fr) 34px!important}
  .lg350-schedule .lg350-fixtures .club-with-logo img,.lg14-match-grid .club-with-logo img{width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;max-width:34px!important;max-height:34px!important;flex-basis:34px!important}
  .cal360-event .cal360-team,.cal360-event .cal360-team.away{display:flex!important;flex-direction:column!important;gap:4px!important;text-align:center!important}
  .cal360-event .cal360-team img,.cal360-event .cal360-team img[class]{width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important;max-width:28px!important;max-height:28px!important;flex-basis:28px!important}
  body.command .mc393-day-hero{grid-template-columns:1fr!important;padding:25px 22px!important;min-height:0!important}
  body.command .mc393-day-hero .mc390-hero-logo{display:none!important}
  body.command .mc390-task-grid{grid-template-columns:1fr!important}
}

/* v39.8.0: selectors target the real rendered fixture and calendar markup. */
body.league .lg350-schedule .lg350-fixtures > article {
  min-height:178px!important;
}
body.league .lg350-schedule .lg350-fixtures > article > div {
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 62px minmax(0,1fr)!important;
  align-items:center!important;
  gap:16px!important;
  min-height:104px!important;
  padding:14px 18px!important;
}
body.league .lg350-schedule .lg350-fixtures > article > div > .club-with-logo {
  display:grid!important;
  grid-template-columns:52px minmax(0,1fr)!important;
  align-items:center!important;
  gap:12px!important;
}
body.league .lg350-schedule .lg350-fixtures > article > div > .club-with-logo.away {
  grid-template-columns:minmax(0,1fr) 52px!important;
}
body.league .lg350-schedule .lg350-fixtures > article > div > .club-with-logo > img {
  width:52px!important;height:52px!important;
  min-width:52px!important;min-height:52px!important;
  max-width:52px!important;max-height:52px!important;
  object-fit:contain!important;transform:none!important;
}
body.league .lg350-schedule .lg350-fixtures > article > div > strong {
  font-size:18px!important;
}

body.calendar .cal360-event p {
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 74px minmax(0,1fr)!important;
  align-items:center!important;
  gap:12px!important;
}
body.calendar .cal360-event .cal360-team {
  display:grid!important;
  grid-template-columns:42px minmax(0,1fr)!important;
  align-items:center!important;
  gap:10px!important;
}
body.calendar .cal360-event .cal360-team.away {
  grid-template-columns:minmax(0,1fr) 42px!important;
}
body.calendar .cal360-event .cal360-team > img {
  width:42px!important;height:42px!important;
  min-width:42px!important;min-height:42px!important;
  max-width:42px!important;max-height:42px!important;
  object-fit:contain!important;transform:none!important;
}

body.league .lg1405-stat-table .person small.stat-club-line img,
body.league .lg1405-stat-page .stat-club-line img,
body.league .hd-summary-player .stat-club-line img {
  width:20px!important;height:20px!important;
  min-width:20px!important;min-height:20px!important;
  max-width:20px!important;max-height:20px!important;
  object-fit:contain!important;transform:none!important;
}
body.league .lg1405-summary-grid img.stat-summary-logo,
body.league .lg1405-team-fairplay img {
  width:32px!important;height:32px!important;
  min-width:32px!important;min-height:32px!important;
  max-width:32px!important;max-height:32px!important;
  object-fit:contain!important;transform:none!important;
}

/* Tagesplan: same visual rhythm as dashboard, without duplicate generic hero. */
body.command .page-hero,
body.command .v10-pagehero,
body.command main > .hero,
body.command main > section:first-child:not(.mc390) {display:none!important}
body.command main {padding-top:28px!important}
body.command .mc390.mc393-unified {display:block!important;max-width:1680px!important;margin:0 auto!important;padding:0 24px 48px!important}
body.command .mc393-day-hero {
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 300px!important;
  align-items:center!important;
  min-height:310px!important;
  padding:38px 48px!important;
  overflow:hidden!important;
}
body.command .mc390-hero-copy,
body.command .mc390-hero-actions,
body.command .mc390-kpis,
body.command .mc390-tabs,
body.command .mc390-section {display:flex!important}
body.command .mc390-hero-copy {flex-direction:column!important;align-items:flex-start!important}
body.command .mc390-hero-actions {align-items:center!important;gap:14px!important}
body.command .mc390-kpis {display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important}
body.command .mc390-tabs {justify-content:center!important}
body.command .mc390-section {display:block!important}
body.command .mc390-task-grid {display:grid!important}
body.command .mc390-club-logo {display:block!important;width:210px!important;height:210px!important;max-width:210px!important;max-height:210px!important;object-fit:contain!important}

@media(max-width:900px){
  body.league .lg350-schedule .lg350-fixtures > article > div{grid-template-columns:1fr!important;text-align:center!important}
  body.league .lg350-schedule .lg350-fixtures > article > div > .club-with-logo,
  body.league .lg350-schedule .lg350-fixtures > article > div > .club-with-logo.away{display:flex!important;flex-direction:column!important;justify-content:center!important;text-align:center!important}
  body.calendar .cal360-event p{grid-template-columns:1fr!important;text-align:center!important}
  body.calendar .cal360-event .cal360-team,
  body.calendar .cal360-event .cal360-team.away{display:flex!important;flex-direction:column!important;justify-content:center!important;text-align:center!important}
  body.command .mc393-day-hero{grid-template-columns:1fr!important}
  body.command .mc390-hero-logo{display:none!important}
  body.command .mc390-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
