/* ハイレツン — 可愛い × プロ / iPhone 片手操作 */

:root {
  /* ブランド */
  --brand1: #ff5fa2;
  --brand2: #c850c0;
  --brand-grad: linear-gradient(135deg, #ff5fa2 0%, #c850c0 100%);
  --gold: #ffc83d;
  --gold2: #ffe9a8;

  /* レアリティ（固定色） */
  --pr: #ff4d6d;
  --er: #2bc48a;
  --prp: #a259ff;
  --erp: #3b82f6;

  /* シリンダー */
  --cyl-l: #38bdf8;
  --cyl-r: #fb8c3c;

  /* 面 */
  --bg-top: #fff1f7;
  --bg-bottom: #fffdfe;
  --surface: #ffffff;
  --surface2: #fdf6fa;
  --sunken: #f7eef4;
  --line: #f3e2ec;
  --ink: #2c1b33;
  --ink2: #7b6a84;
  --ink3: #a99cb1;

  --shadow: 0 8px 24px rgba(200, 80, 192, 0.1), 0 2px 6px rgba(44, 27, 51, 0.05);
  --shadow-lg: 0 14px 40px rgba(200, 80, 192, 0.18), 0 4px 12px rgba(44, 27, 51, 0.07);
  --r: 20px;
  --r-sm: 14px;
  --tap: 48px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  --toast-bg: #3a2142;
  --toast-fg: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-top: #1b1024;
    --bg-bottom: #120c19;
    --surface: #251a30;
    --surface2: #2e2039;
    --sunken: #1b1324;
    --line: #3b2a49;
    --ink: #f7eefa;
    --ink2: #bda9c8;
    --ink3: #8d7c98;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.55);

    --toast-bg: #412f50;
    --toast-fg: #f7eefa;
  }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  color: var(--ink);
  font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', -apple-system,
    BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  font-weight: 500;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  min-height: -webkit-fill-available;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 46%) fixed;
  background-color: var(--bg-bottom);
}

b,
strong {
  font-weight: 800;
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  font-weight: 800;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  background: none;
  border: 0;
  cursor: pointer;
}

.app {
  padding-top: var(--safe-t);
  padding-bottom: calc(var(--safe-b) + 8px);
  max-width: 560px;
  margin: 0 auto;
}
/* 下部固定の操作バーに隠れないよう余白を足す */
.app.has-bar {
  padding-bottom: calc(var(--safe-b) + 170px);
}

/* ───────────────── 共通 ───────────────── */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  text-align: center;
  width: 100%;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:active {
  transform: scale(0.965);
  background: var(--surface2);
}
.btn.primary {
  background: var(--brand-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px rgba(200, 80, 192, 0.32);
}
.btn.primary:active {
  box-shadow: 0 2px 8px rgba(200, 80, 192, 0.3);
}
.btn.warn {
  color: var(--pr);
  border-color: rgba(255, 77, 109, 0.35);
}
.btn.sm {
  min-height: 42px;
  padding: 6px 12px;
  font-size: 0.9rem;
  border-radius: 12px;
}
.btn[disabled] {
  opacity: 0.38;
  pointer-events: none;
}

.grid2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.grid4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.mt {
  margin-top: 14px;
}
.mt-s {
  margin-top: 8px;
}
.muted {
  color: var(--ink2);
}
.tiny {
  font-size: 0.78rem;
  line-height: 1.45;
}
.sm {
  font-size: 0.89rem;
}

.card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--shadow);
}

