/* style.css */

:root {
  --color-background: #8a4dff;
  --color-card: rgba(255, 255, 255, 0.16);
  --color-card-border: rgba(255, 255, 255, 0.18);
  --color-input-fill: #9b6fff;
  --color-input-border: #a97eff;
  --color-button-fill: #ff4fa3;
  --color-button-border: #ff8fc0;
  --color-button-secondary: #6f35c9;
  --color-circle-dark: rgba(78, 31, 148, 0.55);
  --color-circle-light: rgba(255, 255, 255, 0.18);
  --color-timer-ring: rgba(180, 145, 255, 0.45);
  --color-timer-accent: #9fe3b0;
  --color-bubble: #f0ecef;
  --color-bubble-text: #3f3151;
  --color-text: #ffffff;
  --color-text-soft: rgba(255, 255, 255, 0.8);
  --color-placeholder: rgba(255, 255, 255, 0.65);
  --color-shadow: rgba(71, 28, 156, 0.35);
  --color-dot-yellow: #ffd84f;
  --color-dot-peach: #ffb38a;
  --color-dot-pink: #ff5aa5;
  --color-dot-blue: #78d9ff;

  --radius-large: 18px;
  --radius-xl: 20px;
  --radius-full: 999px;

  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.25rem;
  --space-xl: 3rem;

  --content-width: 345px;
  --content-width-web: 1060px;

  --page-padding-x: 16px;
  --page-padding-top: 48px;
  --page-padding-bottom: 40px;

  --title-size: 2rem;
  --label-size: 1rem;
  --input-size: 1rem;
  --button-size: 1rem;
  --link-size: 1rem;
  --card-title-size: 1.1rem;
  --card-text-size: 1rem;

  --zahn-size: 18px;
  --intro-image-width: 190px;
  --timer-size: 300px;

  --circle-button-size: 40px;
  --circle-button-icon-size: 40px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body { font-family: "Inter", sans-serif; background-color: var(--color-background); color: var(--color-text); }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; border: none; background: none; cursor: pointer; }

/* ── Layout ── */
.page-wrapper {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-content: start;
  padding: var(--page-padding-top) var(--page-padding-x) var(--page-padding-bottom);
}

.login-wrapper {
  width: 100%;
  max-width: var(--content-width);
  display: grid;
  grid-template-columns: 1fr;
  row-gap: var(--space-lg);
}

/* ── Typography ── */
.title-wrapper {
  font-family: "Cousine", monospace;
  font-size: var(--title-size);
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
}

.zahn { width: var(--zahn-size); height: var(--zahn-size); object-fit: contain; }

/* ── Introduction ── */
.intro-header-wrapper { display: grid; justify-items: center; row-gap: var(--space-xs); }
.intro-heading-wrapper { display: grid; grid-template-columns: auto 1fr auto; width: 100%; max-width: 250px; }
.intro-heading-wrapper .title-wrapper { text-align: center; font-size: 1.7rem; }
.intro-dots-wrapper { display: grid; justify-items: center; align-items: center; }
.intro-dots { width: 80px; height: auto; }
.intro-dot { width: 14px; height: 14px; transform: rotate(45deg); }
.intro-dot-yellow { background-color: var(--color-dot-yellow); }
.intro-dot-peach  { background-color: var(--color-dot-peach); }
.intro-dot-pink   { background-color: var(--color-dot-pink); }
.intro-dot-blue   { background-color: var(--color-dot-blue); }

.intro-image-wrapper { display: grid; justify-items: center; margin-top: var(--space-sm); margin-bottom: var(--space-sm); }
.intro-image { width: var(--intro-image-width); height: auto; object-fit: contain; }

.intro-card-wrapper {
  display: grid; row-gap: var(--space-sm); padding: 28px 20px 24px;
  border: 2px solid var(--color-card-border); border-radius: var(--radius-xl);
  background-color: var(--color-card); text-align: center;
}
.intro-card-title { font-size: var(--card-title-size); font-weight: 700; line-height: 1.35; }
.intro-card-text  { color: var(--color-text-soft); font-size: var(--card-text-size); line-height: 1.5; }

