/* TLC Verse Match: card board inside the shared arcade cabinet (see cosmic-shooter.css).
   Scoped to .tlc-arcade.vm-cabinet so any page can host it. The screen grows with
   the board instead of using the fixed 16:9 / 4:5 game screen. */

.tlc-arcade.vm-cabinet .gm-screen { aspect-ratio: auto; display: block; text-align: left; min-height: 380px; }
.tlc-arcade .vm-play { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; padding: 10px 12px 14px; }

.tlc-arcade .vm-stats {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; min-height: 38px; padding-right: 92px;
  font-family: var(--cs-pixel); font-size: 0.5rem; letter-spacing: 0.06em; color: var(--cs-muted);
}
.tlc-arcade .vm-stats b { font-weight: 400; color: var(--cs-cyan); font-variant-numeric: tabular-nums; }

.tlc-arcade .vm-board { display: grid; grid-template-columns: repeat(var(--vm-cols, 4), minmax(0, 1fr)); gap: 10px; }

/* a card: both faces share one grid cell, so the card grows to fit the longer face */
.tlc-arcade .vm-card {
  position: relative; display: block; width: 100%; padding: 0; border: 0; background: none;
  font: inherit; color: inherit; cursor: pointer; perspective: 900px; -webkit-tap-highlight-color: transparent;
}
.tlc-arcade .vm-card[disabled] { cursor: default; }
.tlc-arcade .vm-inner {
  display: grid; min-height: 92px; transform-style: preserve-3d; transition: transform 0.35s ease;
}
.tlc-arcade .vm-card.is-up .vm-inner { transform: rotateY(180deg); }
.tlc-arcade .vm-face {
  grid-area: 1 / 1; display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 10px 8px; border-radius: 6px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.tlc-arcade.vm-cabinet .cs-overlay { text-align: center; background: rgba(4, 3, 14, 0.88); }   /* darker than the shooter: the board behind is busy text */
.tlc-arcade .vm-back {
  border: 1px solid rgba(139, 92, 255, 0.55);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 9' shape-rendering='crispEdges'%3E%3Cpath fill='%23F08A3C' d='M3 0h1v9H3zM1 2h5v1H1z'/%3E%3C/svg%3E") no-repeat center / 14px 18px,
    radial-gradient(circle, rgba(34, 230, 255, 0.18) 1px, transparent 1.5px) 0 0 / 10px 10px,
    linear-gradient(160deg, #1A1146, #0B0820);
  box-shadow: inset 0 0 18px rgba(139, 92, 255, 0.25);
}
.tlc-arcade .vm-card:hover:not([disabled]):not(.is-up) .vm-back { border-color: var(--cs-cyan); box-shadow: inset 0 0 18px rgba(34, 230, 255, 0.3), 0 0 12px var(--cs-cyan-soft); }
.tlc-arcade .vm-front { transform: rotateY(180deg); background: #0B0820; color: var(--cs-white); }
.tlc-arcade .vm-front.vm-ref {
  border: 2px solid var(--cs-cyan); color: var(--cs-cyan); box-shadow: 0 0 12px var(--cs-cyan-soft);
  font-family: var(--cs-pixel); font-size: clamp(0.5rem, 1.3vw, 0.62rem); line-height: 1.7; letter-spacing: 0.04em;
}
.tlc-arcade .vm-front.vm-phrase {
  border: 2px solid var(--cs-magenta); box-shadow: 0 0 12px var(--cs-magenta-soft);
  font-family: var(--cs-mono); font-size: clamp(0.72rem, 1.5vw, 0.84rem); line-height: 1.4; overflow-wrap: anywhere;
}
.tlc-arcade .vm-card.is-matched .vm-front { border-color: var(--cs-amber); box-shadow: 0 0 16px rgba(240, 138, 60, 0.5); }
.tlc-arcade .vm-card.is-matched .vm-front.vm-ref { color: var(--cs-amber); }
.tlc-arcade .vm-card.is-miss .vm-front { animation: vm-shake 0.32s steps(4) 1; }
@keyframes vm-shake { 25% { translate: -3px 0; } 50% { translate: 3px 0; } 75% { translate: -2px 0; } }
.tlc-arcade .vm-card:focus-visible { outline: 2px solid var(--cs-white); outline-offset: 3px; border-radius: 6px; }

.tlc-arcade .vm-verse {
  margin: 0; min-height: 3.4em; padding-top: 12px; border-top: 1px dashed rgba(139, 92, 255, 0.4);
  font-family: var(--cs-mono); font-size: 0.8rem; line-height: 1.6; color: var(--cs-muted);
}
.tlc-arcade .vm-verse.has-verse .vm-quote { color: var(--cs-white); }
.tlc-arcade .vm-verse .vm-cite { color: var(--cs-amber); white-space: nowrap; }

/* ---------- start panel: mode picker ---------- */
.tlc-arcade .vm-modes { gap: 10px; }
.tlc-arcade .vm-mode-label { margin: 8px 0 0; font-family: var(--cs-pixel); font-size: 0.56rem; letter-spacing: 0.1em; color: var(--cs-amber); }
.tlc-arcade .vm-trial-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tlc-arcade .cs-btn.vm-alt { color: var(--cs-cyan); background: rgba(34, 230, 255, 0.06); border-color: var(--cs-cyan); box-shadow: 0 0 14px var(--cs-cyan-soft); padding: 13px 14px; }
.tlc-arcade .cs-btn.vm-alt:hover { background: rgba(34, 230, 255, 0.16); }
.tlc-arcade .vm-best-trial { margin-top: 6px; }
.tlc-arcade .vm-menu { background: none; border: 0; padding: 4px; cursor: pointer; }

/* ---------- time trial ---------- */
.tlc-arcade .vm-quiz { display: flex; flex-direction: column; gap: 14px; }
.tlc-arcade .vm-quiz[hidden], .tlc-arcade .vm-board[hidden], .tlc-arcade .vm-verse[hidden] { display: none; }
.tlc-arcade .vm-tbar { height: 8px; border: 1px solid var(--cs-cyan-soft); border-radius: 2px; overflow: hidden; }
.tlc-arcade .vm-tbar-fill { display: block; height: 100%; background: var(--cs-cyan); box-shadow: 0 0 10px var(--cs-cyan-soft); transform-origin: left center; }
.tlc-arcade .vm-tbar.is-low .vm-tbar-fill { background: var(--cs-magenta); box-shadow: 0 0 10px var(--cs-magenta-soft); }
.tlc-arcade .vm-tbar.is-hit { animation: vm-hit 0.45s steps(3) 1; }
@keyframes vm-hit { 0%, 66% { border-color: var(--cs-magenta); box-shadow: 0 0 14px var(--cs-magenta); } }
.tlc-arcade .vm-qtype { margin: 4px 0 0; font-family: var(--cs-pixel); font-size: 0.6rem; letter-spacing: 0.08em; color: var(--cs-amber); }
.tlc-arcade .vm-q {
  margin: 0; min-height: 3em; font-family: var(--cs-mono); font-size: clamp(1rem, 2.4vw, 1.3rem); line-height: 1.5;
  color: var(--cs-white); text-wrap: balance;
}
.tlc-arcade .vm-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tlc-arcade .vm-opt {
  display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 10px 14px; text-align: left; cursor: pointer;
  font-family: var(--cs-mono); font-size: 0.9rem; line-height: 1.35; color: var(--cs-white);
  background: #0B0820; border: 2px solid rgba(139, 92, 255, 0.55); border-radius: 6px;
  transition: border-color 0.15s, background 0.15s;
}
.tlc-arcade .vm-opt:hover:not([disabled]) { border-color: var(--cs-cyan); background: rgba(34, 230, 255, 0.08); }
.tlc-arcade .vm-opt:focus-visible { outline: 2px solid var(--cs-white); outline-offset: 2px; }
.tlc-arcade .vm-opt[disabled] { cursor: default; }
.tlc-arcade .vm-key { flex: none; font-family: var(--cs-pixel); font-size: 0.55rem; color: var(--cs-cyan); }
.tlc-arcade .vm-opt.is-right { border-color: var(--cs-amber); background: rgba(240, 138, 60, 0.16); box-shadow: 0 0 14px rgba(240, 138, 60, 0.4); }
.tlc-arcade .vm-opt.is-wrong { border-color: var(--cs-magenta); background: rgba(255, 62, 165, 0.16); }
.tlc-arcade .vm-qref { margin: 0; min-height: 1.6em; font-family: var(--cs-mono); font-size: 0.82rem; color: var(--cs-amber); }

/* full screen: the board scrolls inside if it is taller than the screen */
.tlc-arcade.vm-cabinet.cs-full .gm-screen { overflow-y: auto; }

@media (max-width: 640px) {
  .tlc-arcade.vm-cabinet .gm-screen { aspect-ratio: auto; min-height: 360px; }
  .tlc-arcade .vm-board { gap: 8px; }
  .tlc-arcade .vm-inner { min-height: 84px; }
  .tlc-arcade .vm-front.vm-phrase { font-size: 0.74rem; }
  .tlc-arcade .vm-front.vm-ref { font-size: 0.52rem; }
  .tlc-arcade .vm-opts { grid-template-columns: 1fr; gap: 8px; }
  .tlc-arcade .vm-opt { min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .tlc-arcade .vm-inner { transition: none; }
  .tlc-arcade .vm-card.is-miss .vm-front { animation: none; }
}
