/* =========================================================
 *  SHINEDOM DREAM
 *  ダークスレート × ピンク〜バイオレットの輝き × 星モチーフ
 * ========================================================= */
:root {
  --bg: #1c1d29;
  --bg2: #262838;
  --panel: rgba(255, 255, 255, .045);
  --panel2: rgba(255, 255, 255, .08);
  --line: rgba(255, 255, 255, .12);
  --text: #ffffff;
  --muted: #a9abc2;
  --pink: #ff2e93;
  --violet: #9b3dff;
  --grad: linear-gradient(120deg, #ff2e93 0%, #c43bff 55%, #7b4dff 100%);
  --gold: #ffd166;
  --cyan: #8fe3ff;
  --red: #ff5d73;
  --green: #4fe3a6;
  --en: "Jost", "Futura", "Century Gothic", "Avenir Next", sans-serif;
  --ja: "IBM Plex Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  color: var(--text);
  font-family: var(--ja);
  line-height: 1.65;
  min-height: 100vh;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(196, 59, 255, .35) 0%, transparent 60%),
    radial-gradient(80% 50% at 100% 100%, rgba(255, 46, 147, .18) 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
/* 背景の大きな星 */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 4l13.2 31.6L97 38.2 71.4 60.6 79.4 94 50 76.2 20.6 94l8-33.4L3 38.2l33.8-2.6z' fill='%23ffffff' fill-opacity='.035'/%3E%3C/svg%3E") no-repeat right -120px top 40px / 520px;
}
#app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 18px 14px 48px; }

h1, h2, h3 { margin: 0; line-height: 1.3; }

/* ---------- ボタン ---------- */
button {
  font: inherit; color: inherit; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel2);
  border-radius: 14px; padding: 10px 14px;
  transition: transform .08s, background .2s, border-color .2s, box-shadow .2s;
}
button:hover { border-color: rgba(255, 255, 255, .5); }
button:active { transform: scale(.97); }
button.primary {
  background: var(--grad); border: none; border-radius: 999px;
  font-family: var(--en), var(--ja); font-weight: 700; letter-spacing: .12em;
  padding: 14px 20px; box-shadow: 0 8px 24px rgba(196, 59, 255, .35);
}
button.primary:hover { box-shadow: 0 10px 30px rgba(255, 46, 147, .5); }
button.wide { width: 100%; }
button:disabled { opacity: .35; cursor: default; transform: none; }
#contBtn, #shareBtn, #againBtn:not(.primary) {
  background: transparent; border: 1.5px solid rgba(255, 255, 255, .85); border-radius: 999px;
  font-weight: 700; letter-spacing: .05em; padding: 12px 18px;
}

/* ---------- パネル ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px; padding: 16px; margin-top: 14px;
  backdrop-filter: blur(6px);
}
.muted { color: var(--muted); font-size: .88em; }

/* 見出し：英字ラベル＋日本語 */
.event-head {
  font-size: .78rem; color: var(--muted); letter-spacing: .08em;
  display: flex; align-items: baseline; gap: 10px;
}
.event-head .en {
  font-family: var(--en); font-weight: 800; font-size: 1.05rem; letter-spacing: .14em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- タイトル画面 ---------- */
.title-screen { text-align: center; padding-top: 6vh; }
.hero { position: relative; padding: 40px 0 26px; }
.hero-star {
  position: absolute; left: 50%; top: 50%; width: 260px; height: 260px;
  transform: translate(-50%, -54%) rotate(-8deg);
  fill: rgba(196, 59, 255, .22);
  filter: drop-shadow(0 0 40px rgba(255, 46, 147, .55));
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: .85; transform: translate(-50%, -54%) rotate(-8deg) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -54%) rotate(-4deg) scale(1.05); }
}
.title-logo {
  position: relative; font-family: var(--en); font-weight: 800; line-height: .95;
  display: flex; flex-direction: column; align-items: center;
}
.title-logo .l1 {
  font-size: clamp(2.6rem, 12vw, 3.8rem); letter-spacing: .06em;
  text-shadow: 0 0 24px rgba(255, 255, 255, .25);
}
.title-logo .l2 {
  font-size: clamp(1.6rem, 7vw, 2.2rem); letter-spacing: .55em; margin-right: -.55em; margin-top: 6px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.title-sub {
  position: relative; color: var(--muted); margin-top: 14px; letter-spacing: .3em; font-size: .82rem;
}
.title-screen input {
  width: 100%; font: inherit; font-size: 1.1rem; text-align: center;
  padding: 14px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, .25); color: var(--text); margin-bottom: 12px;
}
.title-screen input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 46, 147, .25); }
.title-screen .rules { text-align: left; font-size: .85rem; color: var(--muted); }
.title-screen .rules ul { margin: 0; padding-left: 1.2em; }
.title-screen .rules li { margin: 4px 0; }
.title-screen .rules li::marker { content: "★ "; color: var(--pink); font-size: .8em; }

