.hole-score-summary {
  position: sticky;
  z-index: 4;
  top: env(safe-area-inset-top);
  align-self: start;
  min-width: 0;
  margin-top: 0;
  padding: 8px 0 6px;
  background: #f4f2e9;
}

.score-section .text-button {
  color: #d9e7d9;
}

.score-drawer {
  padding-top: 12px;
}

.round-heading {
  justify-content: flex-end;
  margin: 7px 0 5px;
}

#hole-panel {
  touch-action: pan-y;
}

@media (max-width: 619px) {
  body:has(#app-view:not([hidden])) {
    height: 100dvh;
    overflow: hidden;
  }

  body:has(#app-view:not([hidden])) .shell {
    height: 100%;
    padding: 0 8px;
  }

  body:has(#app-view:not([hidden])) main {
    height: 100%;
  }

  body:has(#app-view:not([hidden])) .site-header,
  body:has(#app-view:not([hidden])) .site-footer {
    display: none;
  }

  #app-view {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 4px;
    height: 100%;
    padding-top: env(safe-area-inset-top);
  }

  #app-view > .score-section {
    min-width: 0;
    margin: 0;
    padding: 0;
    border-radius: 10px;
  }

  #app-view > .score-section > summary {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 7px 12px;
  }

  #app-view > .score-section[open] {
    min-height: 0;
    max-height: min(36dvh, 280px);
    overflow-y: auto;
    padding: 8px 12px;
    background: #f4f2e9;
    color: #17382f;
    box-shadow: 0 12px 36px #102a1e45;
  }

  #app-view > .score-section[open] > summary {
    border-bottom: 1px solid #d6e2d7;
  }

  .score-section[open] .text-button {
    color: #2e5a45;
  }

  .score-section[open] #score-details {
    margin-top: 10px;
    padding: 10px;
    border-radius: 10px;
    background: #153d31;
  }

  .score-section[open] .score-row {
    background: #153d31;
  }

  .score-section[open] .hole-list {
    margin-bottom: 8px;
  }

  #app-view > .hole-section {
    min-height: 0;
    margin: 0;
  }

  #hole-panel {
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .hole-card {
    padding: 5px 8px;
    border-radius: 11px;
  }

  .hole-card-head h4 {
    font-size: 16px;
  }

  .hole-state {
    padding: 3px 7px;
  }

  .par3-button {
    display: block;
    min-height: 32px;
    margin: 2px 0 2px auto;
    padding: 3px 8px;
  }

  .player-card {
    display: grid;
    grid-template-columns: minmax(62px, 25%) minmax(0, 1fr);
    column-gap: 4px;
    align-items: center;
    padding: 3px 0;
  }

  .player-card:first-of-type {
    margin-top: 3px;
  }

  .player-card-head {
    min-width: 0;
    margin: 0;
  }

  .player-card-name {
    display: block;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .medal-buttons,
  .medal-buttons.three,
  .medal-buttons.with-diamond {
    display: grid;
    grid-column: 2;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    min-width: 0;
  }

  .medal-buttons.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .medal-buttons.with-diamond {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .medal-buttons.with-diamond.three {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .medal-button {
    min-height: 42px;
    padding: 3px 0;
    font-size: 11px;
  }

  .medal-button small {
    font-size: 9px;
  }

  .event-buttons {
    grid-column: 2;
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    min-width: 0;
    margin-top: 3px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
  }

  .event-button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 3px 6px;
    line-height: 1.2;
    white-space: nowrap;
  }

  .event-button small {
    margin-left: 2px;
  }

  .bottom-actions {
    position: static;
    margin: 0 -8px;
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
  }

  .bottom-actions .primary-button,
  .bottom-actions .secondary-button {
    min-height: 44px;
  }
}

@media (max-width: 619px) and (max-height: 550px) {
  #app-view {
    gap: 2px;
  }

  #app-view > .score-section > summary {
    min-height: 34px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  #app-view > .score-section[open] {
    max-height: 28dvh;
  }

  .hole-card {
    padding-top: 3px;
    padding-bottom: 3px;
  }

  .player-card {
    padding: 1px 0;
  }

  .medal-button {
    min-height: 36px;
  }

  .event-button {
    min-height: 29px;
  }

  .bottom-actions .primary-button,
  .bottom-actions .secondary-button {
    min-height: 40px;
  }
}
