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

:root {
  --bg:      #0d1a0d;
  --card:    #152015;
  --card2:   #102010;
  --accent:  #f5c842;
  --accent2: #4ade80;
  --gold:    #f5c842;
  --green:   #4ade80;
  --red:     #ef4444;
  --text:    #e8f0e8;
  --muted:   #7a9a7a;
  --radius:  18px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ========== LANG TOGGLE ========== */
.btn-lang {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  transition: background 0.15s;
}
.btn-lang:active { background: rgba(255,255,255,0.18); }
.btn-lang-setup {
  position: absolute;
  top: 20px;
  right: 20px;
}

/* ========== HEADER ========== */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 20px 12px;
}
header h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-settings {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.btn-settings:active { background: rgba(255,255,255,0.16); }

/* ========== STREAK/POINTS CARD ========== */
.streak-card {
  margin: 12px 20px;
  background: linear-gradient(135deg, #1a2e0a, #2d4a10);
  border-radius: var(--radius);
  padding: 32px 20px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(245, 200, 66, 0.18);
}
.streak-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(245, 200, 66, 0.07);
}
.level-card-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.level-img {
  width: 80px;
  height: 106px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(100,220,255,0.25);
  border: 1px solid rgba(255,255,255,0.12);
}
.level-card-info {
  flex: 1;
  text-align: left;
}
.level-label {
  font-size: 0.82rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.points-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px;
}
.streak-days {
  font-size: 3.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -2px;
}
.streak-unit {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}
.streak-sub {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  margin-top: 6px;
}
.streak-next-level {
  font-size: 0.72rem;
  color: rgba(245,200,66,0.65);
  margin-top: 5px;
  letter-spacing: 0.01em;
}
.streak-start {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.38);
  margin-top: 8px;
}
.streak-start .days-num {
  font-size: 1rem;
  font-weight: 800;
  color: rgba(255,255,255,0.72);
}

/* ========== CARD TOP BUTTONS ========== */
.card-top-btns {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.btn-card-icon {
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-card-icon:active { background: rgba(255,255,255,0.24); }
.btn-card-icon.active { background: rgba(245,200,66,0.28); }
/* keep old selector working */
.btn-bg-toggle { display: none; }

/* ========== CHART VIEW ========== */
.streak-card.chart-mode {
  background: linear-gradient(135deg, #0a120a, #111e11) !important;
}
#card-chart {
  padding-top: 4px;
}
.chart-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  padding: 0 2px;
}
.chart-total-label {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -0.5px;
}
.chart-range-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.38);
  font-weight: 600;
}
#chart-svg-container svg {
  display: block;
  width: 100%;
}
.chart-no-data {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.3);
  text-align: center;
  padding: 28px 0 20px;
  line-height: 1.6;
}

/* ========== ACTIVITY LAUNCH CARD ========== */
.activity-launch-card {
  margin: 12px 20px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.activity-today-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  min-height: 24px;
}
.activity-done-chip {
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.78rem;
  color: var(--accent2);
}
.activity-hint {
  font-size: 0.78rem;
  color: var(--muted);
  align-self: center;
}
.btn-open-activity {
  width: 100%;
  background: linear-gradient(135deg, rgba(245,200,66,0.15), rgba(74,222,128,0.12));
  border: 1px solid rgba(245,200,66,0.35);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  transition: transform 0.1s, background 0.15s;
  -webkit-font-smoothing: antialiased;
}
.btn-open-activity:active {
  transform: scale(0.97);
  background: rgba(245,200,66,0.22);
}

/* ========== MESSAGE CARD ========== */
.message-card {
  margin: 12px 20px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  border-left: 3px solid var(--accent);
}
.message-card .label {
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: 6px;
}
.message-text {
  font-size: 0.97rem;
  color: var(--text);
  line-height: 1.7;
}

/* ========== WOMEN'S PERSPECTIVE TIPS ========== */
.womens-tips-card {
  margin: 0 20px 12px;
  background: linear-gradient(135deg, rgba(255,180,210,0.08), rgba(200,120,255,0.08));
  border-radius: var(--radius);
  padding: 16px 20px;
  border-left: 3px solid #f472b6;
}
.womens-tips-label {
  font-size: 0.75rem;
  color: #f472b6;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: 8px;
}
.womens-tips-text {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.75;
}

