/* ============================================================
   tap-select.css — All styles for tap_select interaction
   Covers: grid, fruit ninja, tap & collect, fishing
   ============================================================ */

/* ── Grid style ──────────────────────────────────────────────── */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(180px, 30vw), 1fr));
  gap: 10px;
}
.tap-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px; gap: 6px;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.13);
  border-radius: 14px; cursor: pointer;
  transition: all 0.18s; position: relative;
  user-select: none; touch-action: manipulation;
}
@media (hover: hover) {
  .tap-card:hover { background: rgba(255,255,255,0.13); border-color: rgba(0,201,177,0.4); }
}
.tap-card.selected {
  background: rgba(0,201,177,0.15);
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(0,201,177,0.20);
}
.tap-card img { width: 100%; height: clamp(90px, 18vh, 160px); object-fit: cover; border-radius: 10px; }
.tap-card .card-label { font-size: 13px; font-weight: 600; color: white; text-align: center; }
.tap-card .check {
  position: absolute; top: 6px; right: 6px;
  width: 18px; height: 18px;
  background: var(--teal); border-radius: 50%;
  display: none; align-items: center; justify-content: center; font-size: 10px;
}
.tap-card.selected .check { display: flex; }

/* ── Shared: instructions overlay ───────────────────────────── */

.ninja-instructions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 200px;
  cursor: pointer;
  border-radius: 12px;
  border: 1.5px dashed rgba(0,201,177,0.3);
  background: rgba(0,201,177,0.04);
}
.ninja-instructions-title {
  font-size: 18px; font-weight: 800; color: white;
}
.ninja-instructions-sub {
  font-size: 12px; color: rgba(255,255,255,0.55);
  text-align: center; max-width: 220px; line-height: 1.5;
}
.ninja-instructions-tap {
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--teal); margin-top: 4px;
  animation: pulse 1.5s ease-in-out infinite;
}
.ninja-slash-demo {
  font-size: 36px;
  animation: ninja-wobble 1s ease-in-out infinite alternate;
}
@keyframes ninja-wobble {
  0%   { transform: rotate(-15deg) scale(1);   }
  100% { transform: rotate(15deg)  scale(1.15); }
}

/* ── Shared: collected tray ──────────────────────────────────── */

.ninja-tray {
  display: flex; flex-wrap: wrap; gap: 5px;
  justify-content: center; padding: 4px 8px;
  min-height: 28px; flex-shrink: 0;
}
.ninja-tray-item {
  display: flex; align-items: center; gap: 4px;
  background: rgba(0,201,177,0.15);
  border: 1px solid rgba(0,201,177,0.4);
  border-radius: 16px; padding: 3px 8px 3px 5px;
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,0.9);
  animation: tray-pop 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.ninja-tray-item img { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; }
.ninja-tray-item-emoji { font-size: 13px; line-height: 1; }

