:root{
  --bg:#07030d;
  --panel:rgba(255,255,255,.078);
  --panel2:rgba(255,255,255,.105);
  --line:rgba(255,255,255,.13);
  --text:#fff;
  --muted:rgba(255,255,255,.68);
  --soft:rgba(255,255,255,.48);
  --gold:#ffd978;
  --violet:#d9a7ff;
  --dark:#1a1028;
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}

html{
  min-height:100%;
  background:#07030d;
}

body{
  margin:0;
  min-height:100%;
  font-family:-apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Pretendard",system-ui,sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at 15% -5%,rgba(217,167,255,.34),transparent 30%),
    radial-gradient(circle at 88% 16%,rgba(255,217,120,.15),transparent 28%),
    linear-gradient(180deg,#170826 0%,#07030d 74%);
  overflow-x:hidden;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}

button,input,select,textarea{font-family:inherit}

.bg-orb{
  position:fixed;
  border-radius:999px;
  filter:blur(40px);
  opacity:.32;
  pointer-events:none;
  z-index:0;
}
.orb-a{width:180px;height:180px;left:-60px;top:90px;background:#d9a7ff}
.orb-b{width:160px;height:160px;right:-40px;top:260px;background:#ffd978}

.site-header{
  position:sticky;
  top:0;
  z-index:30;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 18px;
  background:rgba(7,3,13,.76);
  backdrop-filter:blur(18px);
  border-bottom:1px solid rgba(255,255,255,.08);
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
}

.brand-mark{
  width:34px;
  height:34px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,var(--gold),var(--violet));
  color:#1a1028;
  font-weight:900;
}

.brand strong{
  display:block;
  font-size:14px;
  letter-spacing:-.02em;
}

.brand small{
  display:block;
  color:var(--soft);
  font-size:11px;
  margin-top:2px;
}

.status-pill{
  font-size:11px;
  color:#f5e2ff;
  border:1px solid var(--line);
  background:rgba(255,255,255,.08);
  padding:7px 10px;
  border-radius:999px;
}

.app{
  position:relative;
  z-index:1;
  width:100%;
  max-width:640px;
  margin:0 auto;
  padding:18px 16px 44px;
}

.view{
  display:none;
  animation:fadeUp .24s ease both;
}

.view.active{
  display:block;
}

@keyframes fadeUp{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:translateY(0)}
}

.hero,
.panel{
  border:1px solid var(--line);
  background:var(--panel);
  border-radius:30px;
  padding:24px;
  box-shadow:0 24px 70px rgba(0,0,0,.28);
}

.hero{
  min-height:calc(100svh - 116px);
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.eyebrow{
  display:inline-flex;
  width:max-content;
  max-width:100%;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.1);
  border:1px solid rgba(255,255,255,.12);
  color:#f4dfff;
  font-size:12px;
  font-weight:800;
}

h1,h2,h3,p{margin-top:0}

h1{
  font-size:clamp(38px,10vw,56px);
  line-height:1.04;
  margin:18px 0 16px;
  letter-spacing:-.06em;
}

h2{
  font-size:clamp(27px,7vw,38px);
  line-height:1.15;
  margin:0 0 10px;
  letter-spacing:-.045em;
}

h3{
  font-size:24px;
  margin:8px 0 8px;
  letter-spacing:-.035em;
}

p{
  color:var(--muted);
  line-height:1.68;
}

.hero p{
  font-size:17px;
}

.section-head{
  margin-bottom:18px;
}

.section-head span{
  display:block;
  color:var(--gold);
  font-size:12px;
  font-weight:900;
  letter-spacing:.08em;
  margin-bottom:8px;
}

.section-head p{
  margin-bottom:0;
}

.hero-cards{
  height:210px;
  position:relative;
  margin:20px 0 24px;
}

.hero-card,
.card-back,
.shuffle-stage .deck div{
  background:
    radial-gradient(circle at 50% 45%,rgba(255,217,120,.18),transparent 33%),
    repeating-linear-gradient(45deg,rgba(255,255,255,.06) 0 2px,transparent 2px 9px),
    linear-gradient(145deg,#321750,#090411);
  border:1px solid rgba(255,255,255,.16);
}

.hero-card{
  position:absolute;
  left:50%;
  top:24px;
  width:112px;
  height:168px;
  margin-left:-56px;
  border-radius:21px;
  color:var(--gold);
  display:grid;
  place-items:center;
  font-size:32px;
  box-shadow:0 18px 34px rgba(0,0,0,.32);
}

.hero-card:nth-child(1){transform:rotate(-22deg) translateX(-66px)}
.hero-card:nth-child(2){transform:rotate(-8deg) translateX(-22px)}
.hero-card:nth-child(3){transform:rotate(8deg) translateX(22px)}
.hero-card:nth-child(4){transform:rotate(22deg) translateX(66px)}

.button-stack{
  display:grid;
  gap:10px;
  margin-top:18px;
}

button{
  width:100%;
  border:0;
  border-radius:18px;
  padding:16px 18px;
  font-size:16px;
  font-weight:900;
  cursor:pointer;
}

.primary{
  color:var(--dark);
  background:linear-gradient(135deg,var(--gold),var(--violet));
  box-shadow:0 18px 40px rgba(217,167,255,.22);
}

.ghost{
  color:var(--text);
  background:rgba(255,255,255,.09);
  border:1px solid rgba(255,255,255,.13);
}

.primary:active,.ghost:active,.pay-method:active,.card-choice:active{
  transform:scale(.985);
}

.form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.field{
  display:block;
  margin-bottom:14px;
}

.field span{
  display:flex;
  align-items:center;
  gap:6px;
  margin-bottom:8px;
  color:#f3dfff;
  font-size:14px;
  font-weight:900;
}

.field em{
  font-style:normal;
  color:var(--soft);
  font-size:12px;
  font-weight:700;
}

input,select,textarea{
  width:100%;
  border:1px solid rgba(255,255,255,.14);
  border-radius:16px;
  background:rgba(0,0,0,.24);
  color:white;
  padding:14px;
  font-size:16px;
  outline:none;
}

input:focus,select:focus,textarea:focus{
  border-color:rgba(255,217,120,.75);
}

textarea{
  min-height:116px;
  resize:vertical;
}

input:disabled{
  opacity:.45;
}

.check-row{
  display:flex;
  align-items:center;
  gap:10px;
  padding:14px;
  border:1px solid rgba(255,255,255,.11);
  border-radius:16px;
  background:rgba(255,255,255,.055);
  margin:0 0 14px;
  color:rgba(255,255,255,.82);
}

.check-row input{
  width:20px;
  height:20px;
  accent-color:#ffd978;
}

.notice-box{
  padding:14px;
  border-radius:18px;
  background:rgba(255,255,255,.065);
  border:1px solid rgba(255,255,255,.1);
  margin-top:6px;
}

.notice-box b{
  color:var(--gold);
}

.notice-box p{
  font-size:13px;
  margin:7px 0 0;
}

.sticky-actions{
  position:sticky;
  bottom:10px;
  padding-top:6px;
  background:linear-gradient(180deg,transparent,rgba(12,5,20,.94) 22%);
  border-radius:0 0 22px 22px;
  z-index:5;
}

.center-panel{
  min-height:calc(100svh - 116px);
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.shuffle-stage{
  min-height:320px;
  display:grid;
  place-items:center;
  position:relative;
}

.deck{
  position:relative;
  width:240px;
  height:280px;
  animation:deckPulse .82s ease-in-out infinite;
}

@keyframes deckPulse{
  50%{transform:scale(1.035)}
}

.deck div{
  position:absolute;
  left:50%;
  top:40px;
  width:132px;
  height:198px;
  margin-left:-66px;
  border-radius:22px;
  display:grid;
  place-items:center;
  color:var(--gold);
  font-size:38px;
  box-shadow:0 20px 38px rgba(0,0,0,.38);
}

.deck div:nth-child(1){animation:mix1 .72s ease-in-out infinite}
.deck div:nth-child(2){animation:mix2 .72s ease-in-out infinite}
.deck div:nth-child(3){animation:mix3 .72s ease-in-out infinite}
.deck div:nth-child(4){animation:mix4 .72s ease-in-out infinite}
.deck div:nth-child(5){animation:mix5 .72s ease-in-out infinite}

@keyframes mix1{50%{transform:rotate(-25deg) translate(-82px,18px)}}
@keyframes mix2{50%{transform:rotate(18deg) translate(72px,-12px)}}
@keyframes mix3{50%{transform:rotate(0deg) translate(0,45px)}}
@keyframes mix4{50%{transform:rotate(-13deg) translate(-46px,-32px)}}
@keyframes mix5{50%{transform:rotate(25deg) translate(50px,30px)}}

.loading-line{
  height:8px;
  border-radius:999px;
  background:rgba(255,255,255,.1);
  overflow:hidden;
}

.loading-line i{
  display:block;
  height:100%;
  width:0%;
  border-radius:999px;
  background:linear-gradient(90deg,var(--gold),var(--violet));
  animation:load 1.65s ease forwards;
}

@keyframes load{
  to{width:100%}
}

.micro-copy{
  text-align:center;
  font-size:13px;
  color:var(--soft);
  margin-top:12px;
}

.selected-strip{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin-bottom:14px;
}

.selected-mini{
  min-height:68px;
  border-radius:15px;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.11);
  padding:10px;
  font-size:12px;
  color:rgba(255,255,255,.64);
}

.selected-mini b{
  display:block;
  color:var(--gold);
  margin-bottom:4px;
}

.card-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
}

.card-choice{
  aspect-ratio:2/3;
  min-height:112px;
  border-radius:17px;
  border:1px solid rgba(255,255,255,.15);
  color:var(--gold);
  display:grid;
  place-items:center;
  font-size:22px;
  font-weight:900;
  cursor:pointer;
  background:
    radial-gradient(circle at 50% 45%,rgba(255,217,120,.18),transparent 33%),
    repeating-linear-gradient(45deg,rgba(255,255,255,.06) 0 2px,transparent 2px 8px),
    linear-gradient(145deg,#2d1649,#090411);
}

.card-choice.chosen{
  color:#fff;
  border-color:var(--gold);
  background:linear-gradient(145deg,#5e3280,#160c23);
}

.card-choice.disabled{
  opacity:.34;
  pointer-events:none;
}

.reveal-list{
  display:grid;
  gap:14px;
}

.reveal-card{
  border-radius:24px;
  background:var(--panel2);
  border:1px solid rgba(255,255,255,.13);
  overflow:hidden;
}

.card-art{
  height:190px;
  background:#160a25;
}

.card-art svg{
  width:100%;
  height:100%;
  display:block;
}

.reveal-text{
  padding:16px;
}

.reveal-text b{
  display:block;
  font-size:19px;
  margin-bottom:7px;
}

.reveal-text p{
  margin:0;
  font-size:14px;
}

.result-list{
  display:grid;
  gap:12px;
}

.result-block{
  padding:16px;
  border-radius:20px;
  background:rgba(255,255,255,.075);
  border:1px solid rgba(255,255,255,.105);
}

.result-block b{
  display:block;
  color:var(--gold);
  margin-bottom:8px;
}

.result-block p{
  margin:0;
  font-size:15px;
}

.premium-card,
.checkout{
  padding:18px;
  border-radius:24px;
  background:linear-gradient(180deg,rgba(255,255,255,.105),rgba(255,255,255,.065));
  border:1px solid rgba(255,255,255,.13);
  margin-top:16px;
}

.price{
  font-size:34px;
  font-weight:950;
  color:var(--gold);
  margin:6px 0 12px;
}

.checkout{
  display:grid;
  gap:12px;
}

.checkout small{
  display:block;
  color:var(--soft);
  margin-bottom:4px;
}

.checkout strong{
  font-size:20px;
}

.pay-method{
  color:#fff;
  background:rgba(0,0,0,.23);
  border:1px solid rgba(255,255,255,.12);
  text-align:left;
}

.disclaimer{
  font-size:12px;
  color:rgba(255,255,255,.46);
  margin:16px 0 0;
}

.modal{
  position:fixed;
  inset:0;
  z-index:100;
  display:none;
  place-items:center;
  padding:18px;
  background:rgba(0,0,0,.68);
  backdrop-filter:blur(10px);
}

.modal.show{
  display:grid;
}

.modal-box{
  width:100%;
  max-width:420px;
  border-radius:28px;
  background:#14091f;
  border:1px solid rgba(255,255,255,.15);
  padding:22px;
  box-shadow:0 30px 90px rgba(0,0,0,.56);
}

.modal-box h3{
  margin-top:0;
}

.modal-progress{
  height:8px;
  border-radius:999px;
  background:rgba(255,255,255,.1);
  overflow:hidden;
  margin-top:18px;
}

.modal-progress i{
  display:block;
  height:100%;
  width:0%;
  background:linear-gradient(90deg,var(--gold),var(--violet));
}

.modal.show .modal-progress i{
  animation:payLoad 1.45s ease forwards;
}

@keyframes payLoad{
  to{width:100%}
}

.toast{
  position:fixed;
  left:16px;
  right:16px;
  bottom:20px;
  z-index:130;
  display:none;
  max-width:608px;
  margin:0 auto;
  padding:14px 16px;
  border-radius:16px;
  background:rgba(0,0,0,.82);
  border:1px solid rgba(255,255,255,.12);
  color:#fff;
  font-size:14px;
}

.toast.show{
  display:block;
  animation:toast .2s ease;
}

@keyframes toast{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:translateY(0)}
}

@media(max-width:520px){
  .app{
    padding:14px 12px 34px;
  }

  .hero,.panel{
    padding:20px;
    border-radius:26px;
  }

  .form-grid{
    grid-template-columns:1fr;
    gap:0;
  }

  .hero-cards{
    height:172px;
  }

  .hero-card{
    width:94px;
    height:141px;
    margin-left:-47px;
  }

  .card-grid{
    gap:8px;
  }

  .card-choice{
    min-height:92px;
    border-radius:15px;
  }

  .selected-strip{
    gap:7px;
  }

  .selected-mini{
    min-height:62px;
    padding:9px;
  }

  .card-art{
    height:158px;
  }

  .shuffle-stage{
    min-height:260px;
  }

  .deck div{
    width:110px;
    height:165px;
    margin-left:-55px;
  }
}
