/* Styles for the 6 newer tests */

/* Verbal Memory: word card flips in */
.word-card {
  min-width: min(380px, 100%); padding: 34px 26px; border-radius: var(--r-lg); text-align: center;
  font: 800 clamp(2.4rem, 9vw, 3.6rem)/1 var(--font-head); letter-spacing: .02em;
  background: linear-gradient(135deg, var(--surface-3), var(--surface-2)); box-shadow: inset 0 -6px 0 rgba(0,0,0,.2), 0 0 0 3px var(--c);
}
.word-card.flip { animation: wordflip .35s cubic-bezier(.3, .7, .4, 1.4); }
@keyframes wordflip { from { transform: perspective(600px) rotateX(-80deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* Chimp Test */
.chimp-grid { display: grid; gap: 6px; width: min(640px, 100%); }
.chimp-empty { aspect-ratio: 1; }
.chimp-cell {
  aspect-ratio: 1; border: 0; border-radius: 12px; cursor: pointer; color: var(--ink);
  font: 800 clamp(1.1rem, 3.6vw, 1.7rem)/1 var(--font-head); background: var(--c);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.2); animation: popin .3s cubic-bezier(.3, .7, .4, 1.6) both;
}
.chimp-grid.masked .chimp-cell:not(.done) { color: transparent; background: #F4F2FF; }
.chimp-cell.done { opacity: .25; background: var(--surface-3); color: var(--text); box-shadow: none; }
.chimp-cell.reveal { color: var(--ink) !important; background: var(--c) !important; opacity: 1; }
.chimp-cell.wrong { background: var(--coral) !important; animation: shake .3s; }

/* Spatial Rotation */
.spatial-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; width: min(560px, 100%); }
.spatial-pane { aspect-ratio: 1; border-radius: var(--r-lg); background: var(--surface-2); display: grid; place-items: center; animation: popin .25s ease-out both; }
.spatial-svg { width: 92%; height: 92%; filter: drop-shadow(0 8px 12px rgba(0,0,0,.35)); }
.spatial-arrow { font-size: 1.8rem; color: var(--muted); }

/* Peripheral Vision */
.peri-arena { position: relative; width: min(560px, 100%); aspect-ratio: 1.25; border-radius: var(--r-lg); overflow: hidden;
  background: radial-gradient(circle at 50% 50%, var(--surface-3), var(--surface-2) 70%); }
.peri-ring { position: absolute; left: 50%; top: 50%; width: 84%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 2px dashed rgba(174,182,232,.18); }
.peri-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 1.8rem; color: var(--c); filter: drop-shadow(0 0 10px var(--c)); animation: pulse 1.6s ease-in-out infinite; }
.peri-dot { position: absolute; width: 22px; height: 22px; margin: -11px; border-radius: 50%; background: #fff; box-shadow: 0 0 18px #fff, 0 0 30px var(--c); opacity: 0; transition: none !important; }
.peri-dot.on { opacity: 1; }
.peri-arrow { position: absolute; width: 48px; height: 48px; margin: -24px; border: 0; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.3rem; background: var(--surface); color: var(--text); cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,.3); transition: transform .12s, background .12s; }
.peri-arrow:disabled { opacity: .25; cursor: default; }
.peri-arrow:not(:disabled):hover { transform: scale(1.12); background: var(--c); color: var(--ink); }
.peri-arrow.right { opacity: 1 !important; background: var(--green); color: var(--ink); }
.peri-arrow.wrong { opacity: 1 !important; background: var(--coral); color: var(--ink); }

/* Melody Memory: two little piano rolls */
.melody-rolls { display: grid; gap: 10px; width: min(520px, 100%); }
.roll { position: relative; display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-md); background: var(--surface-2); transition: box-shadow .2s; }
.roll b { font: 800 .85rem/1 var(--font-head); color: var(--muted); }
.roll-notes { position: relative; height: 90px; display: flex; justify-content: space-around; }
.roll-notes .rn { position: relative; width: 26px; height: 12px; border-radius: 6px; background: var(--surface-3); align-self: flex-end; transition: background .1s, box-shadow .1s, transform .1s; }
.roll-notes .rn.lit { background: var(--c); box-shadow: 0 0 16px var(--c); transform: scale(1.25); }
.roll-notes .rn.changed { background: var(--coral); box-shadow: 0 0 14px var(--coral); }
.roll.good { box-shadow: 0 0 0 3px var(--green); }
.roll.bad { box-shadow: 0 0 0 3px var(--coral); }

/* Angle Eye */
.angle-wrap { width: min(300px, 80vw); aspect-ratio: 1; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; }
.angle-svg { width: 100%; height: 100%; }
.angle-svg .guess-ray { animation: popin .3s ease-out both; }
.angle-input { display: flex; align-items: center; gap: 6px; font: 800 2rem/1 var(--font-head); }
.angle-input .num-input { width: 150px; }

/* Logic Puzzles (IQ-style matrices) */
.logic-board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: center; width: min(820px, 100%); }
.logic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; border-radius: var(--r-lg); background: var(--surface-2); }
.logic-cell { aspect-ratio: 1; border-radius: 14px; background: #F4F2FF; display: grid; place-items: center; animation: popin .3s cubic-bezier(.3,.7,.4,1.5) both; }
:root:not([data-theme="light"]) .logic-cell { background: #1A2058; }
.logic-cell svg, .logic-opt svg { width: 86%; height: 86%; }
.logic-cell.missing { background: transparent; border: 3px dashed var(--c); }
.logic-cell.missing span { font: 800 2.6rem/1 var(--font-head); color: var(--c); animation: pulse 1.4s ease-in-out infinite; }
.logic-cell.solved { border-style: solid; border-color: var(--green); background: rgba(75, 224, 138, .12); animation: fxpop .4s cubic-bezier(.3,.7,.4,1.6); }
.logic-cell.revealed { border-style: solid; border-color: var(--yellow); background: rgba(255, 201, 74, .1); }
.logic-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.logic-opt {
  position: relative; aspect-ratio: 1; border: 0; border-radius: 14px; cursor: pointer; display: grid; place-items: center; padding: 0;
  background: #F4F2FF; box-shadow: 0 5px 0 rgba(0,0,0,.3); transition: transform .12s cubic-bezier(.3,.7,.4,1.5), box-shadow .12s;
  animation: popin .3s cubic-bezier(.3,.7,.4,1.5) both;
}
:root:not([data-theme="light"]) .logic-opt { background: #1A2058; }
.logic-opt:not(:disabled):hover { transform: translateY(-3px); box-shadow: 0 8px 0 rgba(0,0,0,.3), 0 0 0 3px var(--c); }
.logic-opt:not(:disabled):active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.logic-opt:disabled { cursor: default; opacity: .55; }
.logic-opt b { position: absolute; top: 6px; left: 8px; font: 800 .8rem/1 var(--font-head); color: var(--muted); }
.logic-opt.right { opacity: 1; box-shadow: 0 0 0 4px var(--green), 0 0 22px rgba(75,224,138,.5); }
.logic-opt.wrong { opacity: 1; box-shadow: 0 0 0 4px var(--coral); }
@media (max-width: 760px) {
  .logic-board { grid-template-columns: 1fr; gap: 14px; }
  .logic-grid { width: min(340px, 100%); justify-self: center; }
  .logic-options { width: min(360px, 100%); justify-self: center; }
}

@media (max-width: 520px) {
  .chimp-grid { gap: 4px; }
  .chimp-cell { border-radius: 8px; }
  .peri-arrow { width: 40px; height: 40px; margin: -20px; }
  .roll { grid-template-columns: 1fr; }
}
