/* GAMES: shared strip of games, level buttons, rewards album, and the three unlockable games */
.gamesnav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 clamp(18px, 3vw, 28px); }
.gamesnav__tab { position: relative; display: grid; gap: 2px; padding: 10px 14px 11px; border: 2px solid var(--ink); border-radius: 14px; background: var(--paper); color: var(--ink); text-decoration: none; box-shadow: 3px 3px 0 var(--ink); transition: transform .15s; }
.gamesnav__tab b { font-family: var(--font-display); font-weight: 400; font-size: 18px; line-height: 1.05; }
.gamesnav__tab small { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gamesnav__tab:hover { transform: translateY(-2px); }
.gamesnav__tab.is-current { background: var(--cobalt); color: #fff; }
.gamesnav__tab.is-current small { color: rgba(255, 255, 255, .8); }
.gamesnav__tab.is-locked { background: var(--soft); border-style: dashed; box-shadow: none; color: var(--muted); }
.gamesnav__lock { position: absolute; top: 8px; right: 10px; }
.gamesnav__lock svg { width: 16px; height: 16px; }

.lockcard { max-width: 560px; margin: 10px auto 30px; text-align: center; padding: 34px 26px 30px; background: var(--paper); border: 2px dashed var(--ink); border-radius: 22px; }
.lockcard > svg { width: 40px; height: 40px; }
.lockcard h2 { font-family: var(--font-display); font-weight: 400; font-size: 28px; margin: 10px 0 8px; }
.lockcard p { font-size: 17px; line-height: 1.45; margin: 0 0 18px; }

.lvlbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.lvl { display: grid; justify-items: start; gap: 1px; min-width: 64px; padding: 6px 12px 7px; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--paper); color: var(--ink); text-align: left; }
.lvl b { font-family: var(--font-display); font-weight: 400; font-size: 17px; line-height: 1; }
.lvl small { font-size: 12px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.lvl small svg { width: 12px; height: 12px; }
.lvl.is-current { background: var(--ink); color: #fff; }
.lvl.is-current small { color: var(--yellow); }
.lvl:disabled { opacity: .45; border-style: dashed; cursor: not-allowed; }

/* rewards */
.album { margin-top: clamp(30px, 5vw, 56px); }
.album h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(24px, 3vw, 32px); margin: 0 0 14px; display: flex; align-items: baseline; gap: 12px; }
.album h2 small { font-family: var(--font-body); font-size: 15px; color: var(--muted); }
.album__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.album__item { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 14px 10px 12px; border: 1.5px dashed var(--line); border-radius: 16px; background: var(--soft); }
.album__item img { filter: grayscale(1) brightness(.35) opacity(.25); }
.album__item b { font-size: 15px; }
.album__item small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.album__item.is-got { border: 2px solid var(--ink); background: var(--paper); box-shadow: 3px 3px 0 var(--ink); }
.album__item.is-got img { filter: none; transform: rotate(-6deg); }
.album__item .nw { white-space: nowrap; }
.album__note { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.prize h2 { font-family: var(--font-display); font-weight: 400; font-size: 30px; margin: 0 0 14px; }
.reward { display: grid; gap: 12px; }
.reward__sticker { display: flex; align-items: center; gap: 16px; padding: 14px; border: 2px solid var(--ink); border-radius: 16px; background: var(--yellow); }
.reward__sticker img { flex: none; transform: rotate(-8deg); animation: prizePop .5s cubic-bezier(.3, 1.6, .5, 1); }
.reward__sticker p { margin: 0; font-size: 15px; line-height: 1.4; }
.reward__sticker b { display: block; font-size: 18px; margin-bottom: 2px; }
.prize__game { display: flex; align-items: center; gap: 10px; font-size: 16px; margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--sky); }
.prize__game svg { width: 26px; height: 26px; flex: none; }
@keyframes prizePop { from { transform: scale(.3) rotate(-30deg); } }

/* ---------- memory ---------- */
.mem { position: relative; max-width: 760px; }
.mem-stats { font-weight: 600; margin: 0 0 12px; font-variant-numeric: tabular-nums; }
.mem-board { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 116px)); gap: clamp(8px, 1.4vw, 14px); }
.mcard { aspect-ratio: 3 / 4; padding: 0; border: 0; background: none; perspective: 700px; border-radius: 14px; }
.mcard__in { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .38s cubic-bezier(.3, 1.3, .5, 1); }
.mcard.is-open .mcard__in, .mcard.is-done .mcard__in { transform: rotateY(180deg); }
.mcard__back, .mcard__face { position: absolute; inset: 0; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.mcard__back { background: var(--cobalt); background-image: linear-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .14) 1px, transparent 1px); background-size: 14px 14px; box-shadow: 3px 3px 0 var(--ink); }
.mcard__back svg { width: 38%; height: auto; }
.mcard__face { background: var(--paper); transform: rotateY(180deg); box-shadow: 3px 3px 0 var(--ink); }
.mcard__face img { width: 74%; height: auto; pointer-events: none; }
.mcard.is-done .mcard__face { background: var(--yellow); }
.mcard.is-done { cursor: default; }
.mcard:hover:not(.is-open):not(.is-done) .mcard__in { transform: translateY(-3px); }
.mcard:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }
.mem-over { position: absolute; inset: 40px 0 0; display: grid; place-items: center; background: rgba(236, 238, 243, .72); border-radius: 18px; }
.mem-over[hidden] { display: none; }
.mem-over__card { text-align: center; background: var(--paper); border: 2px solid var(--ink); border-radius: 20px; padding: 22px 26px; box-shadow: 6px 6px 0 var(--ink); max-width: 360px; }
.mem-over__card h2 { font-family: var(--font-display); font-weight: 400; font-size: 26px; margin: 4px 0 8px; }
.mem-over__card p { margin: 0 0 14px; line-height: 1.4; }
.mem-over__stars { font-size: 34px; color: var(--yellow); -webkit-text-stroke: 1.5px var(--ink); margin: 0 !important; letter-spacing: .08em; }
.mem-over__btns, .quiz__btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- snake ---------- */
.snake { max-width: 560px; }
.snake__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 10px; }
.snake__top p { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.snake__pal { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.snake__pal i { width: 12px; height: 12px; border: 1.5px solid var(--ink); border-radius: 3px; background: var(--soft); }
.snake__box { position: relative; border: 2px solid var(--ink); border-radius: 18px; overflow: hidden; box-shadow: 6px 6px 0 var(--ink); background: #fff; touch-action: none; }
.snake__box:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 4px; }
.snake__box canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.snake__over { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .78); padding: 16px; }
.snake__over[hidden] { display: none; }
.snake__card { text-align: center; max-width: 340px; background: var(--paper); border: 2px solid var(--ink); border-radius: 20px; padding: 20px 22px; box-shadow: 5px 5px 0 var(--ink); }
.snake__card h2 { font-family: var(--font-display); font-weight: 400; font-size: 26px; margin: 2px 0 8px; }
.snake__card p { margin: 0 0 14px; line-height: 1.4; }
.snake__kicker { font-size: 13px; font-weight: 600; color: var(--cobalt); margin: 0 !important; }
.snake__hint { font-size: 13px; color: var(--muted); margin: 8px 0 0 !important; }
.snake__help { color: var(--muted); font-size: 14px; line-height: 1.45; margin: 16px 0 0; }
.dpad { display: none; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(2, 56px); gap: 8px; justify-content: center; margin: 16px 0 0; }
.dpad button { border: 2px solid var(--ink); border-radius: 14px; background: var(--yellow); font-size: 20px; box-shadow: 3px 3px 0 var(--ink); touch-action: manipulation; }
.dpad button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.dpad [data-d="up"] { grid-column: 2; grid-row: 1; }
.dpad [data-d="left"] { grid-column: 1; grid-row: 2; }
.dpad [data-d="down"] { grid-column: 2; grid-row: 2; }
.dpad [data-d="right"] { grid-column: 3; grid-row: 2; }
@media (pointer: coarse) { .dpad { display: grid; } }

/* ---------- quiz ---------- */
.quiz { max-width: 720px; background: var(--paper); border: 2px solid var(--ink); border-radius: 22px; padding: clamp(18px, 3vw, 30px); box-shadow: 6px 6px 0 var(--ink); }
.quiz__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; font-size: 14px; font-weight: 600; color: var(--muted); }
.quiz__top span:first-child { color: var(--cobalt); }
.quiz__bar { height: 6px; background: var(--soft); border-radius: 99px; margin: 10px 0 18px; overflow: hidden; }
.quiz__bar i { display: block; height: 100%; background: var(--cobalt); transition: width .3s; }
.quiz__q { font-size: clamp(20px, 2.4vw, 26px); line-height: 1.25; margin: 0 0 18px; font-weight: 600; }
.quiz__opts { display: grid; gap: 10px; }
.qopt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border: 1.5px solid var(--ink); border-radius: 14px; background: var(--paper); font-size: 17px; line-height: 1.3; color: var(--ink); transition: background .15s, transform .15s; }
.qopt:hover:not(:disabled) { background: var(--sky); transform: translateX(3px); }
.qopt__l { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px; }
.qopt:disabled { cursor: default; opacity: .6; }
.qopt.is-right { background: #CDEFD9; border-color: #1B8A4B; opacity: 1; }
.qopt.is-right .qopt__l { background: #1B8A4B; }
.qopt.is-wrong { background: #FFD9D6; border-color: var(--red); opacity: 1; }
.qopt.is-wrong .qopt__l { background: var(--red); }
.quiz__why { margin-top: 16px; }
.quiz__why p { margin: 0 0 12px; font-size: 16px; line-height: 1.5; padding: 12px 14px; border-radius: 12px; background: var(--soft); }
.quiz--done { text-align: center; }
.quiz--done h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(24px, 3vw, 32px); margin: 4px 0 10px; }
.quiz--done p { font-size: 17px; line-height: 1.45; margin: 0 0 18px; }
.quiz__score { font-family: var(--font-display); font-size: 64px; line-height: 1; color: var(--cobalt); margin: 0 !important; }

@media (max-width: 720px) {
  .gamesnav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gamesnav__tab { padding: 8px 12px 9px; }
  .gamesnav__tab b { font-size: 16px; }
  .lvlbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)) 14px; padding: 2px var(--gutter) 4px; }
  .lvlbar::-webkit-scrollbar { display: none; }
  .lvl { flex: none; }
  .mem-board { grid-template-columns: repeat(var(--mcols), minmax(0, 1fr)); gap: 8px; }
  .mcard__back, .mcard__face { border-radius: 10px; }
  .album__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reward__sticker { gap: 12px; padding: 12px; }
  .reward__sticker img { width: 64px; height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .mcard__in { transition: none; }
  .reward__sticker img { animation: none; }
  .qopt, .gamesnav__tab { transition: none; }
}