/* ========== FEMININE ENERGY TIPS ========== */
.feminine-tips-card {
  margin: 0 20px 12px;
  background: linear-gradient(135deg, rgba(180,130,255,0.09), rgba(255,210,100,0.07));
  border-radius: var(--radius);
  padding: 16px 20px;
  border-left: 3px solid #c084fc;
}
.feminine-tips-label {
  font-size: 0.75rem;
  color: #c084fc;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: 8px;
}
.feminine-tips-text {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.75;
}

/* ========== PROGRESS / MILESTONES ========== */
.progress-section {
  margin: 12px 20px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.progress-section .label,
.activity-launch-card .label,
.penalty-section .label,
.recommend-card .label {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: 12px;
}
.milestones {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.milestone {
  display: flex;
  align-items: center;
  gap: 10px;
}
.milestone-name {
  font-size: 0.8rem;
  color: var(--muted);
  width: 72px;
  flex-shrink: 0;
}
.milestone-bar-bg {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  overflow: hidden;
}
.milestone-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.8s ease;
}
.milestone-pct {
  font-size: 0.75rem;
  color: var(--muted);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}
.milestone.done .milestone-name { color: var(--gold); font-weight: 700; }
.milestone.done .milestone-bar-fill { background: linear-gradient(90deg, var(--gold), #a8ef66); }
.milestone.current .milestone-name { color: #fff; font-weight: 700; }
.milestone.current .milestone-bar-fill { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.milestone.current .milestone-pct { color: var(--accent2); font-weight: 700; }

/* ========== EMERGENCY BUTTON ========== */
.emergency-zone {
  margin: 16px 20px 4px;
}
.btn-emergency {
  width: 100%;
  background: linear-gradient(135deg, #7f1d1d, #991b1b);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fca5a5;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
  transition: transform 0.1s;
  -webkit-font-smoothing: antialiased;
}
.btn-emergency:active { transform: scale(0.97); }
.emergency-icon { font-size: 1.3rem; }

/* ========== PENALTY SECTION (MAIN SCREEN) ========== */
.penalty-section {
  margin: 12px 20px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.penalty-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.btn-penalty-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  transition: background 0.15s;
  text-align: left;
}
.btn-penalty-inline:active { background: rgba(239, 68, 68, 0.14); }
.btn-penalty-inline.has-img {
  position: relative;
  background-size: cover;
  background-position: center center;
  overflow: hidden;
  border-color: rgba(255,255,255,0.15);
  padding: 0 8px 10px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  aspect-ratio: 16 / 9;
  gap: 2px;
}
.btn-penalty-inline.has-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(30,5,5,0.88) 40%, rgba(30,5,5,0.15) 100%);
  border-radius: inherit;
  z-index: 0;
}
.btn-penalty-inline.has-img > * { position: relative; z-index: 1; }
.penalty-btn-icon { font-size: 1.1rem; flex-shrink: 0; }
.penalty-btn-label { font-size: 0.78rem; color: var(--text); flex: 1; font-weight: 600; line-height: 1.3; }
.penalty-btn-rate { font-size: 0.72rem; color: #fca5a5; font-weight: 700; flex-shrink: 0; }

/* ========== RECOMMEND CARD ========== */
.recommend-card {
  margin: 12px 20px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.recommend-card .label { color: var(--accent); }
.recommend-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.recommend-link {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.07);
  transition: background 0.15s;
}
.recommend-link:active { background: rgba(255,255,255,0.09); }
.recommend-icon { font-size: 2rem; flex-shrink: 0; width: 44px; text-align: center; }
.recommend-info { flex: 1; }
.recommend-title { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.recommend-desc { font-size: 0.78rem; color: var(--muted); line-height: 1.5; }
.recommend-arrow { font-size: 1.3rem; color: var(--muted); flex-shrink: 0; }

/* ========== ACTION BUTTONS ========== */
.actions {
  margin: 20px 20px 8px;
  display: flex;
  gap: 12px;
}
.btn {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.1s;
  -webkit-font-smoothing: antialiased;
}
.btn:active { transform: scale(0.97); }
.btn-share {
  background: rgba(245, 200, 66, 0.12);
  color: var(--accent);
  border: 1px solid rgba(245, 200, 66, 0.3);
}

/* ========== SETUP SCREEN ========== */
.setup-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 40px 30px;
  text-align: center;
  position: relative;
}
.setup-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 12px rgba(245,200,66,0.4));
}
.setup-screen h2 {
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.setup-screen p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 32px;
  line-height: 1.7;
}
.setup-screen label {
  font-size: 0.85rem;
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
  text-align: left;
  width: 100%;
  max-width: 320px;
}
.date-input {
  width: 100%;
  max-width: 320px;
  background: var(--card);
  border: 1px solid rgba(245,200,66,0.4);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 1rem;
  color: var(--text);
  font-family: inherit;
  margin-bottom: 20px;
  outline: none;
  -webkit-appearance: none;
}
.date-input:focus { border-color: var(--accent); }
.btn-start {
  width: 100%;
  max-width: 320px;
  background: linear-gradient(135deg, var(--accent), #a8ef66);
  color: #0d1a0d;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 24px rgba(245,200,66,0.35);
  transition: transform 0.1s;
}
.btn-start:active { transform: scale(0.97); }

/* ========== GENDER BANNER IMAGE ========== */
.gender-banner-img {
  width: 100%;
  max-width: 100%;
  border-radius: 14px;
  margin-bottom: 8px;
  display: block;
}

/* ========== GENDER SCREEN ========== */
.gender-buttons {
  display: flex;
  gap: 14px;
  margin: 24px 0 12px;
  width: 100%;
  max-width: 320px;
}
.btn-gender {
  flex: 1;
  background: var(--card);
  border: 2px solid rgba(245,200,66,0.3);
  border-radius: 16px;
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}
.btn-gender:active { background: rgba(245,200,66,0.1); border-color: var(--accent); }
.gender-btn-icon { font-size: 2.4rem; }
.gender-face {
  width: 90px;
  height: 130px;
  border-radius: 14px;
  background-size: cover;
  border: 2px solid rgba(245,200,66,0.5);
  box-shadow: 0 0 12px rgba(245,200,66,0.2);
  flex-shrink: 0;
}
.gender-screen-desc {
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--text);
  text-align: center;
  margin: 8px 0 16px;
  opacity: 0.9;
}
.gender-select-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.btn-gender.selected {
  border-color: var(--accent);
  background: rgba(245,200,66,0.1);
  box-shadow: 0 0 0 2px rgba(245,200,66,0.4);
}
.btn-gender-start {
  margin-top: 12px;
  width: 100%;
  max-width: 280px;
}
.btn-gender-start:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.gender-other-note {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin: 4px 0 8px;
  line-height: 1.6;
}
.gender-face-other {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: rgba(74,222,128,0.08);
}
.btn-mode-sm {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  flex: 1;
  justify-content: center;
}
.btn-mode-sm:active { background: rgba(74,222,128,0.1); border-color: var(--accent2); }
.setup-video { width: 100%; max-width: 480px; border-radius: 14px; margin-bottom: 16px; display: block; }
.setup-desc-text { white-space: pre-line; font-size: 0.88rem; line-height: 1.8; color: var(--muted); }
.setup-abstinence-note { font-size: 0.82rem; color: var(--accent2); margin-top: 4px; }
.settings-female-note { font-size: 0.78rem; color: var(--muted); line-height: 1.6; margin-top: 10px; padding: 8px 10px; background: rgba(74,222,128,0.06); border-radius: 8px; border-left: 2px solid rgba(74,222,128,0.3); }
.gender-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
.age-note {
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.6;
  margin-top: 10px !important;
  margin-bottom: 0 !important;
}

/* ========== MODAL ========== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 100;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card2);
  border-radius: 24px 24px 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 480px;
  text-align: center;
}
.modal h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.modal p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
}
.modal-close-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-desc {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 16px;
  text-align: left;
}
.modal-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.btn-cancel {
  flex: 1;
  background: rgba(255,255,255,0.07);
  color: var(--text);
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-confirm {
  flex: 1;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ========== ACTIVITY MODAL ========== */
.modal-activity {
  max-height: 85vh;
  overflow-y: auto;
}
.activity-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}
.btn-activity-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(74,222,128,0.07);
  border: 1px solid rgba(74,222,128,0.22);
  border-radius: 14px;
  padding: 14px 10px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
  text-align: center;
}
.btn-activity-item:active { background: rgba(74,222,128,0.16); }
.btn-activity-item.done {
  background: rgba(74,222,128,0.14);
  border-color: var(--accent2);
  opacity: 0.7;
  cursor: default;
}
/* キャラ画像付きボタン */
.btn-activity-item.has-img {
  position: relative;
  background-size: cover;
  background-position: center center;
  overflow: hidden;
  border-color: rgba(255,255,255,0.15);
  padding: 0 8px 10px;
  justify-content: flex-end;
  aspect-ratio: 16 / 9;
}
.btn-activity-item.has-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5,12,5,0.88) 40%, rgba(5,12,5,0.15) 100%);
  border-radius: inherit;
  z-index: 0;
}
.btn-activity-item.has-img > * { position: relative; z-index: 1; }
.btn-activity-item.has-img .act-icon { display: none; }
.btn-activity-item.has-img .act-label { font-size: 0.78rem; }
.btn-activity-item.has-img .act-hint { color: rgba(255,255,255,0.5); }
.btn-activity-item.has-img.done::after {
  content: '✓';
  position: absolute;
  top: 8px; right: 10px;
  font-size: 1rem;
  color: var(--accent2);
  z-index: 2;
}
.act-icon { font-size: 1.6rem; }
.act-label { font-size: 0.8rem; color: var(--text); font-weight: 600; line-height: 1.3; }
.act-hint { font-size: 0.65rem; color: rgba(255,255,255,0.42); line-height: 1.35; text-align: center; padding: 0 2px; }
.act-pts { font-size: 0.75rem; color: var(--accent); font-weight: 700; }
.btn-activity-item.done .act-pts { color: var(--accent2); }