@keyframes tray-pop {
  0%   { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

/* ── Shared: HUD ─────────────────────────────────────────────── */

.ninja-hud {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 4px 8px 2px; flex-shrink: 0;
}
.ninja-counter {
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}
.ninja-replay {
  font-size: 11px; font-weight: 700;
  color: var(--teal); background: none;
  border: 1px solid rgba(0,201,177,0.35);
  border-radius: 12px; padding: 3px 10px;
  cursor: pointer; transition: all 0.15s; display: none;
}
.ninja-replay:hover { background: rgba(0,201,177,0.12); }
.ninja-replay.visible { display: inline-block; }

/* ── Fruit Ninja ─────────────────────────────────────────────── */

.ninja-wrap {
  position: relative; width: 100%; height: 780px;
  overflow: visible; display: flex; flex-direction: column;
}
.ninja-arena {
  position: relative; width: 100%; height: 700px; overflow: visible;
}
.ninja-fruit {
  position: absolute; display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  cursor: crosshair; user-select: none;
  touch-action: none; pointer-events: auto; z-index: 5;
}
.ninja-fruit-inner {
  width: 300px; height: 300px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
  transition: border-color 0.1s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.ninja-fruit-inner img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ninja-fruit-emoji { font-size: 110px; line-height: 1; }
.ninja-fruit-label {
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,0.9); text-align: center;
  max-width: 72px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.ninja-fruit.sliced .ninja-fruit-inner {
  border-color: var(--teal);
  box-shadow: 0 0 18px rgba(0,201,177,0.7), 0 4px 16px rgba(0,0,0,0.4);
  animation: fruit-slice-flash 0.2s ease-out;
}
@keyframes fruit-slice-flash {
  0%   { transform: scale(1.4); background: rgba(0,201,177,0.4); }
  100% { transform: scale(1);   background: rgba(255,255,255,0.08); }
}
.ninja-slash-trail {
  position: absolute; pointer-events: none; z-index: 10;
  border-radius: 2px; height: 3px; transform-origin: left center;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 50%, rgba(0,201,177,0.6) 100%);
  animation: slash-fade 0.35s ease-out forwards;
}
@keyframes slash-fade {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}
.ninja-splat {
  position: absolute; pointer-events: none; z-index: 9;
  border-radius: 50%;
  animation: splat-out 0.5s ease-out forwards;
}
@keyframes splat-out {
  0%   { transform: scale(0); opacity: 0.9; }
  60%  { transform: scale(1.4); opacity: 0.6; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ── Tap & Collect ───────────────────────────────────────────── */

.collect-wrap {
  position: relative; width: 100%;
  display: flex; flex-direction: column; gap: 8px;
}
.collect-game {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; padding: 8px 0;
}
.collect-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; user-select: none;
  transition: transform 0.15s, opacity 0.15s;
}
@media (hover: hover) {
  .collect-card:hover { transform: scale(1.06); }
}
.collect-card.collected { opacity: 0.3; pointer-events: none; }
.collect-card-inner {
  width: 170px; height: 170px; border-radius: 20px;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.collect-card-inner img { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; }
.collect-card-emoji { font-size: 72px; line-height: 1; }
.collect-card-label {
  font-size: 12px; font-weight: 700;
  color: rgba(255,255,255,0.85); text-align: center;
  max-width: 170px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.collect-basket {
  display: flex; align-items: center; gap: 6px;
  justify-content: flex-end; padding: 0 12px;
}
.collect-basket-icon {
  font-size: 28px; line-height: 1;
  transition: transform 0.2s;
}
.collect-basket-icon.collect-basket-bounce {
  animation: basket-bounce 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes basket-bounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4) rotate(-10deg); }
  70%  { transform: scale(0.9) rotate(5deg); }
  100% { transform: scale(1); }
}
.collect-basket-count {
  font-size: 18px; font-weight: 800; color: var(--teal);
  min-width: 24px;
}

/* ── Fishing ─────────────────────────────────────────────────── */

.fish-wrap {
  position: relative; width: 100%;
  display: flex; flex-direction: column; gap: 4px;
}
.fish-river {
  position: relative; width: 100%; height: 400px;
  overflow: hidden; border-radius: 12px;
  background: linear-gradient(180deg, rgba(0,60,120,0.4) 0%, rgba(0,40,90,0.6) 100%);
  border: 1px solid rgba(0,100,200,0.3);
}
.fish-river::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    90deg,
    rgba(255,255,255,0.02) 0px,
    rgba(255,255,255,0.02) 1px,
    transparent 1px,
    transparent 40px
  );
  animation: river-flow 3s linear infinite;
  pointer-events: none;
}
@keyframes river-flow {
  0%   { background-position: 0 0; }
  100% { background-position: 40px 0; }
}
.fish-item {
  position: absolute; display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  cursor: pointer; user-select: none; touch-action: none;
  z-index: 5;
}
.fish-item-inner {
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.fish-item-inner:hover { border-color: var(--teal); box-shadow: 0 0 16px rgba(0,201,177,0.5); }
.fish-item-inner img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.fish-emoji { font-size: 90px; line-height: 1; }
.fish-label {
  font-size: 12px; font-weight: 700;
  color: rgba(255,255,255,0.95); text-align: center;
  max-width: 200px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  margin-top: 4px;
}
.fish-item.fish-caught .fish-item-inner {
  border-color: var(--teal);
  box-shadow: 0 0 20px rgba(0,201,177,0.8);
  animation: fish-catch-flash 0.4s ease-out;
}
@keyframes fish-catch-flash {
  0%   { transform: scale(1.5); background: rgba(0,201,177,0.5); }
  100% { transform: scale(1);   background: rgba(255,255,255,0.1); }
}

/* ── The Lineup ──────────────────────────────────────────────── */

.lineup-wrap {
  position: relative; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding-bottom: 4px;
}

.lineup-counter {
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: rgba(255,255,255,0.35);
}

/* Stage — clips to show only center + peeking sides */
.lineup-stage {
  width: 100%;
  overflow: hidden;
  position: relative;
  height: 240px;
}

/* Scrolling flex row — JS sets transform to slide */
.lineup-track {
  display: flex;
  align-items: center;
  height: 100%;
  transition: transform 0.38s cubic-bezier(0.34,1.1,0.64,1);
  will-change: transform;
  padding: 0;
}

/* ── Card ── */
.lineup-card {
  flex: 0 0 220px;
  width: 220px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
  transition: transform 0.35s cubic-bezier(0.34,1.1,0.64,1),
              opacity   0.35s ease,
              filter    0.35s ease;
  transform: scale(0.78);
  opacity: 0.45;
  padding: 0 8px;
}

.lineup-card-face {
  width: 100%; height: 200px;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.lineup-card-face img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.lineup-card-emoji    { font-size: clamp(36px, 10vw, 64px); line-height: 1; }

.lineup-card-label {
  font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.7);
  text-align: center; width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 4px;
}

/* Center card — full size, lit */
.lineup-card.lineup-center {
  transform: scale(1);
  opacity: 1; z-index: 3;
}
.lineup-card.lineup-center .lineup-card-face {
  border-color: rgba(0,201,177,0.5);
  box-shadow: 0 0 0 3px rgba(0,201,177,0.2), 0 8px 32px rgba(0,0,0,0.6);
}
.lineup-card.lineup-center .lineup-card-label {
  color: rgba(255,255,255,0.9);
}

/* ── Arrows ── */
.lineup-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: 1.5px solid rgba(255,255,255,0.2);
  color: white; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, opacity 0.15s; z-index: 10;
}
.lineup-arrow:hover  { background: rgba(255,255,255,0.2); }
.lineup-arrow:disabled { opacity: 0.2; cursor: default; }
.lineup-arrow-left  { left: 4px; }
.lineup-arrow-right { right: 4px; }

/* ── Hint label ── */
.lineup-hint {
  font-size: 11px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: rgba(255,255,255,0.35);
  text-align: center; animation: pulse 2s ease-in-out infinite;
}

/* ── Change link ── */
.lineup-change-link {
  background: none; border: none; cursor: pointer;
  font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,0.4); text-align: center;
  text-decoration: underline; padding: 0;
  transition: color 0.15s;
}
.lineup-change-link:hover { color: rgba(255,255,255,0.7); }