.section {
  margin: 16px 14px 0;
}
.section > h3 {
  font-size: 0.82rem;
  color: var(--ink2);
  font-weight: 800;
  margin: 0 0 9px 4px;
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

input[type='text'],
input[type='password'],
input[type='number'],
select {
  width: 100%;
  min-height: var(--tap);
  padding: 11px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 1rem;
  font-weight: 600;
}
input:focus,
select:focus {
  outline: none;
  border-color: var(--brand1);
  box-shadow: 0 0 0 3px rgba(255, 95, 162, 0.16);
}
label.field {
  display: block;
  margin-top: 14px;
}
label.field > span {
  display: block;
  font-size: 0.82rem;
  color: var(--ink2);
  font-weight: 700;
  margin-bottom: 6px;
  padding-left: 4px;
}

/* ───────────────── レアリティ ───────────────── */

.r-PR {
  color: var(--pr);
}
.r-ER {
  color: var(--er);
}
.r-PRP {
  color: var(--prp);
}
.r-ERP {
  color: var(--erp);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 9px;
  border-radius: 9px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.6;
  white-space: nowrap;
  letter-spacing: 0.03em;
  color: #fff;
}
.badge.r-PR {
  background: var(--pr);
}
.badge.r-ER {
  background: var(--er);
}
.badge.r-PRP {
  background: var(--prp);
}
.badge.r-ERP {
  background: var(--erp);
}

/* パラレルのキラキラ */
.badge.para {
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.5) inset;
}
.badge.para::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.85) 46%,
    transparent 62%
  );
  transform: translateX(-120%);
  animation: shine 2.6s ease-in-out infinite;
}
@keyframes shine {
  0%,
  62% {
    transform: translateX(-120%);
  }
  86%,
  100% {
    transform: translateX(130%);
  }
}

.spark {
  display: inline-block;
  color: var(--gold);
  animation: twinkle 1.9s ease-in-out infinite;
}
@keyframes twinkle {
  0%,
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.82) rotate(18deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .badge.para::after,
  .spark {
    animation: none;
  }
}

/* シリンダー名 */
.cyl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  white-space: nowrap;
}
.cyl::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: currentColor;
  flex: none;
}
.cyl-L {
  color: var(--cyl-l);
}
.cyl-R {
  color: var(--cyl-r);
}

/* ───────────────── ヘッダ ───────────────── */

.topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  min-height: 56px;
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(180deg, var(--bg-top) 70%, transparent);
  backdrop-filter: blur(12px);
}
.topbar h1 {
  font-size: 1.22rem;
  font-weight: 900;
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.topbar h1 .sub {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink3);
  letter-spacing: 0.06em;
  line-height: 1.1;
}
.icon-btn {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 1.2rem;
  color: var(--ink2);
  transition: transform 0.12s ease, background 0.12s ease;
}
.icon-btn:active {
  transform: scale(0.9);
  background: var(--sunken);
}

.net {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 9px;
  background: var(--sunken);
  color: var(--ink3);
  white-space: nowrap;
}
.net.ok {
  color: var(--er);
  background: rgba(43, 196, 138, 0.13);
}
.net.off {
  color: #c77b1a;
  background: rgba(255, 200, 61, 0.2);
}
.net.pend {
  color: var(--brand2);
  background: rgba(200, 80, 192, 0.13);
}

/* ───────────────── パラレル表示枠 ───────────────── */

.parallel-hero {
  margin: 4px 14px 0;
  border-radius: var(--r);
  padding: 2px;
  background: var(--brand-grad);
  box-shadow: var(--shadow-lg);
}
.parallel-hero > .inner {
  border-radius: 18px;
  padding: 15px 16px 14px;
  background: var(--surface);
}
.ph-label {
  font-size: 0.73rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--brand2);
  display: flex;
  align-items: center;
  gap: 5px;
}
.ph-kind {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 900;
}
.ph-card {
  margin-top: 3px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}
