/* ============================================================
   ハートるんアラーム / PINK CITY Apps #01
   Hot Pink #FF1493 × Magenta #FF00AA / マキシマリズム
   ============================================================ */

:root {
  --pink:        #FF1493;
  --magenta:     #FF00AA;
  --pink-neon:   #FF4FD8;
  --pink-deep:   #C1006B;
  --pink-ink:    #8E0050;
  --pink-soft:   #FFD5EE;
  --pink-milk:   #FFF0F9;
  --white:       #FFFFFF;
  --violet:      #A020F0;
  --violet-deep: #5B0F8B;

  --grad-hot:  linear-gradient(135deg, #FF1493 0%, #FF00AA 50%, #FF4FD8 100%);
  --grad-holo: linear-gradient(118deg,#FF1493 0%,#FF4FD8 20%,#FFA6E4 34%,#FF00AA 56%,#D93CFF 76%,#FF1493 100%);
  --glow-pink: 0 0 18px rgba(255,20,147,.55), 0 0 44px rgba(255,0,170,.35);
  --card-shadow: 0 10px 28px rgba(255,20,147,.22), 0 2px 0 #fff inset;
  --radius: 26px;

  --font: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "ヒラギノ丸ゴ ProN",
          "Baloo 2", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

/* 300msの遅延を消して、押した瞬間に反応させる */
button, .btn, .chip, .tab, .fab, .switch, .alarm-row, [data-action], [data-edit], [data-day], [data-prep], [data-kind] {
  touch-action: manipulation;
}

html, body {
  margin: 0; padding: 0;
  height: 100%;
  font-family: var(--font);
  font-weight: 700;
  color: var(--pink-ink);
  background: #FFE3F4;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(circle at 12% 8%,  rgba(255,255,255,.95) 0%, transparent 42%),
    radial-gradient(circle at 88% 92%, rgba(255,0,170,.30) 0%, transparent 45%),
    radial-gradient(circle at 80% 4%,  rgba(177,79,255,.22) 0%, transparent 40%),
    linear-gradient(170deg, #FFE9F7 0%, #FFD2EF 45%, #FFC0E8 100%);
  background-attachment: fixed;
}

/* ---------- キラキラ背景 ---------- */
.sparkle-layer {
  position: fixed; inset: 0; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, #fff, transparent),
    radial-gradient(2px 2px at 70% 15%, rgba(255,255,255,.9), transparent),
    radial-gradient(3px 3px at 40% 70%, rgba(255,255,255,.8), transparent),
    radial-gradient(2px 2px at 85% 60%, #fff, transparent),
    radial-gradient(2px 2px at 10% 85%, rgba(255,255,255,.85), transparent),
    radial-gradient(3px 3px at 60% 90%, rgba(255,255,255,.7), transparent);
  background-size: 100% 100%;
  animation: twinkle 3.4s ease-in-out infinite alternate;
  opacity: .9; will-change: opacity;
}
@keyframes twinkle { from { opacity:.35; } to { opacity:1; } }

/* ---------- レイアウト ---------- */
#app {
  position: relative; z-index: 1;
  max-width: 520px; margin: 0 auto;
  min-height: 100%;
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top);
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 18px 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.62) 70%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}

.logo {
  margin: 0; font-size: 22px; font-weight: 900; letter-spacing: .02em;
  background: var(--grad-hot);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 6px rgba(255,20,147,.45));
}
.logo-heart { -webkit-text-fill-color: initial; color: initial; margin-left: 2px; }

.icon-btn {
  border: none; background: none; padding: 4px; cursor: pointer;
  display: grid; place-items: center;
}
.wand-icon {
  width: 30px; height: auto;
  filter: drop-shadow(0 0 8px rgba(255,20,147,.7));
  animation: wand-wiggle 2.6s ease-in-out infinite;
  transform-origin: 50% 90%;
}
@keyframes wand-wiggle {
  0%,100% { transform: rotate(-12deg); }
  50%     { transform: rotate(14deg) scale(1.06); }
}

.view {
  flex: 1;
  padding: 4px 16px calc(96px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px;
}

/* ---------- タブバー ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 3px solid rgba(255,20,147,.25);
  box-shadow: 0 -8px 24px rgba(255,20,147,.18);
}
.tab {
  border: none; background: none; cursor: pointer;
  display: grid; gap: 2px; justify-items: center;
  font-family: var(--font); font-weight: 800; font-size: 11px;
  color: #E58CBF; padding: 6px 0; border-radius: 16px;
  transition: transform .16s, color .16s;
}
.tab-ico { font-size: 20px; filter: grayscale(.5) opacity(.7); transition: filter .16s, transform .16s; }
.tab.is-active { color: var(--pink); }
.tab.is-active .tab-ico { filter: none; transform: translateY(-2px) scale(1.16); }
.tab:active { transform: scale(.92); }

/* ---------- カード ---------- */
.card {
  position: relative;
  background: rgba(255,255,255,.95);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--card-shadow);
  border: 2px solid rgba(255,255,255,.9);
}
.card--hot {
  background: var(--grad-hot);
  color: #fff;
  box-shadow: 0 12px 34px rgba(255,20,147,.45);
  border: none;
}
.card-title {
  margin: 0 0 10px; font-size: 15px; font-weight: 900;
  color: var(--pink-deep); display: flex; align-items: center; gap: 6px;
}
.card--hot .card-title { color: #fff; }

/* ---------- ハートるん ---------- */
.heartlune {
  display: block; width: 100%; height: auto;
  filter: drop-shadow(0 6px 16px rgba(255,20,147,.45));
  animation: hl-float 3.2s ease-in-out infinite;
}
@keyframes hl-float {
  0%,100% { transform: translateY(0) rotate(-2deg); }
  50%     { transform: translateY(-10px) rotate(2deg); }
}
.heartlune--bounce { animation: hl-bounce .8s cubic-bezier(.3,1.6,.5,1) infinite; }
@keyframes hl-bounce {
  0%,100% { transform: translateY(0) scale(1) rotate(-3deg); }
  40%     { transform: translateY(-26px) scale(1.06) rotate(4deg); }
  60%     { transform: translateY(-14px) scale(.98) rotate(-2deg); }
}
.heartlune--sleep { animation: hl-sleep 4s ease-in-out infinite; }
@keyframes hl-sleep {
  0%,100% { transform: rotate(-14deg) translateY(0) scale(1); }
  50%     { transform: rotate(-14deg) translateY(-6px) scale(1.03); }
}
.heartlune--party { animation: hl-party .5s ease-in-out infinite; }
@keyframes hl-party {
  0%,100% { transform: rotate(-8deg) scale(1.02); }
  50%     { transform: rotate(8deg) scale(1.1); }
}

/* ふきだし */
.bubble {
  position: relative;
  background: #fff; border-radius: 20px;
  padding: 12px 16px; font-size: 14px; font-weight: 800;
  color: var(--pink-ink); line-height: 1.5;
  box-shadow: 0 6px 18px rgba(255,20,147,.2);
  border: 2px solid rgba(255,20,147,.18);
  white-space: pre-line;
}
.bubble::after {
  content: ''; position: absolute; right: 26px; bottom: -12px;
  border: 8px solid transparent; border-top-color: #fff; border-bottom: 0;
  filter: drop-shadow(0 2px 1px rgba(255,20,147,.18));
}
.bubble--left::after { right: auto; left: 26px; }

/* ---------- 次のアラーム ---------- */
.hero {
  display: grid; grid-template-columns: 1fr 116px; gap: 10px; align-items: end;
}
.hero .heartlune { align-self: center; }

.next-time {
  font-family: "Baloo 2", var(--font);
  font-size: 58px; line-height: 1; font-weight: 800;
  letter-spacing: -.02em;
  background: var(--grad-hot);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 10px rgba(255,20,147,.4));
}
.card--hot .next-time {
  background: none; color: #fff; -webkit-text-fill-color: #fff;
  filter: drop-shadow(0 3px 12px rgba(0,0,0,.18));
}
.next-row { display: flex; align-items: center; gap: 12px; }
.next-meta { font-size: 13px; font-weight: 800; opacity: .92; }
.next-until {
  display: inline-block; margin-top: 6px;
  background: rgba(255,255,255,.28); border-radius: 999px;
  padding: 4px 12px; font-size: 12px; font-weight: 900;
}

/* ---------- アラーム行 ---------- */
.alarm-row {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 8px;
  align-items: center;
  background: #fff; border-radius: 20px; padding: 12px 14px;
  box-shadow: 0 6px 16px rgba(255,20,147,.15);
  border: 2px solid rgba(255,20,147,.1);
  transition: transform .16s, box-shadow .16s;
}
.alarm-row:active { transform: scale(.985); }
/* iOSでdivのタップがdocumentまで上がってこない事故を避ける保険 */
.alarm-row, .alarm-row [data-edit] { cursor: pointer; }
.alarm-row[data-enabled="false"] { opacity: .5; }
.alarm-emoji { font-size: 26px; text-align: center; }
.alarm-name { font-size: 14px; font-weight: 900; color: var(--pink-ink); line-height: 1.3; }
.alarm-sub  { font-size: 11px; font-weight: 800; color: #D77BB0; margin-top: 2px; }
.alarm-time {
  font-family: "Baloo 2", var(--font);
  font-size: 20px; font-weight: 800; color: var(--pink); white-space: nowrap;
}

/* トグル */
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: #F3C9E2; transition: background .2s;
}
.switch-knob {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: #fff; transition: transform .22s cubic-bezier(.3,1.5,.5,1);
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  display: grid; place-items: center; font-size: 12px;
}
.switch input:checked ~ .switch-track { background: var(--grad-hot); box-shadow: var(--glow-pink); }
/* ピンクのカードの上ではトグルが埋もれるので白ベースにする */
.card--hot .switch-track { background: rgba(255,255,255,.3); box-shadow: 0 0 0 2px rgba(255,255,255,.6) inset; }
.card--hot .switch input:checked ~ .switch-track { background: rgba(255,255,255,.95); box-shadow: 0 0 14px rgba(255,255,255,.8); }
.card--hot .switch input:checked ~ .switch-knob { background: var(--grad-hot); }
.switch input:checked ~ .switch-knob { transform: translateX(22px); }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: none; cursor: pointer; font-family: var(--font); font-weight: 900;
  border-radius: 999px; padding: 16px 24px; font-size: 17px;
  background: var(--grad-hot); color: #fff;
  box-shadow: 0 8px 22px rgba(255,20,147,.5), 0 0 0 3px rgba(255,255,255,.6) inset;
  transition: transform .14s cubic-bezier(.3,1.6,.5,1), box-shadow .14s;
  text-shadow: 0 2px 6px rgba(0,0,0,.16);
}
.btn:active { transform: scale(.94); box-shadow: 0 4px 12px rgba(255,20,147,.4); }
.btn--block { width: 100%; }
.btn--ghost {
  background: #fff; color: var(--pink);
  box-shadow: 0 6px 16px rgba(255,20,147,.22), 0 0 0 2px rgba(255,20,147,.3) inset;
  text-shadow: none;
}
.btn--violet {
  background: linear-gradient(135deg,#B14FFF,#7A17D6 60%,#FF00AA);
  box-shadow: 0 8px 22px rgba(122,23,214,.5), 0 0 0 3px rgba(255,255,255,.4) inset;
}
.btn--lg { font-size: 22px; padding: 22px 26px; }
.btn-sub { display: block; font-size: 11px; font-weight: 800; opacity: .9; margin-top: 2px; }

.fab {
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--grad-hot); color: #fff; font-size: 22px; font-weight: 900; line-height: 1;
  box-shadow: 0 6px 16px rgba(255,20,147,.45);
}
.fab:active { transform: scale(.9); }

