/* Anpassungen ausschließlich für kleinere Bildschirme. */
.mobile-game-list, .mobile-user-list { display: none; }

@media (max-width: 700px) {
  body { font-size: 15px; line-height: 1.45; }
  .container { width: calc(100% - 1rem); }

  header { gap: .55rem; padding: .75rem 0; margin-bottom: .9rem; }
  .brand { flex: 1; min-width: 0; font-size: 1.05rem; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu-button { width: 2.7rem; height: 2.7rem; }
  .menu-panel { min-width: min(18rem, calc(100vw - 1rem)); }
  .menu-panel > a, .menu-submenu > summary, .menu-submenu > a { padding: .7rem .75rem; }

  .account-actions { order: 3; width: 100%; justify-content: flex-end; margin-left: 0; gap: .5rem; font-size: .88rem; }
  .account-actions .text { min-height: 0; padding: .15rem 0; }

  h1 { font-size: 1.6rem; line-height: 1.2; }
  h2 { font-size: 1.22rem; line-height: 1.25; }
  h3 { font-size: 1.05rem; }
  .toolbar { gap: .55rem; margin: .2rem 0 .75rem; }

  .card, .legal { padding: .85rem; margin: .75rem 0; border-radius: 8px; }
  .content-page { margin-top: .5rem; }
  label { margin: .55rem 0; }
  input, select, textarea { min-height: 44px; padding: .55rem .6rem; font-size: 16px; }
  textarea { min-height: 100px; }
  button, .button { min-height: 44px; padding: .6rem .8rem; }

  .grid { gap: .45rem; }
  .filter-actions { display: flex; align-items: end; }
  .filter-actions button { width: 100%; }

  .table { margin: .7rem 0; border-radius: 7px; }
  .table table { min-width: 530px; font-size: .88rem; }
  .table th, .table td { padding: .5rem .45rem; vertical-align: middle; }
  .table th { white-space: nowrap; }
  .stats th:first-child, .stats td:first-child { min-width: 130px; white-space: normal; }
  .stats input { min-width: 42px; padding: .45rem .25rem; text-align: center; }
  .game-results table { min-width: 460px; table-layout: fixed; }
  .game-results th:first-child, .game-results td:first-child { width: 105px; min-width: 105px; }
  .game-results th:not(:first-child), .game-results td:not(:first-child) { width: 52px; }
  .game-actions { display: flex; flex-wrap: wrap; gap: .4rem; min-width: 150px; }
  .game-actions .button, .game-actions button { min-height: 38px; padding: .45rem .6rem; }

  .desktop-games-table { display: none; }
  .desktop-users-table { display: none; }
  .mobile-game-list { display: grid; gap: .65rem; margin: .65rem 0; }
  .mobile-game-card { background: #fffffff2; border: 1px solid var(--line); border-radius: 8px; padding: .8rem; box-shadow: 0 1px 5px #13251a0d; }
  .mobile-game-card-link { color: var(--ink); text-decoration: none; cursor: pointer; }
  .mobile-game-card-link:active { background: #e5f2e7; transform: scale(.99); }
  .mobile-game-card-link:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
  .toolbar .desktop-random-game { display: none !important; }
  .mobile-random-game { display: flex; align-items: center; justify-content:center; width:100%; min-height:44px; padding: .7rem .8rem; color: #fff; background: var(--green); border-color: var(--green); text-decoration: none; }
  .mobile-random-game:active { background: var(--green-dark); transform: scale(.99); }
  .mobile-random-game:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
  .mobile-game-title { display: block; margin: 0 0 .65rem; color: var(--ink); font-size: 1.08rem; font-weight: 750; line-height: 1.3; text-decoration: none; }
  .mobile-game-title span { color: var(--green); }
  .mobile-game-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem .75rem; margin: 0; }
  .mobile-game-card dl div { display: grid; gap: .05rem; }
  .mobile-game-card dt { color: #526171; font-size: .78rem; font-weight: 650; }
  .mobile-game-card dd { margin: 0; font-weight: 650; }
  .mobile-game-updated { margin: .7rem 0 0; padding-top: .6rem; border-top: 1px solid var(--line); color: #526171; font-size: .82rem; }
  .mobile-game-actions { display: flex; gap: .5rem; margin-top: .7rem; }
  .mobile-game-actions > *, .mobile-game-actions form { flex: 1; margin: 0; }
  .mobile-game-actions .button, .mobile-game-actions button { display: block; min-height: 42px; width: 100%; padding: .55rem .5rem; text-align: center; }

  .mobile-user-list { display: grid; gap: .65rem; margin: .75rem 0; }
  .mobile-user-card { background: #fffffff2; border: 1px solid var(--line); border-radius: 8px; padding: .8rem; box-shadow: 0 1px 5px #13251a0d; }
  .mobile-user-card h2 { margin: 0; font-size: 1.08rem; }
  .mobile-user-card p { margin: .35rem 0 0; color: #526171; font-size: .84rem; }
  .mobile-user-actions { display: grid; gap: .5rem; margin-top: .75rem; }
  .mobile-user-actions form { margin: 0; }
  .mobile-user-actions .button, .mobile-user-actions button { display: block; width: 100%; min-height: 42px; text-align: center; }

  .notice, .error { margin: .65rem 0; }
  footer { gap: 1rem; padding: 1.35rem 0; }
}

@media (max-width: 430px) {
  header { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .45rem; }
  .brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-actions { grid-column: 1 / -1; justify-content: flex-end; min-width: 0; }
  .account-actions .user { max-width: 5.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  h1 { font-size: 1.45rem; }
  h2 { font-size: 1.15rem; }
  .card, .legal { padding: .75rem; }
  .table table { min-width: 500px; font-size: .82rem; }
  .table th, .table td { padding: .45rem .38rem; }
  .stats th:first-child, .stats td:first-child { min-width: 118px; }
  .stats input { min-width: 38px; }
  .game-results table { min-width: 440px; }
  .game-results th:first-child, .game-results td:first-child { width: 96px; min-width: 96px; }
  .game-results th:not(:first-child), .game-results td:not(:first-child) { width: 49px; }
  .mobile-game-card { padding: .72rem; }
  .mobile-game-title { font-size: 1rem; }
}

/* Die öffentliche Ergebnistabelle soll ohne seitliches Wischen auf das Display passen. */
@media (max-width: 700px) {
  .total-label-short { display: inline; }
  .total-label-full { display: none; }
  .game-results { overflow: hidden; }
  .game-results table {
    width: calc(100% + 1px);
    min-width: calc(100% + 1px);
    table-layout: fixed;
  }

  .game-results .event-column {
    width: 24%;
  }

  .game-results th:first-child,
  .game-results td:first-child {
    width: auto;
    min-width: 0;
    padding-left: .35rem;
    padding-right: .25rem;
  }

  .game-results th:not(:first-child),
  .game-results td:not(:first-child) {
    width: auto;
    min-width: 0;
    padding-left: .2rem;
    padding-right: .2rem;
  }
}

@media (min-width: 701px) {
  .total-label-short { display: none; }
}
