/* Lettertypen staan op de eigen site (geen verbinding met Google nodig). Beide vallen onder de SIL Open Font License; zie fonts/. */
@font-face { font-family: 'Bungee'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/bungee-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/nunito-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/nunito-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 900; font-display: swap; src: url('fonts/nunito-latin-900-normal.woff2') format('woff2'); }

/* FunBrix — de games zijn blokjes; het blokje dat je kiest wordt 2 x 2 en de rest schuift op. */
:root {
  --plum: #6F2BB0;
  --peach: #C9787A;
  --gold: #E7B53A;
  --ink: #1B1440;
  --lime: #B8F36B;
  --aqua: #4FE3E0;
  --display: 'Bungee', 'Arial Black', Impact, sans-serif;
  --body: 'Nunito', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html { min-height: 100%; background: linear-gradient(180deg, #6F2BB0 0%, #9A4E9C 28%, #C9787A 58%, #DDA04E 84%, #E7B53A 100%); }
body {
  margin: 0;
  min-height: 100vh;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
  font-family: var(--body);
  color: #fff;
}
a { color: inherit; }
button, input { font: inherit; }
:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }

/* ---------- logo ---------- */
.top { text-align: center; padding: 28px 16px 4px; }
.logo {
  display: inline-flex;
  align-items: flex-end;
  gap: 0.05em;
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(46px, 12.5vw, 138px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: #fff;
}
.logo-word {
  text-shadow:
    0.035em 0.035em 0 #FF7AA8,
    0.07em 0.07em 0 #F2557F,
    0.105em 0.105em 0 #D63A66,
    0.14em 0.14em 0 rgba(110, 18, 64, 0.35);
}
.logo-tld {
  font-family: var(--body);
  font-weight: 900;
  font-size: 0.34em;
  line-height: 1;
  margin: 0 0 0.12em 0.2em;
  color: var(--aqua);
}
.hint { margin: 14px 0 0; font-weight: 800; font-size: 16px; color: rgba(255, 255, 255, 0.88); }

/* ---------- het bord met blokjes ---------- */
.board-wrap { width: min(980px, calc(100% - 28px)); margin: 22px auto 36px; }
.board { position: relative; --cell: 220px; }
.brick {
  --b: #fff;
  --r: 26px;
  position: absolute;
  overflow: hidden;
  border: 6px solid var(--b);
  border-radius: var(--r);
  background: #A9A4B8;
  box-shadow: 0 7px 0 color-mix(in srgb, var(--b) 50%, #2A0D45);
  transition: left 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), border-radius 0.55s;
}
.brick.big { --r: 34px; z-index: 2; }
.board.still .brick { transition: none; }

/* klikvlak over een klein blokje */
.brick-hit {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: calc(var(--r) - 6px);
}
.brick-hit:focus-visible { outline-offset: -8px; }
.brick.big .brick-hit { display: none; }
@media (hover: hover) {
  .brick:not(.big):hover { filter: brightness(1.06); }
}

/* plaatje en titel */
.brick-media { position: absolute; inset: 0; }
.brick-media img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); display: block; }
.brick-media .full { display: none; }
/* groot: het hele plaatje scherp in beeld, met een vage kopie erachter */
.brick.big .brick-media .cover { filter: blur(14px) brightness(0.7) saturate(1.2); transform: scale(1.15); }
.brick.big .brick-media .full {
  display: block;
  position: absolute;
  z-index: 1;
  left: 5%;
  top: 19%;
  width: 90%;
  height: 44%;
  object-fit: contain;
  object-position: 50% 50%;
  filter: drop-shadow(0 8px 14px rgba(27, 20, 64, 0.5));
}
.brick-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(27, 20, 64, 0.5) 0%, rgba(27, 20, 64, 0) 48%);
}
.brick-title {
  position: absolute;
  z-index: 2;
  top: 7%;
  left: 5%;
  right: 5%;
  margin: 0;
  text-align: center;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(13px, calc(var(--cell) * 0.12), 30px);
  line-height: 1.02;
  color: var(--fill, #fff);
  text-shadow:
    0.06em 0 0 var(--shade), -0.06em 0 0 var(--shade), 0 0.06em 0 var(--shade), 0 -0.06em 0 var(--shade),
    0.045em 0.045em 0 var(--shade), -0.045em 0.045em 0 var(--shade), 0.045em -0.045em 0 var(--shade), -0.045em -0.045em 0 var(--shade),
    0.07em 0.11em 0 rgba(27, 20, 64, 0.35);
  pointer-events: none;
}
.brick.big .brick-title { font-size: clamp(22px, calc(var(--cell) * 0.19), 46px); top: 5%; }

/* uitleg bij een groot blokje */
.brick-info { display: none; }
.brick.big .brick-info {
  display: block;
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 56px 22px 22px;
  background: linear-gradient(0deg, rgba(27, 20, 64, 0.94) 0%, rgba(27, 20, 64, 0.8) 55%, rgba(27, 20, 64, 0) 100%);
}
.brick-info p { margin: 0 0 14px; max-width: 44ch; font-size: 17px; line-height: 1.45; font-weight: 700; }
.brick-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  font-size: 14px;
  font-weight: 800;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 3px solid #fff;
  background: var(--b);
  color: var(--ink);
  font-weight: 900;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(27, 20, 64, 0.45);
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(27, 20, 64, 0.45); }