.intro-actions-wrapper { display: grid; grid-template-columns: 1fr; row-gap: var(--space-sm); margin-top: var(--space-sm); }

.intro-button {
  width: 100%; min-height: 58px;
  display: grid; grid-auto-flow: column; justify-content: center; align-items: center; gap: 10px;
  padding: var(--space-sm); border-radius: var(--radius-large);
  font-size: var(--button-size); font-weight: 700; box-shadow: 0 8px 18px var(--color-shadow);
}
.intro-button-primary   { background-color: var(--color-button-fill); border: 2px solid var(--color-button-border); color: var(--color-text); }
.intro-button-secondary { background-color: var(--color-button-secondary); border: 2px solid transparent; color: var(--color-text); }

/* ── Login / Register ── */
.form-wrapper  { display: grid; grid-template-columns: 1fr; row-gap: var(--space-lg); }
.input-wrapper { display: grid; grid-template-columns: 1fr; row-gap: var(--space-2xs); }
.input-wrapper label { font-size: var(--label-size); font-weight: 600; }
.input-wrapper input {
  width: 100%; min-height: 56px; padding: var(--space-sm);
  border: 2px solid var(--color-input-border); border-radius: var(--radius-large);
  background-color: var(--color-input-fill); color: var(--color-text);
  font-size: var(--input-size); outline: none;
}
.input-wrapper input::placeholder { color: var(--color-placeholder); }
.input-wrapper input:focus { border-color: var(--color-text); }

.button-wrapper { display: grid; grid-template-columns: 1fr; }
.button-wrapper button {
  width: 100%; min-height: 58px; padding: var(--space-sm);
  border: 2px solid var(--color-button-border); border-radius: var(--radius-large);
  background-color: var(--color-button-fill); color: var(--color-text);
  font-size: var(--button-size); font-weight: 700; box-shadow: 0 8px 18px var(--color-shadow);
}
.button-wrapper button:active, .intro-button:active { transform: translateY(1px); }

.register-wrapper { text-align: center; color: var(--color-text-soft); font-size: var(--link-size); font-weight: 600; }
.register-wrapper a:hover { text-decoration: underline; }

