/* =========================================================
   style.css  ―― ログイン れんしゅうランド の みため
   子ども向けに カラフル・大きなボタン・まるっこい デザイン
   ========================================================= */

:root {
  --bg1: #a8edea;
  --bg2: #fed6e3;
  --card: #ffffff;
  --ink: #3a2e4a;
  --primary: #6c5ce7;
  --primary-d: #5541d6;
  --accent: #ff9f43;
  --good: #22c55e;
  --bad: #ef4444;
  --radius: 22px;
  --shadow: 0 10px 24px rgba(80, 60, 120, 0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Kaku Gothic ProN",
               "Rounded Mplus 1c", "M PLUS Rounded 1c", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
  -webkit-text-size-adjust: 100%;
}

/* ---------- 上バー ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(80, 60, 120, 0.1);
}
.topbar-btn {
  border: none;
  background: #fff;
  color: var(--primary);
  font-weight: 800;
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.topbar-btn:hover { transform: translateY(-1px); }
.brand { font-weight: 900; font-size: 17px; letter-spacing: .02em; }
.coin-badge {
  font-weight: 900;
  font-size: 18px;
  background: #fff3bf;
  color: #b8860b;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  min-width: 78px;
  text-align: center;
}

/* ---------- レイアウト ---------- */
#app {
  max-width: 860px;
  margin: 0 auto;
  padding: 22px 16px 40px;
}
.footer {
  text-align: center;
  padding: 16px;
  font-size: 13px;
  color: rgba(58, 46, 74, 0.6);
}

/* ---------- ボタン きほん ---------- */
.btn {
  border: none;
  border-radius: 999px;
  font-weight: 800;
  font-size: 17px;
  padding: 13px 26px;
  cursor: pointer;
  transition: transform .08s, box-shadow .15s, background .15s;
  font-family: inherit;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 8px 18px rgba(108,92,231,.4); }
.btn.primary:hover { background: var(--primary-d); }
.btn.ghost { background: #fff; color: var(--primary); box-shadow: var(--shadow); }
.btn.big { font-size: 20px; padding: 16px 34px; margin-top: 8px; }
.btn.small { font-size: 14px; padding: 9px 18px; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }

/* ---------- ホーム ---------- */
.hero {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.mascot { font-size: 60px; line-height: 1; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-8px);} }
.hero-text h1 { margin: 0 0 4px; font-size: 24px; }
.hero-text p { margin: 0; color: rgba(58,46,74,.7); font-size: 15px; }

.bonus-btn {
  width: 100%;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ff9a9e, #fecfef);
  color: #7a2e5d;
  font-weight: 900;
  font-size: 18px;
  padding: 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.bonus-done {
  background: #e6fcf5;
  color: #087f5b;
  font-weight: 800;
  text-align: center;
  padding: 14px;
  border-radius: var(--radius);
  margin-bottom: 18px;
}
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100%{ box-shadow: 0 8px 18px rgba(255,154,158,.4);} 50%{ box-shadow: 0 8px 30px rgba(255,154,158,.85);} }

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.menu-grid.two { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 14px; }
.menu-card {
  border: none;
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 14px;
  cursor: pointer;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .1s;
  font-family: inherit;
}
.menu-card:hover { transform: translateY(-4px) scale(1.02); }
.menu-emoji { font-size: 46px; }
.menu-label { font-weight: 900; font-size: 18px; margin-top: 6px; }
.menu-desc { font-size: 13px; color: rgba(58,46,74,.6); margin-top: 4px; }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}
.stats span {
  background: rgba(255,255,255,.7);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 14px;
}

/* ---------- 見出し ---------- */
.screen-title { font-size: 26px; margin: 4px 0 10px; }
.screen-lead { color: rgba(58,46,74,.75); font-size: 16px; line-height: 1.7; margin: 0 0 18px; }
.hint { font-size: 14px; color: rgba(58,46,74,.6); }

/* ---------- まなぶ（本えらび） ---------- */
.book-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px; }
.book-card {
  border: none;
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 18px;
  cursor: pointer;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 8px solid var(--book-color, var(--primary));
  font-family: inherit;
}
.book-card:hover { transform: translateY(-4px); }
.book-emoji { font-size: 50px; }
.book-title { font-weight: 900; font-size: 19px; margin: 8px 0; }
.book-badge {
  display: inline-block;
  background: #fff3bf;
  color: #b8860b;
  font-weight: 800;
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 999px;
}

