/* ---------------------------------------------------------
   spiel1.css — Saubere, vollständige Datei
   Kopiere 1:1 in eine neue Datei (spiel1.css) und lade sie hoch.
   Achte darauf, dass am Dateiende KEIN Fremdtext angehängt wird.
--------------------------------------------------------- */

/* ---------------------------------------------------------
   Grundlayout
--------------------------------------------------------- */
:root{
  --cell-size: 60px;
  --gap: 6px;
  --padding: 6px;
  --bg: #f7f7f7;
  --accent: #0078d7;
}

html,body{
  height:100%;
}

body {
  font-family: Arial, sans-serif;
  background: var(--bg);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #222;
  box-sizing: border-box;
}

/* Zentrierter Seitencontainer */
.page-center {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
}

/* ---------------------------------------------------------
   Titelbereich
--------------------------------------------------------- */
h1 {
  font-size: 32px;
  margin-top: 30px;
  margin-bottom: 5px;
  font-weight: 700;
  letter-spacing: 1px;
}



h1::after {
  content: "";
  display: block;
  width: 220px;
  height: 3px;
  background: var(--accent);
  margin: 10px auto 20px auto;
  border-radius: 2px;
}

/* ---------------------------------------------------------
   Buttons
--------------------------------------------------------- */
.button-row {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 20px;
}

.button-row button {
  padding: 10px 18px;
  margin: 0 5px;
  border: none;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  transition: background .12s ease, transform .06s ease;
}

.button-row button:hover {
  background: #005fa3;
  transform: translateY(-1px);
}

.button-row #timer {
  margin-left: 12px;
  font-weight: 600;
  color: #333;
}

/* ---------------------------------------------------------
   Spielfeld + Karten nebeneinander
--------------------------------------------------------- */
.game-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------
   Einheitliche Maße für Board und Karten
--------------------------------------------------------- */
.board, .cards {
  box-sizing: border-box;
  padding: var(--padding);
  gap: var(--gap);
  border-radius: 8px;
}

/* ---------------------------------------------------------
   Spielfeld (5×5)
   feste Zellenhöhe erzwingen, verhindert Shrink
--------------------------------------------------------- */
.board {
  display: grid;
  grid-template-columns: repeat(5, var(--cell-size));
  grid-template-rows: repeat(5, var(--cell-size));
  gap: var(--gap);
  padding: var(--padding);
  border-radius: 8px;
  box-sizing: border-box;
  align-self: start;
  height: calc(var(--cell-size) * 5 + var(--gap) * 4 + var(--padding) * 2);
  min-height: calc(var(--cell-size) * 5 + var(--gap) * 4 + var(--padding) * 2);
}

/* ---------------------------------------------------------
   Kartenraster (5×5)
--------------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(5, var(--cell-size));
  grid-auto-rows: var(--cell-size);
  gap: var(--gap);
  padding: var(--padding);
  border-radius: 8px;
  box-sizing: border-box;
  align-content: start;
  min-height: calc(var(--cell-size) * 5 + var(--gap) * 4 + var(--padding) * 2);
}

/* Zellen: Standardrahmen */
.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  border: 1px dashed rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  box-sizing: border-box;
  outline: none;
  border-radius: 8px;
  padding: 0;
  margin: 0;
}

/* Entferne sichtbaren Fokusring */
.cell:focus,
.cell:focus-visible {
  outline: none;
}

/* Eigene Drag-Over Optik */
.cell.drag-over {
  border: 2px dashed #4aa3ff;
  background: rgba(74,163,255,0.06);
}

/* Karten: Basis */
.card {
  width: calc(var(--cell-size) - 8px);
  height: calc(var(--cell-size) - 8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border-radius: 6px;
  margin: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
  transition: transform .08s ease, opacity .08s ease, box-shadow .08s ease;
  user-select: none;
  -webkit-user-drag: element;
  cursor: grab;
  color: #fff;
  box-sizing: border-box;
}

/* Hover / active */
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}

/* Drag-Image: exakt wie Karte zentrieren */
/* Drag-Image Styling */
.drag-image {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  z-index: 99999;
  box-shadow: 0 12px 30px rgba(0,0,0,0.28);
  border-radius: 6px;
  transform: translate3d(0,0,0);
  opacity: 0.98;
  box-sizing: border-box;
}

/* Originalkarte während Drag: unsichtbar, aber Platz behalten */
.card.dragging { /* falls noch verwendet */
  visibility: hidden;
  opacity: 0;
}

/* Wenn JS direkt style.visibility setzt, stelle sicher, dass display nicht verändert */

/* Placeholder exakt wie Karte */
.card.placeholder {
  visibility: hidden !important;
  display: block !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Rote Karte sicher sichtbar */
.color-1 { background: #e74c3c; color: #fff !important; }



.color-2 { background: #3498db; color: #fff; }
.color-3 { background: #27ae60; color: #fff; }
.color-4 { background: #f1c40f; color: #000; }
.color-5 { background: #8A2BE2; color: #fff; }

/* ---------------------------------------------------------
   Anleitung
--------------------------------------------------------- */
.anleitung {
  max-width: 700px;
  margin: 30px auto 10px auto;
  line-height: 1.5;
  color: #444;
  font-size: 15px;
}

/* ---------------------------------------------------------
   Statusfeld
--------------------------------------------------------- */
.status {
  margin-top: 15px;
  font-size: 18px;
  font-weight: bold;
  min-height: 22px;
}

.status.ok { color: #0a8a0a; }
.status.error { color: #c00000; }

/* ---------------------------------------------------------
   Drag & Drop Effekte (Fallback)
--------------------------------------------------------- */
.drag-over {
  outline: 3px dashed #0078d7;
  outline-offset: -3px;
}

/* .hidden wird in JS verwendet; visibility statt display */
.hidden { visibility: hidden; }

/* Ende der Datei */