/* ── Choose Profile ── */
.choose-profile-wrapper { align-items: center; text-align: center; row-gap: var(--space-lg); padding-top: var(--space-xl); }
.choose-profile-header { display: grid; row-gap: var(--space-2xs); }
.choose-profile-header .title-wrapper { font-family: "Inter", sans-serif; font-size: 2.2rem; font-weight: 700; line-height: 1.2; text-transform: none; }
.choose-profile-subtitle { color: var(--color-text-soft); font-size: 1rem; }
.profile-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-md); width: 100%; }
.profile-card { display: grid; justify-items: center; row-gap: var(--space-xs); background: none; border: none; cursor: pointer; padding: 0; color: var(--color-text); flex: 0 0 calc(25% - var(--space-md)); min-width: 130px; max-width: 160px; }
@media (max-width: 600px) { .profile-card { flex: 0 0 calc(33.333% - var(--space-md)); } }
@media (max-width: 420px) { .profile-card { flex: 0 0 calc(50% - var(--space-md)); } }
.profile-card:active .profile-avatar { transform: scale(0.95); }
.profile-avatar { width: 100%; max-width: 130px; aspect-ratio: 1/1; border-radius: 20px; border: 4px solid transparent; overflow: hidden; transition: transform 0.15s ease; background-color: var(--color-circle-dark); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar--pink   { border-color: #ff4fa3; }
.profile-avatar--yellow { border-color: #ffd84f; }
.profile-avatar--teal   { border-color: #4cd9c4; }
.profile-avatar--add    { background-color: #7b3fd4; border-color: transparent; display: grid; place-items: center; }
.profile-avatar--add img { width: 40px; height: 40px; object-fit: contain; }
.profile-card--add { cursor: default; opacity: 0.85; }
.profile-name { font-size: 1rem; font-weight: 600; line-height: 1.3; text-align: center; }
.choose-profile-actions { display: grid; grid-template-columns: 1fr; row-gap: var(--space-sm); width: 100%; }
.choose-profile-actions .intro-button { background-color: transparent; border: 2px solid rgba(255,255,255,0.3); font-size: 0.95rem; font-weight: 600; min-height: 50px; border-radius: var(--radius-full); display: grid; place-items: center; }

/* ── Generate Profile ── */
.gen-profile-wrapper {
  row-gap: var(--space-lg);
  padding-top: var(--space-sm);
}

.gen-profile-header {
  display: grid;
  grid-template-columns: var(--circle-button-size) 1fr;
  align-items: start;
  column-gap: var(--space-sm);
}

.gen-profile-title {
  font-family: "Inter", sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.15;
  text-transform: none;
  text-align: center;
  padding-right: var(--circle-button-size);
}

.gen-alert {
        width: 100%;
        padding: 14px 18px;
        border-radius: var(--radius-large);
        font-size: 0.95rem;
        font-weight: 600;
        line-height: 1.4;
        display: flex;
        align-items: center;
        gap: 10px;
      }

      .gen-alert--error {
        background: rgba(255, 80, 80, 0.18);
        border: 1.5px solid rgba(255, 80, 80, 0.45);
        color: #fff;
      }

      .gen-alert--success {
        background: rgba(80, 220, 140, 0.18);
        border: 1.5px solid rgba(80, 220, 140, 0.45);
        color: #fff;
      }

/* Avatar */
.gen-avatar-wrapper {
  display: grid;
  justify-items: center;
  row-gap: var(--space-xs);
}

.gen-avatar-img-box {
  position: relative;
  width: 150px;
  height: 150px;
}

.gen-avatar-img {
  width: 150px;
  height: 150px;
  border-radius: var(--radius-xl);
  object-fit: cover;
  border: 3px solid #ff8fc0;
  display: block;
}

.gen-avatar-edit-btn {
  position: absolute;
  bottom: -8px;
  right: -8px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ff4fa3;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.gen-avatar-edit-btn:active { transform: scale(0.93); }

.gen-avatar-label {
  color: var(--color-text-soft);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: var(--space-2xs);
}

/* Form card */
.gen-form-card {
  width: 100%;
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-xl);
  padding: 24px 20px 28px;
  display: grid;
  row-gap: var(--space-md);
}

/* Input with info icon */
.gen-input-icon-wrapper {
  position: relative;
  display: grid;
}
.gen-input-icon-wrapper input {
  padding-right: 52px;
}

.gen-info-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,0.18);
  border: none;
  display: grid;
  place-items: center;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s ease;
}
.gen-info-btn:hover { background: rgba(255,255,255,0.28); }

.gen-info-text {
  color: var(--color-text-soft);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-top: var(--space-2xs);
}

/* Submit button — pill shape */
.gen-submit-btn {
  border-radius: var(--radius-full) !important;
  min-height: 62px !important;
  font-size: 1.05rem !important;
}

/* ── Edit Profile Page ── */
.edit-profile-wrapper {
  row-gap: var(--space-lg);
  padding-top: var(--space-sm);
}

.edit-profile-header {
  display: grid;
  grid-template-columns: var(--circle-button-size) 1fr;
  align-items: start;
  column-gap: var(--space-sm);
}

.edit-profile-title {
  font-family: "Inter", sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  padding-right: var(--circle-button-size);
}

/* ── Profile List ── */
.profile-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  width: 100%;
  list-style: none;
}

.profile-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  transition: background 0.15s ease;
}

.profile-list-avatar {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background-color: var(--color-circle-dark);
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.profile-list-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-list-initial {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
}

/* ── Name display / edit ── */
.profile-list-info {
  flex: 1;
  min-width: 0;
}

.profile-display-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.profile-edit-form {
  display: none;
  align-items: center;
  gap: 8px;
}

.profile-edit-form.is-active {
  display: flex;
}

.profile-edit-form.is-active ~ .profile-display-name {
  display: none;
}

.profile-name-input {
  flex: 1;
  min-height: 40px;
  padding: 6px 12px;
  border: 2px solid var(--color-input-border);
  border-radius: var(--radius-large);
  background-color: var(--color-input-fill);
  color: var(--color-text);
  font-size: 0.95rem;
  font-family: "Inter", sans-serif;
  outline: none;
  min-width: 0;
}

.profile-name-input:focus {
  border-color: var(--color-text);
}

.profile-name-save-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-timer-accent);
  color: #241b39;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.profile-name-save-btn:active {
  transform: scale(0.93);
}

