/* Kreide auf Asphalt — Pausenhof-Duell */

:root {
  --asphalt: #2e3136;
  --asphalt-deep: #26292d;
  --chalk: #f4f1e6;
  --chalk-dim: #b9b6ab;
  --chalk-yellow: #f2cf5b;
  --chalk-blue: #8ec9e8;
  --chalk-pink: #f2a1c0;
  --font-hand: 'Patrick Hand', 'Comic Sans MS', cursive;
  --font-title: 'Caveat', 'Patrick Hand', cursive;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.04), transparent 60%),
    radial-gradient(ellipse at 50% 120%, rgba(0, 0, 0, 0.45), transparent 70%),
    var(--asphalt);
  color: var(--chalk);
  font-family: var(--font-hand);
  font-size: 1.25rem;
  line-height: 1.4;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.board {
  width: 100%;
  max-width: 34rem;
  text-align: center;
}

.screen { animation: chalk-in 0.35s ease-out; }

@keyframes chalk-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* --- Typo --- */

.title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(3.2rem, 12vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-shadow: 0 0 14px rgba(244, 241, 230, 0.25);
  margin-bottom: 0.75rem;
}

.title.small { font-size: clamp(2.4rem, 9vw, 3.4rem); line-height: 1.1; margin-bottom: 1rem; }

.subtitle {
  color: var(--chalk-dim);
  margin-bottom: 2.5rem;
}

.heading {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 2.2rem;
  margin-bottom: 1.25rem;
}

.status {
  min-height: 1.8rem;
  margin-top: 1rem;
  color: var(--chalk-dim);
}

.status.good { color: var(--chalk-yellow); }

.blink { animation: blink 1.6s ease-in-out infinite; }

@keyframes blink { 50% { opacity: 0.35; } }

/* --- Kreide-Buttons --- */

.chalk-btn {
  font-family: var(--font-hand);
  font-size: 1.3rem;
  color: var(--chalk);
  background: transparent;
  border: 2px solid var(--chalk);
  border-radius: 14px 10px 16px 8px / 10px 16px 8px 14px;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.chalk-btn:hover:not(:disabled) {
  background: var(--chalk-yellow);
  border-color: var(--chalk-yellow);
  color: var(--asphalt-deep);
  transform: rotate(-1.2deg) scale(1.04);
}

.chalk-btn:focus-visible {
  outline: 3px dashed var(--chalk-yellow);
  outline-offset: 4px;
}

.chalk-btn:disabled { opacity: 0.35; cursor: default; }

.chalk-btn.small { font-size: 1.05rem; padding: 0.45rem 1rem; }

.chalk-btn.ghost { border-style: dashed; color: var(--chalk-dim); }

.chalk-btn.ghost:hover { background: transparent; color: var(--chalk); border-color: var(--chalk); }

/* --- Startscreen --- */

.mode-row {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
}

.mode-btn { padding: 1.1rem 1.8rem; }
.mode-btn:first-child { transform: rotate(-1.5deg); }
.mode-btn:last-child { transform: rotate(1.2deg); }
.mode-btn:hover:not(:disabled) { transform: rotate(0deg) scale(1.05); }

.mode-big {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 2.4rem;
  line-height: 1;
}

.mode-small { font-size: 1rem; opacity: 0.75; }

/* --- Link teilen --- */

.link-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.link-box code {
  font-family: ui-monospace, 'Cascadia Mono', monospace;
  font-size: 0.95rem;
  color: var(--chalk-blue);
  border: 2px dashed var(--chalk-dim);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  max-width: 100%;
  overflow-wrap: anywhere;
  user-select: all;
}

/* --- Spielfeld --- */

.scoreboard {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  border-bottom: 2px solid rgba(244, 241, 230, 0.25);
  padding-bottom: 0.8rem;
  margin-bottom: 1.5rem;
}

.score-side { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; min-width: 5.5rem; }

.score-label { font-size: 1.1rem; }
.score-label.you { color: var(--chalk-yellow); }
.score-label.opp { color: var(--chalk-pink); }

.score-divider {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--chalk-dim);
  align-self: center;
}

/* Strichliste */
.tally { display: flex; gap: 5px; min-height: 26px; align-items: center; }

.tally i {
  display: block;
  width: 3px;
  height: 24px;
  background: currentColor;
  border-radius: 2px;
}

.tally i:nth-child(odd) { transform: rotate(3deg); }
.tally i:nth-child(even) { transform: rotate(-2deg); }

#tally-you { color: var(--chalk-yellow); }
#tally-opp { color: var(--chalk-pink); }

.tally .zero { color: var(--chalk-dim); font-size: 1rem; }

/* Arena */

.arena {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 7.5rem;
  padding: 0 0.5rem;
}

.hand {
  font-size: clamp(4rem, 15vw, 5.5rem);
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}

.you-hand { transform: scaleX(-1); }

.hand.hidden-hand { opacity: 0.25; }

.countdown {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 2rem;
  color: var(--chalk-yellow);
  min-width: 8rem;
}

.shake { animation: shake 0.6s ease-in-out 3; }

@keyframes shake {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px) rotate(-6deg); }
}

.you-hand.shake { animation-name: shake-flip; }

@keyframes shake-flip {
  0%, 100% { transform: scaleX(-1) translateY(0); }
  50% { transform: scaleX(-1) translateY(-18px) rotate(-6deg); }
}

.pop { animation: pop 0.3s ease-out; }

@keyframes pop {
  0% { transform: scale(0.5); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.you-hand.pop { animation-name: pop-flip; }

@keyframes pop-flip {
  0% { transform: scaleX(-1) scale(0.5); }
  70% { transform: scaleX(-1) scale(1.15); }
  100% { transform: scaleX(-1) scale(1); }
}

/* Auswahl */

.pick-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.pick-btn {
  font-size: 2.2rem;
  padding: 0.8rem 1.3rem;
  line-height: 1;
}

.pick-btn span { font-size: 1rem; }

.pick-btn.chosen {
  background: var(--chalk-yellow);
  border-color: var(--chalk-yellow);
  color: var(--asphalt-deep);
}

@media (max-width: 480px) {
  body { padding: 1rem; font-size: 1.15rem; }
  .pick-btn { flex: 1 1 28%; }
  .countdown { min-width: 5rem; font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .shake, .you-hand.shake, .pop, .you-hand.pop, .screen { animation: none; }
  .blink { animation: none; opacity: 0.7; }
}
