/* Große Touch-Flächen, kein Zoom/Markieren, funktioniert auf Tablet und Handy */
:root { --bg:#14181f; --panel:#1d232d; --tile:#2a3340; --text:#f2f4f7; --muted:#9aa5b5; --accent:#2fa84f; --danger:#d64545; --warn:#e0a526; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body { height: 100dvh; overscroll-behavior: none; background: var(--bg); color: var(--text); font: 18px/1.3 -apple-system, "Helvetica Neue", Arial, sans-serif; display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
button { font: inherit; color: inherit; border: 0; border-radius: 14px; padding: 14px 20px; background: var(--tile); min-height: 52px; }
button:active { filter: brightness(1.25); }
button:disabled { opacity: .4; }
button.primary { background: var(--accent); font-weight: 700; }
button.danger { background: var(--danger); font-weight: 700; }
button.cash { background: #c98a1a; font-weight: 700; }
button.phone { background: #3d6fd6; font-weight: 700; }
button.ghost { background: transparent; border: 1px solid #3a4454; }

#mockBanner { background: var(--warn); color: #000; text-align: center; font-weight: 700; padding: 6px; }
header { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--panel); }
header h1 { font-size: 20px; margin: 0; }
#cats { display: flex; gap: 8px; flex: 1; overflow-x: auto; }
#cats button { white-space: nowrap; }
#cats button.active { background: #3d6fd6; font-weight: 700; }

main { flex: 1; display: flex; min-height: 0; }
#grid { flex: 1; overflow-y: auto; padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; align-content: start; }
.tile { min-height: 110px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; text-align: left; padding: 14px; position: relative; }
.tile .name { font-size: 20px; font-weight: 700; }
.tile .price { color: var(--muted); }
.tile .badge { position: absolute; top: 8px; right: 8px; background: var(--accent); border-radius: 999px; min-width: 30px; text-align: center; padding: 2px 8px; font-weight: 700; }

#cart { width: 340px; max-width: 45%; background: var(--panel); display: flex; flex-direction: column; padding: 14px; gap: 10px; }
#cart h2 { margin: 0; font-size: 18px; color: var(--muted); }
#lines { list-style: none; margin: 0; padding: 0; flex: 1; overflow-y: auto; }
#lines li { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid #2c3544; }
#lines .qty { display: flex; align-items: center; gap: 10px; }
#lines .qty button { min-height: 44px; width: 44px; padding: 0; font-size: 22px; }
#lines .sum { text-align: right; align-self: center; font-variant-numeric: tabular-nums; }
#total { font-size: 38px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; justify-content: center; }
.row button { flex: 1; }
#payBtn, #cashBtn, #phoneBtn { font-size: 22px; min-height: 64px; }
.cashgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.cashgrid button.sel { background: #c98a1a; font-weight: 700; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 4px; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.75); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 10; }
.overlay[hidden] { display: none; }
.box { background: var(--panel); border-radius: 20px; padding: 28px; width: min(480px, 100%); text-align: center; display: flex; flex-direction: column; gap: 14px; }
.box h2 { margin: 0; font-size: 28px; }
.box p { margin: 0; color: var(--muted); }
.icon { font-size: 64px; line-height: 1; }
.amount { font-size: 44px; font-weight: 800; }
.box input { font: inherit; font-size: 28px; text-align: center; padding: 12px; border-radius: 12px; border: 1px solid #3a4454; background: var(--bg); color: var(--text); }
.spin { display: inline-block; width: 56px; height: 56px; border: 6px solid #3a4454; border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#reportBody table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
#reportBody td { padding: 6px 4px; border-bottom: 1px solid #2c3544; }
#reportBody td:last-child { text-align: right; }


/* ---------- Mobil / Tablet ---------- */
#cartHead { display: flex; justify-content: space-between; align-items: center; }
#cartHead small { font-size: inherit; }
#cartArrow { display: none; }
.box { max-height: 100%; overflow-y: auto; }

/* Hochformat (Handy, Tablet hochkant): Artikel oben, Bestellung als Leiste unten */
@media (orientation: portrait) and (max-width: 900px) {
  header { flex-wrap: wrap; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; gap: 8px; }
  header h1 { flex: 1; }
  #cats { order: 3; flex-basis: 100%; padding-bottom: 2px; }
  main { flex-direction: column; }
  #grid { grid-template-columns: repeat(2, 1fr); padding: 10px; gap: 10px; }
  .tile { min-height: 92px; padding: 12px; }
  .tile .name { font-size: 18px; }
  main { overflow: hidden; }
  #cart { flex-shrink: 1; min-height: 0; width: 100%; max-width: none; max-height: 80dvh; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); gap: 8px; border-radius: 18px 18px 0 0; box-shadow: 0 -4px 16px rgba(0,0,0,.4); }
  #cartHead { cursor: pointer; font-size: 18px; min-height: 36px; }
  #cartArrow { display: inline; }
  #cart.open #cartArrow { transform: rotate(180deg); }
  #lines, #clearBtn { display: none; }
  #cart.open #lines { display: block; flex: 1 1 auto; min-height: 56px; max-height: 38dvh; }
  #cart.open #clearBtn { display: block; }
  #total { font-size: 30px; }
  #payBtn, #cashBtn, #phoneBtn { min-height: 60px; font-size: 19px; padding-inline: 8px; }
  footer { display: none; }
}

/* Querformat auf dem Handy (wenig Höhe): nebeneinander, kompakter */
@media (orientation: landscape) and (max-height: 520px) {
  header { padding: 4px 12px; }
  header h1 { display: none; }
  button { min-height: 44px; padding: 8px 14px; }
  #grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); padding: 10px; gap: 10px; }
  .tile { min-height: 76px; padding: 10px; }
  .tile .name { font-size: 17px; }
  #cart { width: 300px; padding: 8px 12px; gap: 6px; padding-right: max(12px, env(safe-area-inset-right)); }
  #cart h2 { font-size: 15px; }
  #total { font-size: 28px; }
  #payBtn, #cashBtn, #phoneBtn { min-height: 52px; font-size: 18px; padding-inline: 8px; }
  footer { display: none; }
  .box { padding: 16px; gap: 8px; }
  .icon { font-size: 40px; }
  .amount { font-size: 34px; }
}
a.btnlink { color: inherit; text-decoration: none; border: 1px solid #3a4454; border-radius: 10px; padding: 10px 14px; font: inherit; white-space: nowrap; }
#reportBody h3 { margin: 16px 0 6px; font-size: 15px; color: #9aa5b5; }