/* een spel dat nu al live is: het spel zelf staat in het grote blokje */
.brick-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #1B1440; visibility: hidden; }
.brick.big .brick-frame { visibility: visible; }
.brick.live.big .brick-media, .brick.live.big .brick-title, .brick.live.big .brick-info { display: none; }
.brick-tools { display: none; }
.brick.live.big .brick-tools { display: flex; position: absolute; z-index: 4; right: 10px; bottom: 10px; gap: 8px; }
.tool {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--b);
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(27, 20, 64, 0.45);
}
.brick:fullscreen { border-radius: 0; border-width: 0; }

/* ---------- BrixChat ---------- */
.brick.chat { background: linear-gradient(180deg, #2B2070, #1B1440); display: flex; flex-direction: column; }
.chat-title { position: static; margin: 14px 10px 6px; }
.chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 6px 14px;
  font-size: 14px;
  line-height: 1.3;
  text-align: right;
  scrollbar-width: thin;
}
.chat-log .msg b { display: block; font-weight: 900; font-size: 13px; }
.chat-log .msg span { color: #EEF0FF; overflow-wrap: anywhere; }
.chat-form {
  display: flex;
  margin: 8px 10px 6px;
  border: 4px solid var(--lime);
  border-radius: 999px;
  background: #0E0A26;
  overflow: hidden;
}
.chat-form input { flex: 1; min-width: 0; padding: 9px 14px; border: 0; background: transparent; color: #fff; font-weight: 700; }
.chat-form input::placeholder { color: rgba(255, 255, 255, 0.75); }
.chat-form input:focus { outline: none; }
.chat-form:focus-within { box-shadow: 0 0 0 3px #fff; }
.chat-form button { border: 0; padding: 0 14px; background: var(--lime); color: var(--ink); font-weight: 900; cursor: pointer; }
.chat-note { margin: 0 12px 10px; font-size: 12px; text-align: center; color: rgba(255, 255, 255, 0.7); }
.brick.chat .brick-hit { display: none; }

/* ---------- getekende voorbeelden voor spellen zonder plaatje ---------- */
.art { position: absolute; inset: 0; }
.art.bubbles { background: linear-gradient(180deg, #CFD3FF, #9EA6F0); }
.art.bubbles .row { position: absolute; left: 4%; right: 4%; display: flex; justify-content: center; gap: 2%; }
.art.bubbles .row:nth-child(1) { top: 3%; }
.art.bubbles .row:nth-child(2) { top: 17%; padding-left: 6%; }
.art.bubbles .row:nth-child(3) { top: 31%; }
.bub { width: 12%; aspect-ratio: 1; border-radius: 50%; box-shadow: inset -0.12em -0.14em 0 rgba(0, 0, 0, 0.18); background: radial-gradient(circle at 35% 30%, #fff 0 12%, var(--c) 40%, color-mix(in srgb, var(--c) 70%, #000)); }
.art.bubbles .shooter { position: absolute; left: 50%; bottom: 8%; width: 15%; transform: translateX(-50%); }
.art.bubbles .aim { position: absolute; left: 50%; bottom: 20%; width: 3px; height: 34%; background: repeating-linear-gradient(180deg, #5B4BC4 0 6px, transparent 6px 11px); transform-origin: 50% 100%; transform: rotate(-16deg); }
.art.gems { background: linear-gradient(180deg, #2C2177, #1D1552); display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: 3%; padding: 6%; }
.gem { position: relative; filter: drop-shadow(0 0.08em 0.05em rgba(0, 0, 0, 0.5)); }
.gem::after { content: ""; position: absolute; }
.gem.red { clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); background: conic-gradient(from 22.5deg, #FF4D6D 0 12.5%, #C9184A 0 25%, #FF758F 0 37.5%, #A4133C 0 50%, #E5294F 0 62.5%, #800F2F 0 75%, #FF4D6D 0 87.5%, #FF8FA3 0); }
.gem.red::after { inset: 26%; clip-path: inherit; background: linear-gradient(160deg, #FFB3C1, #F0305A 70%); }
.gem.green { margin: 0 10%; clip-path: polygon(50% 0, 100% 22%, 100% 78%, 50% 100%, 0 78%, 0 22%); background: conic-gradient(#8CE99A 0 16.6%, #40C057 0 33.3%, #2B8A3E 0 50%, #37B24D 0 66.6%, #69DB7C 0 83.3%, #B2F2BB 0); }
.gem.green::after { inset: 24% 26%; clip-path: inherit; background: linear-gradient(160deg, #D3F9D8, #51CF66 70%); }
.gem.blue { clip-path: inset(4% round 12%); background: conic-gradient(from 45deg, #748FFC 0 25%, #3B5BDB 0 50%, #1C3BA8 0 75%, #5C7CFA 0); }
.gem.blue::after { inset: 22%; border-radius: 8%; background: linear-gradient(160deg, #BAC8FF, #4C6EF5 75%); }
.gem.orange { clip-path: polygon(50% 2%, 99% 94%, 1% 94%); background: conic-gradient(from 0deg at 50% 62%, #FFC078 0 33.3%, #F76707 0 66.6%, #FD7E14 0); }
.gem.orange::after { left: 34%; right: 34%; top: 44%; bottom: 20%; clip-path: polygon(50% 0, 100% 100%, 0 100%); background: linear-gradient(170deg, #FFE8CC, #FF922B 80%); }
.gem.purple { margin: 0 8%; clip-path: polygon(50% 0, 94% 30%, 80% 100%, 20% 100%, 6% 30%); background: conic-gradient(from 0deg at 50% 45%, #D0BFFF 0 20%, #845EF7 0 40%, #6741D9 0 60%, #7950F2 0 80%, #B197FC 0); }
.gem.purple::after { inset: 26% 30% 30%; clip-path: polygon(50% 0, 100% 35%, 80% 100%, 20% 100%, 0 35%); background: linear-gradient(160deg, #E5DBFF, #9775FA 75%); }

/* ---------- voet ---------- */
.foot { text-align: center; padding: 0 16px 28px; font-weight: 800; color: rgba(27, 20, 64, 0.75); }
.foot p { margin: 0; }

@media (max-width: 560px) {
  .brick { --r: 20px; border-width: 5px; box-shadow: 0 5px 0 color-mix(in srgb, var(--b) 50%, #2A0D45); }
  .brick.big { --r: 26px; }
  .brick-info p { font-size: 15px; }
  .brick.big .brick-info { padding: 40px 16px 16px; }
  .brick.big .brick-media .full { top: 17%; height: 32%; }
  .hint { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .brick { transition: none; }
}
