/* はじけるのがみえる あわパズル — スマホを先に考えた、たのしい みためにした レイアウト */

:root {
  --bg: #ffe6f4;
  --bg2: #bfeaff;
  --ink: #2b1d4f;
  --muted: #6b5a8e;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-line: rgba(120, 80, 190, 0.22);
  --dot: rgba(255, 255, 255, 0.55);
  --p0: #ff4f9a;
  --p0d: #c81e6a;
  --p1: #ff6b3d;
  --hint: #0ea5e9;
  --warn: #f59e0b;
  --gutter: 12px;
  --pop: 'Mochiy Pop One', 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #2a1f5c; --bg2: #121a3d; --ink: #f1ebff; --muted: #b9a8e6;
    --panel: rgba(255, 255, 255, 0.1); --panel-line: rgba(200, 170, 255, 0.25); --dot: rgba(255, 255, 255, 0.06);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #2a1f5c; --bg2: #121a3d; --ink: #f1ebff; --muted: #b9a8e6;
  --panel: rgba(255, 255, 255, 0.1); --panel-line: rgba(200, 170, 255, 0.25); --dot: rgba(255, 255, 255, 0.06);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg2); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 25px 25px, var(--dot) 11px, transparent 12px) 0 0 / 70px 70px,
    radial-gradient(circle at 60px 58px, var(--dot) 6px, transparent 7px) 0 0 / 70px 70px,
    linear-gradient(170deg, var(--bg) 0%, var(--bg2) 75%) fixed;
  color: var(--ink);
  font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Meiryo', sans-serif;
  font-weight: 700;
  line-height: 1.5;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  -webkit-user-select: none; user-select: none;
  animation: bgmove 30s linear infinite;
}
@keyframes bgmove { to { background-position: 70px -70px, 70px -70px, 0 0; } }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: 0.45; }

/* ---------- 上のバー ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px var(--gutter) 4px; max-width: 980px; margin: 0 auto;
}
.title { margin: 0; white-space: nowrap; display: flex; align-items: center; gap: 6px; line-height: 1; }
.t-sub { font-size: 12px; font-weight: 900; color: var(--muted); }
.t-main { display: flex; font-family: var(--pop); font-weight: 400; font-size: 27px; letter-spacing: -0.02em; }
.t-main i {
  font-style: normal; display: inline-block;
  -webkit-text-stroke: 7px #fff; paint-order: stroke fill;
  text-shadow: 0 3px 0 rgba(60, 20, 110, 0.35);
  animation: hop 2.4s ease-in-out infinite;
}
.t-main .c1 { color: #ff3d7f; transform: rotate(-8deg); animation-delay: 0s; }
.t-main .c2 { color: #22b85f; transform: rotate(6deg); animation-delay: 0.12s; }
.t-main .c3 { color: #2f86ff; transform: rotate(-4deg); animation-delay: 0.24s; }
.t-main .c4 { color: #ffb300; transform: rotate(7deg); animation-delay: 0.36s; }
.t-main .c5 { color: #9b4dff; transform: rotate(-6deg); animation-delay: 0.48s; }
@keyframes hop { 0%, 70%, 100% { translate: 0 0; } 80% { translate: 0 -5px; } 90% { translate: 0 1px; } }
.top-actions { display: flex; gap: 6px; }
.chip {
  border: 3px solid #fff; background: linear-gradient(180deg, #b388ff, #7c4dff); color: #fff;
  border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 900; white-space: nowrap;
  box-shadow: 0 3px 0 #5a2fc2, 0 4px 8px rgba(60, 20, 120, 0.25);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
.chip:active { transform: translateY(2px); box-shadow: 0 1px 0 #5a2fc2; }
#btn-guide { background: linear-gradient(180deg, #4fd1ff, #1e9bff); box-shadow: 0 3px 0 #0e6fc2, 0 4px 8px rgba(20, 60, 120, 0.25); }
#btn-pause { background: linear-gradient(180deg, #5ee59a, #1fb35a); box-shadow: 0 3px 0 #0e7a3a, 0 4px 8px rgba(20, 90, 50, 0.25); }
.chip.on { background: linear-gradient(180deg, #ffd54a, #ff9f0a) !important; box-shadow: 0 3px 0 #c76b00 !important; }

/* ---------- 全体の並び ---------- */
.layout { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 var(--gutter) 12px; }
.arena { display: flex; gap: 8px; align-items: flex-start; justify-content: center; }
.side-me, .side-col { display: flex; flex-direction: column; gap: 4px; }
.side-col { align-items: stretch; }
.well {
  position: relative; border-radius: 20px; padding: 6px;
  background: linear-gradient(135deg, #ff7ab6 0%, #ffd43b 30%, #5eead4 55%, #60a5fa 78%, #c084fc 100%);
  box-shadow: 0 5px 0 rgba(90, 40, 150, 0.35), 0 10px 22px rgba(60, 20, 120, 0.25);
}
.well::after {
  content: ''; position: absolute; inset: 6px; border-radius: 14px; pointer-events: none;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.9), inset 0 6px 14px rgba(0, 0, 0, 0.25);
}
.well canvas { display: block; border-radius: 14px; touch-action: none; }
.well.small { border-radius: 14px; padding: 4px; box-shadow: 0 4px 0 rgba(90, 40, 150, 0.3); }
.well.small::after { inset: 4px; border-radius: 10px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9); }
.well.small canvas { border-radius: 10px; }

