:root {
  --ink: #3b2a1a;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  font-family: ui-rounded, "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(#bfe8ff 0%, #e6f7ff 58%, #b9e38c 58%, #8fcf5e 100%) fixed;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

[hidden] { display: none !important; }

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

h1 {
  font-size: clamp(2.2rem, 7vw, 3.5rem);
  text-align: center;
  margin: 8px 0;
}

.lead {
  text-align: center;
  font-size: 1.4rem;
  margin: 0 0 24px;
}

/* Übersicht */

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* Auf dem Handy wären vier Spalten zu klein */
@media (max-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 16px 12px;
  background: var(--bg);
  border: 4px solid #fff;
  border-radius: 28px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .12);
  color: inherit;
  text-decoration: none;
  transition: transform .15s;
}

.card:hover, .card:focus-visible { transform: translateY(-4px) rotate(-1.5deg); }
.card:active { transform: scale(.97); }

.card canvas {
  width: 100%;
  aspect-ratio: 1;
}

.card span {
  margin-top: 4px;
  font-size: 1.6rem;
  font-weight: 700;
}

/* Detailansicht */

.bar {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
}

.back {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .15);
  color: inherit;
  font-size: 2rem;
  text-decoration: none;
}

.back:active { transform: translateY(2px); }

.stage-wrap {
  position: relative;
  width: min(100%, 62vh, 560px);
  aspect-ratio: 1;
  margin: 8px auto 0;
  background: var(--bg);
  border: 6px solid #fff;
  border-radius: 50%;
  box-shadow: 0 8px 0 rgba(0, 0, 0, .12);
}

#stage {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

#stage.grabbing { cursor: grabbing; }

.hint {
  margin: 18px 0 0;
  text-align: center;
  font-size: 1.5rem;
}

.bubble {
  position: absolute;
  z-index: 1;
  top: 2%;
  right: 2%;
  padding: 10px 18px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .12);
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
}

.bubble::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: -14px;
  border: 10px solid transparent;
  border-top: 14px solid #fff;
  border-bottom: 0;
}

.bubble.pop { animation: pop 1.6s ease-out forwards; }

@keyframes pop {
  0%   { opacity: 0; transform: scale(.4) rotate(-8deg); }
  12%  { opacity: 1; transform: scale(1.1) rotate(3deg); }
  20%  { transform: scale(1) rotate(0); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px); }
}