/* ── Action buttons ── */
.profile-list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.profile-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--color-text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.profile-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.profile-action-btn:active {
  transform: scale(0.92);
}

.profile-action-btn--delete:hover {
  background: rgba(255, 79, 163, 0.25);
  border-color: rgba(255, 79, 163, 0.4);
  color: #ff8fc0;
}

.profile-action-btn--edit.is-editing {
  background: rgba(159, 227, 176, 0.2);
  border-color: rgba(159, 227, 176, 0.4);
  color: var(--color-timer-accent);
}

/* ── Inline Alert ── */
.edit-alert {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-large);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  display: none;
  align-items: center;
  gap: 10px;
}

.edit-alert.is-visible {
  display: flex;
}

.edit-alert--error {
  background: rgba(255, 80, 80, 0.18);
  border: 1.5px solid rgba(255, 80, 80, 0.45);
  color: #fff;
}

.edit-alert--success {
  background: rgba(80, 220, 140, 0.18);
  border: 1.5px solid rgba(80, 220, 140, 0.45);
  color: #fff;
}

/* ── Delete Modal ── */
#delete-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(60, 20, 120, 0.55);
  align-items: flex-end;
  justify-content: center;
  padding: 24px;
}

#delete-modal.is-open {
  display: flex;
}

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

.delete-modal-text strong {
  color: #1a0f2e;
}

/* Abbrechen → prominent pink (unverändert) */
#delete-modal .modal-btn-secondary {
  background: var(--color-button-fill);
  border: 2px solid var(--color-button-border);
  color: var(--color-text);
  box-shadow: 0 8px 18px rgba(255, 79, 163, 0.35);
  font-weight: 700;
}
#delete-modal .modal-btn-secondary:hover {
  background: #e03a90;
  border-color: var(--color-button-fill);
}
#delete-modal .modal-btn-secondary:active {
  transform: translateY(1px);
  background: #e03a90;
}

/* Ja, löschen → rot, bei hover dunkler */
#delete-modal .modal-btn-primary {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: var(--color-error);        /* #a12c7b — rot */
  box-shadow: none;
  font-weight: 600;
}
#delete-modal .modal-btn-primary:hover {
  color: var(--color-error-hover);  /* #7d1e5e — dunkelrot */
  border-color: rgba(255, 255, 255, 0.6);
}


/* ── Loading Skeleton ── */
.profile-list-skeleton {
  display: grid;
  gap: var(--space-sm);
}

