body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0 0 50px 0;
  background: #000;
  color: #eee;
}


.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: #111;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.header-buttons {
  display: flex;
  gap: 10px;
}


button {
  background: #333;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

button:hover {
  background: #555;
}


.main-grid {
  display: grid;
  grid-template-columns: 5fr 1fr;
  height: calc(100vh - 60px);
  align-items: flex-start;
}

.tiles {
  padding: 10px;
  overflow-y: auto;
}

.sidebar {
  padding: 0 10px 10px;
  overflow-y: auto;
  background: #111;
  border-left: 1px solid #333;
}
.sidebar h2,
.sidebar h3 {
  margin: 0 0 5px;
}

.sidebar-buttons {
  display: flex;
  gap: 5px;
  margin: 10px 0;
}
.button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

@media (min-width: 1200px) {
  .button-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tile {
  background-color: #ccc;
  border: 1px solid #555;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #000;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
  aspect-ratio: 5 / 2;
}

.tile:hover {
  background-color: #bbb;
}

.hittn {
  background-color: #555;
}

#undo-btn {
  color: red;
}

#pay-btn {
  color: lime;
}

.tile.disabled {
  background-color: #666;
  cursor: default;
  opacity: 0.5;
  pointer-events: none;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.sidebar table th,
.sidebar table td {
  font-size: 11px;
  line-height: 0.95em;
}

th, td {
  border: 1px solid #333;
  padding: 6px;
  color: #fff;
}

th {
  background-color: #222;
  text-align: left;
}

#log {
  margin-top: 10px;
  font-size: 12px;
  overflow-y: visible;
}

.login-box {
  max-width: 300px;
  margin: 100px auto;
  padding: 20px;
  border: 1px solid #333;
  background: #111;
  color: #fff;
  border-radius: 8px;
}

.login-box input {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  background: #222;
  border: 1px solid #333;
  color: #fff;
  border-radius: 4px;
}

.error { color:red; }

@media (max-width: 768px) {
  .main-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
  .sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid #333;
  }
}

@media (max-width: 600px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-buttons {
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px;
  }
  .header-buttons button {
    flex: 1 1 calc(50% - 10px);
  }
  .button-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tile {
    font-size: 16px;
  }
}
.dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #111;
  padding: 20px;
  border: 1px solid #333;
  color: #fff;
  border-radius: 8px;
  z-index: 1000;
}
.dialog input, .dialog select {
  display: block;
  margin-bottom: 10px;
  width: 100%;
}

#stats-charts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#stats-charts > div {
  flex: 1 1 300px;
}

.footer {
  text-align: center;
  padding: 10px;
  font-size: 14px;
  background: #111;
  border-top: 1px solid #333;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
}
