/* ==========================
   GLOBAL RESET & BASE
========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: "Arial", sans-serif;
  background-color: #f4f6fb;
  color: #333;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==========================
   HEADER / STATS
========================== */
header {
  padding: 12px 16px;
  background-color: #3f51b5;
  color: #fff;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

#stats {
  font-size: 0.9rem;
  color: #ffeb3b;
}

/* ==========================
   MAIN AREA / LANDING PAGE
========================== */
main#app {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 Spalten */
  grid-template-rows: repeat(2, 1fr);    /* 2 Reihen */
  gap: 16px;
  padding: 16px;
  justify-items: center; /* zentriert Kacheln in der Spalte */
  align-items: center;   /* zentriert Kacheln in der Reihe */
}


/* ==========================
   KACHELN / CATEGORIES
========================== */
.category-tile {
  background-color: #fff;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: bold;
  color: #3f51b5;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  aspect-ratio: 1 / 1;
  max-width: 220px;
  width: 100%;       /* füllt die Grid-Zelle */
}

.category-tile {
  aspect-ratio: 1 / 1; /* macht Kacheln quadratisch */
}

.category-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 10px rgba(0,0,0,0.15);
}

.category-tile:active {
  transform: translateY(0);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* ==========================
   BUTTONS
========================== */
button {
  background-color: #3f51b5;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button:hover {
  background-color: #303f9f;
}

button:active {
  background-color: #1a237e;
}

/* ==========================
   INPUT FIELDS
========================== */
input[type="text"], input[type="number"] {
  padding: 10px 12px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  width: 100%;
  margin-bottom: 12px;
}

/* ==========================
   TASK / RESULT AREA
========================== */
.task-container {
  background-color: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  text-align: center;
}

.task-text {
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.result-feedback {
  margin-top: 8px;
  font-weight: bold;
  font-size: 1.1rem;
}

/* ==========================
   MINI-GAME AREA
========================== */
.game-container {
  background-color: #e3f2fd;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
  text-align: center;
}

/* ==========================
   RESPONSIVE
========================== */
@media (max-width: 768px) {
  main#app {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .category-tile {
    font-size: 1.1rem;
    padding: 14px;
  }
}

@media (max-width: 480px) {
  .category-tile {
    font-size: 1rem;
    padding: 12px;
  }

  header h1 {
    font-size: 1.5rem;
  }
}
/* ==========================
   PUZZLE & SORT / DRAG & DROP
========================== */
.puzzle-tile, .sort-tile {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #aaa;
    background: #f2f2f2;
    cursor: grab;
    user-select: none;   /* kein Text markieren */
    touch-action: none;  /* verhindert Scrollen auf Touchgeräten */
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
}

.puzzle-tile.dragging, .sort-tile.dragging {
    opacity: 0.7;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}