:root {
  --bg: #fff6f7;
  --card: rgba(255, 255, 255, 0.88);
  --text: #382127;
  --muted: rgba(56, 33, 39, 0.65);
  --accent: #f3a6b6;
  --accent-strong: #e28aa1;
  --card-border: rgba(243, 166, 182, 0.45);
  --surface-border: rgba(243, 166, 182, 0.35);
  --shadow: 0 12px 30px rgba(120, 86, 96, 0.18);
  --shadow-soft: 0 8px 18px rgba(120, 86, 96, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.85), transparent 55%), var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  line-height: 1.5;
}

body.ping-active { --bg: #ffd6d6; }

body.ping-active .app {
  background: rgba(255, 107, 107, 0.15);
  border-radius: 24px;
}

body.theme-sleepy { --bg: #f5f3ff; --accent: #d5cbff; --accent-strong: #b4a6ff; }
body.theme-exhausted { --bg: #f0f7ff; --accent: #bfe1ff; --accent-strong: #8ac2ff; }
body.theme-angry { --bg: #fff1f2; --accent: #ffb2b2; --accent-strong: #ff8b8b; }
body.theme-sad { --bg: #f6fbff; --accent: #bfe6ff; --accent-strong: #8bcfff; }
body.theme-happy { --bg: #f4fff2; --accent: #bff0c4; --accent-strong: #8fd89a; }
body.theme-cheeky { --bg: #fff6e9; --accent: #f7d3a7; --accent-strong: #f0b979; }
body.theme-shock { --bg: #f2f1ff; --accent: #c9c7ff; --accent-strong: #9f9bff; }
body.theme-hungry { --bg: #fff7f1; --accent: #ffd3a6; --accent-strong: #f5b574; }

.app {
  width: min(520px, 100%);
  padding: 24px 18px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0 auto;
  position: relative;
}

.app__header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.app__header h1 {
  margin: 0 0 8px;
  font-size: 1.8rem;
  letter-spacing: 0.01em;
  text-align: center;
  cursor: pointer;
}

.hint {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.card {
  background: var(--card);
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card.pop { animation: pop 0.35s ease; }

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); box-shadow: 0 14px 28px rgba(120, 86, 96, 0.2); }
  100% { transform: scale(1); }
}

.card h2 { margin: 0 0 12px; font-size: 1.1rem; }

.pill-group { display: flex; flex-wrap: wrap; gap: 10px; }
.pill-group--small { gap: 6px; }

.mouse-meter { position: relative; margin-top: 10px; }

.mouse-meter input[type="range"] {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 999px;
  background: #f1d6dd;
  outline: none;
  cursor: pointer;
}

.mouse-meter input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: #f1d6dd;
}

.mouse-meter input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: #f1d6dd;
}

.mouse-meter input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32'><text x='50%' y='55%' font-size='26' text-anchor='middle' dominant-baseline='middle'>🐭</text></svg>") center / contain no-repeat;
  background-color: transparent;
  border: none;
  margin-top: -13px;
  cursor: pointer;
  box-shadow: none;
  filter: none;
}

.mouse-meter input[type="range"]::-moz-range-thumb {
  width: 32px;
  height: 32px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32'><text x='50%' y='55%' font-size='26' text-anchor='middle' dominant-baseline='middle'>🐭</text></svg>") center / contain no-repeat;
  background-color: transparent;
  border: none;
  cursor: pointer;
  box-shadow: none;
  filter: none;
}

.mouse-meter__labels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.mouse-value { color: var(--text); font-weight: 600; }

.pill {
  border: none;
  background: #fceef1;
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.pill--small { font-size: 0.9rem; padding: 8px 14px; }

.pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(226, 138, 161, 0.2);
}

.pill:active { transform: translateY(0); }

.pill.active {
  background: var(--accent);
  color: #3b1f25;
  box-shadow: 0 6px 14px rgba(226, 138, 161, 0.3);
}

#client-buttons button[data-name="Maus B"].active {
  position: relative;
}

#client-buttons button[data-name="Maus B"].active::after {
  content: "👑";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.3em;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(120, 86, 96, 0.25));
  animation: crown-float 1.8s ease-in-out infinite;
}

@keyframes crown-float {
  0% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-3px); }
  100% { transform: translateX(-50%) translateY(0); }
}

.pill:disabled { opacity: 0.6; cursor: not-allowed; }

.pill:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.client-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 4px; }
.label--inline { margin: 0; }
.value { font-size: 1.1rem; font-weight: 600; }

.status-card { border: 1px solid #f1d6dd; }

.status-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.status-grid > div {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-soft);
}