/* ---------- フォーム ---------- */
.field { display: grid; gap: 8px; }
.label { font-size: 13px; font-weight: 900; color: var(--pink-deep); }
.input, .select {
  width: 100%; font-family: var(--font); font-weight: 800; font-size: 16px;
  padding: 13px 16px; border-radius: 18px; border: 2px solid rgba(255,20,147,.25);
  background: #fff; color: var(--pink-ink);
}
.input:focus, .select:focus { outline: none; border-color: var(--pink); box-shadow: var(--glow-pink); }

input[type="range"].input {
  -webkit-appearance: none; appearance: none;
  padding: 0; height: 26px; border: none; background: transparent;
}
input[type="range"].input::-webkit-slider-runnable-track {
  height: 12px; border-radius: 999px;
  background: linear-gradient(90deg, #FF1493, #FF00AA, #FF4FD8);
  box-shadow: 0 2px 8px rgba(255,20,147,.35) inset;
}
input[type="range"].input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; margin-top: -7px; border-radius: 50%;
  background: #fff; border: 3px solid var(--pink);
  box-shadow: 0 3px 10px rgba(255,20,147,.5);
}
input[type="range"].input::-moz-range-track {
  height: 12px; border-radius: 999px; background: linear-gradient(90deg,#FF1493,#FF00AA,#FF4FD8);
}
input[type="range"].input::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--pink);
}

