/* Seashell scratch engine (sv-sc-). Uses the site tokens from style.css. */

.sv-sc {
  container-type: inline-size;
  width: 100%;
  max-width: 470px;
}

.sv-sc-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* The ticket: sand-coloured card with a scalloped sea-blue rim */
.sv-sc-ticket {
  --sand: #fbf0d9;
  position: relative;
  display: grid;
  gap: clamp(8px, 2.2cqw, 14px);
  padding: clamp(14px, 4cqw, 24px);
  border-radius: 22px;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255, 255, 255, 0.7), transparent 60%),
    repeating-linear-gradient(135deg, rgba(222, 196, 150, 0.16) 0 6px, transparent 6px 14px),
    var(--sand);
  color: #20214a;
  box-shadow: 0 0 0 6px #3f43c9, 0 0 0 9px #f6f7fb, 0 0 0 12px rgba(6, 7, 25, 0.35), 0 24px 48px rgba(0, 0, 0, 0.5);
  margin: 12px;
}

.sv-sc-ticket.is-fresh { animation: sv-sc-deal 420ms var(--sv-ease-out); }

@keyframes sv-sc-deal {
  from { transform: translateY(14px) rotate(-1.5deg) scale(0.97); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}

.sv-sc-head { text-align: center; }

.sv-sc-title {
  margin: 0;
  font-family: var(--sv-font-display);
  font-size: clamp(22px, 6cqw, 30px);
  font-weight: 900;
  color: #0f117c;
  letter-spacing: -0.01em;
}

.sv-sc-sub {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c48e3c;
}

/* Pay key */
.sv-sc-key {
  list-style: none;
  margin: 0;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  border-radius: 14px;
  background: rgba(15, 17, 124, 0.08);
}

.sv-sc-key__item {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 4px 2px;
  border-radius: 10px;
  transition: background-color var(--sv-fast) var(--sv-ease-out), transform var(--sv-fast) var(--sv-ease-out);
}

.sv-sc-key__sym { width: clamp(26px, 7.5cqw, 38px); height: auto; }

.sv-sc-key__mult {
  font-family: var(--sv-font-display);
  font-size: 13px;
  font-weight: 900;
  color: #20214a;
  font-variant-numeric: tabular-nums;
}

.sv-sc-key__item.is-lit { background: #ffcf5a; transform: scale(1.06); box-shadow: 0 4px 14px rgba(196, 140, 20, 0.35); }

/* Play area: symbols under a canvas foil */
.sv-sc-play { position: relative; }

.sv-sc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 2cqw, 12px);
}

.sv-sc-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 40%, #ffffff, #f3e4c4);
  box-shadow: inset 0 0 0 2px rgba(15, 17, 124, 0.18), inset 0 -6px 12px rgba(190, 150, 90, 0.18);
  transition: opacity var(--sv-med) var(--sv-ease-out), box-shadow var(--sv-med) var(--sv-ease-out);
}

.sv-sc-sym { width: 74%; height: 74%; }
.sv-sc-cell.is-open .sv-sc-sym { animation: sv-sc-pop 360ms var(--sv-ease-out); }
.sv-sc-cell.is-dim { opacity: 0.7; }

.sv-sc-cell.is-match {
  box-shadow: inset 0 0 0 3px #ffcf5a, 0 0 0 3px rgba(255, 207, 90, 0.5), 0 0 26px rgba(255, 207, 90, 0.75);
  background: radial-gradient(circle at 50% 40%, #fffdf2, #ffe7a3);
}

.sv-sc-cell.is-match .sv-sc-sym { animation: sv-sc-wiggle 700ms var(--sv-ease-out) 2; }

@keyframes sv-sc-pop {
  0% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes sv-sc-wiggle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-7deg) scale(1.08); }
  60% { transform: rotate(6deg) scale(1.08); }
}

.sv-sc-foil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  touch-action: pan-y;
}

.sv-sc.is-open .sv-sc-foil { touch-action: none; cursor: crosshair; }

.sv-sc-cover {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: 0;
  width: max-content;
  max-width: 86%;
  padding: 10px 16px;
  border-radius: var(--sv-r-pill);
  background: rgba(6, 7, 25, 0.86);
  color: var(--sv-ink);
  font-family: var(--sv-font-display);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity var(--sv-med) var(--sv-ease-out), transform var(--sv-med) var(--sv-ease-out);
}

.sv-sc.is-open .sv-sc-cover,
.sv-sc.is-done .sv-sc-cover { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }

.sv-sc-banner {
  position: absolute;
  left: 50%;
  bottom: -14px;
  padding: 8px 18px;
  border-radius: var(--sv-r-pill);
  background: linear-gradient(180deg, #ffe08a, #f4b73a);
  color: var(--sv-on-gold);
  font-family: var(--sv-font-display);
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 8px) scale(0.95);
  transition: opacity var(--sv-med) var(--sv-ease-out), transform var(--sv-med) var(--sv-ease-out);
}

.sv-sc-banner.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.sv-sc-banner.is-flat { background: #20214a; color: #f2f6fb; font-size: 14px; }

.sv-sc-foot {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
  color: #5b5e7c;
}

@container (max-width: 400px) {
  .sv-sc-key { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sv-sc-key__item { grid-template-columns: auto auto; align-items: center; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .sv-sc-ticket.is-fresh,
  .sv-sc-cell.is-open .sv-sc-sym,
  .sv-sc-cell.is-match .sv-sc-sym { animation: none; }
}
