.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.hub-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.hub-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 28px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  color: #f9fbff;
  text-decoration: none;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.32);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.hub-button:hover,
.hub-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.42);
  filter: brightness(1.04);
}

.hub-button-learn {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 243, 182, 0.34), transparent 20%),
    linear-gradient(180deg, #2f4866 0%, #1d304a 100%);
}

.hub-button-play {
  background:
    radial-gradient(circle at 82% 22%, rgba(255, 208, 117, 0.32), transparent 20%),
    linear-gradient(180deg, #513d74 0%, #2b2648 100%);
}

.category-stack {
  display: grid;
  gap: 26px;
}

.menu-category {
  display: grid;
  gap: 16px;
}

.category-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.category-heading h2 {
  margin: 0;
  font-size: clamp(1.3rem, 2.3vw, 1.85rem);
  color: #fff2c4;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
}

.category-heading::after {
  content: "";
  flex: 1;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 214, 117, 0.7), rgba(255, 214, 117, 0.04));
}

.category-top-bar {
  margin-bottom: 18px;
}

.category-top-bar-centered {
  justify-content: center;
}

.category-top-bar-centered .back-btn {
  min-width: 200px;
  margin: 0 auto;
}

.game-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  aspect-ratio: 4 / 3;
  min-height: 0;
  border-radius: var(--radius-lg);
  text-align: left;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  isolation: isolate;
}

.game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 1;
  z-index: -2;
}

.game-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: transparent;
}

