/* ============================================
   Tarot Site – Moonlight White Theme (Final)
   Clean / Flat / Immersive
============================================ */

/* Reset */
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Root variables */
:root{
  --text:#1A1C22;
  --muted:rgba(26,28,34,.70);
  --line:rgba(26,28,34,.12);

  --blue1:rgba(120,170,255,.35);
  --blue2:rgba(90,140,230,.30);
  --blue3:rgba(90,130,220,.18);

  --radius:18px;
  --radius2:26px;

  --sans:'Hiragino Sans','Yu Gothic','Meiryo',sans-serif;
  --serif:'Hiragino Mincho ProN','Yu Mincho','Noto Serif JP',serif;
}

/* ============================================
   Base Layout
============================================ */

body{
  font-family: var(--sans);
  line-height: 1.75;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;

  /* Cool white base (no yellow cast) */
  background:
    radial-gradient(1100px 700px at 20% 10%, rgba(210,225,255,.22), transparent 60%),
    radial-gradient(900px 650px at 80% 25%, rgba(185,205,240,.18), transparent 62%),
    linear-gradient(180deg, #F7FAFF 0%, #FFFFFF 45%, #F5F8FF 100%);
}

/* Moonlight veil */
body::after{
  content:"";
  position: fixed;
  inset: -30%;
  pointer-events: none;
  z-index: 0;

  background:
    radial-gradient(900px 620px at 18% 22%, var(--blue1), transparent 60%),
    radial-gradient(820px 620px at 82% 26%, var(--blue2), transparent 62%),
    radial-gradient(980px 760px at 50% 82%, var(--blue3), transparent 66%),
    conic-gradient(from 200deg at 50% 50%,
      rgba(140,190,255,.25),
      rgba(90,140,230,.18),
      transparent 38%,
      rgba(120,170,255,.22),
      transparent 78%);

  filter: blur(20px) saturate(1.25);
  opacity: .65;
  animation: moonVeilDrift 6s ease-in-out infinite;
}

@keyframes moonVeilDrift{
  0%{
    transform: translate3d(-3%, -2%, 0) rotate(-2deg);
    opacity: .55;
  }
  50%{
    transform: translate3d( 3%,  2%, 0) rotate( 2deg);
    opacity: .75;
  }
  100%{
    transform: translate3d(-3%, -2%, 0) rotate(-2deg);
    opacity: .55;
  }
}

/* Foreground */
.container,
.site-footer,
dialog{
  position: relative;
  z-index: 1;
}

.container{
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 28px 20px;
  width: 100%;
}

/* ============================================
   Typography
============================================ */

.site-title,
.page-title{
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: .02em;
}

.site-title{
  font-size: 2.35rem;
  margin-bottom: 22px;
}

.page-title{
  font-size: 1.75rem;
  margin-bottom: 16px;
}

.top-description,
.select-instruction{
  font-size: 1.02rem;
  color: var(--muted);
  margin-bottom: 28px;
}

/* ============================================
   Buttons (Flat + Pressable)
============================================ */

.btn{
  padding: 14px 34px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid rgba(26,28,34,.14);
  background: rgba(26,28,34,.04);
  color: var(--text);
  letter-spacing: .02em;
  transition: background-color .15s ease, transform .1s ease;
}

.btn:active{
  transform: translateY(1px);
}

.btn-primary{
  background: linear-gradient(180deg, rgba(140,190,255,.55), rgba(90,140,230,.55));
  border-color: rgba(90,140,230,.45);
}

.btn-outline{
  background: transparent;
  border-color: rgba(90,140,230,.45);
}

.btn-large{
  padding: 18px 54px;
  font-size: 1.15rem;
}

/* ============================================
   Card Selection
============================================ */

.card-item{
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(68px, 10vw, 106px);
  height: calc(clamp(68px, 10vw, 106px) * 1.51);
  cursor: pointer;
  transform-origin: center;
  transition: transform .22s ease, filter .22s ease;
}

.card-item img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 18px 46px rgba(10,10,10,.16);
}

.card-item:hover{
  transform: scale(1.06);
}

/* ============================================
   Result Page (Flat)
============================================ */

.result-display{
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius2);
  padding: 42px 40px;
  margin-bottom: 26px;
}