.skeleton-item {
  height: 80px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-card-border);
  background-image: linear-gradient(
    90deg,
    var(--color-card) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    var(--color-card) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ── Brushing Page ── */
.page-wrapper-brushing { padding-top: var(--page-padding-top); }

.brushing-wrapper { display: grid; grid-template-columns: 1fr; row-gap: var(--space-md); }

.brushing-header-wrapper {
  display: grid;
  grid-template-columns: var(--circle-button-size) 1fr var(--circle-button-size);
  align-items: center;
  column-gap: var(--space-sm);
}

.brushing-title-wrapper { display: grid; justify-items: center; row-gap: var(--space-2xs); text-align: center; }
.brushing-title-wrapper .title-wrapper { font-size: 1.95rem; }
.brushing-name { color: var(--color-text-soft); font-size: 1.25rem; line-height: 1.3; }

.circle-button { width: var(--circle-button-size); height: var(--circle-button-size); min-width: var(--circle-button-size); min-height: var(--circle-button-size); display: grid; place-items: center; border-radius: 50%; background-color: var(--color-circle-dark); box-shadow: 0 6px 14px var(--color-shadow); }
.circle-button-light { background-color: var(--color-circle-light); }
.circle-button-icon  { width: var(--circle-button-icon-size); height: var(--circle-button-icon-size); object-fit: contain; }

.brushing-stage-wrapper { display: grid; grid-template-columns: 1fr; row-gap: var(--space-lg); justify-items: center; align-items: center; }

.timer-wrapper { display: grid; justify-items: center; width: 100%; }

.brushing-character-wrapper { display: grid; justify-items: center; row-gap: var(--space-sm); }
.brushing-image-wrapper { margin: 0; }
.brushing-image { width: 145px; }

.speech-bubble-wrapper {
  width: 100%; max-width: 220px; justify-self: center; position: relative;
  padding: 18px 20px; border-radius: 16px; background-color: var(--color-bubble);
  box-shadow: 0 8px 18px rgba(49,25,93,0.2); text-align: center;
}
.speech-bubble-wrapper::before {
  content: ""; position: absolute; top: -10px; left: 50%;
  width: 20px; height: 20px; background-color: var(--color-bubble);
  transform: translateX(-50%) rotate(45deg);
}
.speech-bubble-text { color: var(--color-bubble-text); font-size: 1.1rem; line-height: 1.35; }

.brushing-actions-wrapper { display: grid; grid-template-columns: 1fr; row-gap: var(--space-sm); }
.button-icon-image { width: 14px; height: 14px; object-fit: contain; }
.navigation { display: none; }

/* ── Ring Timer ── */
.ring-timer {
  position: relative;
  width: min(var(--timer-size), 100%);
  aspect-ratio: 1;
}
.ring-svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.ring-track {
  fill: none;
  stroke: rgba(180, 145, 255, 0.35);
  stroke-width: 18;
}
.ring-progress {
  fill: none;
  stroke: #9fe3b0;
  stroke-width: 18;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s ease;
}
.ring-center {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
}

.ring-time {
  font-family: "Cousine", monospace;
  font-size: clamp(2.8rem, 15vw, 5rem);
  font-weight: 500; line-height: 1;
  color: var(--color-text);
}

/* ── Sensor Badge ── */
.sensor-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: var(--radius-full);
  font-size: .85rem; font-weight: 700;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.22);
}
.sensor-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sensor-badge.active .sensor-dot {
  background: var(--color-timer-accent);
  box-shadow: 0 0 0 3px rgba(159,227,176,.35);
  animation: blink-dot 1s ease-in-out infinite;
}
.sensor-badge.waiting .sensor-dot { background: var(--color-dot-yellow); }
.sensor-badge.paused  .sensor-dot { background: var(--color-dot-peach); }

@keyframes blink-dot {
  0%,100% { opacity:1; } 50% { opacity:.3; }
}

/* ── Cancel Modal ── */
#cancel-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(60, 20, 120, 0.55);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-box {
  background: #C4A8FF;
  border-radius: 24px;
  padding: 36px 28px 32px;
  max-width: 340px;
  width: 100%;
  position: relative;
  box-shadow: 0 16px 48px var(--color-shadow);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  font-size: 20px;
  color: var(--color-text-soft);
}
.modal-close:hover { color: var(--color-text); }

.modal-title {
  margin: 0 0 16px;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
}