/* ---------- ヘッダー ---------- */
.hud { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.hud .name { font-size: 1.5rem; font-weight: 700; letter-spacing: .04em; }
.hud .age { font-size: .85rem; color: var(--muted); text-align: right; line-height: 1.4; }
.hud .age b { font-family: var(--en); font-size: 1.9rem; font-weight: 800; color: var(--text); }
.progress { height: 3px; background: rgba(255, 255, 255, .08); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.progress > div { height: 100%; background: var(--grad); }
.unit-badge {
  display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .05em;
  padding: 2px 12px; border-radius: 999px; border: 1.5px solid currentColor; margin-top: 4px;
}
.seasons { display: flex; gap: 6px; margin-top: 12px; }
.seasons span {
  flex: 1; text-align: center; font-size: .74rem; padding: 4px 0; border-radius: 999px;
  background: rgba(255, 255, 255, .05); color: var(--muted);
}
.seasons span.done { color: rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .1); }
.seasons span.now { background: var(--grad); color: #fff; font-weight: 700; box-shadow: 0 4px 14px rgba(255, 46, 147, .4); }
.seasons span.big { outline: 1px solid rgba(255, 209, 102, .6); }

/* ---------- 能力 ---------- */
.ic { width: 1.05em; height: 1.05em; vertical-align: -.16em; margin-right: .3em; flex-shrink: 0; }
.stats { display: grid; gap: 9px; }
.stat { display: grid; grid-template-columns: 6.6em 1fr 2.4em; align-items: center; gap: 10px; font-size: .9rem; }
.stat .label { display: flex; align-items: center; white-space: nowrap; }
.stat .bar { height: 8px; background: rgba(255, 255, 255, .07); border-radius: 4px; overflow: hidden; }
.stat .bar > div { height: 100%; border-radius: 4px; transition: width .5s; box-shadow: 0 0 10px currentColor; }
.stat .val { text-align: right; font-family: var(--en); font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.stat.unit-stat .label::after { content: "★"; color: var(--gold); font-size: .75em; margin-left: 3px; }
.record {
  display: flex; justify-content: space-around; text-align: center; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line); font-size: .75rem; color: var(--muted);
}
.record b { display: block; font-family: var(--en); font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1.2; }

/* ---------- 試合・練習 ---------- */
.match-name { font-size: 1.2rem; font-weight: 700; margin: 4px 0 10px; }
.match-name.big { color: var(--gold); text-shadow: 0 0 18px rgba(255, 209, 102, .45); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choices button { text-align: left; padding: 11px 13px; background: rgba(255, 255, 255, .05); }
.choices button:hover:not(:disabled) { background: rgba(255, 46, 147, .12); border-color: var(--pink); }
.choices button small { display: block; color: var(--muted); font-size: .74rem; margin-top: 2px; }
.choices button.unit-rec { border-color: rgba(255, 209, 102, .7); }

/* ---------- 結果 ---------- */
.result h3 { font-size: .95rem; margin: 14px 0 4px; color: var(--cyan); letter-spacing: .04em; }
.result h3:first-child { margin-top: 0; }
.result p { margin: 4px 0; }
.result .verdict { font-family: var(--en), var(--ja); font-size: 1.7rem; font-weight: 800; letter-spacing: .12em; margin: 6px 0; }
.verdict.win { background: linear-gradient(90deg, #ffd166, #ff2e93); -webkit-background-clip: text; background-clip: text; color: transparent; }
.verdict.lose { color: var(--red); }
.delta {
  display: inline-flex; align-items: center; font-size: .8rem; margin: 3px 6px 3px 0;
  padding: 1px 10px; border-radius: 999px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line);
}
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.event-box { border-left: 3px solid var(--pink); padding: 2px 0 2px 12px; margin-top: 14px; }
.event-box .ev-title { font-family: var(--en), var(--ja); font-weight: 700; letter-spacing: .06em; color: var(--pink); }
.event-choices { display: grid; gap: 8px; margin-top: 8px; }
.event-choices button { border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, .7); background: transparent; font-weight: 700; }
.fade-in { animation: fade .35s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- ユニット選択 ---------- */
.unit-list { display: grid; gap: 10px; margin-top: 12px; }
.unit-list button { text-align: left; border-left-width: 5px; border-radius: 14px; background: rgba(255, 255, 255, .04); }
.unit-list button b { display: block; font-size: 1.08rem; letter-spacing: .04em; }
.unit-list button small { color: var(--muted); }

/* ---------- エンディング ---------- */
.ending { text-align: center; }
.ending .retire { font-family: var(--en); font-weight: 700; color: var(--muted); letter-spacing: .3em; font-size: .78rem; }
.ending .nickname {
  font-size: 1.9rem; font-weight: 700; margin: 12px 0 2px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 16px rgba(255, 46, 147, .35));
}
.ending .fullname { font-size: 1.25rem; font-weight: 700; margin-bottom: 10px; }
.ending .comment { text-align: left; font-size: .92rem; }
.history { text-align: left; font-size: .82rem; max-height: 240px; overflow-y: auto; margin-top: 6px; }
.history div { border-bottom: 1px solid var(--line); padding: 5px 0; }
.btn-row { display: flex; gap: 8px; margin-top: 14px; }
.btn-row button { flex: 1; }
.footer-link { text-align: center; margin-top: 22px; }
.footer-link button { background: none; border: none; color: var(--muted); font-size: .78rem; text-decoration: underline; }

/* ---------- タイトル（ベルト） ---------- */
.belts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.belt {
  font-size: .72rem; font-weight: 700; padding: 2px 10px; border-radius: 999px;
  color: var(--bc); border: 1px solid var(--bc);
  background: color-mix(in srgb, var(--bc) 14%, transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--bc) 35%, transparent);
}
.title-info {
  font-size: .84rem; font-weight: 700; color: var(--bc);
  border: 1px solid color-mix(in srgb, var(--bc) 60%, transparent); border-radius: 999px;
  padding: 4px 14px; margin-bottom: 10px; display: inline-block;
  background: color-mix(in srgb, var(--bc) 10%, transparent);
}
.title-note { font-weight: 700; margin: 8px 0; padding: 8px 12px; border-radius: 12px; background: rgba(0, 0, 0, .3); }
.title-note.get { color: var(--gold); box-shadow: 0 0 18px rgba(255, 209, 102, .3); border: 1px solid rgba(255, 209, 102, .5); }
.title-note.defend { color: var(--green); }
.title-note.lose { color: var(--red); }
.title-row { border-left: 4px solid var(--bc); padding: 4px 12px; margin-top: 10px; font-size: .9rem; }
.title-row b { color: var(--bc); }

/* ---------- 選手・対戦カード ---------- */
.next-card { background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-top: 10px; }
.nc-head { font-size: .78rem; color: var(--cyan); margin-bottom: 6px; letter-spacing: .04em; }
.pls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }
.pl {
  display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  font-size: .9rem; font-weight: 700; padding: 4px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line);
}
.pl small { color: var(--muted); font-weight: 400; font-size: .68rem; }
button.pl.pick { padding: 6px 13px; }
button.pl.pick.sel { border-color: var(--pink); background: rgba(255, 46, 147, .22); box-shadow: 0 0 12px rgba(255, 46, 147, .35); }
.choices small .st { display: inline-block; white-space: nowrap; margin-right: 8px; }
.title-info { border-radius: 12px; }
.title-screen .rules ul.effects { list-style: none; padding-left: 0; }
.title-screen .rules ul.effects li::marker { content: none; }
.title-screen .rules ul.effects li { padding-left: 1.4em; text-indent: -1.4em; }

/* タイトル挑戦 / シングルの選択 */
.mode-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.mode-toggle button { border-radius: 14px; text-align: left; font-weight: 700; font-size: .88rem; background: rgba(255, 255, 255, .04); }
.mode-toggle button small { display: block; font-weight: 400; font-size: .7rem; color: var(--muted); margin-top: 2px; }
.mode-toggle button.sel { border-color: var(--pink); background: rgba(255, 46, 147, .2); box-shadow: 0 0 12px rgba(255, 46, 147, .3); }