/* ---------- スライド（教科書ページ） ---------- */
.slide-wrap { max-width: 560px; margin: 0 auto; }
.slide-progress {
  text-align: center;
  font-weight: 800;
  color: var(--book-color, var(--primary));
  margin-bottom: 10px;
}
.slide-card, .quiz-card, .result-card, .start-card, .form-card, .login-box, .scenario-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow);
  text-align: center;
}
.slide-emoji { font-size: 68px; }
.slide-heading { font-size: 23px; margin: 10px 0; color: var(--book-color, var(--primary)); }
.slide-text { font-size: 18px; line-height: 1.9; text-align: left; }
.slide-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }

/* ---------- クイズ ---------- */
.quiz-emoji { font-size: 56px; }
.quiz-q { font-size: 20px; font-weight: 800; line-height: 1.7; margin: 12px 0 20px; }
.quiz-buttons { display: flex; gap: 18px; justify-content: center; }
.ox-btn {
  border: none;
  border-radius: 20px;
  width: 130px;
  height: 130px;
  font-size: 52px;
  font-weight: 900;
  cursor: pointer;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow: var(--shadow);
  font-family: inherit;
}
.ox-btn span { font-size: 15px; font-weight: 700; }
.ox-btn.maru { background: linear-gradient(135deg,#69db7c,#38d9a9); }
.ox-btn.batsu { background: linear-gradient(135deg,#ff8787,#ff6b6b); }
.ox-btn:hover:not(:disabled) { transform: scale(1.05); }
.quiz-feedback { margin-top: 18px; font-size: 16px; line-height: 1.7; font-weight: 700; }
.quiz-feedback.good { color: var(--good); }
.quiz-feedback.bad { color: var(--bad); }

/* ---------- けっか ---------- */
.result-emoji { font-size: 72px; }
.result-card h2 { font-size: 26px; margin: 8px 0; }
.result-good { color: var(--good); font-weight: 800; font-size: 18px; }
.result-again { color: var(--accent); font-weight: 800; }
.result-nav { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.result-table { margin: 16px auto; max-width: 340px; }
.result-table > div {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px dashed #e5e0ef;
  font-weight: 700;
  font-size: 16px;
}
.result-table > div span { font-weight: 900; color: var(--primary); }
.result-table .hl {
  background: #fff3bf;
  border-radius: 14px;
  border: none;
  margin-top: 8px;
}
.result-table .hl span { color: #b8860b; }
.success-card { border: 3px solid #ffe066; }

/* ---------- スタート画面 ---------- */
.start-emoji { font-size: 70px; }

/* ---------- タイピング：むずかしさ えらび ---------- */
.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.level-card {
  border: none;
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 16px;
  cursor: pointer;
  text-align: center;
  box-shadow: var(--shadow);
  font-family: inherit;
  border-top: 8px solid var(--primary);
  transition: transform .1s;
}
.level-card:nth-child(1) { border-top-color: #40c057; }
.level-card:nth-child(2) { border-top-color: #4dabf7; }
.level-card:nth-child(3) { border-top-color: #ff6b6b; }
.level-card:hover { transform: translateY(-4px) scale(1.02); }
.level-emoji { font-size: 52px; }
.level-label { font-weight: 900; font-size: 20px; margin: 6px 0; }
.level-desc { font-size: 13px; color: rgba(58,46,74,.65); line-height: 1.6; min-height: 42px; }
.level-time {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 800;
  background: #fff3bf;
  color: #b8860b;
  padding: 4px 14px;
  border-radius: 999px;
}

/* ---------- タイピング ---------- */
.typing-game { max-width: 620px; margin: 0 auto; text-align: center; }
.typing-word.ready {
  font-size: 26px;
  color: var(--primary);
  letter-spacing: normal;
  background: #f3f0ff;
  border: 3px dashed var(--primary);
  cursor: pointer;
  animation: pulse 1.4s ease-in-out infinite;
}
.ready-msg { line-height: 1.5; font-weight: 900; }
.typing-hud {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 22px;
}
.hud-item {
  background: #fff;
  border-radius: 16px;
  padding: 12px 20px;
  font-size: 22px;
  font-weight: 900;
  box-shadow: var(--shadow);
  min-width: 90px;
}
.hud-item.danger { background: #ffe3e3; color: var(--bad); animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .5; } }
.typing-hint { font-size: 20px; font-weight: 800; color: var(--accent); margin-bottom: 12px; min-height: 28px; }
.typing-word {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px 20px;
  box-shadow: var(--shadow);
  font-size: 52px;
  font-weight: 900;
  letter-spacing: 4px;
  font-family: "SF Mono", "Consolas", monospace;
  word-break: break-all;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ch.done { color: var(--good); }
.ch.cur { color: var(--primary); background: #efeaff; border-radius: 6px; padding: 0 2px; }
.ch.rest { color: #b8b2c8; }
.typing-caption { margin-top: 14px; color: rgba(58,46,74,.55); font-size: 14px; }
.shake { animation: shake .25s; }
@keyframes shake { 0%,100%{transform:translateX(0);} 25%{transform:translateX(-8px);} 75%{transform:translateX(8px);} }
.hidden-input { position: absolute; opacity: 0; height: 1px; width: 1px; pointer-events: none; }

/* ---------- おぼえる ---------- */
.memory-wrap { max-width: 520px; margin: 0 auto; text-align: center; }
.memory-progress { font-weight: 800; color: var(--primary); margin-bottom: 12px; }
.memory-instr { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.memory-show {
  background: #fff;
  border: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 34px;
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 3px;
  font-family: "SF Mono","Consolas",monospace;
  box-shadow: var(--shadow);
  word-break: break-all;
}
.memory-count { margin-top: 16px; font-size: 18px; font-weight: 700; }
.memory-count span { color: var(--bad); font-size: 24px; font-weight: 900; }
.memory-hidden { font-size: 40px; letter-spacing: 8px; margin: 18px 0; color: #b8b2c8; }
.memory-feedback { margin-top: 16px; font-size: 17px; font-weight: 700; }
.memory-feedback.good { color: var(--good); }
.memory-feedback.bad { color: var(--bad); }

/* ---------- 入力ボックス ---------- */
.text-input {
  width: 100%;
  border: 3px solid #e5e0ef;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 18px;
  font-family: inherit;
  outline: none;
  transition: border .15s;
  margin-bottom: 4px;
}
.text-input:focus { border-color: var(--primary); }
.big-input { font-size: 24px; text-align: center; letter-spacing: 2px; margin: 8px 0 16px; }

/* ---------- ログイン練習（とうろく） ---------- */
.field-label { display: block; text-align: left; font-weight: 800; font-size: 14px; margin: 14px 0 6px; }
.form-msg { min-height: 22px; font-weight: 700; color: var(--bad); margin: 8px 0; font-size: 15px; }
.form-msg.bad { color: var(--bad); }
.tip-box {
  background: #fff9db;
  border: 2px dashed #ffe066;
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.7;
  margin-top: 18px;
  color: #7a6a1a;
}
.pw-meter { margin: 6px 0 4px; font-size: 13px; font-weight: 700; text-align: left; }
.pw-bar { height: 10px; background: #eee; border-radius: 999px; overflow: hidden; margin-bottom: 4px; }
.pw-bar-fill { height: 100%; border-radius: 999px; transition: width .2s; }

.account-chip {
  background: #fff;
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
  font-size: 16px;
  text-align: center;
  margin-bottom: 16px;
}
#reset-acc { display: block; margin: 16px auto 0; }

/* ---------- ログイン フォーム ---------- */
.login-box { max-width: 420px; margin: 0 auto; }
.login-lock { font-size: 60px; }
.login-box h2 { margin: 6px 0; }
.login-sub { color: rgba(58,46,74,.7); font-size: 15px; margin-bottom: 10px; }
.login-box .btn.big { width: 100%; margin-top: 10px; }
.login-box #li-back { display: block; margin: 10px auto 0; }
.pw-row { display: flex; gap: 8px; align-items: stretch; }
.pw-row .text-input { flex: 1; margin-bottom: 0; }
.eye-btn {
  border: 3px solid #e5e0ef;
  background: #fff;
  border-radius: 16px;
  padding: 0 16px;
  font-size: 20px;
  cursor: pointer;
}

/* ---------- こんなとき どうする？ ---------- */
.scenario-card { max-width: 500px; margin: 0 auto; }
.scenario-progress { font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.scenario-emoji { font-size: 58px; }
.scenario-situation { font-size: 19px; font-weight: 800; line-height: 1.7; margin: 12px 0 20px; }
.scenario-choices { display: flex; flex-direction: column; gap: 12px; }
.choice-btn {
  border: 3px solid #e5e0ef;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: transform .08s, border .15s;
}
.choice-btn:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--primary); }
.choice-btn.correct { border-color: var(--good); background: #ebfbee; }
.choice-btn.wrong { border-color: var(--bad); background: #fff0f0; }
.scenario-feedback { margin-top: 16px; font-weight: 700; font-size: 16px; line-height: 1.6; }
.scenario-feedback.good { color: var(--good); }
.scenario-feedback.bad { color: var(--bad); }

/* ---------- ガチャ ---------- */
.gacha-machine { max-width: 300px; margin: 0 auto 4px; text-align: center; }
.gacha-top { font-size: 60px; }
.gacha-body {
  position: relative;
  height: 150px;
  background: linear-gradient(135deg,#ffd6e0,#c3f0ff);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 5px solid #fff;
}
.gacha-ball { position: absolute; width: 40px; height: 40px; border-radius: 50%; animation: float 3s ease-in-out infinite; }
.b1 { background:#ff8787; left: 20%; top: 20%; animation-delay: 0s; }
.b2 { background:#74c0fc; left: 55%; top: 15%; animation-delay: .6s; }
.b3 { background:#ffd43b; left: 30%; top: 55%; animation-delay: 1.2s; }
.b4 { background:#b197fc; left: 65%; top: 55%; animation-delay: 1.8s; }
@keyframes float { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-14px);} }
.gacha-slot { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); width: 70px; height: 14px; background: #6c5ce7; border-radius: 999px; }
.gacha-info { text-align: center; font-size: 16px; margin: 14px 0; }

/* 2つの ガチャ えらび */
.gacha-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 460px;
  margin: 0 auto 12px;
}
.gacha-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: none;
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-family: inherit;
  border-top: 8px solid var(--primary);
  transition: transform .1s;
}
.gacha-type-btn.gt-icon   { border-top-color: #2f9e44; }
.gacha-type-btn.gt-frame  { border-top-color: #7048e8; }
.gacha-type-btn.gt-theme  { border-top-color: #f59f00; }
.gacha-type-btn.gt-effect { border-top-color: #e64980; }
.gacha-type-btn:hover { transform: translateY(-4px) scale(1.02); }
.gt-emoji { font-size: 44px; }
.gt-label { font-weight: 900; font-size: 17px; }
.gt-sub { font-size: 12px; color: rgba(58,46,74,.6); text-align: center; }
.gt-count {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
  background: #fff3bf;
  color: #b8860b;
  padding: 3px 12px;
  border-radius: 999px;
}
#coll-btn { display: block; margin: 10px auto; width: min(320px, 90%); }
@media (max-width: 420px) {
  .gacha-pick { grid-template-columns: 1fr; }
}
.gacha-hint { text-align: center; color: rgba(58,46,74,.6); font-size: 14px; margin-top: 10px; }

.gacha-rolling { text-align: center; padding: 40px 0; }
.rolling-machine { font-size: 90px; animation: roll .3s linear infinite; }
@keyframes roll { 0%{transform: rotate(-12deg);} 50%{transform: rotate(12deg);} 100%{transform: rotate(-12deg);} }
.rolling-text { font-size: 20px; font-weight: 800; color: var(--primary); }

.reveal-card {
  max-width: 380px;
  margin: 0 auto;
  position: relative;
  border: 4px solid #eee;
  background: var(--card);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow);
  text-align: center;
}
.reveal-card.rarity-1 { border-color: #ced4da; }
.reveal-card.rarity-2 { border-color: #4dabf7; box-shadow: 0 10px 30px rgba(77,171,247,.4); }
.reveal-card.rarity-3 { border-color: #ffd43b; box-shadow: 0 10px 40px rgba(255,212,59,.6); background: linear-gradient(180deg,#fffdf5,#fff); }
.new-badge { position: absolute; top: -14px; right: -8px; background: var(--bad); color: #fff; font-weight: 900; padding: 6px 14px; border-radius: 999px; transform: rotate(10deg); box-shadow: var(--shadow); }
.reveal-stars { font-size: 24px; color: #ffd43b; letter-spacing: 3px; }
.reveal-emoji { font-size: 100px; margin: 6px 0; }
.reveal-name { font-size: 26px; margin: 4px 0 8px; }
.reveal-msg { font-weight: 800; font-size: 16px; }
.reveal-msg.good { color: var(--good); }
.spin-in { animation: spinIn .6s cubic-bezier(.2,.8,.2,1.2); }
@keyframes spinIn { 0%{ transform: scale(0) rotate(-180deg); opacity:0;} 100%{ transform: scale(1) rotate(0); opacity:1;} }

/* ---------- コレクション ---------- */
.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px,1fr)); gap: 12px; margin: 16px 0; }
.coll-item {
  background: #fff;
  border-radius: 18px;
  padding: 14px 8px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  border-bottom: 5px solid #ced4da;
}
.coll-item.rarity-2 { border-bottom-color: #4dabf7; }
.coll-item.rarity-3 { border-bottom-color: #ffd43b; }
.coll-item.locked { filter: grayscale(1); opacity: .55; }
.coll-stars { font-size: 12px; color: #ffd43b; letter-spacing: 1px; }
.coll-emoji { font-size: 46px; }
.coll-name { font-size: 13px; font-weight: 800; margin-top: 2px; }
.coll-count { position: absolute; top: 8px; right: 8px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 900; padding: 2px 8px; border-radius: 999px; }
#back-gacha { display: block; margin: 0 auto; }

/* ---------- ガチャ結果の きせかえボタン ---------- */
.reveal-card #equip { display: block; width: 100%; margin: 6px 0 4px; }

/* ---------- きせかえ（マイページ） ---------- */
.dress-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.dress-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  border: 5px solid #fff;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  animation: bob 2.4s ease-in-out infinite;
}
.dress-preview-text { font-weight: 800; color: rgba(58,46,74,.6); font-size: 14px; }

.dress-head { font-size: 19px; margin: 22px 0 10px; }
.dress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
}
.dress-cell {
  position: relative;
  border: 3px solid transparent;
  background: #fff;
  border-radius: 18px;
  padding: 12px 6px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-family: inherit;
  transition: transform .1s, border .15s;
}
.dress-cell:hover { transform: translateY(-3px); }
.dress-cell.chosen { border-color: var(--primary); background: #f3f0ff; }
.dress-cell.locked { filter: grayscale(1); opacity: .6; cursor: help; }
.dress-cell.locked:hover { transform: none; }
.dress-emoji { font-size: 42px; line-height: 1.1; }
.dress-name { font-size: 12px; font-weight: 800; margin-top: 4px; }
.dress-check {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 26px;
  height: 26px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-weight: 900;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.dress-swatch {
  height: 52px;
  border-radius: 12px;
  border: 3px solid #fff;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 6px;
  font-size: 24px;
}
.dress-swatch span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: block;
}
.dress-swatch.locked-swatch { background: #eee; align-items: center; justify-content: center; padding: 0; }

.dress-hint {
  text-align: center;
  color: rgba(58,46,74,.6);
  font-size: 14px;
  margin: 20px 0 14px;
}
#to-gacha { display: block; margin: 0 auto; }

/* フレーム プレビュー用の ちいさな アバター */
.dress-mini {
  width: 54px;
  height: 54px;
  margin: 2px auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
}

/* ========================================================
   アバターフレーム（アイコンの まわりの かざり枠）
   .avatar-frame を つけた 円い アバターに、.fr-* で 枠を つける。
   かどの かざりは ::after（font-size:0.5em で 大きさが なじむ）。
   ======================================================== */
.avatar-frame { position: relative; box-sizing: border-box; overflow: visible; }
.mascot.avatar-frame {
  padding: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
}
.avatar-frame::after {
  position: absolute;
  top: -8px;
  right: -6px;
  font-size: 0.5em;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
}

.fr-sparkle { box-shadow: 0 0 0 4px #ffe066, 0 0 16px 4px rgba(255,212,59,.75); }
.fr-sparkle::after { content: "✨"; }

.fr-flower  { box-shadow: 0 0 0 4px #69db7c, 0 0 12px 2px rgba(64,192,87,.5); }
.fr-flower::after { content: "🌼"; }

.fr-star    { box-shadow: 0 0 0 4px #ffd43b, 0 0 12px 2px rgba(255,212,59,.55); }
.fr-star::after { content: "⭐"; }

.fr-heart   { box-shadow: 0 0 0 4px #ffa8c5, 0 0 0 8px #ffe0ec; }
.fr-heart::after { content: "💖"; }

.fr-fire {
  box-shadow: 0 0 0 4px #ff922b, 0 0 18px 5px rgba(255,120,20,.7);
  animation: frFire 1.1s ease-in-out infinite;
}
.fr-fire::after { content: "🔥"; }
@keyframes frFire {
  0%, 100% { box-shadow: 0 0 0 4px #ff922b, 0 0 16px 4px rgba(255,120,20,.6); }
  50%      { box-shadow: 0 0 0 4px #ffd43b, 0 0 26px 8px rgba(255,90,10,.85); }
}

.fr-crown   { box-shadow: 0 0 0 5px #ffd43b, 0 0 16px 3px rgba(230,180,0,.6); }
.fr-crown::after {
  content: "👑";
  top: -0.62em;
  right: auto;
  left: 50%;
  transform: translateX(-50%);
}

.fr-rainbow {
  border: 4px solid transparent;
  border-radius: 50%;
  background-image: linear-gradient(#fff0, #fff0),
                    conic-gradient(from 0deg, #ff6b6b, #ffd43b, #69db7c, #4dabf7, #b197fc, #ff6b6b);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 0 14px 3px rgba(150,120,255,.5);
}
.fr-rainbow::after { content: "🌈"; }

/* ========================================================
   背景エフェクト（ふる かざり）
   #fx-layer を 画面ぜんたいに ひろげ、粒（.fx-particle）を ながす。
   カードより うしろ（z-index:-1）で ふわふわ 動く。
   ======================================================== */
#fx-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}
.fx-particle {
  position: absolute;
  top: 0;
  will-change: transform;
  animation-iteration-count: infinite;
  animation-timing-function: linear, ease-in-out;
  user-select: none;
}
.fx-fall { animation-name: fxFall, fxSway; }
.fx-rise { animation-name: fxRise, fxSway; }
@keyframes fxFall {
  0%   { transform: translateY(-12vh) rotate(0deg); }
  100% { transform: translateY(112vh) rotate(320deg); }
}
@keyframes fxRise {
  0%   { transform: translateY(112vh) rotate(0deg); }
  100% { transform: translateY(-12vh) rotate(-200deg); }
}
@keyframes fxSway {
  0%, 100% { margin-left: -16px; }
  50%      { margin-left: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-particle { animation: none; }
}

/* ---------- トースト ---------- */
#toast-box {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
}
.toast {
  background: #3a2e4a;
  color: #fff;
  font-weight: 800;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .3s, transform .3s;
  font-size: 16px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.good { background: #2b8a3e; }
.toast.bad { background: #c92a2a; }

/* ---------- アニメーション ---------- */
.pop { animation: pop .35s cubic-bezier(.2,.8,.2,1.2); }
@keyframes pop { 0%{ transform: scale(.9); opacity: 0;} 100%{ transform: scale(1); opacity: 1;} }

/* ---------- スマホ ---------- */
@media (max-width: 560px) {
  .brand { display: none; }
  .hero-text h1 { font-size: 20px; }
  .typing-word { font-size: 40px; }
  .ox-btn { width: 110px; height: 110px; font-size: 44px; }
  .screen-title { font-size: 22px; }
}
