/* Styles for BASTA. Reuses the shared tokens from styles.css. */

.basta-subtitle { font-size: 20px; }

.basta-letter-picker { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.basta-letter-toggle {
  appearance: none;
  font: inherit;
  font-weight: 800;
  font-size: 16px;
  padding: 10px 0;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: line-through;
}
.basta-letter-toggle.on { background: rgba(255, 210, 63, 0.16); border-color: var(--accent); color: var(--text); text-decoration: none; }
.basta-letter-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Deck with a flipping top card */
.basta-deck { position: relative; height: 260px; display: grid; place-items: center; }
.basta-card-stack, .basta-card {
  position: absolute;
  width: 190px;
  height: 250px;
  border-radius: 20px;
}
.basta-card-stack { background: linear-gradient(145deg, #5b1a7a, #7a1a3f); border: 1px solid var(--card-border); }
.basta-card-stack:nth-child(1) { transform: rotate(-7deg) translate(-8px, 6px); }
.basta-card-stack:nth-child(2) { transform: rotate(5deg) translate(8px, 4px); }
.basta-card { border: 0; padding: 0; background: none; perspective: 900px; cursor: pointer; font: inherit; color: var(--text); }
.basta-card-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.basta-card.flipped .basta-card-inner { transform: rotateY(180deg); }
.basta-card-face {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  text-align: center;
}
.basta-card-back {
  font-size: 64px;
  background: repeating-linear-gradient(45deg, #ff3d6e 0 14px, #c41845 14px 28px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.basta-card-front {
  transform: rotateY(180deg);
  background: #fff7fb;
  color: #2a0b1d;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.basta-card-front small { text-transform: uppercase; letter-spacing: 1px; font-weight: 800; color: #a3326a; }
.basta-card-front strong { font-size: 26px; line-height: 1.15; font-weight: 900; text-wrap: balance; }

/* Category banner and turn */
.basta-category { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 16px; background: #fff7fb; color: #2a0b1d; }
.basta-category small { text-transform: uppercase; letter-spacing: 1px; font-weight: 800; font-size: 12px; color: #a3326a; }
.basta-category strong { font-size: 22px; font-weight: 900; }
.basta-turn { text-align: center; font-size: 18px; color: var(--muted); }
.basta-turn strong { color: var(--accent); font-size: 24px; }
.basta-status { text-align: center; color: var(--muted); font-weight: 600; }
.basta-used { text-align: center; color: var(--muted); font-size: 14px; }

/* Letter wheel */
.basta-wheel-wrap { --basta-radius: 104px; position: relative; width: 260px; height: 260px; margin: 0 auto; max-width: 100%; }
.basta-pointer { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); color: var(--accent); font-size: 26px; z-index: 2; }
.basta-wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #5b1a7a, #a632ff, #ff3d6e, #ffd23f, #22d17a, #5b1a7a);
  box-shadow: inset 0 0 0 10px rgba(20, 7, 31, 0.55), 0 10px 30px rgba(0, 0, 0, 0.35);
}
.basta-wheel::after { content: ""; position: absolute; inset: 70px; border-radius: 50%; background: var(--bg); }
.basta-wheel-letter {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 17px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Big letter and timer */
.basta-letter-row { display: flex; align-items: center; justify-content: center; gap: 24px; }
.basta-letter {
  width: 130px;
  height: 130px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  font-size: 88px;
  font-weight: 900;
  color: #2a0b1d;
  background: linear-gradient(145deg, #ffd23f, #ff9a3d);
  box-shadow: 0 12px 30px rgba(255, 154, 61, 0.35);
  animation: basta-pop 0.35s ease-out;
}
.basta-timer { position: relative; width: 120px; height: 120px; }
.basta-timer-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.basta-timer-track { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 10; }
.basta-timer-fill { fill: none; stroke: var(--da); stroke-width: 10; stroke-linecap: round; transition: stroke 0.2s; }
.basta-seconds { position: absolute; inset: 0; display: grid; place-items: center; font-size: 46px; font-weight: 900; font-variant-numeric: tabular-nums; }
.basta-timer.warning .basta-timer-fill { stroke: var(--no-da); }
.basta-timer.warning .basta-seconds { color: var(--no-da); animation: basta-pulse 0.5s ease-in-out infinite alternate; }

.basta-pass {
  min-height: 84px;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 2px;
  border: 0;
  background: linear-gradient(160deg, var(--da), var(--da-dark));
  box-shadow: 0 10px 28px rgba(34, 209, 122, 0.35);
}

/* Round results and stats */
.basta-result { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding-top: 16px; }
.basta-result .emoji { font-size: 64px; animation: basta-pop 0.45s ease-out; }
.basta-lost .title { color: var(--no-da); font-size: 40px; }
.basta-won .title { color: var(--da); font-size: 34px; }
.basta-result .who { font-size: clamp(30px, 9vw, 42px); font-weight: 900; color: var(--accent); word-break: break-word; }

.basta-stats { overflow-x: auto; }
.basta-stats table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.basta-stats th, .basta-stats td { padding: 8px 6px; text-align: right; }
.basta-stats thead th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.basta-stats tbody th, .basta-stats thead th:first-child { text-align: left; }
.basta-stats tbody tr + tr { border-top: 1px solid var(--card-border); }

@keyframes basta-pop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes basta-pulse { from { transform: scale(1); } to { transform: scale(1.15); } }

@media (prefers-reduced-motion: reduce) {
  .basta-card-inner, .basta-wheel { transition: none !important; }
  .basta-letter, .basta-result .emoji, .basta-timer.warning .basta-seconds { animation: none; }
}

/* Smaller wheel on the turn screen so PASAR stays above the fold on phones */
.basta-wheel-wrap.small { --basta-radius: 74px; width: 190px; height: 190px; }
.basta-wheel-wrap.small .basta-wheel::after { inset: 48px; }
.basta-wheel-wrap.small .basta-wheel-letter { font-size: 14px; width: 26px; height: 26px; margin: -13px 0 0 -13px; }