.status-line {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

.message-card { display: flex; flex-direction: column; gap: 6px; }

.message-card textarea {
  width: 100%;
  margin-top: 6px;
  border-radius: 14px;
  border: 1px solid var(--surface-border);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  min-height: 120px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
}

.message-card textarea:disabled,
input:disabled { background: #f6f0f2; }

.message-card__button { align-self: flex-start; }

.wish-detail { margin-top: 12px; display: grid; gap: 6px; }

.wish-detail input {
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  padding: 10px 12px;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
}

.card--ping {
  border: 1px solid rgba(255, 107, 107, 0.35);
  background: linear-gradient(135deg, #fff7f7 0%, #fff1f3 100%);
}

.card--siren {
  border: 2px solid #ff6b6b;
  background: linear-gradient(135deg, #fff5f5 0%, #ffe9e9 100%);
}

.card--countdown {
  border: 1px solid #f7c9d6;
  background: linear-gradient(135deg, #fff7fb 0%, #ffeef6 55%, #fff9f0 100%);
  position: relative;
  overflow: hidden;
}

.card--valentine {
  border: 1px solid #f2c6d4;
  background: linear-gradient(135deg, #fff7fb 0%, #ffeef5 55%, #fff9f2 100%);
  position: relative;
  overflow: hidden;
}

.love-card {
  background: var(--card);
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.love-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(243, 166, 182, 0.12), transparent 55%);
  pointer-events: none;
}

.love-header {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.love-header::before {
  content: "💌";
  font-size: 1rem;
}

.love-content {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}

.love-text {
  font-size: 1.15rem;
  line-height: 1.55;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  animation: loveFade 0.45s ease;
}

.love-footer {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

@keyframes loveFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.card--valentine::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.85), transparent 60%);
  pointer-events: none;
}

.card--countdown::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.9), transparent 55%);
  pointer-events: none;
}

.countdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.countdown-header h2 { margin-bottom: 6px; }

.valentine-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.valentine-header h2 { margin-bottom: 6px; }

.valentine-badge {
  font-size: 2.1rem;
  background: #fff0f6;
  border-radius: 16px;
  padding: 6px 10px;
  box-shadow: 0 10px 20px rgba(226, 138, 161, 0.18);
}

.pill-group--valentine {
  gap: 12px;
  position: relative;
  z-index: 1;
}

.pill-group--valentine .pill {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 138, 161, 0.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.pill-group--valentine .pill.active {
  background: linear-gradient(135deg, #f9b5c9 0%, #f2a3b8 100%);
  color: #3b1f25;
}

.valentine-note {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  position: relative;
  z-index: 1;
}

.countdown-badge {
  font-size: 2.2rem;
  background: #fff0f6;
  border-radius: 16px;
  padding: 6px 10px;
  box-shadow: 0 10px 20px rgba(226, 138, 161, 0.2);
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.countdown-unit {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(243, 166, 182, 0.35);
}

.countdown-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: #7a2f42;
}

.countdown-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

.wishlist {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  padding: 12px 14px;
  border: 1px dashed rgba(243, 166, 182, 0.6);
  position: relative;
  z-index: 1;
}

.wishlist h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.wishlist__items {
  margin: 0;
  padding-left: 0;
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 0.95rem;
  list-style: none;
}

.wishlist__items li {
  display: flex;
}

.wishlist__items input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #f1d6dd;
  padding: 8px 10px;
  font-size: 0.95rem;
  background: #fff;
  color: var(--text);
}

.siren {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.siren__icon {
  font-size: 2rem;
  animation: siren-pulse 0.6s ease-in-out infinite alternate;
}

.card--siren.active { box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.2); }

@keyframes siren-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.ping-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.ping-header h2 { margin-bottom: 4px; }

.ping-button {
  align-self: center;
  background: radial-gradient(circle at top, #ff9a9a 0%, #ff6b6b 55%, #ff4d4d 100%);
  border: 1px solid rgba(255, 77, 77, 0.85);
  box-shadow: 0 10px 20px rgba(255, 77, 77, 0.25);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(65, 16, 16, 0.35);
}

.ping-button:hover {
  box-shadow: 0 14px 22px rgba(255, 77, 77, 0.3);
  transform: translateY(-2px);
}

.ping-button:disabled {
  background: #ffd0d0;
  border-color: rgba(255, 77, 77, 0.45);
  box-shadow: none;
  color: rgba(120, 35, 35, 0.6);
  text-shadow: none;
}

.ping-button--active {
  animation: siren-glow 1.2s ease-in-out infinite;
}

@keyframes siren-glow {
  0% {
    box-shadow: 0 10px 20px rgba(255, 77, 77, 0.28), 0 0 0 0 rgba(255, 77, 77, 0.4);
  }
  70% {
    box-shadow: 0 14px 26px rgba(255, 77, 77, 0.32), 0 0 0 18px rgba(255, 77, 77, 0);
  }
  100% {
    box-shadow: 0 10px 20px rgba(255, 77, 77, 0.28), 0 0 0 0 rgba(255, 77, 77, 0);
  }
}

.ping-clear-button {
  align-self: center;
  background: #ffe6e6;
  border: 1px solid rgba(255, 107, 107, 0.35);
  box-shadow: none;
}

.ping-clear-button:hover { box-shadow: 0 8px 16px rgba(255, 154, 154, 0.2); }

.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  font-size: 0.9rem;
}

.history-item {
  display: grid;
  gap: 6px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--surface-border);
}

.history-item:last-child { border-bottom: none; padding-bottom: 0; }

.history-time { font-size: 0.8rem; color: var(--muted); }

.version {
  margin: 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.admin-only { display: none; }
body.admin-mode .admin-only { display: inline-flex; }

.role-ozi-only,
.role-schloep-only { display: none; }

body.role-ozi .role-ozi-only { display: block; }
body.role-schloep .role-schloep-only { display: block; }

.treat-counter {
  position: fixed;
  top: 16px;
  right: 16px;
  font-size: 0.9rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  padding: 6px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 20;
  box-shadow: var(--shadow-soft);
}

.treat-counter.bump {
  animation: counter-bump 0.3s ease;
}

@keyframes counter-bump {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.treat {
  position: absolute;
  font-size: 2.1rem;
  cursor: pointer;
  z-index: 15;
  animation: treat-float 3s ease-in-out infinite;
  user-select: none;
}

@keyframes treat-float {
  0% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-6px); }
  100% { transform: translate(-50%, -50%) translateY(0); }
}

@media (max-width: 480px) {
  .app { padding: 20px 14px 40px; }
  .countdown-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}