.ph-card .no {
  font-size: 1.22rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.ph-card .nm {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  min-width: 0;
}
.ph-main {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ph-person {
  display: flex;
  align-items: baseline;
  gap: 2px;
  line-height: 1;
}
.ph-person b {
  font-size: 3.2rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}
.ph-person span {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink2);
}
.ph-meta {
  font-size: 0.86rem;
  color: var(--ink2);
  font-weight: 700;
  line-height: 1.5;
}
.ph-meta .big {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.ph-best {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(255, 95, 162, 0.12), rgba(200, 80, 192, 0.12));
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ph-best b {
  font-size: 1.12rem;
  font-weight: 900;
  color: var(--brand2);
  font-variant-numeric: tabular-nums;
}
.ph-zure {
  margin-top: 7px;
  font-size: 0.75rem;
  color: var(--ink3);
  font-weight: 600;
}
.parallel-hero.quiet {
  background: var(--line);
}
.parallel-hero.quiet .ph-label {
  color: var(--ink2);
}

/* ───────────────── シリンダー状態 ───────────────── */

.cylinders {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin: 12px 14px 0;
}
.cylbox {
  position: relative;
  min-width: 0;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: 12px 12px 11px;
  box-shadow: var(--shadow);
  text-align: left;
  width: 100%;
  transition: transform 0.12s ease;
}
.cylbox:active {
  transform: scale(0.975);
}
.cylbox.next {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--brand1), 0 8px 22px rgba(255, 95, 162, 0.26);
}
.cylbox .nexttag {
  position: absolute;
  top: -9px;
  right: 10px;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #fff;
  background: var(--brand-grad);
  padding: 2px 9px;
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(200, 80, 192, 0.35);
}
.cylbox .hd {
  font-size: 0.8rem;
}
.cylbox .lot {
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.lot-badge {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 900;
  background: var(--sunken);
  color: var(--ink);
  line-height: 1;
}
.cylbox.L .lot-badge {
  background: rgba(56, 189, 248, 0.16);
  color: #0d8ec4;
}
.cylbox.R .lot-badge {
  background: rgba(251, 140, 60, 0.16);
  color: #d1690f;
}
.lot-badge.unset {
  font-size: 1.3rem;
  background: var(--sunken);
  color: var(--ink3);
}
.cylbox .pos {
  min-width: 0;
  font-size: 0.8rem;
  color: var(--ink2);
  font-weight: 700;
}
.cylbox .pos b {
  display: block;
  font-size: 1.04rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.cylbox .bar {
  height: 5px;
  border-radius: 3px;
  background: var(--sunken);
  margin-top: 9px;
  overflow: hidden;
}
.cylbox .bar > i {
  display: block;
  height: 100%;
  border-radius: 3px;
}
.cylbox.L .bar > i {
  background: var(--cyl-l);
}
.cylbox.R .bar > i {
  background: var(--cyl-r);
}
.cylbox .rare-peek {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 700;
  min-width: 0;
}
.cylbox .rare-peek .t {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ───────────────── 予測リスト ───────────────── */

.plist {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.phit {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  width: 100%;
  text-align: left;
  transition: transform 0.12s ease;
}
.phit:active {
  transform: scale(0.985);
}
.phit.para {
  border-color: transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--brand-grad) border-box;
  border: 2px solid transparent;
  box-shadow: 0 8px 24px rgba(200, 80, 192, 0.2);
}
.phit .who {
  flex: none;
  width: 44px;
  text-align: center;
}
.phit .who b {
  display: block;
  font-size: 1.55rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.phit.para .who b {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.phit .who span {
  font-size: 0.64rem;
  color: var(--ink3);
  font-weight: 700;
}
.phit .body {
  flex: 1;
  min-width: 0;
}
.phit .where {
  font-size: 0.75rem;
  color: var(--ink2);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.phit .rare {
  margin-top: 5px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.phit .rare .no {
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.phit .rare .nm {
  font-size: 0.8rem;
  color: var(--ink2);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phit .rare .pct {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--ink3);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pgap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 14px;
  background: var(--sunken);
  color: var(--ink3);
  font-size: 0.82rem;
  font-weight: 700;
}
.pgap .n {
  font-variant-numeric: tabular-nums;
  color: var(--ink2);
  font-weight: 800;
}

/* ───────────────── 配列セットアップ ───────────────── */

.setup {
  margin: 16px 14px 0;
  background: var(--surface);
  border-radius: var(--r);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-lg);
  padding: 20px 16px 18px;
  text-align: center;
}
.setup h2 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 900;
}
.setup .lead {
  margin: 5px 0 0;
  font-size: 0.85rem;
  color: var(--ink2);
  font-weight: 600;
}
.setup .emoji {
  font-size: 2.1rem;
  line-height: 1;
}
.seg {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  background: var(--sunken);
  border-radius: 15px;
  padding: 5px;
}
.seg button {
  min-height: 46px;
  border-radius: 11px;
  font-weight: 800;
  color: var(--ink2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.14s ease;
}
.seg button.on {
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(44, 27, 51, 0.12);
}
.seg button.on.v-L {
  color: var(--cyl-l);
}
.seg button.on.v-R {
  color: var(--cyl-r);
}

.arr-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.arr-grid button {
  width: 100%;
  max-width: 60px;
  aspect-ratio: 1;
  min-height: 52px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--sunken);
  color: var(--ink2);
  font-size: 1.4rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  transition: transform 0.12s ease, background 0.12s ease;
}
.arr-grid button:active {
  transform: scale(0.9);
}
.arr-grid button.on {
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 5px 14px rgba(200, 80, 192, 0.35);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}
.stepper button {
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 17px;
  background: var(--sunken);
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--ink2);
  display: grid;
  place-items: center;
  transition: transform 0.12s ease;
}
.stepper button:active {
  transform: scale(0.88);
}
.stepper input {
  width: 108px;
  text-align: center;
  font-size: 2rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  min-height: 60px;
  padding: 4px;
}

/* ───────────────── 一覧 ───────────────── */

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.listitem {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: 15px 16px;
  min-height: 68px;
  text-align: left;
  width: 100%;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease;
}
.listitem:active {
  transform: scale(0.982);
}
.listitem .ico {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  background: linear-gradient(135deg, rgba(255, 95, 162, 0.16), rgba(200, 80, 192, 0.16));
}
.listitem .t {
  flex: 1;
  min-width: 0;
}
.listitem .t b {
  display: block;
  font-size: 1.04rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.listitem .t span {
  font-size: 0.78rem;
  color: var(--ink2);
  font-weight: 600;
}
.listitem .arrow {
  color: var(--ink3);
  font-size: 1.2rem;
}

/* ───────────────── 操作バー ───────────────── */

.actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 14px calc(12px + var(--safe-b));
  background: linear-gradient(180deg, transparent, var(--bg-bottom) 26%);
  backdrop-filter: blur(10px);
  z-index: 25;
}
.chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 0 9px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar {
  display: none;
}
.chips .lbl {
  flex: none;
  align-self: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--ink3);
  padding-right: 2px;
  white-space: nowrap;
}
.chip-n {
  flex: none;
  min-width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  font-size: 1.05rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.12s ease;
}
.chip-n:active {
  transform: scale(0.88);
  background: var(--brand-grad);
  color: #fff;
}
.chip-n.max {
  border-color: rgba(255, 95, 162, 0.5);
  color: var(--brand2);
}
.barrow {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.btn-undo {
  flex: none;
  width: 56px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: var(--ink2);
  font-size: 1.25rem;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease;
}
.btn-undo:active {
  transform: scale(0.9);
}
.btn-undo[disabled] {
  opacity: 0.35;
  pointer-events: none;
}
.btn-play {
  flex: 1;
  min-height: 62px;
  border-radius: 18px;
  background: var(--brand-grad);
  color: #fff;
  font-size: 1.16rem;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(200, 80, 192, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-play:active {
  transform: scale(0.965);
  box-shadow: 0 3px 10px rgba(200, 80, 192, 0.35);
}
.btn-play[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

/* ───────────────── シート ───────────────── */

.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
}
.sheet-wrap[hidden] {
  display: none;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44, 27, 51, 0.42);
  backdrop-filter: blur(3px);
}
.sheet {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-bottom);
  border-radius: 26px 26px 0 0;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(44, 27, 51, 0.2);
  animation: up 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes up {
  from {
    transform: translateY(30px);
    opacity: 0.4;
  }
}
.sheet-grip {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  margin: 9px auto 0;
}
.sheet-head {
  display: flex;
  align-items: center;
  padding: 10px 10px 8px 18px;
}
.sheet-head h2 {
  flex: 1;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 900;
}
.sheet-x {
  min-width: 40px;
  min-height: 40px;
  border-radius: 13px;
  color: var(--ink3);
  font-size: 1.05rem;
}
.sheet-body {
  padding: 4px 14px calc(20px + var(--safe-b));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.menu-list .btn {
  justify-content: flex-start;
  margin-bottom: 9px;
  min-height: 56px;
  font-size: 0.98rem;
  gap: 12px;
}
.menu-list .btn .mi {
  font-size: 1.2rem;
  width: 26px;
  text-align: center;
}

.histlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hist {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 11px 13px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  font-weight: 600;
}
.hist.undone {
  opacity: 0.45;
}
.hist.undone .t > div:first-child {
  text-decoration: line-through;
}
.hist .who {
  font-size: 0.72rem;
  color: var(--ink3);
  font-weight: 600;
}
.hist .t {
  flex: 1;
  min-width: 0;
}

.probrow {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  width: 100%;
  text-align: left;
}
.probrow + .probrow {
  margin-top: 7px;
}
.probrow.best {
  border-color: var(--brand1);
}
.probrow .k {
  min-width: 52px;
  font-weight: 800;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.probrow .meter {
  flex: 1;
  height: 9px;
  background: var(--sunken);
  border-radius: 5px;
  overflow: hidden;
}
.probrow .meter > i {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: var(--brand-grad);
}
.probrow .v {
  min-width: 52px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  font-size: 0.88rem;
}

/* ───────────────── トースト ───────────────── */

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(176px + var(--safe-b));
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--toast-bg);
  color: var(--toast-fg);
  padding: 11px 14px 11px 17px;
  border-radius: 16px;
  font-size: 0.88rem;
  font-weight: 700;
  z-index: 200;
  width: calc(100% - 28px);
  max-width: 420px;
  box-shadow: 0 10px 30px rgba(44, 27, 51, 0.35);
  animation: toastin 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes toastin {
  from {
    transform: translateX(-50%) translateY(12px);
    opacity: 0;
  }
}
.toast .msg {
  min-width: 0;
}
.toast button {
  flex: none;
  color: var(--gold2);
  font-weight: 900;
  font-size: 0.86rem;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.13);
}

/* ───────────────── ログイン ───────────────── */

.login {
  padding: 9vh 22px 24px;
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}
.login .logo {
  width: 88px;
  height: 88px;
  margin: 0 auto 16px;
  border-radius: 26px;
  background: var(--brand-grad);
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 12px 30px rgba(200, 80, 192, 0.35);
}
.login h1 {
  font-size: 2rem;
  font-weight: 900;
  margin: 0 0 3px;
  letter-spacing: 0.02em;
}
.login p {
  color: var(--ink2);
  font-size: 0.87rem;
  font-weight: 600;
  margin: 0 0 22px;
}
.login .field {
  text-align: left;
}
.err {
  color: var(--pr);
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 12px;
  min-height: 1.3em;
}

.empty {
  text-align: center;
  color: var(--ink3);
  padding: 34px 18px;
  font-size: 0.9rem;
  font-weight: 600;
}
.empty .emoji {
  display: block;
  font-size: 2.2rem;
  margin-bottom: 8px;
}
