@media (orientation: portrait) {
  .app[data-screen="home"] #athlete-loading:not([hidden]) {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px 9px;
    inset-block-end: calc(100% + 8px);
    padding: 8px 12px;
    border: 1px solid #588786;
    border-radius: 7px 7px 10px 7px;
    background: linear-gradient(105deg, #173c43f5, #11262ff5);
    color: #e0f4ef;
    box-shadow: 0 4px 14px #04101866, inset 0 1px #d8fff019;
  }

  #athlete-loading .athlete-load-indicator {
    display: none;
    width: 18px;
    height: 10px;
    flex: none;
    background: repeating-linear-gradient(90deg, #8ee0ce 0 3px, transparent 3px 6px);
    transform: skewX(-24deg);
  }

  #athlete-loading[data-state="loading"] .athlete-load-indicator {
    display: block;
    animation: athlete-wait 1s ease-in-out infinite alternate;
  }

  .app[data-screen="home"] #athlete-loading[data-state="error"]:not([hidden]) {
    border-color: #bc9181;
    background: #241c25f5;
    color: #ffe0c8;
  }

  #athlete-loading #athlete-retry {
    margin: 0;
    padding: 5px 13px;
    border-radius: 6px;
    background: #312834;
    border-color: #a98477;
    font: 750 var(--type-action, 13px)/1.2 var(--volley-ui, system-ui, sans-serif);
  }

  @keyframes athlete-wait {
    from { opacity: .42; }
    to { opacity: 1; }
  }

  #dialog .lineup-plate {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    place-items: center;
    gap: 12px 8px;
    padding: 11px clamp(20px, 12vw, 60px);
    margin-bottom: 10px;
    border: 1px solid #4a6978;
    border-block-start-color: #759d9e;
    border-radius: 6px;
    background:
      linear-gradient(180deg, #15344580, #12273480),
      repeating-linear-gradient(90deg, #153744 0 1px, #112937 1px 24px);
  }

  #dialog .lineup-plate::before {
    content: "";
    position: absolute;
    inset: 0 8% auto;
    top: 50%;
    border-top: 1px dashed #86b3b861;
  }

  #dialog .lineup-plate > span {
    width: 14px;
    height: 14px;
    border: 1px solid #6ca3a3;
    border-radius: 50%;
    background: #2d6975;
    box-shadow: 0 2px 5px #06121c80;
  }

  #dialog[data-panel="lineup-loading"] .lineup-plate > span:not(:first-child) {
    animation: athlete-wait 760ms ease-in-out infinite alternate;
    animation-delay: var(--lineup-delay, 0ms);
  }

  #dialog[data-panel="lineup-loading"] .lineup-plate > span:first-child {
    background: #8fded1;
    border-color: #c2fff1;
  }

  #dialog .lineup-plate > span:nth-child(2n) { --lineup-delay: -230ms; }
  #dialog .lineup-plate > span:nth-child(3n) { --lineup-delay: -440ms; }

  #dialog[data-panel="lineup-error"] .lineup-plate {
    border-block-start-color: #dba291;
  }

  #dialog[data-panel="lineup-error"] .lineup-plate > span {
    background: #24313d;
    border-color: #7b7278;
  }

  #referee-inset #referee-label {
    border-top: 1px solid #9fced277;
    color: #e3f2ef;
    background: #0a1b29f5;
    padding-inline: 3px;
    font-size: clamp(10px, 2.82vw, 11px);
    white-space: nowrap;
  }

  #dialog .match-score-card {
    --tide-mark: url("./assets/team-tide.svg");
    --sun-mark: url("./assets/team-sun.svg");
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 4px;
    font: 700 24px/1 var(--volley-numeral, "Barlow Condensed", sans-serif);
    font-variant-numeric: tabular-nums;
    color: #fff4e5;
  }

  #dialog .match-score-side {
    --team-ink: #a9eee0;
    --team-edge: #457e7c;
    --team-wash: #183e48;
    --team-mark: var(--tide-mark);
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 5px 9px;
    border: 1px solid var(--team-edge);
    border-radius: 4px 4px 8px 4px;
    background: linear-gradient(106deg, var(--team-wash), #13232e);
  }

  #dialog .match-score-side[data-team="1"] {
    --team-ink: #ffc3ab;
    --team-edge: #87565c;
    --team-wash: #472e3a;
    --team-mark: var(--sun-mark);
    flex-direction: row-reverse;
    background: linear-gradient(254deg, var(--team-wash), #13232e);
  }

  #dialog .match-team-name {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--team-ink);
    white-space: nowrap;
    font: 750 var(--type-label, 12px)/1.2 var(--volley-ui, system-ui, sans-serif);
  }

  #dialog .match-team-name::before {
    content: "";
    width: 14px;
    height: 14px;
    flex: none;
    background: currentColor;
    -webkit-mask: var(--team-mark) center / contain no-repeat;
    mask: var(--team-mark) center / contain no-repeat;
  }

  #dialog .match-score-separator { color: #a3b6c0; }

  #dialog .pause-context {
    padding: 7px 8px;
    border: 1px solid #426271;
    border-radius: 7px;
    background: #0d1f2c;
  }

  #dialog .pause-match-detail {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 3px 9px;
    color: #bed2d7;
    font-size: var(--type-meta, 11px);
    line-height: 1.5;
  }

  #dialog .match-score-card + .pause-match-detail { margin-top: 7px; }
  #dialog .pause-match-detail strong { color: #f2eada; }
  #dialog .pause-service {
    margin: 5px 0 0;
    padding-inline: 1px;
    color: #a4bcc8;
    font-size: var(--type-meta, 11px);
    line-height: 1.45;
  }

  #dialog .pause-lesson {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid #537677;
    border-radius: 6px;
    background: linear-gradient(110deg, #183e48, #112631);
    color: #f1f7ef;
  }

  #dialog .pause-lesson span {
    flex: none;
    color: #a3e1d9;
    font: 700 19px/1 var(--volley-numeral, "Barlow Condensed", sans-serif);
    font-variant-numeric: tabular-nums;
  }

  :root[data-presentation="broadcast"] #dialog[data-panel="result"] {
    --winner-ink: #b4f0e1;
    --winner-haze: #2b656b;
    --winner-mark: url("./assets/team-tide.svg");
    border: 1px solid #7b949d;
    border-block-start: 3px solid var(--winner-ink);
    border-radius: 10px 10px 17px 10px;
    background:
      radial-gradient(ellipse at 50% -10%, var(--winner-haze), transparent 64%),
      linear-gradient(166deg, #172633, #0a1824 72%);
    box-shadow: 0 22px 64px #01070cd9, inset 0 1px #faf5e12e;
  }

  :root[data-presentation="broadcast"] #dialog[data-panel="result"][data-result-team="1"] {
    --winner-ink: #ffc6aa;
    --winner-haze: #76434c;
    --winner-mark: url("./assets/team-sun.svg");
  }

  :root[data-presentation="broadcast"] #dialog[data-panel="result"]::backdrop {
    background: linear-gradient(180deg, #05121ec4, #06101ba6 49%, #05121ee0);
  }

  :root[data-presentation="broadcast"] #dialog[data-panel="result"] #dialog-content {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: clamp(12px, 4.1vw, 19px);
  }

  :root[data-presentation="broadcast"] #dialog[data-panel="result"] .dialog-head {
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 0;
    text-align: center;
  }

  :root[data-presentation="broadcast"] #dialog[data-panel="result"] .dialog-head #dialog-title {
    color: #fff4e5;
    font: 900 clamp(24px, 7.5vw, 32px)/1.19 var(--volley-display);
    letter-spacing: .025em;
    text-shadow: 0 2px 12px #06121daa;
  }

  #dialog[data-panel="result"] #dialog-title:focus { outline: none; }

  #dialog .match-finish-banner {
    order: -1;
    display: grid;
    justify-items: center;
    gap: 9px;
    color: var(--winner-ink);
    font: 740 var(--type-meta, 11px)/1.25 var(--volley-ui, system-ui, sans-serif);
    letter-spacing: .18em;
  }

  #dialog .match-finish-banner > span:first-child {
    display: grid;
    grid-template-columns: 25px auto 25px;
    align-items: center;
    gap: 8px;
    margin-inline-start: .18em;
  }

  #dialog .match-finish-banner > span:first-child::before,
  #dialog .match-finish-banner > span:first-child::after {
    content: "";
    height: 1px;
    background: currentColor;
    opacity: .48;
  }

  #dialog .match-finish-emblem {
    display: grid;
    place-items: center;
    position: relative;
    width: 50px;
    height: 50px;
    border: 1px solid var(--winner-ink);
    border-radius: 15px 15px 19px 15px;
    background: linear-gradient(155deg, #c8e4f12c, #10212f80);
    box-shadow: 0 5px 16px #080e1b69, inset 0 0 0 3px #121b2d51;
    transform: rotate(-7deg);
  }

  #dialog .match-finish-emblem::before {
    content: "";
    width: 29px;
    height: 29px;
    background: currentColor;
    -webkit-mask: var(--winner-mark) center / contain no-repeat;
    mask: var(--winner-mark) center / contain no-repeat;
    transform: rotate(7deg);
  }

  #dialog[data-panel="result"] .match-score-card {
    margin-top: 4px;
    font-size: clamp(39px, 14vw, 65px);
  }

  #dialog[data-panel="result"] .match-score-side {
    position: relative;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    min-height: 94px;
    padding: 7px 6px 8px;
    overflow: hidden;
  }

  #dialog[data-panel="result"] .match-score-side[data-team="1"] {
    flex-direction: column;
  }

  #dialog[data-panel="result"] .match-score-side::before {
    content: "";
    position: absolute;
    left: -7px;
    bottom: -13px;
    width: 72px;
    height: 72px;
    background: var(--team-ink);
    -webkit-mask: var(--team-mark) center / contain no-repeat;
    mask: var(--team-mark) center / contain no-repeat;
    opacity: .10;
    pointer-events: none;
  }

  #dialog[data-panel="result"] .match-score-side[data-team="1"]::before {
    left: auto;
    right: -7px;
  }

  #dialog[data-panel="result"][data-result-team="0"] .match-score-side[data-team="0"],
  #dialog[data-panel="result"][data-result-team="1"] .match-score-side[data-team="1"] {
    border-block-start-color: var(--team-ink);
    box-shadow: inset 0 1px var(--team-ink);
  }

  #dialog[data-panel="result"] .match-score-separator {
    font-size: .7em;
    transform: translateY(.26em);
  }

  :root[data-presentation="broadcast"] #dialog[data-panel="result"] .dialog-copy {
    margin: 0;
    text-align: center;
  }

  :root[data-presentation="broadcast"] #dialog[data-panel="result"] .dialog-actions {
    margin-top: 3px;
    padding-top: 9px;
    border-top: 1px solid #526574a3;
  }
}

@media (orientation: portrait) and (prefers-reduced-motion: reduce) {
  #athlete-loading[data-state="loading"] .athlete-load-indicator { animation: none; }
  #dialog[data-panel="lineup-loading"] .lineup-plate > span { animation: none; }
}

@media (orientation: portrait) and (prefers-reduced-motion: no-preference) {
  #dialog[open][data-panel="result"] .match-finish-emblem {
    animation: match-finish-rise 280ms cubic-bezier(.19, .83, .35, 1) both;
  }

  @keyframes match-finish-rise {
    from { opacity: .36; transform: translateY(6px) scale(.84) rotate(-12deg); }
    to { opacity: 1; transform: translateY(0) scale(1) rotate(-7deg); }
  }
}

@container home-screen (orientation: portrait) and (max-height: 560px) {
  .app[data-screen="home"] #athlete-loading[data-state="error"]:not([hidden]) {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 5px 8px;
  }

  .app[data-screen="home"] #athlete-loading[data-state="error"] #athlete-loading-text {
    flex: 1;
    min-width: 0;
  }

  .app[data-screen="home"] #athlete-loading[data-state="error"] #athlete-retry {
    flex: none;
    padding-inline: 9px;
  }
}