.card-image{
  max-width: 320px;
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.card-image.reversed{
  transform: rotate(180deg);
}

.card-name{
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.card-message{
  font-size: 1.05rem;
  line-height: 1.9;
  margin-bottom: 26px;
  text-align: left;
}

/* Lucky items (Result Page) */
.lucky-items{
  display: flex;
  justify-content: center;
  gap: 34px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(26,28,34,.10);
}

.lucky-item{ text-align: center; min-width: 220px; }

.lucky-label{
  font-size: .85rem;
  color: rgba(26,28,34,.55);
  margin-bottom: 8px;
  letter-spacing: .06em;
}

.lucky-value{
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}

/* Lucky color chip */
.color-display{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.color-box{
  display: inline-block;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(26,28,34,.14);
}


/* ============================================
   Footer & Dialog
============================================ */

.site-footer{
  padding: 18px 20px 26px;
  text-align: center;
}

.link-button{
  background: none;
  border: none;
  color: rgba(26,28,34,.62);
  cursor: pointer;
  font-size: .9rem;
}

dialog{
  border-radius: var(--radius);
  border: 1px solid var(--line);
  max-width: 520px;
  width: 92%;
}

dialog::backdrop{
  background: rgba(0,0,0,.40);
}

/* ============================================
   Responsive
============================================ */

@media (max-width: 768px){
  .site-title{ font-size: 2.0rem; }
  .page-title{ font-size: 1.5rem; }
}

@media (max-width: 480px){
  .site-title{ font-size: 1.7rem; }
}


.top-content,
.select-content,
.result-content{
  text-align: center;
}

/* ============================================
   Peek window + Antique frame (FINAL)
============================================ */

/* 包装レイヤー */
.wheel-frame-wrapper{
  position: relative;
  width: min(520px, 92vw);
  margin: 0 auto;
}

/* 覗き窓（カードを切る箱） */
.card-wheel-container{
  position: relative;
  width: 100%;
  height: min(72vh, 620px);
  overflow: hidden;   /* ← 切るのはここだけ */
}

/* カード円 */
.card-wheel{
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* フレーム共通 */
.frame{
  position: absolute;
  top: 0;
  height: 100%;
  width: clamp(70px, 10vw, 140px);
  object-fit: contain;
  pointer-events: none;
  z-index: 3;
  opacity: .95;
}

/* 左フレーム */
.frame-left{
  left: calc(-1 * clamp(70px, 10vw, 140px) - 12px);
}

/* 右フレーム（反転） */
.frame-right{
  right: calc(-1 * clamp(70px, 10vw, 140px) - 12px);
  transform: scaleX(-1);
}

/* ① 覗き窓（カードフィールド）を縦長・細めにする */
.wheel-frame-wrapper{
  width: min(380px, 86vw); /* ←ここを小さくすると縦長感が戻る */
}

/* フレームを覗き窓に食い込ませる（隙間マイナス） */
.frame-left{
  left: calc(-1 * clamp(70px, 10vw, 140px) + 40px);
}
.frame-right{
  right: calc(-1 * clamp(70px, 10vw, 140px) + 40px);
}

/* ============================================
   Disclaimer dialog (centered + polished)
============================================ */

#disclaimerDialog{
  /* 画面中央に固定（スクロールしても中央） */
  position: fixed;
  inset: auto;              /* UAデフォを潰す */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  /* サイズ */
  width: min(560px, 92vw);
  max-height: min(70vh, 520px);
  overflow: auto;

  /* 見た目 */
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 18px;
  padding: 22px 22px 18px;
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);

  box-shadow:
    0 18px 60px rgba(0,0,0,.22),
    0 2px 10px rgba(0,0,0,.10);

  color: #1f2937;
  font-family: inherit;
}

/* モーダル背面（暗幕） */
#disclaimerDialog::backdrop{
  background: rgba(0, 10, 30, .45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

/* 中身の整形（あなたのHTML構造に合わせて） */
#disclaimerDialog .dialog-content h2{
  margin: 0 0 12px;
  font-size: 20px;
  letter-spacing: .04em;
}

#disclaimerDialog .dialog-body{
  line-height: 1.8;
  font-size: 15px;
  color: rgba(31,41,55,.88);
}

#disclaimerDialog .dialog-body p{
  margin: 0 0 10px;
}

