/* ==========================================================================
   GazeTo — Diagnostik: Raster-Treffsicherheits-Test (#grid-accuracy-test)
   ========================================================================== */

.r-gridtest {
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(12px, 3vw, 28px) clamp(12px, 3vw, 24px) 36px;
  display: flex;
  flex-direction: column;
  min-height: 70vh;
}

.gat-head { margin-bottom: 16px; }
.gat-head .page-title { margin: 4px 0 8px; }

/* Intro */
.gat-intro-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.gat-intro-step { display: flex; align-items: center; gap: 14px; }
.gat-intro-step__icon {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-accent-tint, rgba(75,105,140,0.1)); color: var(--c-accent, #4b698c);
}
.gat-intro-step__icon i, .gat-intro-step__icon svg { width: 22px; height: 22px; }
.gat-intro-step p { margin: 0; font-size: 16px; color: var(--c-fg1, #1d1d1f); }

.gat-actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.gat-primary { font-size: 17px; }

/* Top bar during a round */
.gat-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.gat-bar__progress { font-weight: 700; color: var(--c-fg1, #1a3a6a); font-size: 16px; }
.gat-trial-dots { display: flex; gap: 6px; flex: 1 1 auto; }
.gat-trial-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--c-border, #d7dce6);
}
.gat-trial-dot.is-hit { background: #2f9e44; }
.gat-trial-dot.is-miss { background: #e8a33d; }
.gat-exit { margin-left: auto; }

/* Grid stage — fills available space */
.gat-stage {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 50vh;
}
.gat-grid {
  display: grid;
  gap: clamp(8px, 1.6vw, 16px);
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
}
.gat-cell {
  position: relative;
  border: 3px solid transparent;
  border-radius: 16px;
  background: rgba(75,105,140,0.10);
  cursor: pointer;
  min-height: 64px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .1s ease, box-shadow .15s ease, border-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.gat-cell__star { opacity: 0; transition: opacity .15s ease, transform .15s ease; color: #fff; }
.gat-cell__star i, .gat-cell__star svg { width: 40px; height: 40px; }

/* ── Full-screen board during a running round ──────────────────────────────
   Real communication grids span the whole page, not a narrow centred column —
   so the test board fills the entire viewport while a round is active. */
body.gat-playing .gat-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  margin: 0; padding: 8px 14px;
  background: var(--c-bg, #fff);
  border-bottom: 1px solid var(--c-border, #e4e7ee);
}
body.gat-playing .gat-stage {
  position: fixed; top: 50px; left: 0; right: 0; bottom: 0;
  min-height: 0; margin: 0; padding: 10px; display: block;
}
body.gat-playing .gat-grid {
  max-width: none; width: 100%; height: 100%; margin: 0;
  gap: clamp(4px, 1vw, 12px);
}
body.gat-playing .gat-cell { min-height: 0; border-width: 2px; border-radius: 10px; }
body.gat-playing .gat-cell__star i,
body.gat-playing .gat-cell__star svg { width: clamp(14px, 4.5vmin, 40px); height: clamp(14px, 4.5vmin, 40px); }

/* Active target — pulsing, inviting */
.gat-cell--target {
  border-color: #ffd60a;
  background: linear-gradient(135deg, #ffe16b, #ffb01f);
  box-shadow: 0 0 0 4px rgba(255,214,10,0.35), 0 10px 28px rgba(255,176,31,0.4);
  animation: gat-pulse 1.1s ease-in-out infinite;
}
.gat-cell--target .gat-cell__star { opacity: 1; transform: scale(1); }
@keyframes gat-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Hit / miss feedback */
.gat-cell--hit {
  border-color: #2f9e44 !important;
  background: #2f9e44 !important;
  animation: gat-pop .35s ease;
}
.gat-cell--hit .gat-cell__star { opacity: 1; }
@keyframes gat-pop {
  0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); }
}
.gat-cell--miss { animation: gat-shake .35s ease; }
@keyframes gat-shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); } 75% { transform: translateX(6px); }
}
/* Show where the target was after a miss */
.gat-cell--showtarget {
  border-color: #ffd60a;
  box-shadow: 0 0 0 4px rgba(255,214,10,0.4);
}
.gat-cell--showtarget .gat-cell__star { opacity: .9; }

/* DOM-dwell ring reuses .dom-dwelling (dom-dwell.css) — cells are dwell targets. */

/* Interstitial */
.gat-inter {
  flex: 1 1 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px; padding: 40px 16px;
}
.gat-inter__icon {
  width: 84px; height: 84px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-accent-tint, rgba(75,105,140,0.12)); color: var(--c-accent, #4b698c);
  animation: gat-pop .5s ease;
}
.gat-inter__icon i, .gat-inter__icon svg { width: 44px; height: 44px; }
.gat-inter__title { margin: 6px 0 0; font-family: var(--f-display, serif); font-size: 26px; color: var(--c-fg1, #1a3a6a); }
.gat-inter__text { margin: 0; font-size: 17px; color: var(--c-fg2, #51607a); }

/* Result */
.gat-result { display: flex; flex-direction: column; gap: 16px; }
.gat-reco {
  text-align: center;
  padding: 24px 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(75,105,140,0.12), rgba(75,105,140,0.04));
  border: 2px solid var(--c-accent, #4b698c);
}
.gat-reco__size { font-family: var(--f-display, serif); font-size: clamp(40px, 12vw, 64px); font-weight: 800; color: var(--c-accent, #4b698c); line-height: 1; }
.gat-reco__label { margin-top: 6px; font-size: 17px; color: var(--c-fg1, #1a3a6a); font-weight: 600; }
.gat-reco__mini { margin-top: 4px; font-size: 14px; color: var(--c-fg2, #51607a); }

.gat-table { border: 1px solid var(--c-border, #e4e7ee); border-radius: 14px; overflow: hidden; }
.gat-table__row { display: grid; grid-template-columns: 1fr 1.4fr 1fr; }
.gat-table__row + .gat-table__row { border-top: 1px solid var(--c-border, #eef1f6); }
.gat-table__row--head { background: var(--c-bg-subtle, #f6f8fb); font-weight: 700; color: var(--c-fg2, #51607a); }
.gat-table__c { padding: 10px 12px; font-size: 15px; }
.gat-table__row.is-pass { background: rgba(47,158,68,0.06); }
.gat-table__row.is-fail { background: rgba(232,163,61,0.06); }

.gat-note { font-size: 13px; line-height: 1.5; color: var(--c-fg3, #7a8597); margin: 0; }

/* CTA card on the Diagnostik result screen */
.diag-gridtest-cta {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  margin: 14px 0 4px;
  padding: 14px 16px;
  border: 1px solid var(--c-border, #e4e7ee);
  border-radius: 16px;
  background: var(--c-bg-card, #fff);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.diag-gridtest-cta:hover, .diag-gridtest-cta:focus-visible {
  transform: translateY(-2px); border-color: var(--c-accent, #4b698c);
  box-shadow: 0 8px 24px rgba(26,58,106,0.12); outline: none;
}
.diag-gridtest-cta__icon {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: #B983FF; color: #fff;
}
.diag-gridtest-cta__icon i, .diag-gridtest-cta__icon svg { width: 24px; height: 24px; }
.diag-gridtest-cta__body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.diag-gridtest-cta__title { font-weight: 700; color: var(--c-fg1, #1a3a6a); font-size: 16px; }
.diag-gridtest-cta__text { font-size: 14px; color: var(--c-fg2, #51607a); }
.diag-gridtest-cta > i:last-child, .diag-gridtest-cta > svg:last-child { color: var(--c-accent, #4b698c); opacity: .7; }
.high-contrast .diag-gridtest-cta { border-color: #000; }

/* Stage-appropriate note shown instead of the test in Stufe 1–2 (non-interactive). */
.diag-gridtest-note {
  display: flex; align-items: flex-start; gap: 14px;
  width: 100%; margin: 14px 0 4px; padding: 14px 16px;
  border: 1px dashed var(--c-border, #d7dbe6);
  border-radius: 16px;
  background: var(--c-bg-subtle, #f6f8fc);
}
.diag-gridtest-note__icon {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(75,105,140,0.12); color: var(--c-accent, #4b698c);
}
.diag-gridtest-note__icon i, .diag-gridtest-note__icon svg { width: 22px; height: 22px; }
.diag-gridtest-note__body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; }
.diag-gridtest-note__title { font-weight: 700; color: var(--c-fg1, #1a3a6a); font-size: 15px; }
.diag-gridtest-note__text { font-size: 14px; line-height: 1.45; color: var(--c-fg2, #51607a); }
.high-contrast .diag-gridtest-note { border-color: #000; background: transparent; }

/* Recommended-size badge in the VSD editor grid chooser */
.vsd-size-btn--reco {
  position: relative;
  border-color: var(--c-accent, #4b698c) !important;
  box-shadow: 0 0 0 3px rgba(75,105,140,0.18);
}
.vsd-size-btn__badge {
  position: absolute;
  top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--c-accent, #4b698c); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.high-contrast .vsd-size-btn--reco { border-color: #000 !important; }
.high-contrast .vsd-size-btn__badge { background: #000; color: #fff; }

/* High contrast */
.high-contrast .gat-cell { border-color: #000; background: #fff; }
.high-contrast .gat-cell--target { background: #ffd60a; border-color: #000; }
.high-contrast .gat-reco { border-color: #000; }
.high-contrast .gat-table { border-color: #000; }
.high-contrast .gat-note { color: #000; }
