:root {
  --bg0: #fff8ef;
  --bg1: #ffe8d2;
  --ink: #1c2430;
  --muted: #5c6675;
  --accent: #ff6b3d;
  --accent-deep: #e24a1c;
  --leaf: #1fa37a;
  --sky: #2f7de1;
  --sand: #f3c96b;
  --danger: #d64545;
  --card: rgba(255, 255, 255, 0.78);
  --line: rgba(28, 36, 48, 0.08);
  --radius: 18px;
  --shadow: 0 18px 40px rgba(226, 120, 60, 0.12);
  --font-display: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif;
  --font-body: "IBM Plex Sans JP", "Hiragino Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 600px at 10% -10%, #ffd7a8 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #b8f0d8 0%, transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1));
  line-height: 1.6;
}

.bg-glow {
  position: fixed;
  inset: auto -10% -20% auto;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(255, 107, 61, 0.18), transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: drift 12s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate(-20px, 10px) scale(1); }
  to { transform: translate(30px, -30px) scale(1.08); }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  backdrop-filter: blur(10px);
  background: rgba(255, 248, 239, 0.85);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}
.nav a:hover { color: var(--accent-deep); }

.logout-form { margin-left: auto; }

.main {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 2rem));
  margin: 1.25rem auto 3rem;
}
.main-login {
  min-height: calc(100vh - 2rem);
  display: grid;
  place-items: center;
}

.login-panel, .form-card, .section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.1rem;
  animation: rise 0.45s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.hero-streak {
  text-align: center;
  padding: 1.6rem 1.2rem 1.4rem;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.92), rgba(255, 232, 210, 0.88));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 1.1rem;
  animation: rise 0.5s ease both;
}

.login-brand, h1, h2 {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.01em;
  margin: 0 0 0.55rem;
}
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 0.92rem;
}
.lede { color: var(--muted); margin-top: 0; }
.hint, .muted { color: var(--muted); font-size: 0.9rem; }
.hint { margin: 0.4rem 0 0; }

.streak-label {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-weight: 600;
}
.streak-number {
  margin: 0.1rem 0 0.6rem;
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1;
  color: var(--accent-deep);
}
.streak-number .num {
  font-size: clamp(4.2rem, 18vw, 6.5rem);
  display: inline-block;
  animation: pop 0.55s cubic-bezier(.2,1.4,.4,1) both;
}
.streak-number .unit {
  font-size: 1.6rem;
  margin-left: 0.2rem;
  vertical-align: 0.85rem;
}
@keyframes pop {
  from { transform: scale(0.85); opacity: 0.4; }
  to { transform: scale(1); opacity: 1; }
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0.8rem 0 1.1rem;
}
.stat-row > div {
  padding: 0.55rem 0.3rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.65);
}
.stat-k { display: block; font-size: 0.75rem; color: var(--muted); }
.stat-v { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}
.section .cta-row { justify-content: flex-start; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-lg { padding: 0.95rem 1.45rem; font-size: 1.05rem; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-secondary { background: #1c2430; color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }

.stack { display: grid; gap: 0.9rem; }
.field { display: grid; gap: 0.35rem; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  font: inherit;
  background: #fff;
}
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 560px) {
  .row-2 { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
  .logout-form { margin-left: 0; width: 100%; }
}

.choice-grid {
  border: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.choice-grid legend {
  font-weight: 700;
  margin-bottom: 0.45rem;
}
.choice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  background: #fff;
  border: 2px solid transparent;
  cursor: pointer;
}
.choice:has(input:checked) {
  border-color: var(--accent);
  background: #fff1ea;
}
.choice input { accent-color: var(--accent); }

.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
}

.banner {
  border-radius: 12px;
  padding: 0.75rem 0.95rem;
  margin-bottom: 0.9rem;
  font-weight: 600;
}
.banner-ok { background: #dff7ec; color: #0f6b4c; }
.banner-ng { background: #ffe1e1; color: #8f1f1f; }

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}
.list > li {
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--line);
}
.list.compact > li { padding: 0.55rem 0.75rem; }
.list-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.7rem;
  align-items: center;
}
.next { color: var(--sky); margin: 0.25rem 0 0; }
.task-reco {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0.2rem 0 0;
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #ffe6c8;
  font-size: 0.78rem;
  font-weight: 700;
}
.tag-morning { background: #fff0a8; color: #7a5a00; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  margin: 0.6rem 0 1rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.swatch {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 4px;
  margin-right: 0.3rem;
  vertical-align: -1px;
}

.contrib {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  max-width: 320px;
}
.cell {
  aspect-ratio: 1;
  border-radius: 6px;
  background: #e8e4dc;
}
.cell.empty { visibility: hidden; }
.cell.achieved { background: var(--leaf); }
.cell.missed { background: #f0a3a3; }
.cell.vacation { background: var(--sky); }
.cell.freeze { background: var(--sand); }
.cell.pending { background: #cfd6e0; outline: 2px dashed rgba(28,36,48,0.2); outline-offset: -2px; }
.cell.pulse { transform: scale(1.12); transition: transform 0.2s ease; }

.mascot-hero {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}
.mascot-img {
  width: 112px;
  height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(226, 120, 60, 0.25));
  animation: mascot-bob 2.8s ease-in-out infinite;
}
.mascot-line {
  margin: 0;
  max-width: 26rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
  line-height: 1.45;
}
@keyframes mascot-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
  .mascot-img { animation: none; }
}

.token-reveal {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.35rem 0.5rem;
  background: #fff;
  border-radius: 8px;
  word-break: break-all;
  font-size: 0.85rem;
}

.launch-section .lede { margin-bottom: 0.85rem; }
.launch-grid {
  display: grid;
  gap: 0.75rem;
}
.launch-btn {
  display: grid;
  gap: 0.2rem;
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.05rem 1.15rem;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255, 236, 214, 0.9));
  cursor: pointer;
  font: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 24px rgba(226, 120, 60, 0.08);
}
.launch-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 107, 61, 0.45);
}
.launch-btn:active { transform: translateY(0); }
.launch-btn.is-busy { opacity: 0.7; pointer-events: none; }
.launch-btn-label {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--ink);
}
.launch-btn-desc {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}
.launch-status { min-height: 1.4em; }
.h3-soft {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 1rem 0 0.5rem;
}