.phead {
  display: flex; align-items: center; gap: 6px; min-height: 36px;
  background: var(--panel); border: 3px solid #fff; border-radius: 999px; padding: 2px 12px 2px 3px;
  box-shadow: 0 3px 0 var(--panel-line);
}
.phead .ava {
  width: 32px; height: 32px; flex: none; border-radius: 50%; padding: 2px;
  background: radial-gradient(circle at 40% 35%, #fff, color-mix(in srgb, var(--cc, #ff4f9a) 35%, #fff));
  box-shadow: 0 0 0 2px var(--cc, #ff4f9a);
}
.phead .ava svg, .opp-face svg, .result-face svg, .char-card svg, .sp-face svg { width: 100%; height: 100%; display: block; }
.phead b { font-size: 14px; font-family: var(--pop); font-weight: 400; }
.phead .score { margin-left: auto; font-size: 20px; font-family: var(--pop); font-weight: 400; font-variant-numeric: tabular-nums; color: var(--p0); }
.phead .score small { font-size: 11px; color: var(--muted); margin-right: 4px; font-family: 'Zen Maru Gothic', sans-serif; font-weight: 900; }

/* とどく くもりあわ */
.pend { display: flex; gap: 2px; align-items: center; min-height: 18px; flex-wrap: nowrap; overflow: hidden; padding-left: 4px; }
.pend i { display: block; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0%, #e2e8f0 45%, #94a3b8 100%); box-shadow: 0 0 0 2px #fff, 0 2px 3px rgba(0, 0, 0, 0.25); flex: none; }
.pend i.s1 { width: 10px; height: 10px; }
.pend i.s6 { width: 16px; height: 16px; }
.pend i.s30 { width: 18px; height: 18px; background: radial-gradient(circle at 35% 30%, #fff 0%, #fecaca 40%, #ef4444 100%); }
.pend.small { min-height: 14px; }
.pend.small i.s1 { width: 7px; height: 7px; }
.pend.small i.s6 { width: 11px; height: 11px; }
.pend.small i.s30 { width: 13px; height: 13px; }
.pend.warn { animation: shake 0.4s; }

.nextbox {
  position: relative; display: flex; flex-direction: column; align-items: center;
  background: linear-gradient(180deg, #4b3fb4, #2c2780); border: 3px solid #fff; border-radius: 16px; padding: 14px 6px 6px;
  box-shadow: 0 4px 0 rgba(90, 40, 150, 0.35);
  margin-top: 8px;
}
.nextbox .lbl {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(180deg, #ffd54a, #ff9f0a); color: #4a2a00; border: 2px solid #fff; border-radius: 999px;
  padding: 0 10px; font-size: 11px; font-family: var(--pop); font-weight: 400; line-height: 18px; white-space: nowrap;
}
.nextbox canvas { display: block; }

.solo-info { display: none; flex-direction: column; gap: 6px; font-size: 12px; }
body.solo .solo-info { display: flex; }
.solo-info div { background: var(--panel); border: 3px solid #fff; border-radius: 14px; padding: 4px 6px; text-align: center; color: var(--muted); box-shadow: 0 3px 0 var(--panel-line); }
.solo-info b { display: block; font-size: 19px; font-family: var(--pop); font-weight: 400; color: var(--p0); font-variant-numeric: tabular-nums; line-height: 1.25; }

.opp { display: flex; flex-direction: column; gap: 3px; align-items: center; position: relative; }
body.solo .opp { display: none; }
.opp-face {
  width: 70px; height: 70px; border-radius: 50%; padding: 5px;
  background: radial-gradient(circle at 40% 30%, #fff, color-mix(in srgb, var(--cc, #ff4f9a) 40%, #fff) 70%);
  border: 4px solid #fff; box-shadow: 0 0 0 3px var(--cc, #ff4f9a), 0 6px 12px rgba(60, 20, 120, 0.25);
  animation: float 2.6s ease-in-out infinite;
}
.opp-face.bounce { animation: bounce 0.5s, float 2.6s ease-in-out 0.5s infinite; }
@keyframes float { 50% { transform: translateY(-3px) rotate(2deg); } }
.opp-name {
  font-size: 12px; font-family: var(--pop); font-weight: 400; line-height: 1.15; text-align: center;
  background: var(--cc-name, linear-gradient(180deg, #ff7ab6, #ff3d7f)); color: #fff; border: 2px solid #fff; border-radius: 10px;
  padding: 2px 8px; box-shadow: 0 2px 0 rgba(120, 20, 70, 0.35); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
.opp-name small { font-size: 9px; font-family: 'Zen Maru Gothic', sans-serif; font-weight: 900; opacity: 0.95; }
.speech {
  position: absolute; top: 100px; left: -4px; right: -4px; z-index: 5;
  padding: 5px 8px; border-radius: 14px; border: 3px solid #2b1d4f;
  background: #fff; color: #2b1d4f; font-size: 12px; font-weight: 900; line-height: 1.35; text-align: center;
  box-shadow: 0 4px 0 rgba(43, 29, 79, 0.25);
  opacity: 0; transform: scale(0.5) rotate(-6deg); transform-origin: center top; transition: opacity 0.18s, transform 0.25s cubic-bezier(.3, 1.8, .5, 1); pointer-events: none;
}
.speech::before { content: ''; position: absolute; top: -10px; left: 50%; margin-left: -8px; border: 8px solid transparent; border-top: 0; border-bottom: 9px solid #2b1d4f; }
.speech::after { content: ''; position: absolute; top: -5px; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top: 0; border-bottom: 6px solid #fff; }
.speech.show { opacity: 1; transform: scale(1) rotate(0); }
@keyframes bounce { 30% { transform: translateY(-10px) scale(1.1); } 60% { transform: translateY(0) scale(0.95); } }
@keyframes shake { 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* ---------- じょうたい ---------- */
.status {
  min-height: 40px; padding: 4px 14px; border-radius: 999px; width: 100%; max-width: 520px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--panel); border: 3px solid #fff; box-shadow: 0 3px 0 var(--panel-line);
  font-size: 14.5px; font-weight: 900; line-height: 1.3;
}
.status.pop { background: linear-gradient(180deg, #fff6c2, #ffe066); color: #7a3e00; box-shadow: 0 3px 0 #e0a800; animation: wiggle 0.5s; }
.status.hint { background: linear-gradient(180deg, #d9f4ff, #9fdcff); color: #064e7a; box-shadow: 0 3px 0 #38a3e0; }
.status.danger { background: linear-gradient(180deg, #ffe0e6, #ffb3c1); color: #9b1030; box-shadow: 0 3px 0 #ff6b86; }
@keyframes wiggle { 25% { transform: rotate(-1.5deg) scale(1.03); } 50% { transform: rotate(1.5deg) scale(1.03); } 75% { transform: rotate(-0.5deg); } }

/* ---------- そうさ ボタン（キャンディ） ---------- */
.pad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; width: 100%; max-width: 520px; }
.pad button {
  --b1: #8fd3ff; --b2: #2f9bff; --b3: #1569c7;
  min-height: 60px; border-radius: 20px; border: 3px solid #fff; color: #fff;
  background: radial-gradient(ellipse at 50% 15%, rgba(255, 255, 255, 0.55), transparent 55%), linear-gradient(180deg, var(--b1), var(--b2));
  box-shadow: 0 5px 0 var(--b3), 0 7px 10px rgba(40, 20, 90, 0.25);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2px 0; -webkit-touch-callout: none; transition: transform 0.05s;
}
.pad button[data-act="A"], .pad button[data-act="C"] { --b1: #d6b3ff; --b2: #9b4dff; --b3: #6a22c9; }
.pad button[data-act="D"] { --b1: #8af0b5; --b2: #1fb35a; --b3: #0e7a3a; }
.pad button[data-act="H"] { --b1: #ffd27a; --b2: #ff8a00; --b3: #c25e00; }
.pad button i { font-style: normal; font-size: 25px; line-height: 1; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.pad button small { font-size: 10px; font-weight: 900; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); }
.pad button.down, .pad button:active { transform: translateY(4px) scale(0.97); box-shadow: 0 1px 0 var(--b3), 0 2px 4px rgba(40, 20, 90, 0.2); }
.controls { display: flex; gap: 8px; width: 100%; max-width: 520px; }
.big {
  flex: 1; min-height: 44px; border-radius: 999px; border: 3px solid #fff;
  background: linear-gradient(180deg, #fff, #f1e9ff); font-size: 16px; font-family: var(--pop); font-weight: 400; color: #5b2bbf;
  box-shadow: 0 4px 0 #b9a1ec, 0 6px 10px rgba(40, 20, 90, 0.18);
}
.big:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #b9a1ec; }
.big.hint { background: radial-gradient(ellipse at 50% 10%, rgba(255, 255, 255, 0.7), transparent 60%), linear-gradient(180deg, #fff38a, #ffc400); color: #6b3a00; box-shadow: 0 4px 0 #d18f00, 0 6px 10px rgba(120, 70, 0, 0.2); }
body.vs #btn-undo { display: none; }
.big.power { position: relative; overflow: hidden; color: #fff; background: linear-gradient(180deg, #c9b8e8, #9d86c9); box-shadow: 0 4px 0 #6f5a9c, 0 6px 10px rgba(40, 20, 90, 0.18); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); }
.big.power .pw-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(180deg, #ff9cc8, #ff3d7f); transition: width 0.3s; }
.big.power .pw-label { position: relative; }
.big.power.full { background: linear-gradient(180deg, #ff9cc8, #ff3d7f); box-shadow: 0 4px 0 var(--p0d), 0 0 0 4px #ffe14d, 0 6px 16px rgba(255, 61, 127, 0.5); animation: pwpulse 0.9s ease-in-out infinite; }
.big.power.full .pw-fill { width: 100% !important; background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.6), transparent 60%), conic-gradient(from 0deg, #ff4d6d, #ffb000, #ffe14d, #3ddc84, #3aa0ff, #a463ff, #ff4d6d); opacity: 0.9; }
@keyframes pwpulse { 50% { transform: scale(1.05) rotate(-1deg); } }
.pgauge { width: 72px; height: 9px; border-radius: 99px; background: rgba(120, 90, 180, 0.25); border: 2px solid #fff; overflow: hidden; box-shadow: 0 1px 0 rgba(90, 40, 150, 0.3); }
.pgauge i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff9cc8, #ff3d7f); transition: width 0.3s; }
.pgauge.full i { background: conic-gradient(from 90deg, #ff4d6d, #ffb000, #ffe14d, #3ddc84, #3aa0ff, #a463ff, #ff4d6d); animation: blinkg 0.6s infinite; }
@keyframes blinkg { 50% { opacity: 0.55; } }

/* ---------- VS の がめん ---------- */
.splash {
  position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center; gap: 4vw;
  background: repeating-linear-gradient(-30deg, rgba(255, 255, 255, 0.06) 0 24px, transparent 24px 48px), radial-gradient(circle, #6d3bd9 0%, #2b1660 75%);
  pointer-events: none;
}
.splash.show { display: flex; animation: spOut 1.55s forwards; }
@keyframes spOut { 0% { opacity: 0; } 8%, 82% { opacity: 1; } 100% { opacity: 0; } }
.sp-side { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sp-side b { font-family: var(--pop); font-weight: 400; font-size: 20px; color: #fff; -webkit-text-stroke: 6px #2b1660; paint-order: stroke fill; }
.sp-face {
  width: min(32vw, 170px); height: min(32vw, 170px); border-radius: 50%; padding: 10px;
  background: radial-gradient(circle at 40% 30%, #fff, color-mix(in srgb, var(--cc) 45%, #fff) 70%);
  border: 6px solid #fff; box-shadow: 0 0 0 5px var(--cc), 0 12px 30px rgba(0, 0, 0, 0.4);
}
.splash.show .sp-l { animation: inL 0.45s cubic-bezier(.2, 1.6, .5, 1) both; }
.splash.show .sp-r { animation: inR 0.45s cubic-bezier(.2, 1.6, .5, 1) 0.1s both; }
.sp-vs {
  font-family: var(--pop); font-size: min(18vw, 96px); color: #ffd43b; line-height: 1;
  -webkit-text-stroke: 10px #ff3d7f; paint-order: stroke fill; text-shadow: 0 8px 0 #2b1660;
}
.splash.show .sp-vs { animation: vsIn 0.5s cubic-bezier(.2, 1.8, .5, 1) 0.35s both; }
@keyframes inL { from { transform: translateX(-70vw) rotate(-20deg); } }
@keyframes inR { from { transform: translateX(70vw) rotate(20deg); } }
@keyframes vsIn { from { transform: scale(3) rotate(-20deg); opacity: 0; } }

/* ---------- ダイアログ ---------- */
dialog {
  border: 4px solid #fff; border-radius: 26px; padding: 0;
  width: min(92vw, 480px); max-height: 90vh;
  background: linear-gradient(180deg, #fff7fc, #f1f6ff); color: #2b1d4f;
  box-shadow: 0 8px 0 rgba(90, 40, 150, 0.35), 0 24px 60px rgba(30, 10, 70, 0.45);
}
dialog:focus, dialog:focus-visible { outline: none; }
.dlg { border-top: 8px solid transparent; border-image: linear-gradient(90deg, #ff7ab6, #ffd43b, #5eead4, #60a5fa, #c084fc) 1; }
dialog::backdrop { background: rgba(40, 16, 90, 0.55); }
dialog[open] { animation: dlgIn 0.3s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes dlgIn { from { transform: translateY(24px) scale(0.85); opacity: 0; } }
.dlg { padding: 14px 18px 16px; max-height: calc(90vh - 8px); overflow: auto; }
dialog:has(.wide) { width: min(94vw, 720px); }
.dlg h2 { margin: 0 0 10px; font-size: 22px; font-family: var(--pop); font-weight: 400; color: #7c3aed; }
.dlg h3 { margin: 14px 0 4px; font-size: 16px; font-weight: 900; color: #db2777; }
.dlg p { margin: 4px 0; font-size: 14.5px; font-weight: 500; }
.dlg ul, .dlg ol { margin: 4px 0; padding-left: 1.4em; font-size: 14.5px; font-weight: 500; }
.dlg li { margin: 3px 0; }
.dlg fieldset { border: none; margin: 0 0 12px; padding: 0; }
.dlg legend { font-weight: 900; font-size: 14px; margin-bottom: 6px; padding: 0; color: #7c3aed; }
.dlg fieldset[hidden] { display: none; }
.welcome { background: linear-gradient(180deg, #fff6c2, #ffe98a); border: 3px solid #fff; box-shadow: 0 3px 0 #e8c14a; border-radius: 16px; padding: 8px 12px !important; color: #6b3a00; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { flex: 1 1 auto; }
.seg input, .char-grid input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block; text-align: center; padding: 9px 10px; border-radius: 16px;
  border: 3px solid #fff; background: #fff; font-weight: 900; font-size: 14.5px; cursor: pointer;
  box-shadow: 0 3px 0 #d9ccf2;
}
.seg span small { display: block; font-size: 11px; font-weight: 700; opacity: 0.8; }
.seg input:checked + span { background: linear-gradient(180deg, #ff8cc0, #ff3d7f); color: #fff; box-shadow: 0 3px 0 var(--p0d); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2); }
.seg input:focus-visible + span, .char-grid input:focus-visible + .char-card { outline: 3px solid var(--hint); }

.char-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.char-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 0;
  padding: 5px 2px 5px; border-radius: 16px; border: 3px solid #fff; background: #fff; cursor: pointer;
  box-shadow: 0 3px 0 #d9ccf2; transition: transform 0.15s;
}
.char-card .pic {
  width: 54px; height: 54px; border-radius: 50%; padding: 4px;
  background: radial-gradient(circle at 40% 30%, #fff, color-mix(in srgb, var(--cc) 35%, #fff) 75%);
}
.char-card b { font-size: 12px; font-family: var(--pop); font-weight: 400; line-height: 1.3; white-space: nowrap; }
.char-card small { font-size: 10px; color: var(--muted); line-height: 1.2; font-weight: 700; }
.char-card .stars { color: #ffb300; font-size: 10px; letter-spacing: -1px; line-height: 1.1; text-shadow: 0 1px 0 #c76b00; }
.char-card .beat { position: absolute; top: 2px; right: 3px; width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 50%; font-size: 11px; color: #fff; background: #22b85f; font-weight: 900; }
.char-grid input:checked + .char-card { border-color: var(--cc); box-shadow: 0 0 0 3px var(--cc), 0 4px 0 color-mix(in srgb, var(--cc) 60%, #000); transform: translateY(-3px); }
.char-grid input:checked + .char-card .pic { animation: hopc 0.8s ease-in-out infinite; }
@keyframes hopc { 50% { transform: translateY(-3px) rotate(-4deg); } }
.char-grid.mini { grid-template-columns: repeat(8, 1fr); gap: 4px; }
.char-grid.mini .char-card { padding: 2px; border-radius: 12px; }
.char-grid.mini .pic { width: 100%; height: auto; aspect-ratio: 1; }
.opp-intro { font-size: 13px !important; color: var(--muted); margin-top: 6px !important; min-height: 2.6em; }
body.solo-form .vs-only, body.vs-form .solo-only { display: none; }

.dlg-buttons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.dlg-buttons button, .menu button {
  min-height: 46px; padding: 8px 18px; border-radius: 999px; border: 3px solid #fff;
  background: #fff; font-weight: 900; font-size: 15px; color: #5b2bbf; box-shadow: 0 4px 0 #cdbdf0;
}
.dlg-buttons button:active, .menu button:active { transform: translateY(3px); box-shadow: 0 1px 0 #cdbdf0; }
.dlg-buttons button[hidden], .menu button[hidden] { display: none; }
button.primary { background: linear-gradient(180deg, #ff8cc0, #ff3d7f) !important; color: #fff !important; box-shadow: 0 4px 0 var(--p0d) !important; font-family: var(--pop); font-weight: 400 !important; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2); }
button.danger { color: #dc2626 !important; }
.menu { display: flex; flex-direction: column; gap: 9px; }
.menu button { width: 100%; font-size: 16px; }
.toggle { display: flex; align-items: center; gap: 10px; padding: 10px 4px; font-size: 15px; font-weight: 700; border-bottom: 2px dotted #e2d6f7; }
.toggle input { width: 24px; height: 24px; accent-color: var(--p0); flex: none; }

.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.g-item { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 3px solid #fff; border-radius: 16px; padding: 8px; box-shadow: 0 3px 0 #d9ccf2; }
.g-figs { display: flex; align-items: center; gap: 2px; flex: none; }
.g-figs svg { width: 64px; height: auto; display: block; border-radius: 8px; }
.g-figs .arr { font-weight: 900; color: var(--muted); }
.g-body { flex: 1; min-width: 0; }
.g-body b { font-size: 15px; font-family: var(--pop); font-weight: 400; color: #db2777; }
.g-body p { margin: 2px 0 0; font-size: 13px; line-height: 1.5; }
.pw-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; font-size: 34px; background: conic-gradient(#ff4d6d, #ffb000, #ffe14d, #3ddc84, #3aa0ff, #a463ff, #ff4d6d); box-shadow: inset 0 0 0 4px #fff; }
.pw-list { grid-column: 1 / -1; }
.pw-list ul { list-style: none; padding: 0; margin: 4px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 4px 10px; font-size: 12.5px; }
.pw-list li { display: flex; align-items: center; gap: 6px; margin: 0; line-height: 1.35; }
.pw-list li b { font-size: 13px; color: #7c3aed; font-family: 'Zen Maru Gothic', sans-serif; font-weight: 900; white-space: nowrap; }
.pw-list li small { color: var(--muted); font-size: 11px; }
.pw-pic { width: 34px; height: 34px; flex: none; }
.pw-pic svg { width: 100%; height: 100%; }

.result { text-align: center; overflow: hidden; }
.result-face { position: relative; width: 120px; height: 120px; margin: 4px auto 0; }
.result-face::before {
  content: ''; position: absolute; inset: -60px; z-index: -1; border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 212, 59, 0.45) 0 12deg, transparent 12deg 24deg);
  mask: radial-gradient(circle, #000 30%, transparent 70%); -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%);
  animation: spin 8s linear infinite;
}
.result-face svg { position: relative; animation: float 2.4s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result h2 { font-size: 34px; margin: 2px 0 4px; -webkit-text-stroke: 7px #fff; paint-order: stroke fill; text-shadow: 0 4px 0 rgba(90, 40, 150, 0.3); }
.result h2.win { color: #ff8a00; animation: vsIn 0.5s cubic-bezier(.2, 1.8, .5, 1) both; }
.result h2.lose { color: #7c6ba8; }
.result .dlg-buttons { justify-content: center; }
.score-table { margin: 10px auto 0; border-collapse: separate; border-spacing: 0; font-size: 14px; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 3px 0 #d9ccf2; }
.score-table th, .score-table td { padding: 5px 12px; border-bottom: 2px dotted #eee6fb; text-align: right; }
.score-table tr:last-child td { border-bottom: none; }
.score-table th:first-child, .score-table td:first-child { text-align: left; }
.score-table th { color: #7c3aed; }
.score-table .newbest { color: #ff3d7f; font-weight: 900; }

/* ---------- トースト・あわふぶき ---------- */
.toast {
  position: fixed; left: 50%; top: 36%; z-index: 50; pointer-events: none;
  transform: translate(-50%, -50%) scale(0.4) rotate(-8deg); opacity: 0;
  padding: 10px 22px; border-radius: 999px; font-size: 22px; font-family: var(--pop); font-weight: 400;
  background: linear-gradient(180deg, #fff, #ffe5f1); color: #ff3d7f; border: 4px solid #fff;
  box-shadow: 0 5px 0 rgba(200, 30, 106, 0.35), 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s cubic-bezier(.3, 1.8, .5, 1), opacity 0.2s; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-3deg); }
.toast.big { background: linear-gradient(180deg, #fff38a, #ffc400); color: #a33a00; font-size: 26px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; bottom: -30px; border-radius: 50%; animation: rise 2.4s ease-in forwards; border: 2px solid rgba(255, 255, 255, 0.9);
  background: radial-gradient(circle at 35% 30%, #fff 0%, rgba(255, 255, 255, 0.4) 30%, var(--c) 100%); opacity: 0.9; }
@keyframes rise { to { transform: translate(var(--dx), -115vh); } }

/* ---------- くらい がめん ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .phead, :root:not([data-theme="light"]) .status, :root:not([data-theme="light"]) .solo-info div { border-color: rgba(255, 255, 255, 0.35); }
  :root:not([data-theme="light"]) .big:not(.hint) { background: linear-gradient(180deg, #4b3a8a, #3a2b70); color: #fff; box-shadow: 0 4px 0 #22184a; border-color: rgba(255, 255, 255, 0.4); }
}
:root[data-theme="dark"] .phead, :root[data-theme="dark"] .status, :root[data-theme="dark"] .solo-info div { border-color: rgba(255, 255, 255, 0.35); }
:root[data-theme="dark"] .big:not(.hint) { background: linear-gradient(180deg, #4b3a8a, #3a2b70); color: #fff; box-shadow: 0 4px 0 #22184a; border-color: rgba(255, 255, 255, 0.4); }

/* ---------- ひろい 画面 ---------- */
@media (min-width: 760px) {
  .arena { gap: 16px; }
  .opp-face { width: 96px; height: 96px; }
  .speech { top: 126px; font-size: 13.5px; }
}
@media (max-width: 480px) {
  .t-sub { display: none; }
  .t-main { font-size: 24px; }
  .chip { padding: 5px 9px; font-size: 12px; }
}
@media (max-width: 370px) {
  .chip { padding: 4px 7px; font-size: 11px; }
  .t-main { font-size: 21px; }
  .pad button { min-height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
