/* IJsbreker kaartjes · speelpagina. Tokens en fonts staan in base.css. */

/* langzaam drijvend licht, zodat de pagina leeft zonder af te leiden */
.bg-light {
  position: fixed; inset: -20%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(34% 28% at 30% 30%, rgba(255,153,232,0.22), transparent 70%),
    radial-gradient(30% 26% at 72% 64%, rgba(176,159,232,0.26), transparent 70%);
  animation: drift 38s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(-4%, -3%, 0) rotate(0deg); }
  to   { transform: translate3d(4%, 3%, 0) rotate(8deg); }
}

/* ───────────────────────── Layout ───────────────────────── */

.app {
  position: relative; z-index: 1;
  width: 100%; max-width: 440px; margin: 0 auto;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 14px;
  padding:
    max(14px, env(safe-area-inset-top)) 18px
    max(14px, env(safe-area-inset-bottom));
}

/* ───────────────────────── Kop ───────────────────────── */

.top { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 4px; }
.logo { width: 124px; height: auto; display: block; filter: drop-shadow(0 8px 18px rgba(40, 30, 110, 0.18)); }
.eyebrow {
  font-family: var(--font-display); font-weight: var(--w-display);
  font-size: 15px; letter-spacing: 1px; color: #fff;
}

/* ───────────────────────── Segmented control ───────────────────────── */

.seg {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 5px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.seg-thumb {
  position: absolute; top: 5px; bottom: 5px; left: 5px;
  width: calc(50% - 5px);
  background: #fff;
  border-radius: 50px;
  box-shadow: 0 6px 16px -6px rgba(40, 30, 110, 0.35);
  transition: transform 340ms var(--ease-out);
}
.seg[data-active="challenge"] .seg-thumb { transform: translateX(100%); }
.seg-btn {
  position: relative; z-index: 1;
  height: 44px; border-radius: 50px;
  font-family: var(--font-display); font-weight: var(--w-display); font-size: 15.5px;
  color: #fff;
  transition: color 220ms ease;
}
.seg-btn[aria-selected="true"] { color: var(--ink); }
.seg-btn:focus-visible { outline-offset: -2px; }

/* ───────────────────────── Kaartenstapel ───────────────────────── */

.deck {
  position: relative;
  min-height: 300px;
  max-height: 560px;
  margin-top: 16px;             /* ruimte voor de kaarten die erachter uitsteken */
}

.deck-layer, .card {
  position: absolute; inset: 0;
  border-radius: var(--radius);
}
.deck-layer {
  border: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transform-origin: 50% 0;
  transition: transform 420ms var(--ease-out);
}
.deck-layer.l1 { background: rgba(255, 255, 255, 0.46); transform: translateY(-9px) scale(0.955); }
.deck-layer.l2 { background: rgba(255, 255, 255, 0.24); transform: translateY(-17px) scale(0.91); }
/* bij trekken schuift de stapel een fractie op, alsof je er een kaart vanaf pakt */
.deck.is-drawing .l1 { transform: translateY(-5px) scale(0.975); }
.deck.is-drawing .l2 { transform: translateY(-12px) scale(0.935); }

.card {
  display: flex; flex-direction: column;
  padding: 24px 24px 20px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow:
    0 30px 60px -26px rgba(40, 30, 110, 0.55),
    0 2px 6px rgba(40, 30, 110, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
  cursor: grab;
}
.card.is-dragging { cursor: grabbing; }
.card.is-leaving { pointer-events: none; z-index: 2; }

/* zachte gloed in de hoek, per stapel een andere kleur */
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(90% 60% at 100% 100%, rgba(255, 102, 216, 0.10), transparent 60%);
}
.card[data-cat="challenge"]::before {
  background: radial-gradient(90% 60% at 100% 100%, rgba(176, 159, 232, 0.18), transparent 60%);
}

.card-art {
  position: absolute; right: -26px; bottom: -22px;
  width: 168px; height: 168px;
  color: var(--pink);
  opacity: 0.09;
  transform: rotate(-12deg);
  pointer-events: none;
}
.card[data-cat="challenge"] .card-art { color: var(--purple); opacity: 0.16; }

.card-head { position: relative; display: flex; align-items: center; justify-content: space-between; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; color: var(--pink-deep);
  background: rgba(255, 102, 216, 0.12);
  border: 1px solid rgba(255, 102, 216, 0.26);
  padding: 6px 13px 6px 10px; border-radius: 50px;
}
.chip svg { width: 15px; height: 15px; }
.card[data-cat="challenge"] .chip {
  color: #6a55c8;
  background: rgba(176, 159, 232, 0.18);
  border-color: rgba(176, 159, 232, 0.4);
}

.card-text {
  position: relative;
  margin: auto 0;
  padding: 18px 0;
  font-family: var(--font-display); font-weight: var(--w-display);
  line-height: 1.12; letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
  font-size: clamp(27px, 8.4vw, 34px);
}
/* lange teksten iets kleiner, zodat alles op de kaart past */
.card-text.len-m  { font-size: clamp(25px, 7.4vw, 30px); }
.card-text.len-l  { font-size: clamp(22px, 6.5vw, 27px); line-height: 1.16; }
.card-text.len-xl { font-size: clamp(20px, 5.8vw, 24px); line-height: 1.2; }

.card-foot {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--ink-faint);
}
.card-hint { letter-spacing: 0.2px; text-transform: none; font-size: 13px; font-weight: 600; color: var(--ink-soft); }

