/* =========================================================
   erfanXstudio /play — هماهنگ کامل با فونت، هدر و تم صفحه اصلی
   + فیت کامل هر بازی درون کادر موبایل و دسکتاپ بدون بریدگی
   ========================================================= */

:root {
  --surface: #111114;
  --surface-2: #18181d;
  --green: #22c55e;
  --amber: #f59e0b;
  --play-radius: 8px;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  background: var(--bone);
}

body.play-body {
  background: var(--bone);
  color: var(--ink);
  font-family: 'Vazirmatn', sans-serif;
  overflow-x: hidden;
}

/* هماهنگی کامل هدر ریسپانسیو با صفحه اصلی */
header {
  opacity: 1 !important;
  animation: none !important;
}

.play-desktop-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.play-sound-pill {
  height: 34px;
  min-width: 38px;
  padding: 0 10px;
  border-radius: 20px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.play-sound-pill:hover {
  border-color: var(--acid);
}

.play-sound-pill.muted {
  opacity: 0.45;
}

@media (max-width: 1000px) {
  .desktop-nav { display: none; }
  .mobile-nav { display: flex; }
  .nav { padding: 12px 18px; }
  .logo { font-size: 24px; gap: 8px; }
}

.tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.play-wrap {
  width: min(980px, 100%);
  margin: 0 auto;
  padding-inline: 20px;
}

/* ============ SLIDES & CLEAN SEPARATION ============ */
.play-slide {
  scroll-snap-align: start;
  scroll-margin-top: 62px;
  min-height: calc(100svh - 62px);
  padding: 22px 0 28px;
  border-bottom: 1px solid rgba(237, 234, 228, 0.14);
  display: flex;
  align-items: center;
  position: relative;
}

.play-slide:nth-child(even) {
  background: #0d0d10;
}

.play-slide-hero {
  padding-top: 18px;
  padding-bottom: 24px;
}

.play-slide-footer {
  min-height: auto;
  padding-top: 34px;
  padding-bottom: 34px;
  border-bottom: none;
}

.slide-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ============ HERO + TOP SCOREBOARD ============ */
.play-hero-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.play-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.play-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--grey);
}

.play-breadcrumb a:hover {
  color: var(--ink);
}

.play-sound-top-btn {
  min-height: 32px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: 'Vazirmatn', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.18s ease, opacity 0.18s ease;
}

.play-sound-top-btn:hover {
  border-color: var(--acid);
}

.play-sound-top-btn.muted {
  opacity: 0.55;
  color: var(--grey);
}

