body {
  font-family: Arial, sans-serif;
  margin: 10px;
  background: #f2f2f2;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

#total {
  font-size: 28px;
  font-weight: bold;
  margin-right: auto;
}

.topbar .clock {
    font-size: 28px;
    margin-right: auto;
    margin-left: auto;
}

button {
  border: 2px solid black;
  color: white;
  padding: 8px 13px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
}

button:hover {
  filter: brightness(0.92);
}

/* Top Buttons */

#resetBtn { background: #c62828; }
#payBtn { background: #2e7d32; }
#historyBtn { background: #1565c0; }
#fullscreenBtn { background: #6a1b9a; }

/* Kategorien */

.category {
  margin-bottom: 18px;
}

.category-title {
  font-size: 19px;
  font-weight: bold;
  margin-bottom: 7px;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 8px;
}

/* Tiles */

.tile {
  position: relative;
  background: white;
  border: 2px solid black;
  min-height: 82px;
  padding: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  word-break: break-word;
}

.tile:hover {
  filter: brightness(0.96);
}

.count {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: black;
  color: white;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  pointer-events: none;
}

.decrease {
  position: absolute;
  bottom: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  background: #444;
  color: white;
  border: none;
  font-size: 14px;
  padding: 0;
}

.decrease:hover {
  background: black;
}

.label {
  line-height: 1.1;
  font-size: 14px;
  font-weight: bold;
  max-width: 92%;
}

.price {
  position: absolute;
  bottom: 3px;
  right: 4px;
  font-size: 11px;
}

/* Default Colors */

.default-tile {
  background: white;
}

.default-tile .label {
  color: black;
}

/* Overlay */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: white;
  border: 3px solid black;
  width: min(1050px, 96vw);
  max-height: 94vh;
  overflow-y: auto;
  padding: 16px;
}

/* Payment */

.money-section {
  margin-top: 12px;
  margin-bottom: 14px;
}

.money-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 6px;
}

.money-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 8px;
}

.money-btn {
  border: 2px solid black;
  padding: 12px 6px;
  text-align: center;
  font-size: 17px;
  cursor: pointer;
  user-select: none;
  font-weight: bold;
}

.money-btn:hover {
  filter: brightness(0.94);
}

.coins {
  background: #ffe082;
}

.notes {
  color: black;
}

.money-btn.notes[data-value="5"] {
  background: #b8d8b8;
}

.money-btn.notes[data-value="10"] {
  background: #e57373;
}

.money-btn.notes[data-value="20"] {
  background: #64b5f6;
}

.money-btn.notes[data-value="50"] {
  background: #ffb74d;
}

.money-summary {
  font-size: 22px;
  margin-bottom: 10px;
  line-height: 1.5;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Action Buttons */

#cardBtn { background: #1565c0; }
#cashBtn { background: #2e7d32; }
#cashPlusBtn { background: #00897b; }
#clearMoneyBtn { background: #ef6c00; }
#closeOverlayBtn, #closeSavedBtn, #closeCamBtn,
#closeHistoryBtn { background: #616161; }
#clearHistoryBtn { background: #c62828; }

/* Verlauf */

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

th, td {
  border: 2px solid black;
  padding: 7px;
  text-align: left;
  background: white;
}

th {
  background: #ddd;
}

.history-total {
  margin-top: 12px;
  padding: 10px;
  border: 2px solid black;
  background: #e8f5e9;
  font-size: 20px;
  font-weight: bold;
}

#savedBtn {
  background: #455a64;
}
#payLaterBtn {
  background: #6d4c41;
}

.tile[data-count="0"] .decrease {
  display: none;
}
.tile[data-count="0"] .count {
  display: none;
}

#cameras {
    display: flex;
    gap: 10px;
}

#cameras img {
    max-width: 45%;
}