:root {
  --bg: #120a1f;
  --panel: #1f1233;
  --text: #fff;
  --muted: #b9a9d6;
  --pink: #ff2e93;
  --cyan: #19e3ff;
  --lime: #c6ff1a;
  --yellow: #ffe600;
  --radius: 18px;
  --font-display: 'Anton', Impact, sans-serif;
  --font-body: 'Archivo Narrow', 'Arial Narrow', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 46, 147, .25), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(25, 227, 255, .2), transparent 45%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  -webkit-tap-highlight-color: transparent;
}

.app { max-width: 1100px; margin: 0 auto; padding: 16px 16px 48px; }

/* Viršus */
.top { display: flex; align-items: center; gap: 24px; margin-bottom: 24px; }
.logo { font-family: var(--font-display); font-size: 28px; letter-spacing: 1px; text-transform: uppercase; }
.logo b { color: var(--pink); margin-left: 4px; }
.progress { flex: 1; height: 8px; background: var(--panel); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--cyan)); transition: width .4s; }

/* Žingsniai */
.step { display: none; animation: pop .35s ease; }
.step.is-active { display: block; }
@keyframes pop { from { opacity: 0; transform: translateY(12px); } }

.step--intro { text-align: center; padding: 10vh 0; }
.step--intro h1 {
  font-family: var(--font-display); font-size: clamp(40px, 8vw, 84px); line-height: 1;
  margin: 0 0 16px; text-transform: uppercase;
  text-shadow: 4px 4px 0 var(--pink), 8px 8px 0 var(--cyan);
}
.step--intro p { color: var(--muted); font-size: 22px; margin-bottom: 40px; }

.step__count { color: var(--cyan); font-weight: 700; letter-spacing: 2px; }
.step h2 { font-family: var(--font-display); font-size: clamp(30px, 5vw, 48px); font-weight: 400; margin: 4px 0 24px; text-transform: uppercase; }