.modal-text {
  margin: 0 0 32px;
  color: var(--color-circle-dark);
  font-size: 1rem;
  line-height: 1.55;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-btn-primary {
  width: 100%;
  padding: 18px 12px;
  border-radius: var(--radius-large);
  background: var(--color-timer-accent);
  color: var(--color-bubble-text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.modal-btn-primary:active { transform: translateY(1px); }

.modal-btn-secondary {
  width: 100%;
  padding: 18px 12px;
  border-radius: var(--radius-large);
  border: 2px solid var(--color-card-border);
  background: transparent;
  color: var(--color-text-soft);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.modal-btn-secondary:hover { color: var(--color-text); border-color: var(--color-text-soft); }
/* ── Success Page ───────────────────────────────────────── */

.success-page-wrapper {
  overflow: hidden;
}

.success-wrapper {
  justify-items: center;
  row-gap: var(--space-md);
}

/* Header */
.success-header-wrapper {
  display: grid;
  justify-items: center;
  row-gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.success-title {
  font-size: 3.5rem;
  text-align: center;
}

.success-stars-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.success-stars {
  width: 110px;
  height: 34px;
  object-fit: contain;
  animation-delay: 0s;
}

.success-image {
  animation-delay: 0s;
}

/* Character */
.success-character-wrapper {
  display: grid;
  justify-items: center;
}

.success-image-wrapper {
  margin: 0;
}

.success-image {
  width: 230px;
  image-rendering: pixelated;
}

/* Card */
.success-card-wrapper {
  width: 100%;
  position: relative;
  padding: 42px 28px 36px;
  border: 3px solid #9fe3b0;
  background: rgba(255, 255, 255, 0.08);
  overflow: visible;
}

.success-card-inner {
  display: grid;
  row-gap: var(--space-md);
  justify-items: center;
}

.success-card-title {
  font-size: 2.1rem;
}

.success-card-text {
  font-size: 1.15rem;
  line-height: 1.6;
  text-align: center;
  max-width: 260px;
}

/* Rewards */
.success-rewards-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
}

.success-badge {
  min-width: 140px;
  min-height: 58px;
  padding: 0 22px;
  border-radius: var(--radius-full);

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  font-size: 1rem;
  font-weight: 700;

  box-shadow: 0 8px 18px var(--color-shadow);
}

.success-badge-points {
  background: #9fe3b0;
  color: #241b39;
}

.success-badge-star {
  background: #ffd84f;
  color: #241b39;
}

.success-badge-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* Decorative corners */
.success-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--color-dot-pink);
  transform: rotate(45deg);
}

.success-corner-top-left {
  top: -10px;
  left: -10px;
}

.success-corner-top-right {
  top: -10px;
  right: -10px;
}

.success-corner-bottom-left {
  bottom: -10px;
  left: 28px;
  background: var(--color-dot-yellow);
}

.success-corner-bottom-right {
  bottom: -10px;
  right: 28px;
  background: var(--color-dot-blue);
}

/* Buttons */
.success-actions-wrapper {
  width: 100%;
  margin-top: var(--space-sm);
}

.success-main-button {
  min-height: 68px;
  border-radius: 28px;
  font-size: 1.2rem;
}

.success-secondary-button {
  min-height: 68px;
  border-radius: 28px;
  font-size: 1.2rem;
  background-color: #A97EFF;
  border: 2px solid #B88FFF;
  box-shadow: 0 8px 18px rgba(169, 126, 255, 0.35);
  color: #ffffff;
}

.success-btn-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

@keyframes eddyBounce {
  0%   { transform: translateY(0px); animation-timing-function: ease-in; }
  45%  { transform: translateY(-28px); animation-timing-function: ease-out; }
  55%  { transform: translateY(-28px); animation-timing-function: ease-in; }
  100% { transform: translateY(0px); }
}

.success-image,
.success-stars {
  animation: eddyBounce 0.65s ease-in-out infinite;
  transform-origin: bottom center;
}



/* ── Stats Page ── */

.stats-page-wrapper {
  padding-top: var(--page-padding-top);
}

.stats-wrapper {
  row-gap: var(--space-md);
}

/* ── Tabs ── */
.stats-tabs-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--color-circle-dark);
  border-radius: var(--radius-full);
  padding: 4px;
}

.stats-tab {
  padding: 10px;
  border-radius: var(--radius-full);
  font-size: var(--button-size);
  font-weight: 700;
  color: var(--color-text-soft);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.stats-tab--active {
  background: var(--color-button-fill);
  color: var(--color-text);
}

.stats-tabs-wrapper--three {
  grid-template-columns: 1fr 1fr 1fr;
}

/* ── Cards ── */
.stats-card {
  width: 100%;
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-xl);
  padding: 22px 20px;
  display: grid;
  row-gap: var(--space-md);
}

