/* ── Reset & base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --bg:        #1a1033;
  --bg-card:   #261548;
  --bg-box:    #2d1b69;
  --primary:   #7c4dff;
  --gold:      #f0c040;
  --gold-dark: #c89a10;
  --text:      #f0ebff;
  --text-muted:#a99dc8;
  --radius:    16px;
  --shadow:    0 8px 32px rgba(0,0,0,0.5);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100vh; display: flex; flex-direction: column; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 24px;
  transition: transform 0.1s, opacity 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #5c35cc);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124,77,255,0.5);
}
.btn-primary:not(:disabled):hover { box-shadow: 0 6px 28px rgba(124,77,255,0.7); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #1a1033;
  box-shadow: 0 4px 20px rgba(240,192,64,0.4);
  width: 100%;
}
.btn-gold:not(:disabled):hover { box-shadow: 0 6px 28px rgba(240,192,64,0.6); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.15);
  font-weight: 400;
  font-size: 0.9rem;
}

.btn-large { font-size: 1.2rem; padding: 18px 48px; }

.btn-main-text { font-size: 1rem; }
.btn-sub { font-size: 0.75rem; font-weight: 400; opacity: 0.75; margin-top: 2px; }

/* ── Top screen ──────────────────────────────────────────────── */
#screen-top {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: radial-gradient(ellipse at 50% 30%, #3b206b 0%, var(--bg) 70%);
}

.top-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.kotaro-icon img {
  width: 120px;   /* お好みのサイズに調整 */
  height: 120px;
  border-radius: 50%;  /* 丸くしたい場合 */
  object-fit: cover;
  filter: drop-shadow(0 0 24px rgba(124,77,255,0.8));
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

h1 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.3;
  background: linear-gradient(135deg, #f0ebff, var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.service-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 300px;
  text-align: center;
  margin-top: 4px;
}

.tarot-link {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  padding-bottom: 2px;
}
.tarot-link:hover { color: var(--text); }

/* ── Result screen ───────────────────────────────────────────── */
#screen-result { padding: 24px 20px 48px; }

.result-content {
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Card flip ───────────────────────────────────────────────── */
.card-container {
  width: 180px;
  aspect-ratio: 255 / 492;
  margin: 0 auto;
  perspective: 900px;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4,0,0.2,1);
}

.card-inner.is-flipped { transform: rotateY(180deg); }

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Back face */
.card-back {
  background: linear-gradient(135deg, #2d1b69 0%, #1a1033 100%);
  border: 1px solid rgba(124,77,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-back-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.card-back-paw {
  font-size: 3.5rem;
  filter: drop-shadow(0 0 12px rgba(124,77,255,0.8));
}

.card-back-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* Front face */
.card-front {
  transform: rotateY(180deg);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-front img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  transition: transform 0.3s;
}

.card-placeholder {
  color: var(--gold);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  padding: 16px;
  line-height: 1.5;
}

/* ── Card info ───────────────────────────────────────────────── */
.card-info { text-align: center; }

.card-info h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.keywords {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ── Reading boxes ───────────────────────────────────────────── */
.reading-box {
  background: var(--bg-box);
  border-radius: var(--radius);
  padding: 20px;
  font-size: 0.95rem;
  line-height: 1.8;
  border: 1px solid rgba(255,255,255,0.06);
}

.free-reading { border-left: 3px solid var(--primary); }

.ai-reading { border-left: 3px solid var(--gold); }

.ai-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

#ai-reading-text { white-space: pre-wrap; }

/* ── AI CTA ──────────────────────────────────────────────────── */
.ai-cta { /* inherits flex gap from .result-content */ }

/* ── Modals ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.is-open {
  animation: fade-in 0.2s ease;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
  background: var(--bg-card);
  border-radius: 24px 24px 0 0;
  padding: 32px 24px 48px;
  width: 100%;
  max-width: 480px;
  position: relative;
  animation: slide-up 0.3s cubic-bezier(0.4,0,0.2,1);
}

@keyframes slide-up {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.5;
}

.modal-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 20px;
}

/* Concern grid */
.concern-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-concern {
  background: rgba(124,77,255,0.15);
  color: var(--text);
  border: 1px solid rgba(124,77,255,0.35);
  border-radius: 12px;
  padding: 18px 8px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.6;
}

.btn-concern:hover { background: rgba(124,77,255,0.3); }

/* Ad modal */
.ad-area {
  margin-bottom: 16px;
  border-radius: 12px;
  overflow: hidden;
}

.ad-placeholder {
  background: rgba(255,255,255,0.05);
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 12px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.5rem;
}

.ad-timer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

#ad-countdown {
  font-weight: 700;
  color: var(--gold);
  font-size: 1.1rem;
}

#btn-ad-done { width: 100%; }