/* Plytelės */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 120px; padding: 12px; border: 2px solid transparent; border-radius: var(--radius);
  background: var(--panel); color: var(--text); font: inherit; font-weight: 700; text-align: center;
  cursor: pointer; transition: transform .15s, border-color .15s, background .15s;
}
.tile:active { transform: scale(.96); }
.tile__emoji { font-size: 40px; line-height: 1; }
.tile--alt { background: transparent; border: 2px dashed #4a3570; color: var(--muted); }
.tile.is-selected { border-color: var(--pink); background: #3a1650; transform: scale(1.03); }
.tile.is-rolled { animation: roll .6s; }
@keyframes roll { 30% { transform: rotate(-6deg) scale(1.08); } 60% { transform: rotate(6deg) scale(1.08); } }

.custom { display: flex; gap: 12px; margin-top: 16px; }
.custom input {
  flex: 1; min-width: 0; padding: 16px 18px; border-radius: var(--radius); border: 2px solid #4a3570;
  background: var(--panel); color: var(--text); font: inherit;
}
.custom--name { max-width: 420px; margin: 0 0 20px; }
.custom input:focus { outline: none; border-color: var(--cyan); }

/* Mygtukai */
.btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 16px 28px;
  border: 0; border-radius: 99px; background: var(--pink); color: #fff; font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; box-shadow: 0 6px 0 #a3105a;
}
.btn:active { transform: translateY(3px); box-shadow: 0 3px 0 #a3105a; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn--big { font-family: var(--font-display); font-weight: 400; font-size: 28px; padding: 18px 48px; text-transform: uppercase; letter-spacing: 1px; }
.btn--ghost { background: transparent; border: 2px solid var(--muted); box-shadow: none; }
.link { display: block; margin-top: 24px; background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 8px 0; }

/* Nuotrauka */
.photo {
  display: grid; place-items: center; width: min(100%, 420px); aspect-ratio: 3 / 4; margin-bottom: 20px;
  border: 3px dashed #4a3570; border-radius: var(--radius); background: var(--panel);
  color: var(--muted); text-align: center; cursor: pointer; overflow: hidden;
}
.photo { position: relative; cursor: default; margin-bottom: 16px; }
.photo img, .photo__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo__video { transform: scaleX(-1); } /* veidrodinis vaizdas, kaip įprasta asmenukėms */
.photo__count {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 1;
  font-family: var(--font-display); font-size: 140px; color: #fff; text-shadow: 6px 6px 0 var(--pink);
}
.photo-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.photo-actions .btn { cursor: pointer; }
.consent { display: flex; gap: 12px; align-items: flex-start; max-width: 600px; margin-bottom: 24px; color: var(--muted); }
.consent input { width: 24px; height: 24px; flex: none; accent-color: var(--pink); }
.hint { color: var(--muted); margin: -12px 0 16px; }
.error { color: #ff6b6b; font-weight: 700; }

/* Rezultatas */
.step--result { text-align: center; }
.status { font-family: var(--font-display); font-size: 26px; text-transform: uppercase; color: var(--lime); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }

/* ===== Kortelė ===== */
.card {
  position: relative; width: min(100%, 560px); aspect-ratio: 2 / 3; margin: 0 auto;
  container-type: inline-size; overflow: hidden; border-radius: 6px; background: #000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6); text-align: left;
}
.card::after { /* VHS eilutės */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .12) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.card__photo { position: absolute; inset: 0; }
.card__hero { /* permatomas herojus ant fono; neskaidri nuotrauka užpildo visą kortelę */
  position: absolute; left: 0; top: 0; width: 100%; height: 72%; object-fit: contain; object-position: center bottom;
}
.card__hero { filter: drop-shadow(0 0 3cqw rgba(0, 0, 0, .45)); }
.card__hero--full { height: 100%; object-fit: cover; object-position: center top; filter: none; }
.card__backdrop { /* vietoj nuotraukos: TV studijos fonas su verslo srities emoji */
  position: absolute; inset: 0; display: grid; place-items: center;
  background:
    repeating-conic-gradient(from 0deg at 50% 32%, rgba(255, 255, 255, .07) 0 10deg, transparent 10deg 20deg),
    radial-gradient(circle at 50% 32%, #ff4f8b, #9b0048 40%, #1a0010 80%);
}
.card__backdrop span { font-size: 40cqw; line-height: 1; margin-top: -38cqw; filter: drop-shadow(1.5cqw 1.5cqw 0 rgba(0, 0, 0, .35)); }
.card__loading {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4cqw;
  background: linear-gradient(160deg, #2b1147, #0b2940); color: var(--muted); font-size: 4cqw;
}
.spinner { width: 14cqw; height: 14cqw; border: 1.6cqw solid rgba(255, 255, 255, .15); border-top-color: var(--pink); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.card__brand {
  position: absolute; z-index: 2; color: #fff; font-family: 'Courier New', monospace; font-weight: 700;
  font-size: 3.6cqw; text-shadow: 0 0 .6cqw #000, 0 0 .6cqw #000;
}
.card__brand { top: 4cqw; right: 5cqw; font-family: var(--font-display); font-weight: 400; font-size: 5cqw; text-transform: uppercase; }
.card__brand b { color: var(--yellow); font-weight: 400; margin-left: 1cqw; }

.card__panel { /* blizgi informacijos panelė apačioje */
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 6cqw 6cqw 7cqw;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .22), transparent 30%),
    linear-gradient(135deg, #e0003c, #b0006d 55%, #2a0017);
  clip-path: polygon(0 9cqw, 100% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 1cqw 0 rgba(255, 255, 255, .35);
}
.card__panel::before { /* halftone taškai */
  content: ''; position: absolute; inset: 0; opacity: .18; pointer-events: none;
  background: radial-gradient(circle, #000 25%, transparent 26%) 0 0 / 2.4cqw 2.4cqw;
}
.card__name {
  position: relative; margin-top: 3cqw; font-family: var(--font-display); font-size: 11cqw; line-height: 1;
  text-transform: uppercase; color: #fff; text-shadow: .7cqw .7cqw 0 #000, 0 0 4cqw rgba(255, 255, 255, .45);
  opacity: 0; transform: translateX(-10cqw);
}
.card__age { color: var(--yellow); }
.card__facts { position: relative; margin: 3.5cqw 0 0; padding: 0; list-style: none; }
.card__facts li {
  position: relative; margin-top: 2cqw; padding-left: 7cqw; color: #fff; font-weight: 700;
  font-size: 5cqw; line-height: 1.15; text-shadow: .4cqw .4cqw 0 rgba(0, 0, 0, .6);
  opacity: 0; transform: translateX(8cqw);
}
.card__facts li::before {
  content: ''; position: absolute; left: 0; top: .9cqw; width: 3.6cqw; height: 3.6cqw;
  background: var(--yellow); transform: rotate(45deg); box-shadow: .5cqw .5cqw 0 #000;
}

/* Vardas ir eilutės išslenka po vieną, kaip laidoje */
.is-revealed .card__name, .result-page .card__name,
.is-revealed .card__facts li, .result-page .card__facts li { animation: slide-in .45s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.is-revealed .card__facts li:nth-child(1), .result-page .card__facts li:nth-child(1) { animation-delay: .7s; }
.is-revealed .card__facts li:nth-child(2), .result-page .card__facts li:nth-child(2) { animation-delay: 1.3s; }
.is-revealed .card__facts li:nth-child(3), .result-page .card__facts li:nth-child(3) { animation-delay: 1.9s; }
.is-revealed .card__facts li:nth-child(4), .result-page .card__facts li:nth-child(4) { animation-delay: 2.5s; }
.card__nick b { color: var(--yellow); }
.card__nick b::before { content: '„'; }
.card__nick b::after { content: '“'; }
@keyframes slide-in { to { opacity: 1; transform: none; } }

.debug {
  width: min(100%, 560px); margin: 20px auto 0; padding: 12px 16px; border: 1px dashed #4a3570;
  border-radius: 12px; color: var(--muted); font-size: 15px; line-height: 1.45; text-align: left;
}
.debug summary { cursor: pointer; font-weight: 700; color: var(--cyan); }
.debug p { margin: 8px 0 0; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

/* Galerija */
a.logo { color: inherit; text-decoration: none; }
.gallery__count { margin-left: auto; color: var(--muted); font-weight: 700; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.gallery__item { display: block; color: var(--muted); text-decoration: none; transition: transform .15s; }
.gallery__item:hover { transform: translateY(-4px); }
.gallery__item .card { width: 100%; }
.gallery .card__name, .gallery .card__facts li { opacity: 1; transform: none; }
.gallery__date { display: block; margin-top: 8px; font-size: 14px; text-align: center; }

.result-page { display: grid; place-content: center; padding: 16px; }