.stats-card-title {
  font-family: "Inter", sans-serif;
  font-size: var(--card-title-size);
  font-weight: 700;
  color: var(--color-text);
}

/* ── Stats Overview Page ── */

/* Score Card */
.stats-card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stats-card-title-row .stats-card-title {
  margin-bottom: 0;
}

.stats-score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 0 4px;
}
.stats-score-value {
  font-family: "Cousine", monospace;
  font-size: 5rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}
.stats-score-sub {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-soft);
}

.stats-activity-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-3, 12px);
}

.stats-activity-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 14px 16px;
}

.stats-activity-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.stats-activity-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stats-activity-time {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
}

.stats-activity-duration {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

.stats-activity-item--aborted .stats-activity-duration {
    color: rgba(255,255,255,0.75);
}

.stats-activity-heart {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* Diese Woche */
.stats-week-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.stats-week-tile {
  background: var(--color-circle-dark);
  border-radius: var(--radius-large);
  padding: 16px;
  display: grid;
  gap: 6px;
  width: 100%;
}
.stats-week-tile-icon {
  width: 20px;
  height: 20px;
}
.stats-week-tile-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-soft);
}
.stats-week-tile .stats-metric-value {
  font-size: 2rem;
}

/* Letzte Aktivität */
.stats-activity-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stats-activity-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--color-circle-dark);
  border-radius: var(--radius-large);
  padding: 14px 16px;
}
.stats-activity-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.stats-activity-info {
  flex: 1;
}
.stats-activity-date {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  display: block;
}
.stats-activity-duration {
  font-size: 0.85rem;
  color: var(--color-text-soft);
  display: block;
}
.stats-activity-badge {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.stats-activity-empty {
  color: var(--color-text-soft);
  font-size: 0.9rem;
  text-align: center;
  padding: 20px 0;
}

/* ── Stats Cards – Metriken ── */

.stats-overview-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 0;
}

.stats-metric-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
}

.stats-metric-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-large);
  background: var(--color-circle-dark);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.stats-metric-icon--pink  { color: var(--color-button-fill); }
.stats-metric-icon--yellow { color: var(--color-dot-yellow); }
.stats-metric-icon--teal  { color: var(--color-timer-accent); }

.stats-metric-value {
  font-family: "Cousine", monospace;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.stats-metric-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-soft);
  text-align: center;
}

.stats-metric-divider {
  width: 1px;
  background: var(--color-card-border);
  align-self: stretch;
  margin: 8px 0;
}

/* ── Chart ── */
.stats-chart-wrapper {
  width: 100%;
  min-height: 180px;
}

/* ── Goal Card ── */
.stats-goal-card {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  row-gap: 0;
  gap: 16px;
}

.stats-goal-content {
  display: grid;
  row-gap: 6px;
  flex: 1;
}

.stats-goal-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.stats-goal-checkbox-wrapper {
  display: flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.stats-goal-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.stats-goal-checkmark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--color-card-border);
  background: var(--color-circle-dark);
  display: grid;
  place-items: center;
  color: transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.stats-goal-checkbox:checked + .stats-goal-checkmark {
  background: var(--color-timer-accent);
  border-color: var(--color-timer-accent);
  color: #241b39;
}

/* ── Success Page Responsive ── */
@media (min-width: 768px) {
  .success-title {
    font-size: 4.2rem;
  }

  .success-image {
    width: 260px;
  }

  .success-card-text {
    max-width: 320px;
  }
}

/* ══════════════════════════════════════════
   RESPONSIVE — Grid-System über alle Seiten
   Breakpoints: 480 · 768 · 900 · 1024 · 1280 · 1440
   ══════════════════════════════════════════ */

