/* Opmaak van Het Piccolo Scorebord. Kleuren en beweging komen uit tokens.css.
   Op de iPhone mag niets opzij schuiven: html en body staan vast, alleen #scherm en .blad__vel scrollen. */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  position: fixed;
  inset: 0;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--espresso);
  color: var(--room);
  font-family: var(--letter-tekst);
  font-size: 1rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
svg.picto { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.visueel-verborgen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.kleur-1 { color: var(--rosso); }
.kleur-2 { color: var(--pistacchio); }

/* --- Sfeer: het licht van twee lampen boven de bar, met wat korrel --- */
.sfeer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='k'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .9 0 0 0 0 .8 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23k)'/%3E%3C/svg%3E"),
    radial-gradient(120% 60% at 50% 100%, #231812 0%, transparent 60%),
    var(--espresso);
}
.sfeer__lamp {
  position: absolute;
  top: -18rem;
  left: 50%;
  width: 34rem;
  height: 34rem;
  margin-left: -17rem;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 196, 120, 0.2), rgba(255, 160, 90, 0.06) 60%, transparent);
  animation: zoem 7s ease-in-out infinite alternate;
}
.sfeer__lamp--2 {
  top: auto;
  bottom: -22rem;
  left: 0;
  background: radial-gradient(closest-side, rgba(255, 91, 61, 0.1), transparent);
  animation-duration: 11s;
}
@keyframes zoem { to { opacity: 0.7; transform: scale(1.06); } }

/* --- Kop --- */
.kop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 0.6rem) var(--rand-scherm) 0.6rem;
  background: linear-gradient(var(--espresso) 65%, transparent);
}
.kop__merk {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--letter-bord);
  font-size: 1.05rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: var(--messing-verloop);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.kop__lampje {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--pistacchio);
  box-shadow: 0 0 0.6rem var(--pistacchio-gloed);
  transition: background 0.4s;
}
.kop__lampje.is-offline { background: var(--room-stil); box-shadow: none; }
body:not(.heeft-duel) .kop__instellingen,
body:not(.heeft-duel) .tabs { display: none; }

.rondknop {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--glas);
  border: 1px solid var(--rand);
  color: var(--room-zacht);
  transition: transform 0.3s var(--veer), background 0.2s;
}
.rondknop:active { transform: scale(0.9); background: var(--glas-sterk); }

/* --- Het scrollende scherm --- */
#scherm {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: calc(env(safe-area-inset-top) + 4rem) var(--rand-scherm) calc(env(safe-area-inset-bottom) + 7.5rem);
}
#scherm > * { max-width: 30rem; margin-left: auto; margin-right: auto; }
#scherm > * { animation: binnen 0.5s var(--glij) both; }
#scherm > *:nth-child(2) { animation-delay: 0.06s; }
#scherm > *:nth-child(3) { animation-delay: 0.12s; }
@keyframes binnen { from { opacity: 0; transform: translateY(0.8rem); } }

.schermtitel {
  margin: 0.4rem 0 1rem;
  font-family: var(--letter-bord);
  font-weight: 600;
  font-size: 2.2rem;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.schermuitleg { color: var(--room-zacht); margin: -0.4rem 0 1.2rem; }

/* --- Tabbalk --- */
.tabs {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 0.7rem);
  z-index: 5;
  transform: translateX(-50%);
  width: min(26rem, calc(100% - 2 * var(--rand-scherm)));
  display: grid;
  grid-template-columns: 1fr 1fr auto 1fr 1fr;
  align-items: center;
  padding: 0.4rem;
  border-radius: 1.6rem;
  background: rgba(36, 28, 23, 0.72);
  border: 1px solid var(--rand);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 1rem 2.4rem rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.tabs__knop {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  padding: 0.35rem 0;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--room-stil);
  text-decoration: none;
  transition: color 0.2s;
}
.tabs__knop.is-actief { color: var(--messing-licht); }
.tabs__knop.is-actief .picto { filter: drop-shadow(0 0 0.4rem rgba(240, 196, 109, 0.6)); }
.tabs__plus {
  display: grid;
  place-items: center;
  width: 3.7rem;
  height: 3.7rem;
  margin: -1.6rem 0.3rem 0;
  border-radius: 50%;
  background: var(--messing-verloop);
  color: #3b2508;
  box-shadow: 0 0.6rem 1.4rem rgba(224, 178, 90, 0.35), 0 0 0 0.3rem var(--espresso), inset 0 2px 0 rgba(255, 255, 255, 0.7), inset 0 -3px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.35s var(--veer);
}
.tabs__plus .picto { width: 1.7rem; height: 1.7rem; stroke-width: 2.6; }
.tabs__plus:active { transform: scale(0.88) rotate(90deg); }

