/* Afval sorteren: home tile, the menu picture, the thing to sort (a card that can be dragged), the
   line with why, and the bins (big buttons with a picture and a name). Shared look lives in
   css/style.css; the progress dots are Klok kijken's (.klok-dot). */

#tile-afval .tile-art { display: flex; align-items: center; justify-content: center; }
.af-tile-svg { width: 100%; height: 100%; max-width: 104px; display: block; }
.af-menu-art { display: flex; justify-content: center; margin: 4px auto 8px; }
.af-menu-art svg { width: min(100%, 300px); height: auto; display: block; }
.af-ov { display: inline-flex; width: 220px; height: 100px; }
.af-ov svg { width: 100%; height: 100%; }
.af-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }

#af-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 14px;
}
.af-top { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.af-chat { width: min(100%, 560px); display: flex; align-items: center; gap: 8px; }
.af-flower { flex: none; width: 84px; height: 124px; transform-origin: 50% 100%; } /* decoration: the line beside it says everything (aria-hidden) */
.af-flower-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.af-flower-head { transform-box: fill-box; transform-origin: 50% 100%; }
.af-flower.hop { animation: af-hop 0.55s ease 1; }
.af-flower.tilt .af-flower-head { animation: af-tilt 0.9s ease 1; }
.af-flower.party .af-flower-head { animation: af-dance 1.2s ease-in-out infinite; }
.af-flower .af-sparkles { animation: af-twinkle 1.2s ease-in-out infinite; }
@keyframes af-hop { 0%, 100% { transform: translateY(0) scale(1); } 30% { transform: translateY(2px) scale(1.04, 0.94); } 60% { transform: translateY(-10px) scale(0.98, 1.04); } }
@keyframes af-tilt { 0%, 100% { transform: rotate(0); } 30%, 70% { transform: rotate(10deg); } }
@keyframes af-dance { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes af-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.ov-art .af-ov-end { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ov-art .af-ov-stars { display: flex; gap: 6px; }
.ov-art .af-ov-flower { display: block; width: 80px; height: 118px; }
.ov-art .af-ov-flower svg { width: 100%; height: 100%; }
.af-say {
  margin: 0;
  flex: 1;
  min-width: 0;
  min-height: 3.6em;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--bz-radius-l);
  background: var(--bz-surface);
  box-shadow: var(--bz-shadow-s);
  font-size: var(--bz-text-m);
  font-weight: var(--bz-weight-head);
  line-height: 1.3;
  color: var(--bz-ink);
  text-align: center;
  text-wrap: balance;
}
.af-say.why { background: var(--bz-group-tint); color: var(--bz-group-ink); }
.af-thing {
  flex: none;
  width: clamp(120px, 34vmin, 200px);
  padding: 10px 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border-radius: var(--bz-radius-l);
  background: #fff;
  box-shadow: 0 5px 0 var(--bz-brand-edge), var(--bz-shadow-s);
  touch-action: none;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
  z-index: 3;
}
.af-thing[hidden] { display: none; }
.af-thing-art { width: 100%; aspect-ratio: 1; }
.af-thing-art svg { width: 100%; height: 100%; display: block; }
.af-thing-name { font-weight: var(--bz-weight-head); font-size: var(--bz-text-s); color: var(--bz-ink-soft); text-align: center; line-height: 1.2; }
.af-thing.held { cursor: grabbing; box-shadow: 0 10px 0 var(--bz-brand-edge), var(--bz-shadow); }
.af-thing.back { transition: transform 0.25s ease; }
.af-thing.bounce { animation: af-bounce 0.45s ease 1; }
.af-thing.in { transition: transform 0.5s ease-in, opacity 0.5s ease-in; opacity: 0; }
@keyframes af-bounce { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-10px) rotate(-4deg); } 75% { transform: translateX(10px) rotate(4deg); } }

/* the bins, big (Mark's playtest, 1 Dec 2026: "mogen de prullenbakken iets groter"): every bin a
   picture of 76 px or more on phones, more on tablets; three in a row (two rows for five or six) */
