/* Match-day tablet view: each action and court remains inside one viewport. */
@media (min-width: 700px) {
  html, body { width: 100%; height: 100%; overflow: hidden; }
  .app { width: 100%; max-width: none; height: 100vh; height: 100dvh; overflow: hidden; padding: max(7px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .layout, .layout aside, .entry, .court-card { min-width: 0; min-height: 0; }
  .layout aside { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, .42fr); gap: 6px; overflow: hidden; }
  .insights, .recent { display: block; min-height: 0; margin: 0; overflow: hidden; }
  .insights { display: flex; flex-direction: column; }
  .insights #insights { flex: 1; min-height: 0; display: grid; grid-template-rows: repeat(4, minmax(0, 1fr)); }
  .insight { min-height: 0; overflow: hidden; padding: 5px 0; }
  .insight b { margin: 0 0 2px; font-size: .75rem; line-height: 1.15; }
  .insight p { font-size: .78rem; line-height: 1.2; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .recent #history { max-height: none; height: calc(100% - 18px); overflow: hidden; }
  .rally:nth-child(n+3) { display: none; }
  .entry { overflow: hidden; }
  .entry h3 { margin: 6px 0; line-height: 1.18; }
  .choices { gap: 5px; min-height: 0; }
  .choice { min-height: 43px; line-height: 1.1; }
  .choice small { font-size: .69rem; }
  .actions { margin-top: auto; padding-top: 6px; }
  .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 6px; }
  .quick .btn { min-height: 38px; line-height: 1.1; padding: 5px; font-size: .82rem; }
  .court-head small { display: none; }
  .court-head { min-height: 24px; }
  .full-court { height: calc(100% - 28px); }
  .half, .spot { min-height: 0; }
}

@media (min-width: 700px) and (orientation: landscape) {
  .app { grid-template-columns: minmax(220px, .92fr) minmax(300px, 1.15fr) minmax(190px, .75fr); grid-template-rows: 34px 63px minmax(0, 1fr); gap: 7px; }
  .app > header, .app > .scoreboard { grid-column: 1 / -1; }
  .app > .court-card { grid-column: 1; grid-row: 3; }
  .app > .layout { display: contents; }
  .layout > .entry { grid-column: 2; grid-row: 3; }
  .layout > aside { grid-column: 3; grid-row: 3; }
  .full-court { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 8px minmax(0, 1fr); }
  .net { grid-row: 2; }
  .player { width: clamp(42px, 5vw, 56px); height: clamp(42px, 5vw, 56px); }
  .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 700px) and (orientation: portrait) {
  .app { grid-template-rows: 36px 66px minmax(240px, 32dvh) minmax(0, 1fr); gap: 7px; }
  .layout { display: grid; grid-template-columns: minmax(0, 1.48fr) minmax(0, 1fr); gap: 7px; }
  .layout > aside { min-width: 0; }
  .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player { width: 46px; height: 46px; }
}

@media (min-width: 700px) and (max-height: 680px) {
  .app { grid-template-rows: 30px 54px minmax(0, 1fr); gap: 5px; }
  .brand small, .recent, .court-head small { display: none; }
  .layout aside { display: block; }
  .insights #insights { grid-template-rows: repeat(4, minmax(0, 1fr)); }
  .choice { min-height: 37px; padding: 4px; }
  .choice small { display: none; }
  .quick .btn { min-height: 33px; }
}
