/* ありすの目覚まし — 青いハートテーマ（Android版 colors.xml 準拠） */

:root {
  --primary: #8BBDD8;
  --primary-light: #BBDAEE;
  --primary-dark: #5A95BB;
  --bg: #DCF0FF;
  --surface: #FFFFFF;
  --on-bg: #2E4A65;
  --text-secondary: #6A8AA0;
  --divider: #C0DCF0;
  --snooze: #E07090;
  --dismiss: #70B890;
  --fire-start: #0C1830;
  --fire-mid: #12244A;
  --fire-end: #1A3A70;
  --card-border: #D0E8F8;
}

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

html, body {
  height: 100%;
}

body {
  font-family: "Hiragino Maru Gothic ProN", "BIZ UDGothic", "Yu Gothic UI", "Meiryo", sans-serif;
  background: var(--bg);
  color: var(--on-bg);
  overscroll-behavior: none;
}

.screen {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100%;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

/* ---------- 起動オーバーレイ ---------- */
.start-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: linear-gradient(180deg, #C0D8F4, var(--bg));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  text-align: center;
}

.start-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface);
  box-shadow: 0 8px 24px rgba(90, 149, 187, 0.35);
}

.start-text {
  font-size: 24px;
  font-weight: bold;
  color: var(--on-bg);
}

.btn-start {
  font-size: 20px;
  font-weight: bold;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 28px;
  padding: 16px 48px;
  min-height: 56px;
  box-shadow: 0 4px 12px rgba(90, 149, 187, 0.4);
  cursor: pointer;
}

.start-note {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---------- ホーム ---------- */
.header {
  background: linear-gradient(180deg, #C0D8F4, #A0C4E8);
  padding: calc(16px + env(safe-area-inset-top)) 16px 20px;
  border-radius: 0 0 24px 24px;
}

.greeting-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
  flex-shrink: 0;
}

.avatar.small {
  width: 44px;
  height: 44px;
}

.bubble {
  background: var(--surface);
  border-radius: 4px 18px 18px 18px;
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(90, 149, 187, 0.2);
  white-space: pre-line;
}

.ios-note {
  margin: 12px 16px 0;
  background: #FFF8E1;
  border: 1px solid #FFE082;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: #7A6520;
  line-height: 1.5;
}

.push-card {
  margin: 12px 16px 0;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.push-card-text {
  font-size: 14px;
  line-height: 1.5;
}

.push-card-note {
  font-size: 11px;
  color: var(--text-secondary);
}

.push-toggle-btn {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 16px;
  font-size: 13px;
  white-space: nowrap;
}

.next-alarm {
  margin: 12px 16px 0;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

.list-section {
  padding: 16px;
}

.section-title {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: normal;
}

.alarm-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 2px 6px rgba(90, 149, 187, 0.12);
}

.alarm-info {
  flex: 1;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.alarm-time {
  font-size: 32px;
  font-weight: bold;
  letter-spacing: 1px;
}

.alarm-days {
  font-size: 13px;
  color: var(--text-secondary);
}

.alarm-card.disabled .alarm-time,
.alarm-card.disabled .alarm-days {
  opacity: 0.4;
}

.alarm-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* トグルスイッチ */
.toggle {
  position: relative;
  width: 52px;
  height: 30px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  cursor: pointer;
  z-index: 1;
}

.toggle .track {
  position: absolute;
  inset: 0;
  background: #BDD4E4;
  border-radius: 15px;
  transition: background 0.2s;
}

.toggle .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.toggle input:checked + .track {
  background: var(--primary);
}

.toggle input:checked + .track::after {
  left: 25px;
}

.btn-delete {
  border: none;
  background: none;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 48px 16px;
  line-height: 2;
}

.fab {
  position: fixed;
  right: calc(20px + env(safe-area-inset-right));
  bottom: calc(24px + env(safe-area-inset-bottom));
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 32px;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(90, 149, 187, 0.5);
  cursor: pointer;
  z-index: 10;
}

/* ---------- 設定画面 ---------- */
.set-header {
  background: linear-gradient(180deg, #C0D8F4, #A0C4E8);
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  border: none;
  background: none;
  font-size: 24px;
  color: var(--on-bg);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}

.set-title {
  font-size: 17px;
  font-weight: bold;
}

.set-status {
  font-size: 12px;
  color: #4A6A85;
}

.chat-area {
  padding: 16px;
}

.chat-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.set-form {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.input-time {
  font-size: 40px;
  font-weight: bold;
  text-align: center;
  color: var(--on-bg);
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 12px;
  width: 100%;
}

.weekday-chips {
  display: flex;
  gap: 6px;
  justify-content: space-between;
}

.chip {
  flex: 1;
  min-height: 44px;
  border-radius: 22px;
  border: 1px solid var(--divider);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 15px;
  cursor: pointer;
}

.chip.on {
  background: var(--primary);
  border-color: var(--primary-dark);
  color: #fff;
  font-weight: bold;
}

.btn-primary {
  margin-top: 16px;
  min-height: 56px;
  border: none;
  border-radius: 28px;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(90, 149, 187, 0.4);
}

.btn-secondary {
  min-height: 48px;
  border: none;
  border-radius: 24px;
  background: none;
  color: var(--text-secondary);
  font-size: 15px;
  cursor: pointer;
}

/* ---------- 発火画面（着信風） ---------- */
.fire-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: linear-gradient(180deg, var(--fire-start), var(--fire-mid), var(--fire-end));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  padding-top: calc(24px + env(safe-area-inset-top));
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
  text-align: center;
  color: #fff;
}

.fire-overlay[hidden] {
  display: none;
}

.fire-time {
  font-size: 52px;
  font-weight: bold;
  letter-spacing: 2px;
}

.fire-avatar-frame {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  padding: 6px;
  background: rgba(255, 255, 255, 0.15);
  animation: pulse 1.6s ease-in-out infinite;
}

.fire-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.7);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.85; }
}

.fire-name {
  font-size: 22px;
  font-weight: bold;
}

.fire-serif {
  font-size: 16px;
  line-height: 1.7;
  max-width: 320px;
  min-height: 3.4em;
}

.fire-buttons {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  width: 100%;
  max-width: 360px;
}

.btn-fire {
  flex: 1;
  min-height: 64px;
  border: none;
  border-radius: 32px;
  font-size: 17px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-fire.snooze {
  background: var(--snooze);
  box-shadow: 0 4px 14px rgba(224, 112, 144, 0.5);
}

.btn-fire.dismiss {
  background: var(--dismiss);
  box-shadow: 0 4px 14px rgba(112, 184, 144, 0.5);
}

.btn-fire-icon {
  font-size: 22px;
}
