:root {
  --bg: #f2f2f7;          /* iOS Hintergrund */
  --card: #ffffff;
  --line: #e5e5ea;
  --text: #1c1c1e;
  --muted: #6e6e73;
  --accent: #007aff;     /* iOS Blau */
  --danger: #ff3b30;     /* iOS Rot */
  --radius: 16px;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hidden {
  display: none;
}

/* ===== Spieltyp-Auswahl ===== */

#modeSelect {
  max-width: 420px;
  margin: 0 auto;
}

#modeSelect h2 {
  font-size: 24px;
  margin-bottom: 28px;
}

/* Die beiden Auswahl-Buttons */
#modeSelect button {
  width: 100%;
  padding: 20px 18px;
  margin-bottom: 16px;

  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;

  background: #ffffff;
  color: #1c1c1e;

  border: none;
  border-radius: 18px;

  box-shadow:
    0 6px 20px rgba(0,0,0,.08),
    inset 0 0 0 1px #e5e5ea;

  text-align: left;
}

/* Touch-Feedback */
#modeSelect button:active {
  transform: scale(0.96);
  filter: brightness(0.94);
}

/* Optional: empfohlener Modus leicht hervorheben */
#modeSelect button:first-of-type {
  background: #f2f6ff;
  box-shadow:
    0 6px 20px rgba(0,122,255,.15),
    inset 0 0 0 1px #d6e4ff;
}


.screen {
  text-align: center;
  padding: 40px;
}

.screen button {
  display: block;
  margin: 16px auto;
  padding: 16px;
  font-size: 18px;
  width: 280px;
}

header {
  background: white;
  padding: 12px;
  border-bottom: 1px solid #ccc;
}
/* ===== Spielername Eingabefeld ===== */

#playerName {
  width: 100%;
  max-width: 260px;

  padding: 10px 12px;        /* ↓ weniger Höhe */
  margin-top: 6px;

  font-size: 16px;           /* ↓ weniger dominant */
  font-weight: 500;

  color: #1c1c1e;
  background: #f2f2f7;

  border: none;
  border-radius: 12px;

  outline: none;

  box-shadow: inset 0 0 0 1px #e5e5ea;
}


/* Placeholder ruhig & unaufdringlich */
#playerName::placeholder {
  color: #8e8e93;
  font-weight: 300;
}

/* Fokus-Zustand (sehr wichtig!) */
#playerName:focus {
  background: #ffffff;
  box-shadow:
    inset 0 0 0 1px #007aff,   /* feiner Innenring */
    0 0 0 2px rgba(0,122,255,.15); /* weicher Außenfokus */
}


/* Spieler-Tabs Container */
#playerTabs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

/* Spieler-Button */
#playerTabs button {
  padding: 8px 14px;
  font-size: 16px;
  font-weight: 600;

  background: #f2f2f7;
  color: #1c1c1e;

  border: none;
  border-radius: 999px;

  box-shadow: inset 0 0 0 1px #e5e5ea;
}

/* Aktiver Spieler */
#playerTabs button.active {
  background: #007aff;
  color: white;
  box-shadow: none;
}

/* Tap-Feedback */
#playerTabs button:active {
  transform: scale(0.97);
}

#playerTabs button:last-child {
  background: #ffffff;
  color: #007aff;
  font-weight: 700;
}

.sheet {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  background: var(--card);
  border-radius: var(--radius);
  margin: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
}

.cell {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  display: flex;
  align-items: center;
}

.header {
  font-weight: 700;
  background: #f9f9fb;
  justify-content: center;
  font-size: 14px;
}

.label {
  background: #fafafa;
  font-weight: 600;
  font-size: 15px;
}

.sum {
  background: #f0f4ff;
  font-weight: 700;
}

button.value {
  width: 100%;
  height: 36px;
  font-size: 16px;
  font-weight: 600;

  background: #f2f2f7;
  border: none;
  border-radius: 10px;

  color: var(--text);
}

button.value:active {
  transform: scale(0.97);
  background: #e5e5ea;
}


footer {
  position: sticky;
  bottom: 0;
  background: white;
  padding: 12px;
  border-top: 1px solid #ccc;
}

footer button#resetBtn {
  padding: 12px 18px;
  font-size: 17px;
  font-weight: 600;

  background: #f2f2f7;
  color: #ff3b30;

  border: none;
  border-radius: 14px;

  box-shadow: inset 0 0 0 1px #ff3b30;
}

/* Tap */
footer button#resetBtn:active {
  transform: scale(0.96);
}


/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

.modal:not(.hidden) {
  display: flex;
}


.modalBox {
  width: min(92vw, 360px);
  background: var(--card);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}


.picker {
  text-align: center;
  margin: 20px 0;
}

#modalValue {
  display: block;
  font-size: 44px;
  font-weight: 800;
  margin: 12px 0;
}
.picker button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #f2f2f7;
  font-size: 28px;
  font-weight: bold;
}

.picker button:active {
  background: #e5e5ea;
}

#presets {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0;
}

#presets button {
  background: #eef2ff;
  border: none;
  border-radius: 14px;
  padding: 12px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

button.strike {
  background: #fff0f0;
  color: var(--danger);
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 17px;
  font-weight: 600;
}

#save {
  margin-top: 10px;
  width: 100%;
  padding: 16px;
  font-size: 18px;
  font-weight: 700;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 16px;
}

button {
  transition:
    transform 0.08s ease,
    filter 0.08s ease,
    background-color 0.08s ease;
}

/* Touch / Klick */
button:active {
  transform: scale(0.96);
  filter: brightness(0.92);
}

@media print {

  body {
    background: white;
  }

  header,
  footer,
  #modeSelect {
    display: none !important;
  }

  .sheet {
    margin: 0;
    box-shadow: none;
    border-radius: 0;
  }

  .cell {
    padding: 6px 8px;
    font-size: 12px;
  }

  button.value {
    height: auto;
    font-size: 12px;
    background: none;
  }

  button {
    box-shadow: none;
  }
}

