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

.wz-root{
  /* Centrale toolkit-tokens uit schoolvoetbal-core; hex-fallback als core niet actief is. */
  --brand-dark: var(--sv-color-primary, #003D7C);
  --brand-light: var(--sv-color-primary-light, #DEF1FB);
  --brand-green: var(--sv-color-accent, #6CBE57);
  --brand-green-dark: var(--sv-color-accent-dark, #5BA249);
  --brand-white: #ffffff;
  --brand-text: var(--sv-color-text, #333333);
  --brand-bg: transparent;
  --shadow-sm: var(--sv-shadow-sm, 0 1px 3px rgba(0, 61, 124, 0.08));
  --shadow-md: var(--sv-shadow-md, 0 2px 8px rgba(0, 61, 124, 0.06));
}

.wz-root .woordzoeker-wrapper{
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  color: var(--brand-text);
  position: relative;
  overflow: hidden;
  padding: 20px;
  font-family: inherit;
  background-color: var(--brand-bg);
}

.wz-root h2{
  color: var(--brand-dark);
  margin-bottom: 5px;
  font-size: 1.8rem;
  line-height: 1.2;
}

.wz-root p{
  color: var(--brand-text);
  margin-bottom: 20px;
  font-size: 1rem;
  line-height: 1.4;
}

.wz-root .wz-hud{
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  background: var(--brand-white);
  border: 1px solid #e6ebef;
  border-radius: 12px;
  padding: 10px 14px;
  margin: 0 auto 16px auto;
  width: 100%;
  box-shadow: var(--shadow-md);
  text-align: left;
}

.wz-root .wz-hud-stat{
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.wz-root .wz-hud-label{
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7a8794;
  font-weight: 600;
}

.wz-root .wz-hud-value{
  font-size: 1.3em;
  font-weight: 700;
  color: var(--brand-dark);
  font-variant-numeric: tabular-nums;
}

.wz-root .wz-hint-btn{
  grid-column: 4;
  grid-row: 1 / span 1;
  background: var(--brand-dark);
  color: var(--brand-white);
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s, opacity 0.2s;
}

.wz-root .wz-hint-btn:hover:not(:disabled){
  background: #002952;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,61,124,0.25);
}

.wz-root .wz-hint-btn:disabled{
  opacity: 0.4;
  cursor: not-allowed;
}

.wz-root .grid-cell.wz-hint{
  background-color: #FFD700 !important;
  color: var(--brand-dark) !important;
  border-color: #d4a017 !important;
  box-shadow: 0 0 0 3px rgba(255,215,0,0.45), 0 0 12px rgba(255,215,0,0.7);
  animation: wz_hint_pulse 1.2s ease-in-out 3;
  z-index: 3;
  position: relative;
}

@keyframes wz_hint_pulse{
  0%, 100%{ transform: scale(1); }
  50%{ transform: scale(1.18); }
}

.wz-root .wz-progress-bar{
  grid-column: 1 / -1;
  height: 6px;
  background: #eef3f7;
  border-radius: 999px;
  overflow: hidden;
}

.wz-root .wz-progress-fill{
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand-green), #8DD978);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.wz-root .wz-penalty-flash{
  animation: wz_penalty 0.6s ease;
}

@keyframes wz_penalty{
  0%, 100%{ color: var(--brand-dark); transform: scale(1); }
  50%{ color: var(--sv-color-error, #c0392b); transform: scale(1.2); }
}

.wz-root .wz-start-overlay{
  display: none;
  justify-content: center;
  padding: 10px 0 14px;
}

.wz-root .wz-start-overlay.wz-active{ display: flex; }

.wz-root .wz-start-btn{
  background: var(--brand-green);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

.wz-root .wz-start-btn:hover{
  background: var(--brand-green-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(108, 190, 87, 0.3);
}

/* Focus ring: only visible during keyboard navigation, not on mouse click */
.wz-root .wz-hint-btn:focus-visible,
.wz-root .wz-start-btn:focus-visible{
  outline: 2px solid var(--brand-green);
  outline-offset: 2px;
}

.wz-root.wz-not-started .grid-container{
  pointer-events: none;
  opacity: 0.5;
  filter: blur(1px);
}

.wz-root .grid-container{
  display: grid;
  grid-template-columns: repeat(var(--wz-cols, 11), 1fr);
  gap: 4px;
  margin: 0 auto 20px auto;
  width: 500px;
  max-width: 100%;
  user-select: none;
  background: var(--brand-bg);
  touch-action: none;
}

.wz-root .grid-cell{
  aspect-ratio: 1;
  background: var(--brand-white);
  border: 1px solid #dae1e7;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.3rem;
  cursor: pointer;
  text-transform: uppercase;
  color: var(--brand-dark);
  transition: background-color 0.1s, transform 0.1s, border-radius 0.3s, outline 0.3s;
  box-shadow: var(--shadow-sm);
}

.wz-root .grid-cell.selected{
  background-color: var(--brand-light) !important;
  color: var(--brand-dark) !important;
  border-color: var(--brand-dark);
  transform: scale(0.95);
}

.wz-root .grid-cell.found{
  background-color: var(--brand-green);
  color: var(--brand-white);
  border-color: var(--brand-green);
  animation: wz_pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wz-root .grid-cell.reveal-anim{
  border-radius: 50%;
  border: 1px solid var(--brand-light) !important;
  outline: 2px solid var(--brand-dark);
  outline-offset: -2px;
  color: var(--brand-dark) !important;
  background-color: var(--brand-light) !important;
  z-index: 2;
  box-shadow: 0 0 5px rgba(0,61,124, 0.3);
}

.wz-root .word-list{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  padding: 0 5px;
  width: 100%;
}

.wz-root .word-item{
  background: var(--brand-white);
  color: var(--brand-text);
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s;
}

.wz-root .word-item.found{
  text-decoration: line-through;
  color: #aaa;
  background: transparent;
  border-color: transparent;
  opacity: 0.6;
}

.wz-root .final-solution{
  width: 100%;
  max-width: 100%;
  margin-top: 20px;
  padding: 20px;
  background-color: var(--brand-light);
  color: var(--brand-dark);
  border-radius: 12px;
  font-weight: bold;
  font-size: 1.2rem;
  display: none;
  border: 2px solid var(--brand-dark);
  box-shadow: 0 4px 12px rgba(0,61,124, 0.15);
  z-index: 10;
  position: relative;
  min-height: 80px;
}

.wz-root .solution-text{
  display: block;
  margin-top: 15px;
  font-size: 1.6rem;
  letter-spacing: 1px;
  color: var(--brand-dark);
  min-height: 2rem;
  line-height: 1.4;
}

.wz-root .solution-text span{
  display: inline-block;
  animation: wz_fadeIn 0.5s forwards;
  white-space: nowrap;
}

.wz-root .solution-text .word-chunk{
  display: inline-block;
  white-space: nowrap;
}

.wz-root .confetti{
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: var(--brand-green);
  animation: wz_fall linear forwards;
  top: -10px;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
}

@keyframes wz_pop{
  0%{ transform: scale(1); }
  50%{ transform: scale(1.2); }
  100%{ transform: scale(1); }
}

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

@keyframes wz_fall{
  to{ transform: translateY(800px) rotate(720deg); opacity: 1; }
}

@media (max-width: 600px){
  .wz-root .woordzoeker-wrapper{ padding: 10px 5px; }
  .wz-root h2{ font-size: 1.4rem; }
  .wz-root p{ font-size: 0.9rem; margin-bottom: 10px; }
  .wz-root .grid-container{ width: 100% !important; gap: 1px; margin-bottom: 15px; }
  .wz-root .grid-cell{ font-size: 1.1rem; border-radius: 2px; border: 0.5px solid #dae1e7; font-weight: 500; }
  .wz-root .grid-cell.reveal-anim{ outline: 1px solid var(--brand-dark); }
  .wz-root .word-list{ gap: 4px; }
  .wz-root .word-item{ font-size: 0.75rem; padding: 4px 8px; }
  .wz-root .final-solution{ padding: 15px; font-size: 1rem; }
  .wz-root .solution-text{ font-size: 1.3rem; }
  .wz-root .wz-hud{ padding: 8px 10px; gap: 8px; grid-template-columns: repeat(3, 1fr); }
  .wz-root .wz-hud-value{ font-size: 1.05em; }
  .wz-root .wz-hud-label{ font-size: 0.65em; }
  .wz-root .wz-hint-btn{ grid-column: 1 / -1; grid-row: auto; justify-content: center; padding: 8px 14px; }
}