.snake-card {
  background: linear-gradient(180deg, #c7f68f 0%, #8fe178 100%);
}

.snake-card::before {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 500'%3E%3Cdefs%3E%3ClinearGradient id='bg' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0%25' stop-color='%2397e2ff'/%3E%3Cstop offset='100%25' stop-color='%2379d86c'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='800' height='500' fill='url(%23bg)'/%3E%3Ccircle cx='676' cy='92' r='54' fill='%23ffe16b'/%3E%3Cpath d='M0 372 C109 319 194 348 277 324 C366 298 438 336 530 308 C619 279 697 315 800 274 L800 500 L0 500 Z' fill='%235bbd59'/%3E%3Cpath d='M0 407 C114 363 187 380 276 352 C360 325 471 367 567 338 C665 309 727 330 800 307 L800 500 L0 500 Z' fill='%2347a947'/%3E%3Crect x='552' y='186' width='34' height='34' rx='10' fill='%23ff5f7e'/%3E%3Cpath d='M568 188 C570 177 580 172 587 178' fill='none' stroke='%2328893c' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M188 278 C230 230 303 227 352 259 C401 292 412 362 368 402 C325 441 244 437 198 401 C151 363 147 314 188 278 Z' fill='none' stroke='%2320a44c' stroke-width='32' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='335' cy='286' r='7' fill='%23133a61'/%3E%3Ccircle cx='359' cy='286' r='7' fill='%23133a61'/%3E%3C/svg%3E");
}

.puzzle-card {
  background: linear-gradient(180deg, #ffe77d 0%, #ffb65f 100%);
}

.puzzle-card::before {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 500'%3E%3Cdefs%3E%3ClinearGradient id='bg' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0%25' stop-color='%23fff1a8'/%3E%3Cstop offset='100%25' stop-color='%23ffb05f'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='800' height='500' fill='url(%23bg)'/%3E%3Ccircle cx='128' cy='84' r='34' fill='%23ffffff' fill-opacity='0.55'/%3E%3Ccircle cx='705' cy='99' r='24' fill='%23ffffff' fill-opacity='0.45'/%3E%3Cg transform='translate(415 84)'%3E%3Crect x='0' y='0' width='102' height='102' rx='20' fill='%238ed9ff'/%3E%3Crect x='115' y='0' width='102' height='102' rx='20' fill='%2373d564'/%3E%3Crect x='230' y='0' width='102' height='102' rx='20' fill='%23ff9c42'/%3E%3Crect x='0' y='115' width='102' height='102' rx='20' fill='%23ffb4d0'/%3E%3Crect x='115' y='115' width='102' height='102' rx='20' fill='%23a5b8ff'/%3E%3Crect x='230' y='115' width='102' height='102' rx='20' fill='%239af0d2'/%3E%3Crect x='0' y='230' width='102' height='102' rx='20' fill='%23ffd84d'/%3E%3Crect x='115' y='230' width='102' height='102' rx='20' fill='%23ffa9a0'/%3E%3Crect x='230' y='230' width='102' height='102' rx='20' fill='%23fff7df' stroke='%23f0c56a' stroke-dasharray='12 10' stroke-width='6'/%3E%3Cg fill='%23133a61' font-family='Trebuchet MS, Arial, sans-serif' font-size='42' font-weight='700' text-anchor='middle'%3E%3Ctext x='51' y='63'%3E1%3C/text%3E%3Ctext x='166' y='63'%3E2%3C/text%3E%3Ctext x='281' y='63'%3E3%3C/text%3E%3Ctext x='51' y='178'%3E4%3C/text%3E%3Ctext x='166' y='178'%3E5%3C/text%3E%3Ctext x='281' y='178'%3E6%3C/text%3E%3Ctext x='51' y='293'%3E7%3C/text%3E%3Ctext x='166' y='293'%3E8%3C/text%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.truck-card {
  background: linear-gradient(180deg, #ffc86b 0%, #ff8f4d 100%);
}

.truck-card::before {
  background-image: url("../Images/monstertruck-puzzle.png");
}

.bubble-card {
  background: linear-gradient(180deg, #9cc7ff 0%, #6f88ff 100%);
}

.bubble-card::before {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 500'%3E%3Cdefs%3E%3ClinearGradient id='bg' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0%25' stop-color='%23a5d2ff'/%3E%3Cstop offset='100%25' stop-color='%237a82ff'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='800' height='500' fill='url(%23bg)'/%3E%3Cg opacity='0.95'%3E%3Ccircle cx='174' cy='108' r='42' fill='%23ffd45d'/%3E%3Ccircle cx='250' cy='168' r='42' fill='%23ff7b7b'/%3E%3Ccircle cx='336' cy='108' r='42' fill='%236ee7b7'/%3E%3Ccircle cx='412' cy='168' r='42' fill='%238ed9ff'/%3E%3Ccircle cx='498' cy='108' r='42' fill='%23c3a6ff'/%3E%3C/g%3E%3Cpath d='M400 392 L400 280' stroke='%23ffffff' stroke-width='16' stroke-linecap='round'/%3E%3Cpath d='M400 286 L372 330 M400 286 L428 330' stroke='%23ffffff' stroke-width='16' stroke-linecap='round'/%3E%3Ccircle cx='400' cy='402' r='28' fill='%23ff8c42'/%3E%3C/svg%3E");
}

.gravity-card {
  background: linear-gradient(180deg, #9ed4ff 0%, #5d7dff 100%);
}

.gravity-card::before {
  background-image: url("../Images/zwaartekracht.png");
}

.maze-card {
  background: linear-gradient(180deg, #73d564 0%, #4fc7ff 100%);
}

.maze-card::before {
  background-image: url("../Images/Doolhof.png");
}

.maze-hard-card {
  background: linear-gradient(180deg, #4fc7ff 0%, #1f5f9f 100%);
}

.maze-hard-card::before {
  background-image: url("../Images/Doolhof.png");
  filter: saturate(0.95) brightness(0.72);
}

.count-card {
  background: linear-gradient(180deg, #9ee6ff 0%, #7adf9d 100%);
}

.count-card::before {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 500'%3E%3Cdefs%3E%3ClinearGradient id='bg' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0%25' stop-color='%23aeeeff'/%3E%3Cstop offset='100%25' stop-color='%23b7f2a1'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='800' height='500' fill='url(%23bg)'/%3E%3Cg font-family='Trebuchet MS, Arial, sans-serif' font-weight='700' text-anchor='middle'%3E%3Ccircle cx='180' cy='190' r='48' fill='%23ffd45d'/%3E%3Ccircle cx='310' cy='150' r='48' fill='%23ff8eb1'/%3E%3Ccircle cx='440' cy='220' r='48' fill='%238ed9ff'/%3E%3Ccircle cx='570' cy='170' r='48' fill='%2373d564'/%3E%3Ccircle cx='700' cy='240' r='48' fill='%23ffb36b'/%3E%3Cg fill='%23172b43' font-size='54'%3E%3Ctext x='180' y='208'%3E1%3C/text%3E%3Ctext x='310' y='168'%3E2%3C/text%3E%3Ctext x='440' y='238'%3E3%3C/text%3E%3Ctext x='570' y='188'%3E4%3C/text%3E%3Ctext x='700' y='258'%3E5%3C/text%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.trace-card {
    background: linear-gradient(180deg, #ffb4d0 0%, #ffd86a 100%);
}

.trace-card::before {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 500'%3E%3Cdefs%3E%3ClinearGradient id='bg' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0%25' stop-color='%23ffc2d7'/%3E%3Cstop offset='100%25' stop-color='%23ffe887'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='800' height='500' fill='url(%23bg)'/%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='18' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M228 120 L292 90 L292 374'/%3E%3Cpath d='M430 150 C430 108 468 88 508 88 C548 88 582 112 582 148 C582 186 556 210 516 240 C470 274 442 306 436 352 L592 352'/%3E%3C/g%3E%3Cpath d='M225 121 L292 91 L292 375' stroke='%238950ff' stroke-width='7' stroke-linecap='round' stroke-dasharray='14 12' fill='none'/%3E%3Cpath d='M430 150 C430 108 468 88 508 88 C548 88 582 112 582 148 C582 186 556 210 516 240 C470 274 442 306 436 352 L592 352' stroke='%2300b7ff' stroke-width='7' stroke-linecap='round' stroke-dasharray='14 12' fill='none'/%3E%3Ccircle cx='225' cy='121' r='18' fill='%2373d564'/%3E%3Ccircle cx='592' cy='352' r='18' fill='%23ff8c42'/%3E%3C/svg%3E");
}

.letter-trace-card {
    background: linear-gradient(180deg, #9fdcff 0%, #ffd78f 100%);
}

.letter-trace-card::before {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 500'%3E%3Cdefs%3E%3ClinearGradient id='bg' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0%25' stop-color='%23b8ecff'/%3E%3Cstop offset='100%25' stop-color='%23ffe4a8'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='800' height='500' fill='url(%23bg)'/%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='18' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M215 360 L305 110 L395 360'/%3E%3Cpath d='M250 268 L360 268'/%3E%3Cpath d='M475 110 L475 360'/%3E%3Cpath d='M475 110 C610 110 610 235 475 235'/%3E%3Cpath d='M475 235 C625 235 620 360 475 360'/%3E%3C/g%3E%3Cpath d='M215 360 L305 110 L395 360' stroke='%232f7de1' stroke-width='7' stroke-linecap='round' stroke-dasharray='14 12' fill='none'/%3E%3Cpath d='M250 268 L360 268' stroke='%232f7de1' stroke-width='7' stroke-linecap='round' stroke-dasharray='14 12' fill='none'/%3E%3Cpath d='M475 110 L475 360' stroke='%23ff7d7d' stroke-width='7' stroke-linecap='round' stroke-dasharray='14 12' fill='none'/%3E%3Cpath d='M475 110 C610 110 610 235 475 235' stroke='%23ff7d7d' stroke-width='7' stroke-linecap='round' stroke-dasharray='14 12' fill='none'/%3E%3Cpath d='M475 235 C625 235 620 360 475 360' stroke='%23ff7d7d' stroke-width='7' stroke-linecap='round' stroke-dasharray='14 12' fill='none'/%3E%3Ccircle cx='215' cy='360' r='18' fill='%2373d564'/%3E%3Ccircle cx='620' cy='360' r='18' fill='%23ff9c42'/%3E%3C/svg%3E");
}

.differences-card {
  background: linear-gradient(180deg, #8fc9ff 0%, #f7b66d 100%);
}

.differences-card::before {
  background-image: url("../Images/ollie-image-1.png");
}

.connect-card {
  background: linear-gradient(180deg, #94d8ff 0%, #86f0bf 100%);
}

.connect-card::before {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 500'%3E%3Cdefs%3E%3ClinearGradient id='bg' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0%25' stop-color='%23bdeeff'/%3E%3Cstop offset='100%25' stop-color='%2397f3b0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='800' height='500' fill='url(%23bg)'/%3E%3Crect x='78' y='74' width='282' height='352' rx='34' fill='rgba(255,255,255,0.42)'/%3E%3Crect x='438' y='74' width='282' height='352' rx='34' fill='rgba(255,255,255,0.35)'/%3E%3Cg stroke='%232f7de1' stroke-width='14' stroke-linecap='round'%3E%3Cline x1='218' y1='132' x2='146' y2='248'/%3E%3Cline x1='218' y1='132' x2='290' y2='248'/%3E%3Cline x1='146' y1='248' x2='218' y2='248'/%3E%3Cline x1='218' y1='248' x2='290' y2='248'/%3E%3Cline x1='218' y1='248' x2='146' y2='362'/%3E%3Cline x1='218' y1='248' x2='290' y2='362'/%3E%3Cline x1='146' y1='362' x2='218' y2='362'/%3E%3Cline x1='218' y1='362' x2='290' y2='362'/%3E%3C/g%3E%3Cg fill='%232f7de1'%3E%3Ccircle cx='146' cy='132' r='18'/%3E%3Ccircle cx='218' cy='132' r='18'/%3E%3Ccircle cx='290' cy='132' r='18'/%3E%3Ccircle cx='146' cy='248' r='18'/%3E%3Ccircle cx='218' cy='248' r='18'/%3E%3Ccircle cx='290' cy='248' r='18'/%3E%3Ccircle cx='146' cy='362' r='18'/%3E%3Ccircle cx='218' cy='362' r='18'/%3E%3Ccircle cx='290' cy='362' r='18'/%3E%3Ccircle cx='506' cy='132' r='18'/%3E%3Ccircle cx='578' cy='132' r='18'/%3E%3Ccircle cx='650' cy='132' r='18'/%3E%3Ccircle cx='506' cy='248' r='18'/%3E%3Ccircle cx='578' cy='248' r='18'/%3E%3Ccircle cx='650' cy='248' r='18'/%3E%3Ccircle cx='506' cy='362' r='18'/%3E%3Ccircle cx='578' cy='362' r='18'/%3E%3Ccircle cx='650' cy='362' r='18'/%3E%3C/g%3E%3C/svg%3E");
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(12, 20, 36, 0.76);
  color: #f6fbff;
  font-weight: 700;
  font-size: 0.95rem;
}

.card-title {
  margin: 18px 0 10px;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  line-height: 1;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.card-text {
  max-width: 18rem;
  font-size: 1rem;
  line-height: 1.4;
}

@media (max-width: 860px) {
  .menu-grid,
  .hub-actions {
    grid-template-columns: 1fr;
  }

  .game-card {
    aspect-ratio: auto;
    min-height: 220px;
  }
}

@media (max-width: 560px) {
  .hero {
    padding: 22px 18px 20px;
  }

  .content {
    padding: 16px;
  }

  .menu-grid {
    gap: 14px;
  }

  .game-card {
    padding: 18px;
    min-height: 200px;
  }

  .card-title {
    font-size: clamp(1.9rem, 9vw, 2.6rem);
  }

  .play-btn {
    width: 100%;
    margin-top: 14px;
  }
}