.activity-feedback {
  margin-top: 14px;
  background: rgba(245,200,66,0.1);
  border: 1px solid rgba(245,200,66,0.2);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 700;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s;
  min-height: 42px;
}
.activity-feedback.show { opacity: 1; }

/* ========== PENALTY MODAL ========== */
.modal-penalty {
  max-height: 85vh;
  overflow-y: auto;
}
.penalty-modal-img {
  display: none;
  width: 100%;
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  margin-bottom: 16px;
}
.penalty-modal-img.active {
  display: block;
}
.penalty-modal-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.btn-penalty-modal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}
.btn-penalty-modal-item:active { background: rgba(239,68,68,0.15); }
.btn-penalty-modal-item.has-img {
  position: relative;
  background-size: cover;
  background-position: center center;
  overflow: hidden;
  border-color: rgba(255,255,255,0.15);
  padding: 0 8px 10px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  aspect-ratio: 16 / 9;
  gap: 2px;
}
.btn-penalty-modal-item.has-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(30,5,5,0.88) 40%, rgba(30,5,5,0.15) 100%);
  border-radius: inherit;
  z-index: 0;
}
.btn-penalty-modal-item.has-img > * { position: relative; z-index: 1; }
.penalty-item-icon { font-size: 1.2rem; flex-shrink: 0; }
.penalty-item-label { font-size: 0.78rem; color: var(--text); flex: 1; font-weight: 600; line-height: 1.3; }
.penalty-item-rate { font-size: 0.72rem; color: #fca5a5; font-weight: 700; flex-shrink: 0; }

/* Penalty confirm step */
.penalty-confirm-box {
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
}
.confirm-icon { font-size: 2.5rem; margin-bottom: 8px; }
.confirm-title { font-size: 1rem; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.confirm-body {
  font-size: 0.88rem;
  color: var(--muted);
  white-space: pre-line;
  margin-bottom: 12px;
  line-height: 1.6;
}
.confirm-pts-preview {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fca5a5;
}
.btn-confirm-penalty {
  flex: 1;
  background: rgba(239,68,68,0.8);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.btn-confirm-penalty:active { background: var(--red); }

/* Penalty result step */
.penalty-result-box {
  background: rgba(245,200,66,0.07);
  border: 1px solid rgba(245,200,66,0.15);
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
}
.result-title { font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; letter-spacing: 0.08em; }
.result-pts { font-size: 2.2rem; font-weight: 800; color: #fca5a5; margin-bottom: 6px; }
.result-remaining { font-size: 0.88rem; color: var(--muted); white-space: pre-line; margin-bottom: 14px; }
.result-riseup { font-size: 0.95rem; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.result-tip {
  font-size: 0.82rem;
  color: var(--accent2);
  background: rgba(74,222,128,0.08);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 8px;
}

/* ========== SETTINGS MODAL ========== */
.modal-settings { max-height: 85vh; overflow-y: auto; }
.settings-section {
  margin-bottom: 20px;
  text-align: left;
}
.settings-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.gender-buttons-sm {
  display: flex;
  gap: 10px;
  margin: 0;
  max-width: none;
  width: 100%;
}
.btn-gender-sm {
  flex: 1;
  background: var(--card);
  border: 2px solid rgba(245,200,66,0.2);
  border-radius: 12px;
  padding: 12px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}
.btn-gender-sm:active { background: rgba(245,200,66,0.1); border-color: var(--accent); }
.current-mode-info {
  font-size: 0.82rem;
  color: var(--accent);
  margin-top: 10px;
  font-weight: 600;
}
.limit-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}
.btn-limit {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 1.2rem;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}
.limit-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  min-width: 30px;
  text-align: center;
}
.btn-reset-all {
  width: 100%;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 12px;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fca5a5;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-reset-all:active { background: rgba(239,68,68,0.2); }
.settings-sub-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 14px 0 4px;
}
.settings-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 8px;
  opacity: 0.8;
}
/* ========== WELCOME SCREEN ========== */
.welcome-intro {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.5;
}
.welcome-content {
  width: 100%;
  max-width: 360px;
  text-align: left;
}
.welcome-section {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.welcome-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.welcome-row {
  display: grid;
  grid-template-columns: 24px 1fr 88px;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.82rem;
}
.welcome-row:last-child { border-bottom: none; }
.welcome-row-icon { font-size: 1rem; text-align: center; }
.welcome-row-label { color: var(--text); }
.welcome-row-rate { font-size: 0.76rem; font-weight: 700; color: #f87171; text-align: right; line-height: 1.4; }
.welcome-recovery-desc { font-size: 0.85rem; color: var(--text); margin-bottom: 8px; }
.welcome-interval-rows { display: flex; flex-direction: column; gap: 5px; margin: 4px 0 10px; }
.welcome-interval-row { font-size: 0.82rem; padding: 5px 10px; border-radius: 8px; }
.welcome-interval-row.muted  { background: rgba(255,255,255,0.05); color: var(--muted); }
.welcome-interval-row.half   { background: rgba(245,200,66,0.12);  color: #f5c842; }
.welcome-interval-row.none   { background: rgba(74,222,128,0.12);  color: #4ade80; }
.welcome-interval-row.bonus  { background: rgba(251,191,36,0.18);  color: #fbbf24; }
.welcome-forgiveness-note { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }
.welcome-settings-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 4px 0 16px;
  text-align: center;
}

.btn-toggle-wide {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.btn-toggle-wide:active { background: rgba(245,200,66,0.15); border-color: var(--accent); }

/* ========== EMERGENCY MODAL ========== */
.modal-emergency {
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  max-height: 85vh;
  overflow-y: auto;
}
.emergency-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.emergency-modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fca5a5;
}
.emergency-close {
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}
.emergency-tip-card {
  background: linear-gradient(135deg, #1a1f0e, #1e2a10);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  border: 1px solid rgba(74, 222, 128, 0.2);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.tip-img { display: none; width: 100%; aspect-ratio: 16/9; background-size: cover; background-position: center; border-radius: 10px; }
.tip-img.active { display: block; }
.tip-number { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.1em; font-weight: 600; }
.tip-icon { font-size: 2.8rem; line-height: 1; }
.tip-title { font-size: 1.05rem; font-weight: 800; color: var(--accent2); }
.tip-body { font-size: 0.9rem; color: var(--text); line-height: 1.75; white-space: pre-line; }
.emergency-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  gap: 8px;
}
.btn-tip-nav {
  background: rgba(255,255,255,0.07);
  border: none;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-tip-nav:active { background: rgba(255,255,255,0.13); }
.tip-dots { display: flex; gap: 6px; align-items: center; }
.tip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: background 0.2s, width 0.2s;
}
.tip-dot.active { background: var(--accent2); width: 16px; border-radius: 3px; }
.emergency-affirmation {
  margin-top: 16px;
  background: rgba(245, 200, 66, 0.07);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.88rem;
  color: var(--gold);
  text-align: center;
  line-height: 1.7;
  border: 1px solid rgba(245, 200, 66, 0.15);
}

/* ========== ACCORDION (shared: レベル一覧 / 悪習慣を記録) ========== */
.accordion-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.accordion-toggle-icon {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1;
  flex-shrink: 0;
}

/* ========== EFFECTS SECTION ========== */
.effects-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 18px 16px;
  margin-bottom: 18px;
}
.effects-label-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.effects-toggle-icon {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1;
}
.effects-summary {
  font-size: 0.78rem;
  color: rgba(180,220,180,0.75);
  margin-top: 8px;
  line-height: 1.45;
}
.effects-summary.all-unlocked {
  color: var(--gold);
  font-weight: 700;
}
.effects-sub {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 2px;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}
.effects-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  max-height: 126px;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.effects-list::-webkit-scrollbar { width: 3px; }
.effects-list::-webkit-scrollbar-track { background: transparent; }
.effects-list::-webkit-scrollbar-thumb { background: rgba(74,222,128,0.3); border-radius: 3px; }
.effect-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 9px;
  padding: 8px 10px;
  opacity: 0.42;
  transition: opacity 0.2s;
}
.effect-item.unlocked {
  opacity: 1;
  background: rgba(74, 222, 128, 0.07);
  border-color: rgba(74, 222, 128, 0.2);
}
.effect-day-badge {
  background: rgba(245, 200, 66, 0.12);
  color: var(--gold);
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 5px;
  padding: 2px 6px;
  white-space: nowrap;
  min-width: 34px;
  text-align: center;
  flex-shrink: 0;
}
.effect-item.unlocked .effect-day-badge {
  background: rgba(74, 222, 128, 0.18);
  color: var(--accent2);
}
.effect-icon-col {
  font-size: 1rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}
.effect-text {
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.4;
}
.effect-item.unlocked .effect-text {
  color: #d4f5e0;
}
.effects-note {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.5;
  padding-top: 2px;
}

/* ========== FOOTER ========== */
footer {
  text-align: center;
  padding: 16px 20px 32px;
  color: rgba(255,255,255,0.13);
  font-size: 0.75rem;
}

/* ========== CELEBRATE OVERLAY ========== */
/* ========== REWARD MODAL ========== */
.reward-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.reward-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}
.reward-backdrop.hidden { display: none; }

.reward-modal {
  position: relative;
  width: min(84vw, 380px);
  max-height: 84vh;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.08);
  transform: scale(0.82);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: #000;
}
.reward-backdrop.show .reward-modal {
  transform: scale(1);
}

.reward-video {
  width: 100%;
  max-height: 84vh;
  display: block;
  object-fit: contain;
}

.reward-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.88);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.reward-close:active { background: rgba(255,255,255,0.18); }

/* ========== SETUP PERIOD SECTION ========== */
.setup-period-section {
  width: 100%;
  margin-top: 18px;
  padding: 14px 16px;
  background: rgba(255, 160, 200, 0.07);
  border: 1px solid rgba(255, 160, 200, 0.2);
  border-radius: 14px;
  text-align: left;
}
.setup-period-section label {
  display: block;
  font-size: 0.88rem;
  color: #f5c0d8;
  font-weight: 600;
  margin-bottom: 4px;
}
.setup-period-hint {
  font-size: 0.75rem;
  color: rgba(245, 192, 216, 0.65);
  margin: 0 0 10px;
  line-height: 1.4;
}

/* ========== SETTINGS DONE BUTTON ========== */
.btn-settings-done {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, rgba(74,222,128,0.18), rgba(74,222,128,0.1));
  border: 1px solid rgba(74, 222, 128, 0.4);
  border-radius: 14px;
  color: var(--accent2);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-settings-done:active { opacity: 0.7; }

/* ========== MOON PHASE BAR ========== */
.moon-phase-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 10px;
  padding: 8px 14px;
  background: rgba(255, 160, 200, 0.08);
  border: 1px solid rgba(255, 160, 200, 0.18);
  border-radius: 12px;
  font-size: 0.82rem;
  color: #f5c0d8;
  flex-wrap: wrap;
}
.moon-phase-bar #moon-phase-icon-name {
  font-weight: 700;
  font-size: 0.85rem;
}
.moon-phase-day {
  font-size: 0.75rem;
  color: rgba(245, 192, 216, 0.7);
  margin-left: 2px;
}
.moon-phase-effect {
  margin-left: auto;
  font-size: 0.75rem;
  color: rgba(245, 192, 216, 0.85);
  background: rgba(255, 160, 200, 0.12);
  border-radius: 8px;
  padding: 2px 8px;
}


/* ========== SETTINGS DATE INPUT ========== */
.date-input-sm {
  width: 100%;
  padding: 8px 10px;
  font-size: 0.9rem;
}

/* ========== HIDDEN ========== */
.hidden { display: none !important; }
