:root {
  --bg: #f7f4f0;
  --ink: #2c2823;
  --ink-soft: rgba(44, 40, 35, 0.55);
  --line: rgba(44, 40, 35, 0.12);
  --card: rgba(255, 255, 255, 0.62);
  --accent: #c9a98e;
  --accent-ink: #ffffff;
  --blob-a: rgba(224, 188, 150, 0.55);
  --blob-b: rgba(196, 205, 214, 0.5);
  --blob-c: rgba(233, 206, 196, 0.5);
}

body[data-phase="noon"] {
  --blob-a: rgba(178, 196, 210, 0.5);
  --blob-b: rgba(201, 196, 186, 0.45);
  --blob-c: rgba(190, 205, 200, 0.45);
}

body[data-phase="night"] {
  --bg: #1d1f24;
  --ink: #ece8e2;
  --ink-soft: rgba(236, 232, 226, 0.55);
  --line: rgba(236, 232, 226, 0.14);
  --card: rgba(255, 255, 255, 0.06);
  --accent: #8f9bb0;
  --blob-a: rgba(96, 110, 140, 0.45);
  --blob-b: rgba(70, 80, 105, 0.5);
  --blob-c: rgba(120, 100, 120, 0.4);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  transition: background 1.2s ease, color 1.2s ease;
  min-height: 100vh;
  min-height: 100dvh;
}

.breath-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.blob {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.9;
  will-change: transform;
}

.blob-a {
  background: radial-gradient(circle at 30% 30%, var(--blob-a), transparent 70%);
  top: -18%;
  left: -12%;
  animation: drift-a 26s ease-in-out infinite alternate;
}

.blob-b {
  background: radial-gradient(circle at 60% 40%, var(--blob-b), transparent 70%);
  bottom: -22%;
  right: -14%;
  animation: drift-b 32s ease-in-out infinite alternate;
}

.blob-c {
  background: radial-gradient(circle at 50% 50%, var(--blob-c), transparent 70%);
  top: 28%;
  left: 22%;
  width: 42vmax;
  height: 42vmax;
  animation: drift-c 38s ease-in-out infinite alternate;
}

@keyframes drift-a {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(14vw, 10vh) scale(1.18); }
}

@keyframes drift-b {
  from { transform: translate(0, 0) scale(1.05); }
  to { transform: translate(-12vw, -12vh) scale(0.9); }
}

@keyframes drift-c {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-8vw, 10vh) scale(1.22); }
}

.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 40px 24px calc(40px + env(safe-area-inset-bottom));
  min-height: 100vh;
  min-height: 100dvh;
}

.view { display: flex; flex-direction: column; }

.hidden { display: none !important; }

.brand {
  font-size: 34px;
  font-weight: 200;
  letter-spacing: 12px;
  text-align: center;
  margin: 24px 0 8px;
  padding-left: 12px;
}

.brand.small {
  font-size: 24px;
  letter-spacing: 8px;
  margin: 8px 0;
}

.subtitle {
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 40px;
}

.role-row {
  display: flex;
  gap: 14px;
  margin-bottom: 22px;
}

.role-card {
  flex: 1;
  padding: 18px 0;
  font-size: 18px;
  font-weight: 300;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.role-card.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.seg {
  display: flex;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 22px;
}

.seg-btn {
  flex: 1;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 300;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.seg-btn.selected {
  background: var(--accent);
  color: var(--accent-ink);
}

.join-field { margin-bottom: 22px; }

#pair-code {
  width: 100%;
  text-align: center;
  font-size: 26px;
  letter-spacing: 10px;
  padding: 14px 0 14px 10px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
}

#pair-code:focus { border-color: var(--accent); }

.primary-btn {
  width: 100%;
  padding: 16px 0;
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 2px;
  color: var(--accent-ink);
  background: var(--accent);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.1s ease;
}

.primary-btn:active { transform: scale(0.99); }
.primary-btn:disabled { opacity: 0.5; cursor: default; }

.primary-btn.mini {
  width: auto;
  padding: 12px 22px;
  font-size: 14px;
  letter-spacing: 1px;
}

.app-head { margin-bottom: 26px; }

.whisper {
  text-align: center;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
  margin: 14px 8px 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 20px;
  margin-bottom: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card-title {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 4px;
  color: var(--ink-soft);
  margin: 0 0 16px;
}

.weather-current {
  font-size: 22px;
  font-weight: 200;
  letter-spacing: 4px;
}

.weather-current .meta {
  display: block;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--ink-soft);
  margin-top: 6px;
}

.weather-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.weather-opt {
  flex: 1 1 30%;
  padding: 12px 4px;
  font-size: 14px;
  font-weight: 300;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.weather-opt.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.preset-chip {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 300;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.preset-chip:active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.delivery-form {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

#delivery-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
}

#delivery-input:focus { border-color: var(--accent); }

.delivery-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.delivery-item {
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.delivery-item .time {
  display: block;
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 6px;
}

.delivery-empty {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
}

.ghost-btn {
  width: 100%;
  padding: 15px 0;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 2px;
  color: #c05b5b;
  background: transparent;
  border: 1px solid rgba(192, 91, 91, 0.4);
  border-radius: 14px;
  cursor: pointer;
  margin-top: 6px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(36px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  max-width: 80%;
  padding: 12px 20px;
  font-size: 14px;
  color: #fff;
  background: rgba(30, 28, 25, 0.88);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 10;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
}
