:root{
  --bg: #fffdf6;
  --accent: #b52b2b;
  --muted: #4f4f4f;
  --card-bg: #ffffffcc;
}

*{box-sizing:border-box;font-family:Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial;}

html {
  font-size: 16px; /* Basisgröße */
}

body {
  margin:0;
  background: radial-gradient(circle at 10% 10%, #f6fbf6, var(--bg));
  color:#222;
  min-height:100vh;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  font-size: 1rem;
  line-height: 1.4;
}

/* =========================
   BUTTONS
========================= */
button {
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  color: white;
  background: linear-gradient(180deg,#ff6b6b,#d33);
  display: inline-block;
  text-align: center;
  touch-action: manipulation;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #aaa;
  color: #eee;
}

button:active,
.quiz-option:active,
.crossword-cell input:active,
.sudoku-grid input:active {
  filter: brightness(0.92);
}

.jump-btn {
  position: sticky;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: none;
}

/* =========================
   PLAYER CARDS
========================= */
.player-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 14px;
  width: min(260px, 90vw);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s, outline 0.2s;
}

.player-card.selected {
  outline: 4px solid rgba(40,167,69,0.9);
  transform: translateY(-4px);
}

.player-card img {
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.player-card:hover { background: #b8b8b8; }

/* Player Specs / Sterne */
.player-specs {
  width: 100%;
  text-align: left;
  font-weight: 600;
  margin-top: 6px;
}

.stars {
  display: block;
  text-align: right;
  margin-top: 2px;
  font-weight: bold;
  font-size: 1.3rem;
  color: #FFE75C;
}

/* =========================
   LAYOUT CONTAINERS
========================= */
#main-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

#player-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 32px);
}

.center { text-align:center; padding: 24px; }
.hint{ color:var(--muted); margin-top:12px; }

/* =========================
   HERO / LANDING
========================= */
.hero-svg {
  width: 90%;
  max-width: 900px;
  height: auto;
  aspect-ratio: 8 / 3;
  display: block;
  margin: 0 auto;
  overflow: visible;
}

@media (max-width: 400px) {
  .hero-svg text {
    font-size: 28px;
  }
}

/* =========================
   CROSSWORD
========================= */
.crossword-container {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.grid-wrapper {
  display: inline-block;   /* WICHTIG */
  margin: 0 auto;
}

.crossword-row {
  display: flex;
}

.crossword-cell {
  width: 35px;
  height: 35px;
  border: 1px solid #333;      /* weniger hart als schwarz */
  position: relative;
  background: #ffffff;
  flex-shrink: 0;
}

.crossword-cell input {
  width: 100%;
  height: 100%;
  border: none;
  text-align: center;
  font-weight: bold;
  font-size: 16px;
  text-transform: uppercase;
  background-color: #ffffff;
  color: #111;
}


.crossword-cell.disabled input {
  background-color: #d1d1d1;   /* dunkler */
  color: #666;
  cursor: not-allowed;
}

.crossword-cell input:focus {
  outline: 3px solid #b52b2b;  /* stärker für Touch */
  background-color: #ffecec;  /* klarer Rotton */
}

.empty-cell {
  width: 35px;
  height: 35px;
  background: transparent;
  border: none;
}

.cell-number {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 10px;
  pointer-events: none;
  color: #111;
}

@media (max-width: 420px) {
  .crossword-cell,
  .empty-cell {
    width: 30px;
    height: 30px;
  }

  .crossword-cell input {
    font-size: 14px;
  }
}


/* =========================
   SUDOKU
========================= */
.sudoku-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(32px,1fr));
  gap: 2px;
  max-width: 360px;
  margin: 0 auto;
}

.sudoku-grid input {
  width: 100%;
  aspect-ratio: 1 / 1;
  text-align: center;
  font-size: clamp(14px, 4vw, 18px);
  border: 1px solid #888;
  color: #000;                 /* 👈 immer schwarz */
  background-color: #ffffff;
  opacity: 1;                  /* 👈 wichtig für Mobile */
  -webkit-text-fill-color: #000; /* 👈 iOS Safari Fix */
}

.sudoku-grid input.prefilled {
  background-color: #cfcfcf;
  font-weight: bold;
  color: #000;
  -webkit-text-fill-color: #000;
}

.sudoku-grid input.disabled {
  background-color: #b8b8b8;
  color: #000;                 /* 👈 erzwingen */
  opacity: 1;                  /* 👈 Browser-Override */
  -webkit-text-fill-color: #000;
  cursor: not-allowed;
}

/* =========================
   QUIZ
========================= */
.quiz-container {
  max-width:900px;
  margin:0 auto;
  padding:20px;
  text-align:center;
}

.quiz-question {
  margin-bottom: 24px;
  text-align:left;
}

.quiz-question-number {
  font-weight: bold;
}

.quiz-options {
  margin-top: 8px;
}

.quiz-option {
  border: 1px solid #aaa;      /* dunkler */
  border-radius: 8px;
  padding: 10px 14px;          /* Touch-freundlicher */
  margin: 8px 0;
  cursor: pointer;
  background: #ffffff;
}

.quiz-option:hover { background: #f3f3f3; }
.quiz-option.selected {
  border-color: #1f7a34;
  background: #cfeedd;        /* satter, mobilsicher */
}
.quiz-answer { margin-left: 18px; margin-top: 6px; font-style: italic; color: #444; }

/* =========================
   JUMP / CANVAS
========================= */
#game {
  width: 100%;
  max-width: 1000px;
  aspect-ratio: 8 / 4;
  touch-action: manipulation;
}

@media (max-width: 800px) {
  #game {
    max-width: 100%;
    aspect-ratio: 3 / 4;
  }
}

/* =========================
   GOAL PAGE
========================= */
.players-download {
  display:flex;
  justify-content:center;
  gap:20px;
  margin-top:30px;
  flex-wrap:wrap;
}


/* =========================
   UI COMPONENTS
========================= */

.jump-hint {
  display: none;
  font-size: 0.95rem;
  opacity: 0.85;
  margin-bottom: 0.25rem;
  text-align: center;
}

.score-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.score-item img {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
}

.score-item .name {
  flex: 1;
  font-weight: 600;
}