.af-bins {
  flex: none;
  width: min(100%, 560px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.af-bin {
  min-height: 124px;
  padding: 8px 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-radius: var(--bz-radius-l);
  background: var(--bz-surface);
  box-shadow: var(--bz-edge-s) var(--bz-brand-edge);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
.af-bin-art { width: min(100%, 84px); aspect-ratio: 80 / 92; }
.af-bin-art svg { width: 100%; height: 100%; display: block; overflow: visible; }
.af-bin-name { font-size: var(--bz-text-s); font-weight: var(--bz-weight-head); color: var(--bz-ink); line-height: 1.15; text-align: center; }
.af-bin.over { background: var(--bz-group-tint); outline: 4px solid var(--bz-group-acc); outline-offset: -4px; }
.af-bin.tried { opacity: 0.45; }
.af-bin:disabled { cursor: default; }
.af-bin.help { background: var(--bz-group-tint); outline: 4px solid var(--bz-group-acc); outline-offset: -4px; animation: af-glow 1.4s ease-in-out infinite; }
@keyframes af-glow { 0%, 100% { outline-color: var(--bz-group-acc); } 50% { outline-color: var(--bz-group-tint); } }
.af-lid { transform-box: fill-box; transform-origin: 0% 100%; }
.af-bin.gulp .af-lid { animation: af-lid 0.6s ease 1; }
@keyframes af-lid { 0%, 100% { transform: rotate(0); } 40% { transform: rotate(-24deg); } }

/* narrow phones (360 and less): a little less room round the bins, the pictures as big */
@media (max-width: 370px) {
  #af-stage { padding: 4px 8px 12px; }
  .af-bins { gap: 8px; }
  .af-bin-art { width: min(100%, 80px); }
  .af-bin-name { font-size: var(--bz-text-xs); }
}
/* short upright phones: the thing a bit smaller so the big bins keep their room */
@media (orientation: portrait) and (max-height: 700px) {
  .af-thing { width: clamp(100px, 26vh, 160px); }
  .af-flower { width: 64px; height: 94px; }
  .af-bin { min-height: 112px; }
  .af-bin-art { width: min(100%, 72px); }
}
/* very short upright phones (320x568): everything a little smaller so nothing overlaps */
@media (orientation: portrait) and (max-height: 620px) {
  #af-stage { gap: 6px; }
  .af-top { gap: 4px; }
  .af-thing { width: clamp(88px, 17vh, 120px); padding: 6px 6px 4px; }
  .af-say { min-height: 3.2em; font-size: var(--bz-text-s); padding: 6px 10px; }
  .af-flower { width: 52px; height: 77px; }
  .af-bin { min-height: 96px; padding: 6px 4px; }
  .af-bin-art { width: min(100%, 62px); }
}
/* tablets and desktop: bigger still */
@media (min-width: 600px) and (min-height: 700px) {
  .af-bins { width: min(100%, 700px); gap: 14px; }
  .af-bin { min-height: 170px; }
  .af-bin-art { width: min(100%, 120px); }
  .af-bin-name { font-size: var(--bz-text-m); }
  .af-flower { width: 110px; height: 162px; }
}
/* short sideways phones: the thing and its line on the left, the bins on the right */
@media (orientation: landscape) and (max-height: 520px) {
  #screen-afval { flex-direction: row; }
  #af-stage { flex: 1; min-width: 0; flex-direction: row; align-items: stretch; padding: 10px 10px 10px 0; }
  .af-top { flex: 1 1 42%; }
  .af-thing { width: clamp(96px, 30vh, 150px); }
  .af-say { min-height: 2.6em; font-size: var(--bz-text-s); padding: 6px 10px; }
  .af-flower { width: 60px; height: 88px; }
  .af-bins { width: auto; flex: 1 1 58%; align-content: center; gap: 8px; }
  .af-bin { min-height: 0; padding: 6px 4px; }
  .af-bin-art { width: auto; height: min(100px, calc((100vh - 120px) / 2 - 30px)); height: min(100px, calc((100dvh - 120px) / 2 - 30px)); }
  /* the end card: the flower beside the stars, so its buttons stay in sight */
  .ov-art .af-ov-end { flex-direction: row; gap: 8px; }
  .ov-art .af-ov-flower { width: 50px; height: 74px; }
  .af-bin-name { font-size: var(--bz-text-xs); }
}
@media (prefers-reduced-motion: reduce) {
  .af-thing.bounce, .af-bin.gulp .af-lid, .af-bin.help, .af-flower.hop, .af-flower.tilt .af-flower-head, .af-flower.party .af-flower-head, .af-flower .af-sparkles { animation: none; }
  .af-thing.in { transition: none; }
  .af-thing.back { transition: none; }
}
