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

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

  /* Nur der Menüknopf bleibt beim Scrollen erreichbar. */
  header { position: static; background: transparent; box-shadow: none; }
  .site-menu { position: fixed; top: .4rem; left: .5rem; z-index: 60; }
  header { padding-left: 3.15rem; }
  .menu-button { width: 2.45rem; height: 2.45rem; }
  .brand { font-size: 1.02rem; }

  header { gap: .55rem; padding: .75rem 0 .75rem 3.4rem; 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 { display: flex; width: auto; margin-left: auto; gap: 0; font-size: .88rem; }
  .account-actions .header-profile,
  .account-actions form { display: none; }
  .account-actions .user { display: block; max-width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  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; }
  .scan-form .table,.game-editor .table{overflow:hidden;width:100%;max-width:100%}.scan-form .stats,.game-editor .stats{width:100%;min-width:100%;max-width:100%;table-layout:fixed;font-size:.78rem}.scan-form .stats th:first-child,.scan-form .stats td:first-child,.game-editor .stats th:first-child,.game-editor .stats td:first-child{width:31%;min-width:0}.scan-form .stats th:not(:first-child),.scan-form .stats td:not(:first-child),.game-editor .stats th:not(:first-child),.game-editor .stats td:not(:first-child){width:11.5%;min-width:0;padding-left:.12rem;padding-right:.12rem}.scan-form .stats input,.game-editor .stats input{width:100%;min-width:0;height:38px;min-height:38px;padding:.2rem .05rem;font-size:.9rem}.editor-actions{display:grid;grid-template-columns:1fr 1fr;gap:.55rem}.editor-actions button{width:100%;min-height:40px;padding:.45rem .5rem;font-size:.9rem}.editor-actions .delete-form{margin:0}
  .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; }

  /* Bottom-Tab-Navigation ersetzt das Hamburger-Menü auf allen Seiten (öffentlich und Admin). */
  .site-menu { display: none; }
  header { padding-left: 0; }
  body.public-area main.container,
  body.admin-area main.container { padding-bottom: calc(3.4rem + env(safe-area-inset-bottom, 0px)); }

  .bottom-tabbar,
  body.admin-area .admin-tier1 {
    display: flex;
    background: var(--green);
    border-top: 1px solid var(--green-dark);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .bottom-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; }
  body.admin-area .admin-bottombar {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
  }
  .bottom-tabbar .tab,
  body.admin-area .admin-tier1 .tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    padding: .5rem 0 .4rem;
    color: rgba(255, 255, 255, .72);
    text-decoration: none;
    font-size: .66rem;
    font-weight: 650;
    background: none;
    border: 0;
    cursor: pointer;
    list-style: none;
  }
  .bottom-tabbar .tab::-webkit-details-marker,
  body.admin-area .admin-tier1 .tab::-webkit-details-marker { display: none; }
  .bottom-tabbar .tab svg,
  body.admin-area .admin-tier1 .tab svg {
    width: 20px; height: 20px; fill: none; stroke: currentColor;
    stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  }
  .bottom-tabbar .tab.active,
  body.admin-area .admin-tier1 .tab.active { color: var(--gold); }
  .bottom-tabbar .tab-more,
  body.admin-area .admin-tier1 .tab-more { position: relative; flex: 1; }
  .bottom-tabbar .tab-more[open] > summary,
  body.admin-area .admin-tier1 .tab-more[open] > summary { color: var(--gold); }
  .bottom-tabbar .more-sheet,
  body.admin-area .admin-tier1 .more-sheet {
    position: absolute;
    bottom: calc(100% + .5rem);
    right: .4rem;
    min-width: 11rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 -8px 22px #13251a2b;
    padding: .4rem;
  }
  .bottom-tabbar .more-sheet a,
  .bottom-tabbar .more-sheet button,
  body.admin-area .admin-tier1 .more-sheet a,
  body.admin-area .admin-tier1 .more-sheet button {
    display: block; width: 100%; text-align: left; padding: .6rem .7rem; border-radius: 6px;
    color: var(--ink); text-decoration: none; font-size: .88rem; font-weight: 400;
    background: none; border: 0; cursor: pointer;
  }
  .bottom-tabbar .more-sheet a:hover,
  .bottom-tabbar .more-sheet button:hover,
  body.admin-area .admin-tier1 .more-sheet a:hover,
  body.admin-area .admin-tier1 .more-sheet button:hover { background: #e5f2e7; }
  .bottom-tabbar .more-sheet .sheet-strong,
  body.admin-area .admin-tier1 .more-sheet .sheet-strong { font-weight: 700; }
  .bottom-tabbar .more-sheet .sep,
  body.admin-area .admin-tier1 .more-sheet .sep { height: 1px; background: var(--line); margin: .3rem 0; }
  .bottom-tabbar .more-sheet form,
  body.admin-area .admin-tier1 .more-sheet form { margin: 0; }

  body.admin-area .menu-public-link,
  body.admin-area .menu-submenu { display: none; }
}

@media (max-width: 430px) {
  header { display: flex; gap: .45rem; }
  .brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-actions { 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; }
  .scan-form .stats{font-size:.73rem}.scan-form .stats th:first-child,.scan-form .stats td:first-child{width:32%}.scan-form .stats input{height:36px;min-height:36px;font-size:.84rem}
  .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;
  }

  .report-button { display: block; width: 100%; }
}

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