/* Animation picker was removed — celebration style is configured in admin, not shown to respondent */

/* ── Tap & Speak per-option layout ──────────────────────────────────────── */

.ts-per-option {
  display: flex; flex-direction: column; gap: 8px; width: 100%;
}
.ts-option-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 8px 10px;
}
.ts-option-label {
  display: flex; align-items: center; gap: 7px;
  min-width: 100px; max-width: 130px; flex-shrink: 0;
}
.ts-option-img {
  width: 34px; height: 34px; object-fit: contain; flex-shrink: 0;
  border-radius: 8px; background: rgba(255,255,255,0.08);
}
.ts-option-ph {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: rgba(255,255,255,0.5);
}
.ts-option-text {
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.85);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3;
}
.ts-input-wrap {
  flex: 1; display: flex; align-items: flex-start; gap: 7px; min-width: 0;
}
.ts-text-input {
  flex: 1; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 9px; padding: 7px 10px;
  color: white; font-size: 13px; font-family: var(--font);
  resize: none; outline: none;
  transition: border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 38px;
}
.ts-text-input:focus { border-color: rgba(0,201,177,0.5); }
.ts-text-input::placeholder { color: rgba(255,255,255,0.28); }
.ts-mic-btn {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.15);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: background 0.13s ease, border-color 0.13s ease;
  -webkit-tap-highlight-color: transparent;
}
.ts-mic-btn:hover { background: rgba(255,255,255,0.14); }
.ts-mic-btn.ts-recording {
  background: rgba(231,76,60,0.25);
  border-color: rgba(231,76,60,0.6);
  animation: ts-pulse 1s ease-in-out infinite;
}
@keyframes ts-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(231,76,60,0); }
}
.ts-empty {
  color: rgba(255,255,255,0.35); font-size: 13px;
  text-align: center; padding: 20px 0; font-style: italic;
}