.seg { display: flex; gap: 8px; background: rgba(255,255,255,.7); padding: 6px; border-radius: 999px; }
.seg button {
  flex: 1; border: none; cursor: pointer; border-radius: 999px; padding: 12px 8px;
  font-family: var(--font); font-weight: 900; font-size: 14px;
  background: transparent; color: #D77BB0; transition: all .18s;
}
.seg button.is-on { background: var(--grad-hot); color: #fff; box-shadow: 0 6px 16px rgba(255,20,147,.4); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 2px solid rgba(255,20,147,.28); background: #fff; color: var(--pink);
  border-radius: 999px; padding: 9px 15px; font-family: var(--font); font-weight: 900;
  font-size: 14px; cursor: pointer; transition: all .16s;
}
.chip.is-on { background: var(--grad-hot); color: #fff; border-color: transparent; box-shadow: 0 6px 14px rgba(255,20,147,.4); }
.chips--days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.chip--day { width: 100%; min-height: 40px; aspect-ratio: 1 / 1; padding: 0; border-radius: 50%; display: grid; place-items: center; font-size: 13px; }

/* 時刻ピッカー */
.timepick { display: flex; align-items: center; justify-content: center; }
.timepick input[type="time"] {
  font-family: "Baloo 2", var(--font); font-size: 46px; font-weight: 800;
  width: 100%; max-width: 300px; text-align: center;
  border: none; background: rgba(255,20,147,.09);
  border-radius: 22px; padding: 14px 10px; color: var(--pink);
  -webkit-appearance: none; appearance: none;
}
.timepick input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
.timepick input[type="time"]::-webkit-datetime-edit { text-align: center; }
.timepick input[type="time"]::-webkit-datetime-edit-fields-wrapper { justify-content: center; }
.timepick input:focus { outline: none; box-shadow: var(--glow-pink); }

.calc-note {
  display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center;
  background: linear-gradient(135deg, rgba(255,20,147,.1), rgba(255,0,170,.06));
  border: 2px dashed rgba(255,20,147,.35);
  border-radius: 20px; padding: 12px 14px;
}
.calc-note img { width: 100%; }
.calc-note b { color: var(--pink); font-size: 17px; }

/* ---------- 履歴 ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat {
  background: #fff; border-radius: 22px; padding: 14px; text-align: center;
  box-shadow: 0 6px 18px rgba(255,20,147,.18); border: 2px solid rgba(255,20,147,.12);
}
.stat-label { font-size: 11px; font-weight: 900; color: #D77BB0; }
.stat-value {
  font-family: "Baloo 2", var(--font); font-size: 32px; font-weight: 800;
  background: var(--grad-hot); -webkit-background-clip: text; background-clip: text; color: transparent;
  line-height: 1.15;
}
.stat-note { font-size: 11px; font-weight: 800; color: #E58CBF; }

.log-row {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
  padding: 11px 4px; border-bottom: 2px dotted rgba(255,20,147,.18);
  font-size: 14px; font-weight: 800;
}
.log-row:last-child { border-bottom: none; }
.log-date { color: var(--pink-ink); }
.log-val { font-family: "Baloo 2", var(--font); font-size: 17px; color: var(--pink); }
.badge {
  display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 900;
  background: var(--grad-hot); color: #fff; border-radius: 999px; padding: 3px 8px;
  box-shadow: 0 3px 8px rgba(255,20,147,.4);
}
.badge--gold { background: linear-gradient(135deg,#FFD700,#FF8AD8,#FF1493); }

.streak-banner {
  display: flex; align-items: center; gap: 12px;
  background: var(--grad-holo);
  border-radius: 22px; padding: 14px 16px; color: #fff;
  box-shadow: 0 10px 26px rgba(255,20,147,.45);
}
/* background-position のアニメはGPUに乗らず描画が詰まるので、
   グラデは静止させて、上を通る光だけ transform で動かす */
.holo-sheen { position: relative; overflow: hidden; isolation: isolate; }
.holo-sheen::before {
  content: ''; position: absolute; inset: -30% -60%;
  background: linear-gradient(112deg, transparent 42%, rgba(255,255,255,.55) 50%, transparent 58%);
  animation: sheen 4.5s linear infinite;
  will-change: transform; pointer-events: none; z-index: -1;
}
@keyframes sheen { from { transform: translate3d(-30%,0,0); } to { transform: translate3d(30%,0,0); } }
.streak-num { font-family:"Baloo 2",var(--font); font-size: 40px; font-weight: 800; line-height: 1; }

.empty {
  text-align: center; padding: 26px 16px; color: #D77BB0; font-weight: 800; font-size: 14px;
}

/* ---------- オーバーレイ（起床・スヌーズ・成功・作成） ---------- */
/* [hidden] のUA既定(display:none)はクラス指定に負けるので、明示的に打ち消す。
   これがないと「空っぽで透明なオーバーレイ」が画面全体のタップを吸い込む。 */
.overlay[hidden] { display: none !important; }

.overlay {
  position: fixed; inset: 0; top: 0; right: 0; bottom: 0; left: 0; z-index: 100;
  display: flex; flex-direction: column;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  animation: fade-in .22s ease;
}
@keyframes fade-in { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }

.sheet {
  background: linear-gradient(170deg,#FFF3FA,#FFDCF1 60%,#FFC9EA);
  min-height: 100%;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px;
}
.sheet-head {
  display: grid; grid-template-columns: 40px 1fr 40px; align-items: center;
  font-size: 18px; font-weight: 900; color: var(--pink-deep); text-align: center;
}
.sheet-head .icon-btn { font-size: 24px; color: var(--pink); }

/* 起床画面 */
.wake {
  min-height: 100%;
  padding: calc(16px + env(safe-area-inset-top)) 18px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 20%, rgba(255,255,255,.85) 0%, rgba(255,255,255,0) 30%),
    radial-gradient(circle at 50% 118%, rgba(255,0,170,.9) 0%, transparent 60%),
    var(--grad-holo);
}
.wake-hello {
  font-size: clamp(30px, 9vw, 48px); font-weight: 900; line-height: 1.06; margin: 0;
  color: #fff;
  -webkit-text-stroke: 4px var(--pink);
  paint-order: stroke fill;
  text-shadow: 0 0 26px rgba(255,20,147,.95), 0 6px 0 rgba(193,0,107,.5);
  animation: pop-in .5s cubic-bezier(.2,1.7,.4,1);
}
@keyframes pop-in { from { transform: scale(.5) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.wake .heartlune { max-width: min(210px, 46vh); margin: 0 auto; }
.wake-msg {
  background: rgba(255,255,255,.94); border-radius: 24px; padding: 12px 18px;
  font-size: 15px; font-weight: 900; color: var(--pink-ink); line-height: 1.55;
  box-shadow: 0 8px 22px rgba(255,20,147,.3); white-space: pre-line;
}
.wake-actions { display: grid; grid-template-columns: 1fr 1.15fr; gap: 10px; width: 100%; max-width: 460px; }
.wake-actions .btn { font-size: 16px; padding: 15px 10px; line-height: 1.25; }
.wake-actions .btn-sub { font-size: 10px; }

/* スヌーズ画面 */
.snooze {
  min-height: 100%;
  padding: calc(20px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  text-align: center; color: #fff;
  background:
    radial-gradient(circle at 50% 30%, rgba(255,79,216,.5) 0%, transparent 55%),
    linear-gradient(170deg, #3B0A4F 0%, #7A17D6 55%, #FF00AA 130%);
}
.snooze-title { font-size: 30px; font-weight: 900; margin: 0; text-shadow: 0 0 22px rgba(255,79,216,.9); }
.snooze .bubble { color: var(--pink-ink); }
.ring-wrap { position: relative; width: 220px; height: 220px; display: grid; place-items: center; }
.ring-wrap svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring-bg   { fill: none; stroke: rgba(255,255,255,.2); stroke-width: 12; }
.ring-fg   { fill: none; stroke: url(#ringgrad); stroke-width: 12; stroke-linecap: round;
             filter: drop-shadow(0 0 10px rgba(255,79,216,.9)); transition: stroke-dashoffset 1s linear; }
.ring-time { font-family:"Baloo 2",var(--font); font-size: 46px; font-weight: 800; color: #fff;
             text-shadow: 0 0 20px rgba(255,79,216,.9); }
.snooze .heartlune { max-width: 150px; }
.zzz { position: absolute; right: -6px; top: 4px; font-size: 22px; animation: zzz 2.4s ease-in-out infinite; }
@keyframes zzz { 0%{opacity:0;transform:translate(0,0) scale(.7)} 40%{opacity:1} 100%{opacity:0;transform:translate(16px,-26px) scale(1.2)} }

/* 成功画面 */
.success {
  min-height: 100%;
  padding: calc(20px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 24%, rgba(255,255,255,.9) 0%, rgba(255,255,255,0) 30%),
    radial-gradient(circle at 50% 116%, rgba(255,0,170,.9) 0%, transparent 58%),
    var(--grad-holo);
}
.success-title {
  font-size: clamp(28px, 8.6vw, 44px); font-weight: 900; line-height: 1.08; margin: 0; color: #fff;
  -webkit-text-stroke: 4px var(--pink); paint-order: stroke fill;
  text-shadow: 0 0 26px rgba(255,20,147,.95), 0 6px 0 rgba(193,0,107,.5);
  animation: shake-in .6s cubic-bezier(.2,1.7,.4,1);
}
@keyframes shake-in {
  0% { transform: scale(.4) rotate(-14deg); opacity: 0; }
  60%{ transform: scale(1.12) rotate(6deg); opacity: 1; }
  100%{ transform: none; }
}
.success .heartlune { max-width: min(200px, 40vh); }
.success-msg {
  background: rgba(255,255,255,.95); border-radius: 26px; padding: 18px 20px;
  font-size: 18px; font-weight: 900; color: var(--pink-ink); line-height: 1.6;
  box-shadow: 0 10px 28px rgba(255,20,147,.35); white-space: pre-line;
}
.bonus {
  background: linear-gradient(135deg,#FFD700,#FF8AD8,#FF1493);
  color: #fff; border-radius: 999px; padding: 9px 18px; font-weight: 900; font-size: 14px;
  box-shadow: 0 8px 20px rgba(255,20,147,.45);
  animation: pop-in .5s .2s backwards cubic-bezier(.2,1.7,.4,1);
}

/* RTA */
.rta-clock {
  font-family:"Baloo 2",var(--font); font-size: 56px; font-weight: 800; line-height: 1;
  background: var(--grad-hot); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 10px rgba(255,20,147,.4));
}
.rta-live { animation: rta-pulse 1s ease-in-out infinite; }
@keyframes rta-pulse { 0%,100%{ filter: drop-shadow(0 3px 10px rgba(255,20,147,.4)); } 50%{ filter: drop-shadow(0 3px 20px rgba(255,0,170,.85)); } }

/* 紙吹雪キャンバス */
.fx { position: fixed; inset: 0; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 200; }

.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.stack { display: grid; gap: 12px; }
.muted { color: #D77BB0; font-size: 12px; font-weight: 800; line-height: 1.6; }
.center { text-align: center; }
.grow { flex: 1; }

/* OSの「視差効果を減らす」を全アニメ停止に直結させると、
   画面がフリーズしたようにしか見えないのでやめた。
   キラキラを止めるかどうかはアプリ内の設定（body[data-motion]）で決める。
   止めるのは飾りのループだけ。押した反応（transition）は必ず残す。 */
body[data-motion="off"] .sparkle-layer,
body[data-motion="off"] .holo-sheen::before,
body[data-motion="off"] .wand-icon,
body[data-motion="off"] .zzz { animation: none; }
body[data-motion="off"] .heartlune,
body[data-motion="off"] .heartlune--bounce,
body[data-motion="off"] .heartlune--party,
body[data-motion="off"] .heartlune--sleep { animation: none; }
body[data-motion="off"] .rta-live { animation: none; }

/* ---------- 落ちたときの表示 ---------- */
.crash {
  position: fixed; left: 16px; right: 16px; bottom: 96px; z-index: 500;
  background: #fff; border: 3px solid var(--pink); border-radius: 22px;
  padding: 16px; text-align: center; color: var(--pink-ink);
  box-shadow: 0 12px 30px rgba(255,20,147,.4);
  display: grid; gap: 10px; justify-items: center;
}
.crash[hidden] { display: none !important; }
.crash p { margin: 0; font-size: 12px; font-weight: 800; color: #D77BB0; word-break: break-all; }

/* ---------- 診断 ---------- */
.diag { display: grid; gap: 6px; font-size: 12px; font-weight: 800; }
.diag-row { display: flex; justify-content: space-between; gap: 10px; border-bottom: 2px dotted rgba(255,20,147,.18); padding: 6px 2px; }
.diag-row span:last-child { color: var(--pink); text-align: right; word-break: break-all; }

/* ---------- 音が出せないときの表示と、目で気づくアラーム ---------- */
.mute-warn {
  display: grid; gap: 2px; justify-items: center;
  width: 100%; max-width: 460px;
  border: none; cursor: pointer; font-family: var(--font); font-weight: 900;
  background: #fff; color: var(--pink-deep);
  border-radius: 20px; padding: 14px 16px; font-size: 15px; line-height: 1.4;
  box-shadow: 0 8px 22px rgba(0,0,0,.22), 0 0 0 3px var(--pink) inset;
}
.mute-warn span { font-size: 11px; font-weight: 800; color: #D77BB0; }

/* 音が鳴らせないなら、せめて画面で気づけるようにする。
   画面全体を明るくすると文字が読めなくなるので、枠を光らせる。
   これは飾りではなくアラーム本体なので、キラキラ演出OFFでも止めない。 */
.wake--silent::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  box-shadow: inset 0 0 0 16px #fff, inset 0 0 70px 24px rgba(255,255,255,.85);
  animation: alarm-flash .72s steps(1, end) infinite;
}
@keyframes alarm-flash { 0%, 49% { opacity: 0; } 50%, 100% { opacity: 1; } }
body[data-motion="off"] .wake--silent::after { animation: alarm-flash .72s steps(1, end) infinite; }