/* --- Knoppen en velden --- */
.knop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.7rem 1.2rem;
  border-radius: 1rem;
  font-weight: 700;
  transition: transform 0.3s var(--veer), filter 0.2s;
}
.knop:active { transform: scale(0.96); }
.knop:disabled { filter: grayscale(1) brightness(0.7); }
.knop--groot { width: 100%; min-height: 3.6rem; font-size: 1.08rem; }
.knop--klein { min-height: 2.6rem; padding: 0.5rem 0.9rem; background: var(--glas-sterk); border: 1px solid var(--rand); }
.knop--messing { background: var(--messing-verloop); color: #3b2508; box-shadow: 0 0.5rem 1.2rem rgba(224, 178, 90, 0.22), inset 0 2px 0 rgba(255, 255, 255, 0.6), inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.knop--glas { width: 100%; background: var(--glas); border: 1px solid var(--rand); font-weight: 600; justify-content: flex-start; }
.knop--gevaar { width: 100%; background: rgba(255, 91, 61, 0.1); border: 1px solid rgba(255, 91, 61, 0.35); color: #ff8f7a; }
.knop--speler1 { background: linear-gradient(160deg, #ff8a6e, var(--rosso) 50%, #c23a20); color: #2a0a03; box-shadow: 0 0.6rem 1.4rem var(--rosso-gloed); }
.knop--speler2 { background: linear-gradient(160deg, #d4f59b, var(--pistacchio) 50%, #6fa42d); color: #172a04; box-shadow: 0 0.6rem 1.4rem var(--pistacchio-gloed); }
.tekstknop { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.7rem 0.2rem; color: var(--room-zacht); font-size: 0.92rem; text-decoration: underline; text-decoration-color: var(--rand-sterk); text-underline-offset: 0.25rem; }
.tekstknop .picto { width: 1.05rem; height: 1.05rem; }

.veld { display: grid; gap: 0.3rem; text-align: left; }
.veld > span { font-size: 0.82rem; font-weight: 600; color: var(--room-zacht); }
.veld input, .instelling input, .zoek input {
  width: 100%;
  min-height: 3.1rem;
  padding: 0.7rem 0.95rem;
  border-radius: 0.95rem;
  border: 1px solid var(--rand-sterk);
  background: rgba(0, 0, 0, 0.3);
  font-size: 1.05rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.veld input:focus, .instelling input:focus, .zoek input:focus { border-color: var(--messing); box-shadow: 0 0 0 3px rgba(224, 178, 90, 0.2); }
.veld input::placeholder, .zoek input::placeholder { color: var(--room-stil); }
.veld--klein input { min-height: 2.7rem; font-size: 0.95rem; color-scheme: dark; }

/* --- Welkom --- */
.welkom { text-align: center; padding-top: 0; }
.welkom__coppa { width: 6.4rem; height: 7.7rem; animation: zweef 4s ease-in-out infinite; filter: drop-shadow(0 1.2rem 2rem rgba(224, 178, 90, 0.25)); }
@keyframes zweef { 50% { transform: translateY(-0.6rem) rotate(-2deg); } }
.coppa__stoom path { animation: stoom 3s ease-in-out infinite; transform-origin: center bottom; }
.coppa__stoom path:nth-child(2) { animation-delay: 0.6s; }
.coppa__stoom path:nth-child(3) { animation-delay: 1.2s; }
@keyframes stoom { 0%, 100% { opacity: 0; transform: translateY(6px) scaleY(0.8); } 50% { opacity: 1; transform: translateY(-2px); } }
.welkom__boven { margin: 0.6rem 0 -0.4rem; font-family: var(--letter-bord); letter-spacing: 0.4em; text-transform: uppercase; color: var(--messing); }
.welkom__titel {
  margin: 0 0 0.8rem;
  font-family: var(--letter-bord);
  font-weight: 600;
  font-size: clamp(3rem, 15vw, 4.4rem);
  line-height: 0.92;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff6e4 0%, #f5ead9 45%, #c8a978 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0.3rem 0 #000);
}
.welkom__titel--klein { font-size: clamp(2.2rem, 11vw, 3rem); }
.welkom__titel span { font-size: 0.45em; letter-spacing: 0.3em; color: var(--messing); -webkit-text-fill-color: var(--messing); }
.welkom__tekst { color: var(--room-zacht); max-width: 22rem; margin: 0 auto 1.4rem; }
.welkom__formulier { display: grid; gap: 0.85rem; margin-bottom: 0.6rem; text-align: left; }
.welkom .tekstknop { display: flex; justify-content: center; margin: 0 auto; }
.wie { display: grid; gap: 0.8rem; }

/* --- Blad van onderen --- */
.blad { position: fixed; inset: 0; z-index: 10; }
.blad__achter { position: absolute; inset: 0; background: rgba(5, 3, 2, 0.6); opacity: 0; transition: opacity 0.3s; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.blad__vel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 92%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.6rem var(--rand-scherm) calc(env(safe-area-inset-bottom) + 1.2rem);
  border-radius: 1.8rem 1.8rem 0 0;
  background: linear-gradient(180deg, #2a201a, #1a1410 30%);
  border-top: 1px solid var(--rand-sterk);
  box-shadow: 0 -1rem 3rem rgba(0, 0, 0, 0.6);
  transform: translateY(105%);
  transition: transform 0.42s var(--glij);
}
.blad.is-open .blad__achter { opacity: 1; }
.blad.is-open .blad__vel { transform: none; }
.blad__vel > * { max-width: 30rem; margin-left: auto; margin-right: auto; }
.blad__greep { display: block; width: 2.6rem; height: 0.3rem; margin: 0 auto 0.8rem; border-radius: 1rem; background: var(--rand-sterk); }
.blad__titel { margin: 0 0 1rem; font-size: 1.35rem; font-weight: 750; letter-spacing: -0.01em; }

/* --- Melding en confetti --- */
.melding {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 6.2rem);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: max-content;
  max-width: calc(100% - 2 * var(--rand-scherm));
  padding: 0.75rem 1.1rem;
  border-radius: 1.2rem;
  background: rgba(245, 234, 217, 0.96);
  color: #1c1511;
  font-weight: 650;
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.5);
  transform: translate(-50%, 1rem) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s var(--veer), opacity 0.25s;
}
.melding.is-zichtbaar { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.melding button { padding: 0.35rem 0.7rem; border-radius: 0.7rem; background: #1c1511; color: var(--room); font-weight: 700; font-size: 0.85rem; white-space: nowrap; }

.confetti { position: fixed; inset: 0; z-index: 15; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -1rem; width: 0.5rem; height: 0.8rem; border-radius: 0.1rem; animation: val linear forwards; }
@keyframes val { to { transform: translate(var(--zij), 105vh) rotate(var(--draai)); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