/* ── Anim A: The Lineup (police) ── */
.lineup-anim-bw {
  filter: grayscale(1) brightness(0.35) !important;
  transition: filter 0.5s ease !important;
}
.lineup-anim-spotlight .lineup-card-face {
  box-shadow: 0 0 0 4px rgba(0,201,177,0.6), 0 0 60px rgba(0,201,177,0.3), 0 8px 32px rgba(0,0,0,0.8) !important;
  border-color: var(--teal) !important;
}
.lineup-stamp {
  position: absolute; top: 30%; left: 50%; transform: translateX(-50%) rotate(-18deg) scale(3);
  font-size: 22px; font-weight: 900; letter-spacing: 4px;
  color: rgba(0,201,177,0.95); border: 4px solid rgba(0,201,177,0.9);
  border-radius: 6px; padding: 4px 10px;
  opacity: 0; pointer-events: none; z-index: 20;
  transition: transform 0.25s cubic-bezier(0.34,1.2,0.64,1), opacity 0.15s;
}
.lineup-stamp.lineup-stamp-slam {
  transform: translateX(-50%) rotate(-18deg) scale(1);
  opacity: 1;
}

/* ── Anim B: Crown Drop ── */
.lineup-anim-bow {
  animation: lineup-bow 0.6s ease-out forwards !important;
}
@keyframes lineup-bow {
  0%   { transform: translateX(var(--tx,0)) scale(var(--sc,0.78)) rotate(0deg); }
  50%  { transform: translateX(var(--tx,0)) scale(var(--sc,0.78)) rotate(8deg); }
  100% { transform: translateX(var(--tx,0)) scale(calc(var(--sc,0.78)*0.85)) rotate(5deg); opacity: 0.25; }
}
.lineup-crown {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%) translateY(-60px) scale(0.5);
  font-size: 48px; line-height: 1; pointer-events: none; z-index: 20;
  opacity: 0; transition: transform 0.5s cubic-bezier(0.34,1.4,0.64,1), opacity 0.2s;
}
.lineup-crown.lineup-crown-drop {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
}
.lineup-confetti {
  position: absolute; border-radius: 2px; pointer-events: none; z-index: 21;
  animation: lineup-confetti-fall 1.4s ease-out forwards;
}
@keyframes lineup-confetti-fall {
  0%   { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(180px) rotate(720deg); opacity: 0; }
}

/* ── Anim C: Hall of Fame ── */
.lineup-anim-slideoff {
  animation: lineup-slideoff 0.55s ease-in forwards !important;
}
@keyframes lineup-slideoff {
  0%   { opacity: var(--op, 0.45); }
  100% { opacity: 0; transform: translateX(var(--tx,200px)) scale(0.5); }
}
.lineup-anim-pedestal {
  animation: lineup-pedestal 0.7s cubic-bezier(0.34,1.2,0.64,1) forwards !important;
}
@keyframes lineup-pedestal {
  0%   { transform: translateX(0) scale(1); }
  40%  { transform: translateX(0) scale(1.12); }
  100% { transform: translateX(0) scale(1.08); }
}
.lineup-anim-pedestal .lineup-card-face {
  border-color: #FFD700 !important;
  box-shadow: 0 0 0 3px rgba(255,215,0,0.4), 0 0 50px rgba(255,215,0,0.25), 0 8px 32px rgba(0,0,0,0.7) !important;
}
.lineup-trophy {
  position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%) translateY(40px) scale(0.3);
  font-size: 40px; line-height: 1; pointer-events: none; z-index: 20;
  opacity: 0; transition: transform 0.6s cubic-bezier(0.34,1.4,0.64,1), opacity 0.25s;
}
.lineup-trophy.lineup-trophy-rise {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
}