/* 閉じるボタン（フラット＋押せる感） */
#disclaimerDialog .btn,
#disclaimerDialog button{
  margin-top: 10px;
  width: 100%;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 999px;
  padding: 12px 16px;
  background: rgba(255,255,255,.75);
  color: #111827;
  font-weight: 700;
  cursor: pointer;
  transition: transform .06s ease, background .15s ease;
}

#disclaimerDialog .btn:active,
#disclaimerDialog button:active{
  transform: translateY(1px);
  background: rgba(255,255,255,.92);
}

/* privacy page: put Back button at bottom-center */
.privacy-actions{
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

/* 右側に飛ばす系（float/absolute/fixed）を強制的に無効化 */
.privacy-actions .btn,
.privacy-actions a{
  position: static !important;
  float: none !important;
  right: auto !important;
  left: auto !important;
}


/* ===== Privacy policy: Back button must be bottom-centered ===== */
.page-privacy .privacy-card{
  display: flex;
  flex-direction: column;
}

.page-privacy .privacy-actions{
  margin-top: 28px;
  display: flex;
  justify-content: center;
  width: 100%;
}

/* 何が来ても横に飛ばさない（fixed/absolute/float/right を無効化） */
.page-privacy .back-btn{
  position: static !important;
  float: none !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  bottom: auto !important;

  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ===== Privacy page layout fix (stack + center) ===== */
body.page-privacy .container{
  flex-direction: column;   /* ←横並びを縦並びに */
  justify-content: flex-start;
  align-items: center;
  gap: 18px;
}

body.page-privacy .result-display{
  width: min(92vw, 980px);  /* ←スマホでも収まる */
  margin: 0 auto;
}

body.page-privacy .privacy-actions{
  width: 100%;
  display: flex;
  justify-content: center;  /* ←Backボタンを中央に */
  margin-top: 4px;
}

/* ============================================
   Privacy page polish (cute + readable)
============================================ */

body.page-privacy .result-display{
  /* 余白と読みやすさ強化 */
  padding: 44px 44px;
  background:
    radial-gradient(700px 380px at 20% 0%, rgba(140,190,255,.14), transparent 55%),
    radial-gradient(700px 380px at 90% 10%, rgba(90,140,230,.10), transparent 60%),
    #ffffff;
}

@media (max-width: 768px){
  body.page-privacy .result-display{ padding: 34px 26px; }
}

body.page-privacy .result-display .page-title{
  position: relative;
  padding-bottom: 12px;
  margin-bottom: 18px;
}

body.page-privacy .result-display .page-title::after{
  content:"";
  display:block;
  height: 1px;
  margin-top: 12px;
  background: linear-gradient(90deg, transparent, rgba(90,140,230,.35), transparent);
}

body.page-privacy .result-display h2{
  font-family: var(--serif);
  font-size: 1.05rem;
  margin: 22px 0 10px;
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 見出しの「可愛さ」：小さめの月っぽいドット */
body.page-privacy .result-display h2::before{
  content:"";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(140,190,255,.85), rgba(90,140,230,.65));
  box-shadow: 0 0 0 4px rgba(90,140,230,.10);
  flex: 0 0 auto;
}

body.page-privacy .result-display p{
  margin: 0 0 12px;
  color: rgba(26,28,34,.82);
  line-height: 1.95;
}

/* リンクを上品に（下線が汚くならない） */
body.page-privacy .result-display a{
  color: rgba(40,90,170,.92);
  text-decoration: none;
  border-bottom: 1px solid rgba(40,90,170,.30);
  padding-bottom: 1px;
  transition: border-color .15s ease, background-color .15s ease;
}

body.page-privacy .result-display a:hover{
  border-bottom-color: rgba(40,90,170,.65);
  background: rgba(140,190,255,.12);
}

/* 強調（strong）をやわらかく */
body.page-privacy .result-display strong{
  font-weight: 800;
  color: rgba(26,28,34,.92);
  background: linear-gradient(180deg, transparent 55%, rgba(140,190,255,.20) 55%);
  padding: 0 2px;
  border-radius: 6px;
}

/* セクションの区切りを控えめに */
body.page-privacy .result-display h2 + p{
  margin-top: 6px;
}

body.page-privacy .privacy-actions{
  margin-top: 14px;
}

/* Backボタンを少しだけ“可愛く” */
body.page-privacy .back-btn{
  padding: 14px 40px;
  letter-spacing: .06em;
}
