* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
  background: linear-gradient(135deg, #c7f9cc, #fdfcdc, #a0e7e5);
  color: #222;
  margin: 0;
  padding: 6px;
}

/* Kopfbereich */
.header {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.8);
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

h1 {
  margin: 0;
  color: #007a33;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.15);
  font-size: 1.5rem;
}

/* Hauptlayout */
.container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 4px;
  justify-content: center;
  align-items: flex-start;
}

.left {
  flex: 0 0 280px;
}

.right {
  flex: 1;
  min-width: 280px;
  background: rgba(255,255,255,0.8);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Tetris-Spielfeld */
canvas {
  background: linear-gradient(180deg, #e3ffe7, #d9e7ff);
  display: block;
  margin: 8px auto;
  width: 240px;
  height: 480px;
  image-rendering: pixelated;
  border: 4px solid #3CB371;
  border-radius: 12px;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.2);
}

/* Buttons */
.controls {
  margin-top: 8px;
  text-align: center;
}

button {
  padding: 8px 14px;
  margin: 4px;
  cursor: pointer;
  border-radius: 8px;
  border: none;
  background: linear-gradient(145deg, #3CB371, #2E8B57);
  color: white;
  font-weight: bold;
  letter-spacing: 0.4px;
  transition: all 0.2s ease;
  box-shadow: 0 3px 5px rgba(0,0,0,0.15);
}

button:hover {
  background: linear-gradient(145deg, #2E8B57, #3CB371);
  transform: scale(1.05);
}

/* Tabellen */
.tbl {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: rgba(255,255,255,0.9);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  font-size: 14px;
}

.tbl th, .tbl td {
  padding: 8px;
  border: 1px solid #3CB371;
  text-align: left;
}

.tbl th {
  background: #3CB371;
  color: white;
  font-weight: bold;
}

/* Punkteanzeige */
.scorebox {
  font-size: 16px;
  margin-top: 8px;
  font-weight: bold;
  color: #007a33;
  text-align: center;
}

/* Seitennavigation */
.pagination {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

/* Hinweise */
.note, .note1 {
  font-size: 13px;
  margin-top: 8px;
}

.note {
  color: #444;
}

.note1 {
  color: #000;
}

/* ---------- Responsive Design ---------- */
@media (max-width: 900px) {
  .container {
    flex-direction: column;
    align-items: center;
  }

  canvas {
    width: 200px;
    height: 400px;
  }

  h1 {
    font-size: 1.3rem;
  }
}

@media (max-width: 600px) {
  body {
    padding: 4px;
  }

  .left, .right {
    width: 100%;
    padding: 10px;
  }

  canvas {
    width: 240px;
    height: 420px;
  }

  button {
    padding: 6px 10px;
    font-size: 12px;
  }

  .tbl th, .tbl td {
    padding: 6px;
  }
}


/* --- Mobile Steuerung --- */
.mobile-controls {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* Einheitliche Größe für die Buttons */
.mobile-controls button {
  width: 70px;
  height: 70px;
  font-size: 32px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(145deg, #3CB371, #2E8B57);
  color: white;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  touch-action: manipulation;
}

/* Button-Hover & Klick-Effekt */
.mobile-controls button:active {
  transform: scale(0.92);
  background: linear-gradient(145deg, #2E8B57, #3CB371);
}

/* Auf kleineren Bildschirmen: automatisch verkleinern */
@media (max-width: 480px) {
  .mobile-controls button {
    width: 58px;
    height: 58px;
    font-size: 26px;
    border-radius: 12px;
  }
}


/* --- Tabellenrahmen optisch korrigieren --- */
.tbl {
  width: 100%;
  border-collapse: separate; /* statt collapse */
  border-spacing: 0;
  margin-top: 12px;
  background: rgba(255,255,255,0.9);
  border: 2px solid #3CB371; /* Einheitlicher Rahmen */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Tabellenzellen anpassen */
.tbl th, .tbl td {
  padding: 10px;
  border-bottom: 1px solid #3CB371;
  border-right: 1px solid #3CB371;
  text-align: left;
}

/* Rechte Kante entfernen, damit es sauber aussieht */
.tbl th:last-child,
.tbl td:last-child {
  border-right: none;
}

/* Unterkante der letzten Zeile entfernen */
.tbl tr:last-child td {
  border-bottom: none;
}

/* Tabellenkopf farblich absetzen */
.tbl th {
  background: #3CB371;
  color: white;
  font-weight: bold;
}
