:root{
  --bg:#0b0b12;
  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.7);
  --accent:#ff4d8d;
  --accent2:#ffcf5a;
  --ok:#3ddc97;
  --bad:#ff6b6b;
  --shadow:0 18px 60px rgba(0,0,0,.45);
  --radius:22px;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;
  color:var(--text);
  background:
    radial-gradient(900px 400px at 18% 10%, rgba(255,77,141,.22), transparent 55%),
    radial-gradient(700px 380px at 80% 14%, rgba(255,207,90,.18), transparent 55%),
    radial-gradient(700px 380px at 60% 90%, rgba(61,220,151,.12), transparent 55%),
    var(--bg);
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:18px;
}

.wrap{width:min(980px,100%);display:grid;gap:16px}

header{
  display:flex;align-items:flex-start;justify-content:space-between;gap:12px;
  padding:18px 20px;
  background:linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  border:1px solid rgba(255,255,255,.12);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

.title{display:flex;flex-direction:column;gap:6px}
.title h1{margin:0;font-size:clamp(20px,4vw,32px);letter-spacing:-.02em}
.title p{margin:0;color:var(--muted);line-height:1.4;font-size:14px}

.badge{
  padding:10px 12px;border-radius:999px;
  background:rgba(255,77,141,.14);
  border:1px solid rgba(255,77,141,.35);
  color:rgba(255,255,255,.92);
  font-weight:650;font-size:13px;white-space:nowrap;
  display:flex;align-items:center;gap:8px
}

.grid{display:grid;grid-template-columns:1.1fr .9fr;gap:16px}
@media(max-width:860px){.grid{grid-template-columns:1fr}}

.card{
  background:linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.05));
  border:1px solid rgba(255,255,255,.12);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden
}
.cardHead{
  padding:16px 18px 10px;
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  border-bottom:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.18)
}
.cardHead h2{margin:0;font-size:16px;letter-spacing:-.01em}
.small{font-size:12px;color:var(--muted)}

.puzzleArea{padding:16px 18px 18px;display:grid;gap:12px}
.photoSelect{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
select,button,input{font:inherit}
select{
  appearance:none;
  background:rgba(255,255,255,.08);
  color:var(--text);
  border:1px solid rgba(255,255,255,.14);
  padding:10px 12px;
  border-radius:12px;
  outline:none
}

.pill{
  padding:8px 10px;border-radius:999px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);
  font-size:12px;color:var(--muted);
  display:flex;gap:8px;align-items:center;white-space:nowrap
}

.puzzle{
  width:100%;
  aspect-ratio:4/3;
  border-radius:16px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);
  display:grid;
  grid-template-columns:repeat(4,1fr);
  grid-template-rows:repeat(3,1fr);
  gap:6px;
  padding:6px;
  position:relative;
}

.tile{
  position:relative;
  border-radius:12px;
  overflow:hidden;
  cursor:pointer;
  user-select:none;
  transform:translateZ(0);
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.22);
}
.tile.locked{cursor:default;opacity:.92}

/* Flip tiles */
.tile .front,.tile .back{
  position:absolute;inset:0;
  display:grid;place-items:center;
  backface-visibility:hidden;
  transition:transform 520ms cubic-bezier(.2,.8,.2,1);
}
.tile .front{
  background:
    radial-gradient(220px 120px at 20% 30%, rgba(255,77,141,.22), transparent 60%),
    radial-gradient(200px 110px at 70% 70%, rgba(255,207,90,.16), transparent 60%),
    rgba(255,255,255,.06);
  transform:rotateY(0deg);
  color:rgba(255,255,255,.92);
  font-weight:750;
  letter-spacing:.02em;
}
.tile .front span{
  display:flex;align-items:center;gap:8px;
  padding:10px 12px;
  border-radius:999px;
  background:rgba(0,0,0,.22);
  border:1px solid rgba(255,255,255,.12);
  font-size:13px;
}
.tile .back{
  transform:rotateY(180deg);
  background-repeat:no-repeat;
  filter:saturate(1.05) contrast(1.05);
}
.tile.revealed .front{transform:rotateY(-180deg)}
.tile.revealed .back{transform:rotateY(0deg)}

/* Face-up pieces (swap/slider) */
.piece{
  position:absolute;inset:0;
  background-repeat:no-repeat;
  filter:saturate(1.05) contrast(1.05);
}
.tile.selected{
  outline:2px solid rgba(255,207,90,.9);
  box-shadow:0 0 0 4px rgba(255,207,90,.18);
}
.tile.blank{
  background:rgba(0,0,0,.28);
  cursor:default;
}

.progressRow{
  display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap
}
.bar{
  flex:1;height:10px;border-radius:999px;
  background:rgba(255,255,255,.10);
  overflow:hidden;
  border:1px solid rgba(255,255,255,.12);
  min-width:220px
}
.bar>div{
  height:100%;
  width:0%;
  background:linear-gradient(90deg, rgba(255,77,141,.95), rgba(255,207,90,.95));
  border-radius:999px;
  transition:width 400ms ease
}

.msg{font-size:13px;color:var(--muted);line-height:1.35}

.rightPad{padding:16px 18px 18px;display:grid;gap:12px}

.q{
  padding:12px 12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  display:grid;
  gap:10px
}
.qTop{display:flex;align-items:center;justify-content:space-between;gap:10px}
.qTop strong{font-size:14px}
.qTop .tag{
  font-size:12px;
  color:rgba(255,255,255,.75);
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.18);
  white-space:nowrap
}

.opts{display:grid;gap:8px}
label.opt{
  display:flex;gap:10px;align-items:flex-start;
  padding:10px 12px;border-radius:14px;
  background:rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,.12);
  cursor:pointer;user-select:none;
  transition:background 140ms ease,border-color 140ms ease,transform 140ms ease
}
label.opt:hover{background:rgba(255,255,255,.06);transform:translateY(-1px)}
label.opt input{margin-top:2px;accent-color:var(--accent)}
.optText{display:flex;flex-direction:column;gap:2px}
.optText .main{font-size:13px;color:rgba(255,255,255,.92);font-weight:650}
.optText .sub{font-size:12px;color:rgba(255,255,255,.62)}

button{
  background:linear-gradient(180deg, rgba(255,77,141,.90), rgba(255,77,141,.68));
  color:#fff;border:0;
  padding:10px 12px;border-radius:12px;
  cursor:pointer;font-weight:700;
  box-shadow:0 10px 30px rgba(255,77,141,.18);
  width:100%;
}
button.secondary{
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.14);
  box-shadow:none;
  color:rgba(255,255,255,.9);
  width:auto
}
button:disabled{opacity:.55;cursor:not-allowed}

.reveal{
  padding:18px;
  display:none;
  gap:10px;
  border-top:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.20);
}
.reveal.show{display:grid}
.reveal h3{margin:0;font-size:18px}
.reveal p{margin:0;color:var(--muted);line-height:1.45}
.reveal .final{
  padding:14px 14px;border-radius:16px;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.12);
  display:grid;gap:8px;
}

.fullPhoto{
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
}

.fullPhoto img{
	display:block;
	width:100%;
	height:auto;
}

footer{text-align:center;color:rgba(255,255,255,.55);font-size:12px;padding:10px 0 0}