/* ── 480px ── */
@media (min-width: 480px) {
  :root {
    --content-width: 440px;
    --title-size: 2.1rem;
    --intro-image-width: 205px;
    --timer-size: 340px;
  }
  .intro-heading-wrapper { max-width: 265px; }
}

/* ── 768px (Tablet) ── */
@media (min-width: 768px) {
  :root {
    --content-width: 600px;
    --page-padding-top: 80px;
    --page-padding-x: 24px;
    --title-size: 2.2rem;
    --label-size: 1.05rem;
    --input-size: 1.05rem;
    --button-size: 1.05rem;
    --link-size: 1.05rem;
    --card-title-size: 1.3rem;
    --card-text-size: 1.05rem;
    --zahn-size: 20px;
    --intro-image-width: 220px;
    --timer-size: 420px;
  }
  .intro-heading-wrapper { max-width: 290px; }
  .intro-heading-wrapper .title-wrapper { font-size: 1.95rem; }
  .intro-card-wrapper { padding: 32px 28px 28px; }
  .brushing-title-wrapper .title-wrapper { font-size: 2.2rem; }
  .brushing-image { width: 165px; }

  /* Stats: 2-Spalten-Grid für Cards */
  .stats-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--space-md);
    row-gap: var(--space-md);
    align-items: start;
  }
  /* Header-Zeile bleibt immer full-width */
  .brushing-header-wrapper,
  .stats-tabs-wrapper {
    grid-column: 1 / -1;
  }
  /* Score-Card und Goal-Card full-width */
  .stats-card:has(.stats-score-display),
  .stats-card:has(.stats-goal-card) {
    grid-column: 1 / -1;
  }
  /* Week-Grid: 2 Spalten nebeneinander */
  .stats-week-grid {
    grid-template-columns: 1fr 1fr;
  }
  /* Overview-Metriken mehr Luft */
  .stats-metric-value { font-size: 2.2rem; }
}

/* ── 900px (Brushing Desktop-Layout) ── */
@media (min-width: 900px) {
  .page-wrapper-brushing { padding-top: 88px; padding-bottom: 64px; }

  .brushing-wrapper { max-width: var(--content-width-web); row-gap: 56px; }

  .brushing-stage-wrapper {
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 48px;
    width: 100%;
    justify-self: center;
  }
  .timer-wrapper    { justify-self: end; align-self: center; }
  .brushing-character-wrapper { justify-self: start; align-self: center; row-gap: 12px; }
  .speech-bubble-wrapper { max-width: 168px; padding: 16px 18px; }
  .speech-bubble-text { font-size: 1rem; }
  .brushing-actions-wrapper { width: 100%; max-width: 460px; justify-self: center; margin-top: 0; }
  .intro-button { min-height: 48px; font-size: 0.95rem; }
}

/* ── 1024px (Desktop) ── */
@media (min-width: 1024px) {
  :root {
    --content-width: 860px;
    --page-padding-x: 32px;
    --title-size: 2.4rem;
    --zahn-size: 22px;
    --intro-image-width: 235px;
    --timer-size: 500px;
  }

  /* Stats: 3-Spalten-Grid */
  .stats-wrapper {
    grid-template-columns: 1fr 1fr 1fr;
  }
  /* Score-Card full-width */
  .stats-card:has(.stats-score-display) {
    grid-column: 1 / -1;
  }
  /* Goal-Card 2/3 breit */
  .stats-card:has(.stats-goal-card) {
    grid-column: span 2;
  }
  /* Week-Grid: alle 4 Tiles nebeneinander */
  .stats-week-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .stats-metric-value { font-size: 2.4rem; }
  .stats-score-value  { font-size: 5.5rem; }
}

/* ── 1280px ── */
@media (min-width: 1280px) {
  :root {
    --content-width: 1000px;
  }
  .stats-score-value { font-size: 6rem; }
}

/* ── 1440px ── */
@media (min-width: 1440px) {
  :root {
    --content-width: 1060px;
    --title-size: 2.6rem;
    --zahn-size: 24px;
    --intro-image-width: 250px;
  }
}