.card.is-empty .card-text { font-size: 24px; color: var(--ink-soft); }

/* ───────────────────────── Knoppen ───────────────────────── */

.actions { display: grid; grid-template-columns: 58px 1fr; gap: 10px; }

.btn-next, .btn-share {
  height: 58px; border-radius: 50px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 160ms var(--ease-out), box-shadow 200ms ease, background-color 200ms ease;
}
.btn-next:active, .btn-share:active { transform: scale(0.97); }

.btn-next {
  gap: 10px;
  background: var(--pink); color: #fff;
  box-shadow: var(--shadow-pink);
  font-family: var(--font-display); font-weight: var(--w-display); font-size: 18px;
}
.btn-next svg { width: 20px; height: 20px; transition: transform 200ms var(--ease-out); }

.btn-share {
  position: relative;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.btn-share svg {
  position: absolute; width: 22px; height: 22px;
  transition: transform 260ms var(--ease-out), opacity 200ms ease, filter 200ms ease;
}
.btn-share .ic-check { opacity: 0; transform: scale(0.6); filter: blur(3px); }
.btn-share.is-done .ic-share { opacity: 0; transform: scale(0.6); filter: blur(3px); }
.btn-share.is-done .ic-check { opacity: 1; transform: scale(1); filter: blur(0); }

@media (hover: hover) and (pointer: fine) {
  .btn-next:hover { background: var(--pink-deep); box-shadow: 0 20px 52px -10px rgba(255,102,216,0.72); }
  .btn-next:hover svg { transform: translateX(3px); }
  .btn-share:hover { background: rgba(255, 255, 255, 0.28); }
  .seg-btn:not([aria-selected="true"]):hover { color: rgba(255, 255, 255, 0.82); }
}

.hint {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 18px;
  font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  transition: opacity 400ms ease, transform 400ms var(--ease-out);
}
.hint svg { width: 17px; height: 17px; animation: nudge 2.4s var(--ease-in-out) infinite; }
@keyframes nudge {
  0%, 60%, 100% { transform: translateX(0); }
  30% { transform: translateX(-5px); }
}
.hint.is-gone { opacity: 0; transform: translateY(4px); }

/* ───────────────────────── Toast ───────────────────────── */

.toast {
  position: fixed; left: 50%; z-index: 200;
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 92px);
  display: flex; align-items: center; gap: 9px;
  max-width: calc(100vw - 36px);
  padding: 12px 20px 12px 16px;
  background: var(--ink); color: #fff;
  border-radius: 50px;
  font-size: 14px; font-weight: 700;
  box-shadow: 0 18px 40px -14px rgba(21, 21, 43, 0.6);
  opacity: 0;
  transform: translate(-50%, 10px) scale(0.96);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms var(--ease-out);
}
.toast svg { width: 18px; height: 18px; color: var(--pink); flex: none; }
.toast.is-on {
  opacity: 1; transform: translate(-50%, 0) scale(1);
  transition: opacity 260ms ease, transform 320ms var(--ease-out);
}

.noscript {
  position: fixed; inset: auto 18px 18px; z-index: 300;
  background: #fff; color: var(--ink); padding: 14px 18px; border-radius: 18px; font-weight: 700;
}

/* ───────────────────────── Kleine en grote schermen ───────────────────────── */

@media (max-height: 680px) {
  .app { gap: 10px; }
  .logo { width: 100px; }
  .eyebrow { display: none; }
  .deck { min-height: 250px; }
  .btn-next, .btn-share { height: 52px; }
  .actions { grid-template-columns: 52px 1fr; }
}

@media (min-height: 860px) {
  .app { gap: 18px; padding-top: max(28px, env(safe-area-inset-top)); }
  .card { padding: 30px 28px 24px; }
}

/* ───────────────────────── Minder beweging ───────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .bg-light, .hint svg { animation: none; }
  .seg-thumb, .deck-layer { transition-duration: 0ms; }
}
