/* ========== SecretType v3.9 — styles.css ========== */
* { box-sizing: border-box; }
:root{
  --bg:#f7f7fb; --card:#ffffff; --line:#e8e9ef; --text:#1f2937; --muted:#6b7280;
  --accent:#7257ff; --accent-2:#10b981; --accent-3:#f59e0b; --accent-4:#ef4444;
  --chip:#eef2ff; --chip-active:#7257ff; --chip-text:#111; --chip-on:#fff;
  --tint-1:#f0f7ff; --tint-2:#f4fff6; --tint-3:#fff8f0; --tint-4:#fff0f5;
}
html,body{height:100%}
body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.6; margin: 0;
  background: linear-gradient(180deg,#fafbff 0%, #f6f7ff 40%, #fefbf6 100%);
  color: var(--text);
}

/* Header / Hero */
.header{
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(90deg,#ffffff 0%, #f5f3ff 60%, #fff7ed 100%);
  border-bottom: 1px solid var(--line);
}
.hero-inner{
  max-width: 1000px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 12px;
}
h1{ margin:0; font-size: 1.9rem;
  background: linear-gradient(90deg,var(--accent),var(--accent-3));
  -webkit-background-clip: text; color: transparent;
}
.subtitle{ margin:6px 0 0; color: var(--muted); }

/* Layout */
main{ max-width: 1000px; margin: 16px auto; padding: 0 12px; }
.card{
  background: var(--card); border:1px solid var(--line); border-radius: 16px;
  padding: 20px; margin: 14px 0;
  box-shadow: 0 8px 28px rgba(0,0,0,.05);
}
.hidden{ display:none; }

/* Buttons */
.btn{
  padding:10px 14px; border:1px solid var(--line); background:#fff;
  border-radius: 12px; cursor:pointer; transition:.15s; font-weight: 600;
}
.btn:hover{ transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.btn:focus-visible{ outline: 3px solid #a5b4fc; outline-offset: 2px; }
.btn-ghost{ background: transparent; }
.btn-cta{
  background: linear-gradient(90deg,var(--accent),var(--accent-2));
  color:#fff; border:none;
}

/* Intro */
.lead{ color:#21284a; }
.hl{ background: linear-gradient(transparent 70%, #fff1a6 70%); }
.bullets{ margin:8px 0 0 16px; padding:0; }
.bullets li{ margin:6px 0; }
.note{ color: var(--muted); font-size: .92rem; }
.small{ font-size: .85rem; }

/* Type Grid */
.grid{
  display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr));
  gap: 12px;
}
.type-card{
  border:1px solid var(--line); border-radius: 12px; padding: 14px; background:#fff;
  display:flex; flex-direction:column; gap:6px;
}
.type-card:nth-child(4n+1){ background: linear-gradient(180deg,var(--tint-1),#fff); }
.type-card:nth-child(4n+2){ background: linear-gradient(180deg,var(--tint-2),#fff); }
.type-card:nth-child(4n+3){ background: linear-gradient(180deg,var(--tint-3),#fff); }
.type-card:nth-child(4n+4){ background: linear-gradient(180deg,var(--tint-4),#fff); }
.type-code{ font-size:1.2rem; font-weight:800; color:#111; }
.type-nick{ color:#374151; }
.type-desc{ color:#6b7280; font-size:.9rem; }

/* Inputs (MBTI / LoveType16) */
.rows .row{ margin: 8px 0; }
.rows label{ display:inline-block; min-width:120px; color:#374151; }
.mbti-row{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
input[type="text"], select{
  padding:10px; border:1px solid var(--line); border-radius:12px; background:#fff;
}
.mbti-avatar{
  width:44px; height:44px; border-radius:999px; background:#eef2ff; color:#111;
  display:flex; align-items:center; justify-content:center; font-weight:800; border:1px solid var(--line);
}
.love-avatar{
  width:44px; height:44px; border-radius:999px; background:#ffe4e6; color:#ef4444;
  display:flex; align-items:center; justify-content:center; font-weight:900; border:1px solid var(--line);
}

/* Quiz */
.question{ margin:16px 0; }
.controls{ margin-top:16px; display:flex; gap:8px; flex-wrap:wrap; }
.scale{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.choice{
  display:inline-flex; align-items:center; justify-content:center;
  padding:8px 12px; border-radius:999px; border:1px solid var(--line);
  background:var(--chip); color:var(--chip-text);
  cursor:pointer; user-select:none; min-width:40px; font-weight:600;
}
.choice.active{
  background:var(--chip-active); color:var(--chip-on); border-color:transparent;
  box-shadow:0 6px 20px rgba(114,87,255,.25);
}
.choice:hover{ transform: translateY(-1px); }

/* Badges / Tags */
.badge{
  display:inline-block; padding:6px 10px; border-radius:999px;
  background:#eef2ff; color:#3730a3; font-size:.86rem; margin:0 6px 6px 0;
}

/* Result Overlay */
.result-screen{
  position:fixed; inset:0;
  background: rgba(30,35,50,.35); backdrop-filter: saturate(130%) blur(4px);
  display:flex; align-items:center; justify-content:center; padding:16px;
}
.result-card{
  max-width:840px; width:100%;
  background: linear-gradient(180deg,#ffffff 0%, #f7faff 100%);
  border:1px solid var(--line); border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
  transform: translateY(8px); animation: pop .22s ease-out forwards;
  padding:22px;
}
.result-head{ font-weight:800; font-size:1.2rem; margin-bottom:8px; }
.result-tagline{ font-size:1.05rem; color:#111; margin:8px 0 6px; }
.result-para{ color:#394150; }
.result-extra{ margin-top:10px; }
.result-actions{ display:flex; gap:8px; justify-content:flex-end; margin-top:14px; }

@keyframes pop { to { transform: translateY(0); } }

/* Deep View */
.colorful{ background: linear-gradient(180deg,#ffffff 0%, #fff3f0 30%, #f0fff7 100%); }
.deep-head{ display:flex; align-items:center; gap:12px; justify-content:space-between; }
.progress{ flex:1; height:10px; background:#eef2ff; border-radius:999px; overflow:hidden; margin-left:16px; }
.bar{ height:100%; width:0; background: linear-gradient(90deg,var(--accent-3),var(--accent-4)); }

/* Footer */
footer{ color:#777; text-align:center; padding:24px 0; font-size:.9rem; }

/* Catch & Long text */
.catch{
  font-size:1.6rem; font-weight:900; margin:8px 0;
  background:linear-gradient(90deg,#ff7aa2,#7aa2ff);
  -webkit-background-clip:text; color:transparent;
}
.longText{ margin-top:8px; white-space: pre-wrap; }

/* Responsive tweaks */
@media (max-width: 640px){
  .hero-inner{ flex-direction: column; align-items: flex-start; gap:8px; }
  .rows label{ min-width: auto; display:block; margin-bottom: 6px; }
  .result-card{ padding:16px; }
}

/* Accessibility */
a, button{ -webkit-tap-highlight-color: transparent; }
button:disabled{ opacity:.6; cursor:not-allowed; }
