/* Tile Trainer: a felt-green quiz card with big tiles and big answer buttons. */
.trainer { min-height: 420px; }
.tr-card { border-radius: 20px; padding: 16px; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 12px;
  background: var(--felt-tex), radial-gradient(120% 100% at 50% 30%, var(--felt-a), var(--felt-b));
  box-shadow: inset 0 0 0 6px var(--rail), inset 0 0 0 8px var(--rail-dark), 0 10px 26px rgba(0,0,0,.18); }
@media (min-width: 760px) { .tr-card { padding: 26px 30px; } }
.tr-top { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.tr-count { background: rgba(20,45,22,.5); padding: 3px 12px; border-radius: 999px; }
.tr-score { display: flex; align-items: center; gap: 8px; }
.tr-score strong { font-size: 22px; color: #ffe08a; }
.tr-streak { background: rgba(0,0,0,.2); border-radius: 999px; padding: 2px 10px; font-size: 14px; }
.tr-bar { width: 100%; height: 8px; border-radius: 99px; background: rgba(0,0,0,.18); overflow: hidden; }
.tr-bar span { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width .3s; }

.tr-show { display: flex; justify-content: center; gap: 6px; padding: 8px 0; min-height: 150px; align-items: center; }
.tr-show .tile { width: clamp(84px, 26vw, 120px); filter: drop-shadow(0 6px 8px rgba(0,0,0,.25)); }
.tr-show.many .tile, .tr-start .tr-show .tile { width: clamp(52px, 15vw, 86px); }
.tr-show .tile:nth-child(n+2) { margin-left: -2px; }
.tr-q, .tr-h { margin: 0; text-align: center; font-family: var(--head); font-weight: 700; font-size: clamp(22px, 5.4vw, 30px); text-shadow: 0 1px 2px rgba(0,0,0,.2); }
.tr-p { margin: 0; text-align: center; max-width: 40ch; color: #f1fbee; }

.tr-opts { width: 100%; max-width: 560px; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tr-opts.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tr-opt { font: inherit; font-weight: 700; font-size: clamp(17px, 4.6vw, 21px); min-height: 64px; padding: 8px 10px; border-radius: 14px; cursor: pointer;
  border: none; background: #fffaf0; color: #2a3a2c; box-shadow: 0 4px 0 #c9bfa5; line-height: 1.2; }
.tr-opt:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 #c9bfa5; }
.tr-opt:disabled { cursor: default; opacity: .55; }
.tr-opt.ok { opacity: 1; background: #3fb34f; color: #fff; box-shadow: 0 4px 0 #23782f; }
.tr-opt.bad { opacity: 1; background: #d6382b; color: #fff; box-shadow: 0 4px 0 #9b2318; }
.tr-opt.ok::before { content: "✓ "; } .tr-opt.bad::before { content: "✗ "; }

.tr-why { width: 100%; max-width: 560px; border-radius: 14px; padding: 12px 16px; background: #fff; color: var(--ink); animation: tr-in .2s ease-out; }
.tr-why p { margin: 0; } .tr-why p + p { margin-top: 4px; color: #3d4d42; }
.tr-why.ok { border-left: 8px solid #3fb34f; } .tr-why.bad { border-left: 8px solid #d6382b; }
.tr-verdict { font-weight: 700; font-size: 19px; }
.tr-why.ok .tr-verdict { color: #23782f; } .tr-why.bad .tr-verdict { color: #a12a1d; }
.tr-next, .tr-go { min-width: 240px; font-size: 20px; }
@keyframes tr-in { from { transform: translateY(6px); opacity: 0; } }

.tr-best { margin: 0; background: rgba(20,45,22,.5); padding: 4px 14px; border-radius: 999px; }
.tr-best.new { background: var(--gold); color: var(--gold-ink); font-weight: 700; }
.tr-stars { margin: 0; font-size: 54px; line-height: 1; color: #ffd34d; letter-spacing: 6px; text-shadow: 0 3px 0 rgba(0,0,0,.2); }
.tr-stars span { color: rgba(255,255,255,.3); }
.tr-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; width: 100%; max-width: 460px; }
.tr-stats div { background: #fff; color: var(--ink); border-radius: 12px; padding: 8px; text-align: center; }
.tr-stats dt { font-size: 14px; color: var(--muted); } .tr-stats dd { margin: 0; font-family: var(--head); font-size: 26px; font-weight: 700; color: var(--jade); }
.tr-misses { width: 100%; max-width: 560px; background: #fff; color: var(--ink); border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.tr-mh { margin: 0; font-weight: 700; }
.tr-miss { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.tr-mt { display: flex; gap: 1px; flex: none; } .tr-mt .tile { width: 30px; }
.tr-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; width: 100%; }
.tr-actions .btn { flex: 1 1 200px; max-width: 280px; }
@media (prefers-reduced-motion: reduce) { .tr-why, .tr-bar span { animation: none; transition: none; } }
.trainer { scroll-margin-top: 76px; }
