.spielen-page { background: var(--cream); color: var(--ink); padding-top: 96px; min-height: 100vh; }

.hidden { display: none !important; }

.mode-select {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 14px;
}

.mode-btn {
  padding: 9px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 0.92rem;
  color: var(--navy-700);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.mode-btn:hover { background: var(--cream-2); }
.mode-btn.active {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}

.spielen-page .site-header {
  background: rgba(10, 20, 43, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 30px rgba(10, 20, 43, 0.25);
}

.spielen-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 48px;
  min-height: calc(100vh - 96px);
}

.level-select {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}

.level-btn {
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 0.9rem;
  color: var(--navy-700);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.level-btn:hover { background: var(--cream-2); }
.level-btn.active {
  background: var(--gold-500);
  border-color: var(--gold-500);
  color: var(--navy-900);
}
.level-btn .lvl-short { display: none; }

@media (max-width: 480px) {
  .level-select { gap: 6px; flex-wrap: nowrap; }
  .level-btn { flex: 1 1 0; padding: 7px 6px; font-size: 0.78rem; text-align: center; white-space: nowrap; }
  .level-btn .lvl-full { display: none; }
  .level-btn .lvl-short { display: inline; }
}

.spielen-layout {
  width: 100%;
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: flex-start;
}

.board-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.board-frame {
  position: relative;
  width: min(92vw, 900px, calc(100vh - 260px));
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.highscore-panel {
  width: min(280px, 100%);
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.highscore-panel h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--navy-800);
}
.puzzle-status {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--navy-700);
  min-height: 1.2em;
}
.highscore-panel ol {
  margin: 0;
  padding-left: 22px;
  font-size: 0.92rem;
  color: var(--ink);
}
.highscore-panel li { padding: 3px 0; }

.name-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.name-form input {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.95rem;
  min-width: 180px;
}

@media (max-width: 880px) {
  .spielen-layout { flex-direction: column; align-items: center; }
  .highscore-panel { width: min(92vw, 900px); }
}

.board {
  width: 100%;
  height: 100%;
}

.board-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(247, 243, 236, 0.92);
  color: var(--navy-700);
  font-size: 0.95rem;
  z-index: 5;
}
.board-overlay.hidden { display: none; }
.board-overlay p { margin: 0; }

.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid var(--line);
  border-top-color: var(--gold-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.promotion-choices { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.promotion-choices button {
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 1rem;
  color: var(--navy-800);
  cursor: pointer;
  transition: background 0.15s ease;
}
.promotion-choices button:hover { background: var(--gold-300); }

.spielen-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
}

.ctrl-btn {
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 0.9rem;
  color: var(--navy-700);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.ctrl-btn:hover { background: var(--cream-2); }
.ctrl-btn.danger { color: #8a2a2a; border-color: rgba(138, 42, 42, 0.3); }
.ctrl-btn.danger:hover { background: rgba(138, 42, 42, 0.08); }
