/* Globale Styles mit Farben und Animationen */
:root {
  --primary: #4a90e2;
  --primary-hover: #357abd;
}

body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 40px;
  background: linear-gradient(135deg, #e6e9f0 0%, #eef1f5 100%);
  color: #333;
  text-align: center;
  animation: fadeIn 0.8s ease-in;
  transition: background 0.3s, color 0.3s;
}

body.dark {
  background: linear-gradient(135deg, #2b2b2b 0%, #3d3d3d 100%);
  color: #eee;
}

h1 {
  margin-bottom: 10px;
  animation: slideDown 0.8s ease;
}

button {
  padding: 10px 20px;
  margin: 10px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, background 0.3s ease;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Startseiten-Kachel-Layout ähnlich Poki */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  width: 90%;
  max-width: 1000px;
  margin-top: 20px;
}

.game-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background: #f5f5f5;
}

.game-card i {
  font-size: 4rem;
}

body.dark .game-card {
  background: #444;
}

.game-card span {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 10px;
  font-size: 18px;
  text-align: center;
  transition: background 0.3s ease;
  z-index: 1;
}

.game-card:hover {
  transform: scale(1.05);
}

.game-card:hover span {
  background: rgba(0,0,0,0.8);
}

body.dark .game-card span {
  background: rgba(0,0,0,0.6);
}

body.dark .game-card:hover span {
  background: rgba(0,0,0,0.8);
}

button:hover:not(:disabled) {
  transform: scale(1.05);
  background: var(--primary-hover);
}

button:disabled {
  background: #bbb;
  cursor: not-allowed;
}

.back-button {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.role-card {
  margin: 20px auto;
  padding: 20px;
  width: 80%;
  max-width: 320px;
  border-radius: 12px;
  background: #fff;
  color: #000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: rotateY(90deg);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform 0.6s;
}

body.dark .role-card {
  background: #444;
  color: #fff;
}

.role-card.show {
  transform: rotateY(0deg);
}

@media (max-width: 600px) {
  button {
    width: 90%;
    max-width: 400px;
    font-size: 18px;
  }
}

#themeToggle {
  position: absolute;
  top: 10px;
  right: 60px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#themeToggle:hover {
  background: var(--primary-hover);
}

body.dark #themeToggle {
  background: #ddd;
  color: #000;
}

body.dark #themeToggle:hover {
  background: #bbb;
}

a {
  color: #333;
  transition: color 0.3s;
}

a:hover {
  color: #4a90e2;
}

body.dark a {
  color: #eee;
}

body.dark a:hover {
  color: #90cdf4;
}

#chat {
  height: 200px;
  overflow-y: auto;
  border: 1px solid #ccc;
  margin-top: 1em;
  padding: 0.5em;
  background: rgba(255,255,255,0.8);
  border-radius: 8px;
}

body.dark #chat {
  border-color: #555;
  background: rgba(0,0,0,0.3);
}

#gameArea {
  display: none;
  margin-top: 1em;
  gap: 20px;
  align-items: flex-start;
}

#board {
  display: grid;
  grid-template-columns: repeat(5, 60px);
  gap: 8px;
}

.card {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ccc;
  background: rgba(255,255,255,0.8);
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s, background 0.3s;
  animation: popIn 0.3s ease;
}

body.dark .card {
  background: rgba(0,0,0,0.4);
  border-color: #555;
}

.card:hover {
  transform: scale(1.05);
}

.selected {
  background: #ffeb3b;
  animation: pulse 0.6s infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

@keyframes popIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Styles für Mensch ärger dich nicht */
#madnBoard {
  display: grid;
  grid-template-columns: repeat(11, 40px);
  grid-template-rows: repeat(11, 40px);
  gap: 2px;
  margin-top: 20px;
}
#madnBoard .cell {
  width: 40px;
  height: 40px;
  border: 1px solid #ccc;
  background: #fff;
  position: relative;
}
#madnBoard .cell.path {
  background: #f0f0f0;
}
.token {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.token.rot { background: #e74c3c; }
.token.blau { background: #3498db; }
.token.gelb { background: #f1c40f; }
.token.gruen { background: #2ecc71; }

#profileBtn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  padding: 0;
  background: none;
  color: #000;
}

body.dark #profileBtn {
  color: #fff;
}

#profile-display {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-image {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
}

body.dark .modal-content {
  background: #333;
  color: #fff;
}

.close {
  cursor: pointer;
}