.play-main-title {
  font-family: 'Lalezar', 'Vazirmatn', sans-serif;
  font-size: clamp(24px, 4.4vw, 38px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
  text-wrap: balance;
}

body.lang-en .play-main-title {
  font-family: 'Anton', sans-serif;
  letter-spacing: 0.6px;
}

.play-main-sub {
  max-width: 64ch;
  font-size: 13.5px;
  color: var(--grey);
  line-height: 1.65;
}

.play-quick-jumps {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 2px;
}

.jump-btn {
  width: 100%;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: 'Vazirmatn', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: start;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.jump-btn:hover {
  border-color: var(--acid);
  background: var(--surface-2);
  color: #ffffff;
}

.jump-btn-illusion {
  border-color: rgba(var(--acid-rgb), 0.38);
}

.jump-arrow {
  color: var(--acid);
  font-size: 14px;
  line-height: 1;
}

/* SCOREBOARD BOX */
.leaderboard-box {
  background: var(--surface);
  border: 1px solid rgba(var(--acid-rgb), 0.35);
  border-radius: var(--play-radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.leaderboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.leaderboard-title {
  font-family: 'Lalezar', 'Vazirmatn', sans-serif;
  font-size: 21px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.2;
}

body.lang-en .leaderboard-title {
  font-family: 'Anton', sans-serif;
  letter-spacing: 0.5px;
}

.leaderboard-sub {
  font-size: 12px;
  color: var(--grey);
  margin-top: 2px;
}

.leaderboard-sub strong {
  color: var(--ink);
  font-weight: 700;
}

.btn-refresh {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.18s ease, transform 0.3s ease;
}

.btn-refresh:hover { border-color: var(--acid); }
.btn-refresh.spinning { transform: rotate(360deg); }

.lb-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  background: var(--bone);
  border-radius: 7px;
  border: 1px solid var(--line);
}

.lb-tab {
  min-height: 50px;
  padding: 6px 6px;
  border: 1px solid rgba(237, 234, 228, 0.12);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--grey);
  font-family: 'Vazirmatn', sans-serif;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.lb-tab:hover {
  border-color: rgba(var(--acid-rgb), 0.5);
  color: var(--ink);
}

.lb-tab-type {
  font-size: 10.5px;
  font-weight: 600;
  opacity: 0.8;
  line-height: 1.2;
}

.lb-tab-name {
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.lb-tab.active {
  background: var(--acid);
  border-color: var(--acid);
  color: #ffffff;
}

.lb-tab.active .lb-tab-type {
  color: rgba(255, 255, 255, 0.88);
  opacity: 1;
}

.lb-active-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(var(--acid-rgb), 0.08);
  border: 1px solid rgba(var(--acid-rgb), 0.24);
  border-radius: 6px;
  font-size: 12px;
}

.lb-active-tag {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--acid);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.lb-active-desc {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.4;
}

.lb-list {
  display: flex;
  flex-direction: column;
  max-height: 230px;
  overflow-y: auto;
}

.lb-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.lb-row:last-child { border-bottom: none; }

.lb-rank {
  font-family: 'Space Mono', 'Vazirmatn', monospace;
  font-weight: 700;
  color: var(--grey);
}

.lb-row.rank-1 .lb-rank { color: #fbbf24; }
.lb-row.rank-2 .lb-rank { color: #e2e8f0; }
.lb-row.rank-3 .lb-rank { color: #fb923c; }

.lb-name {
  color: var(--ink);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-score {
  font-family: 'Space Mono', 'Vazirmatn', monospace;
  font-weight: 700;
  color: var(--acid);
  white-space: nowrap;
}

.lb-empty {
  padding: 18px 10px;
  text-align: center;
  font-size: 13px;
  color: var(--grey);
}

.slide-next-cue {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--grey);
  font-family: 'Vazirmatn', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 10px;
  transition: color 0.18s ease;
}

.slide-next-cue:hover {
  color: var(--acid);
}

/* ============ SLIDE HEADERS & TEST CARDS ============ */
.slide-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.slide-index {
  font-family: 'Space Mono', 'Vazirmatn', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--acid);
  padding-top: 4px;
  flex-shrink: 0;
}

.slide-title {
  font-family: 'Lalezar', 'Vazirmatn', sans-serif;
  font-size: clamp(20px, 3.2vw, 29px);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.22;
}

body.lang-en .slide-title {
  font-family: 'Anton', sans-serif;
  letter-spacing: 0.5px;
}

.slide-desc {
  margin-top: 3px;
  font-size: 13px;
  color: var(--grey);
  max-width: 66ch;
  line-height: 1.55;
}

.test-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--play-radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Single-row HUD — never wraps onto 2 tall rows on mobile! */
.game-hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 9px 12px;
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.game-hud.hud-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1px;
  min-width: 0;
}

.hud-label {
  font-size: 11px;
  color: var(--grey);
  white-space: nowrap;
}

.hud-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
  white-space: nowrap;
}

.stage-box {
  min-height: min(310px, 44svh);
  padding: 14px 12px;
  background: #08080a;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stage-intro {
  max-width: 420px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 10px;
}

.stage-intro-desc {
  font-size: 13.5px;
  color: var(--grey);
  line-height: 1.65;
}

.stage-active-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.stage-footer-bar {
  width: min(350px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stage-feedback {
  font-size: 12.5px;
  color: var(--grey);
  line-height: 1.4;
}

/* ============ GAME 1: COLOR GRID (VIEWPORT-AWARE FIT) ============ */
.color-grid {
  width: min(340px, 84vw, 43svh);
  aspect-ratio: 1 / 1;
  display: grid;
  gap: 6px;
}

.color-tile {
  border: none;
  border-radius: 6px;
  cursor: pointer;
  min-width: 0;
  min-height: 0;
  transition: transform 0.12s ease;
}

.color-tile:active { transform: scale(0.94); }

.color-tile.is-wrong { animation: tileShake 0.28s ease; }

.color-tile.is-reveal {
  outline: 3px solid #ffffff;
  outline-offset: -3px;
}

@keyframes tileShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ============ GAME 2: SEQUENTIAL MATRIX MEMORY (3x3 -> 6x6) ============ */
.matrix-grid {
  width: min(340px, 84vw, 43svh);
  aspect-ratio: 1 / 1;
  display: grid;
  gap: 6px;
}

.matrix-tile {
  border-radius: 6px;
  border: 1px solid rgba(237, 234, 228, 0.15);
  background: var(--surface-2);
  color: #ffffff;
  font-family: 'Space Mono', 'Vazirmatn', monospace;
  font-size: clamp(12px, 2.8vw, 17px);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.12s ease, box-shadow 0.14s ease;
}

.matrix-tile:hover {
  border-color: rgba(237, 234, 228, 0.35);
}

.matrix-tile:active {
  transform: scale(0.94);
}

.matrix-tile.lit {
  background: var(--acid);
  border-color: #ff8ba1;
  box-shadow: 0 0 20px rgba(var(--acid-rgb), 0.7);
  transform: scale(1.03);
}

.matrix-tile.found {
  background: var(--green);
  border-color: #86efac;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.35);
}

.matrix-tile.missed {
  background: rgba(var(--acid-rgb), 0.35);
  border-color: var(--acid);
  color: #ffffff;
}

.matrix-tile.wrong {
  background: #7f1d1d;
  border-color: #fca5a5;
  animation: tileShake 0.25s ease;
}

/* ============ GAME 3: PADDLE BALL BOUNCE ============ */
.bounce-stage {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060608;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

#bounceCanvas {
  width: min(440px, 100%);
  height: min(325px, 44svh);
  display: block;
  touch-action: none;
  cursor: ew-resize;
}

.bounce-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 8, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 18px;
}

.bounce-bar {
  width: 100%;
}

/* ============ ILLUSION SHOWCASES ============ */
.illusion-showcase {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--play-radius);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.spiral-stage-big {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 10px;
  background: #000000;
  border-radius: 8px;
  border: 1px solid var(--line);
}

#spiralCanvas {
  width: min(330px, 76vw, 42svh);
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: block;
}

.spiral-hud-pill {
  position: absolute;
  top: 10px;
  inset-inline-end: 12px;
  font-family: 'Space Mono', 'Vazirmatn', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(10, 10, 11, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 4px 10px;
}

/* Lilac Chaser Stage (Calibrated Neutral Gray) */
.lilac-stage-big {
  width: 100%;
  padding: 12px;
  background: #9a9a9a;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lilacCanvas {
  width: min(320px, 76vw, 42svh);
  height: auto;
  aspect-ratio: 1 / 1;
  display: block;
}

.illusion-action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

/* Fullscreen Illusion Overlays (Spiral, Lilac Chaser, Hermann Grid) */
.spiral-fullscreen-overlay,
.illusion-fs-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: #000000;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 16px 16px 86px;
}

.spiral-fullscreen-overlay.show,
.illusion-fs-overlay.show {
  display: flex;
}

#spiralFsCanvas,
#lilacFsCanvas {
  width: min(92vmin, 94vw);
  height: min(92vmin, 94vw);
  max-width: 100vw;
  max-height: calc(100vh - 96px);
  display: block;
}

.lilac-fs-overlay {
  background: #9a9a9a;
}

.hermann-fs-overlay {
  background: #000000;
  transition: background 0.25s ease;
}

.hermann-fs-overlay.inverted {
  background: #ffffff;
}

.hermann-fs-grid {
  width: min(82vmin, 90vw);
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: clamp(8px, 1.8vmin, 14px);
}

.hermann-fs-grid .hermann-cell {
  background: #ffffff;
  transition: background 0.25s ease;
}

.hermann-fs-overlay.inverted .hermann-fs-grid .hermann-cell {
  background: #000000;
}

.spiral-fs-hud {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: rgba(10, 10, 11, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  max-width: 92vw;
}

.spiral-fs-timer {
  font-family: 'Space Mono', 'Vazirmatn', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--acid);
}

.spiral-fs-tip {
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
}

/* Hermann Grid Big (پیش‌فرض: پس‌زمینه مشکی با مربع‌های سفید) */
.hermann-stage-big {
  width: 100%;
  padding: 16px;
  background: #000000;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease;
}

.hermann-grid {
  width: min(300px, 74vw, 41svh);
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 9px;
}

.hermann-cell {
  background: #ffffff;
  transition: background 0.25s ease;
}

.hermann-stage-big.inverted {
  background: #ffffff;
}

.hermann-stage-big.inverted .hermann-cell {
  background: #000000;
}

/* ============ BUTTONS ============ */
.btn-primary,
.btn-primary-sm,
.btn-secondary,
.btn-ghost-sm {
  min-height: 42px;
  padding: 9px 18px;
  border-radius: 6px;
  font-family: 'Vazirmatn', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.btn-primary,
.btn-primary-sm {
  background: var(--acid);
  color: #ffffff;
  border: 1px solid var(--acid);
}

.btn-primary:hover,
.btn-primary-sm:hover {
  background: var(--acid-hover);
  border-color: var(--acid-hover);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary-sm {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 12.5px;
}

.btn-secondary,
.btn-ghost-sm {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-secondary:hover,
.btn-ghost-sm:hover {
  border-color: rgba(237, 234, 228, 0.45);
}

.btn-ghost-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 12.5px;
}

/* ============ RESULT & SHARE MODAL ============ */
.play-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 15000;
  background: rgba(5, 5, 6, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.play-modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.play-modal-box {
  width: min(460px, 100%);
  background: #0b0b0e;
  border: 2px solid var(--acid);
  border-radius: var(--play-radius);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(var(--acid-rgb), 0.25);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.play-modal-overlay.show .play-modal-box {
  transform: scale(1) translateY(0);
}

.play-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--acid);
  color: #ffffff;
  font-weight: 700;
  font-size: 13.5px;
}

.play-modal-close {
  background: none;
  border: none;
  color: #ffffff;
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.play-modal-body {
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.result-hero-block {
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.result-score-big {
  font-family: 'Lalezar', 'Vazirmatn', sans-serif;
  font-size: clamp(32px, 6vw, 44px);
  color: var(--ink);
  line-height: 1.2;
}

body.lang-en .result-score-big {
  font-family: 'Anton', sans-serif;
}

.result-verdict {
  margin-top: 4px;
  font-size: 13.5px;
  font-weight: 600;
  color: #ff6b86;
}

.score-submit-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-form-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.score-input-row {
  display: flex;
  gap: 8px;
}

.score-name-input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #050506;
  color: var(--ink);
  font-family: 'Vazirmatn', sans-serif;
  font-size: 14.5px;
}

.score-name-input:focus {
  border-color: var(--acid);
  outline: none;
}

.score-submit-msg {
  min-height: 18px;
  font-size: 12.5px;
  color: var(--green);
}

.score-submit-msg.is-error {
  color: #ff6b86;
}

.share-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.share-actions button {
  padding: 10px 8px;
  font-size: 13px;
}

.result-bottom-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.result-bottom-actions button {
  flex: 1;
}

/* ============ FAQ & FOOTER ============ */
.faq-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--play-radius);
  padding: 14px 16px;
}

.faq-item summary {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-family: 'Space Mono', monospace;
  font-size: 18px;
  color: var(--acid);
}

.faq-item[open] summary::after { content: '−'; }

.faq-item p {
  margin-top: 8px;
  font-size: 13px;
  color: var(--grey);
  line-height: 1.75;
}

.play-footer-inline {
  margin-top: 14px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.play-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 58ch;
}

.play-footer-brand p {
  font-size: 12.5px;
  color: var(--grey);
  line-height: 1.7;
}

.play-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--grey);
}

.play-footer-links a:hover { color: var(--ink); }

/* دکمه بازگشت به بالا هماهنگ با صفحه اصلی — سمت چپ لینک ارتباط با ما */
.play-scroll-top-btn {
  margin-inline-start: auto;
  width: 42px;
  height: 42px;
  background: var(--ink);
  color: var(--bone);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  font-size: 20px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.play-scroll-top-btn.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.play-scroll-top-btn:hover {
  background: var(--acid);
  color: var(--ink);
  border-color: var(--acid);
  transform: translateY(-4px);
}

.play-footer-copy {
  font-size: 12px;
  color: var(--grey);
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* ============ TOAST ============ */
.play-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #18181d;
  color: var(--ink);
  border: 1px solid var(--acid);
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  z-index: 30000;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.play-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ MOBILE TWEAKS ============ */
@media (max-width: 560px) {
  .play-wrap { padding-inline: 12px; }
  .play-slide { padding: 14px 0 18px; }
  .slide-inner { gap: 10px; }
  .test-card { padding: 11px; gap: 10px; }
  .stage-box { padding: 10px 8px; min-height: min(275px, 42svh); }
  .color-grid,
  .matrix-grid {
    width: min(305px, 84vw, 41svh);
    gap: 5px;
  }
  #bounceCanvas {
    height: min(285px, 41svh);
  }
  .score-input-row { flex-direction: column; }
  .spiral-fs-tip { display: none; }
}
