/* Kinkboard — soft pastel light UI. Mobile first. No external assets. */

:root {
  --bg: #FBF9FB;
  --ink: #2B2A33;
  --muted: #625E6B;
  --muted-2: #6E6A75;
  --line: rgba(43, 42, 51, 0.07);
  --line-strong: rgba(43, 42, 51, 0.14);
  --card: rgba(255, 255, 255, 0.92);
  --card-solid: #FFFFFF;
  --veil: rgba(255, 255, 255, 0.55);

  /* pastel identity */
  --blue: #5E9FC4;
  --blue-ink: #3D7896;
  --blue-soft: #A9D9F2;
  --pink: #D2708F;
  --pink-ink: #B34F6F;
  --pink-soft: #F7C6D9;
  --lilac: #D9CCF2;

  --accent: #5E9FC4;
  --danger: #A8443E;
  --ok: #3F7F55;

  --shadow: 0 10px 30px rgba(80, 90, 120, 0.08);
  --shadow-sm: 0 4px 14px rgba(80, 90, 120, 0.06);
  --shadow-lift: 0 14px 34px rgba(120, 130, 170, 0.14);

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p { overflow-wrap: break-word; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { touch-action: manipulation; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* --------------------------------------------------------------- aurora bg */
.aurora {
  position: fixed;
  inset: -20vh -22vw;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.aurora i {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.42;
  will-change: transform;
}
.aurora i:nth-child(1) {
  width: 74vw; height: 74vw;
  left: -18vw; top: -6vh;
  background: var(--blue-soft);
  animation: drift-a 23s ease-in-out infinite alternate;
}
.aurora i:nth-child(2) {
  width: 64vw; height: 64vw;
  right: -24vw; top: 16vh;
  background: var(--pink-soft);
  opacity: 0.38;
  animation: drift-b 19s ease-in-out infinite alternate;
}
.aurora i:nth-child(3) {
  width: 72vw; height: 72vw;
  left: 6vw; bottom: -18vh;
  background: var(--lilac);
  opacity: 0.28;
  animation: drift-c 25s ease-in-out infinite alternate;
}
.aurora i:nth-child(4) {
  width: 46vw; height: 46vw;
  right: 2vw; top: 52vh;
  background: var(--blue-soft);
  opacity: 0.25;
  animation: drift-d 21s ease-in-out infinite alternate;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(7vw, 5vh, 0) scale(1.12); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.06); }
  to   { transform: translate3d(-6vw, 7vh, 0) scale(0.96); }
}
@keyframes drift-c {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(5vw, -6vh, 0) scale(1.1); }
}
@keyframes drift-d {
  from { transform: translate3d(0, 0, 0) scale(0.98); }
  to   { transform: translate3d(-4vw, -5vh, 0) scale(1.08); }
}

.app {
  position: relative;
  z-index: 1;
  height: 100dvh;
  overflow: hidden;
}

/* ------------------------------------------------------------------ splash */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.4s ease;
}
.splash.gone { opacity: 0; pointer-events: none; }
.splash-mark { opacity: 0.95; }

/* ------------------------------------------------------------------- login */
.login {
  position: absolute;
  inset: 0;
  z-index: 5;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: calc(28px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
  background: transparent;
  display: flex;
  flex-direction: column;
}

.brand { text-align: center; margin: 0; }

.login-body {
  margin: auto 0;
  width: 100%;
  max-width: 380px;
  align-self: center;
}
.brand-mark { display: block; margin: 0 auto 14px; }
.brand h1 {
  font-size: 31px;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}
.brand-tag {
  margin: 8px 0 0;
  color: var(--muted-2);
  font-size: 13.5px;
  letter-spacing: 0.005em;
}

.who-label {
  margin: 34px 0 12px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
}

.who { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.who-card {
  min-height: 152px;
  padding: 18px 14px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}
.who-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-lift); }
.who-card:active { transform: scale(0.985); }
.who-card.sel { border-color: var(--c); background: linear-gradient(180deg, var(--cg), rgba(255, 255, 255, 0.94)); }

.avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.who-name { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.who-hint { font-size: 11.5px; color: var(--muted-2); }

.pin-wrap {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pin-who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 500;
}
.pin-who .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.pin-who button {
  background: none;
  border: none;
  color: var(--muted-2);
  font-size: 12.5px;
  text-decoration: underline;
  cursor: pointer;
  padding: 10px 4px;
  min-height: 44px;
}

.pin-dots { display: flex; gap: 15px; margin: 18px 0 6px; height: 16px; align-items: center; }
.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(43, 42, 51, 0.18);
  background: rgba(255, 255, 255, 0.6);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.pin-dot.on { background: var(--accent); border-color: var(--accent); transform: scale(1.06); }

.pin-msg {
  min-height: 20px;
  font-size: 12.5px;
  color: var(--danger);
  text-align: center;
  margin: 4px 0 2px;
  padding: 0 8px;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 296px;
  margin-top: 8px;
}
.key {
  height: 58px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-size: 22px;
  font-weight: 400;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.key:active { background: linear-gradient(135deg, var(--blue-soft), var(--pink-soft)); transform: scale(0.97); box-shadow: none; }
.key.blank { visibility: hidden; }
.key.icon { color: var(--muted); }
.key:disabled { opacity: 0.5; }

.login-foot {
  padding-top: 28px;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted-2);
  letter-spacing: 0.01em;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
.pin-wrap.shake { animation: shake 0.4s ease; }

/* ------------------------------------------------------------------- shell */
.shell {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.shell[hidden], .login[hidden] { display: none; }

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 8px;
}
.brand-mini {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-sm);
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.view {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 6px 16px 26px;
  scrollbar-width: none;
}
.view::-webkit-scrollbar { display: none; }

.page-head { padding: 10px 2px 18px; }
.eyebrow {
  margin: 0 0 7px;
  font-size: 10.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
}
.page-head h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--ink);
}
.sub { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }

/* ------------------------------------------------------------- goal cards */
.goal {
  position: relative;
  margin-bottom: 14px;
  padding: 18px 16px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.goal-head { display: flex; align-items: center; gap: 12px; }
.goal-emoji {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: linear-gradient(150deg, rgba(169, 217, 242, 0.4), rgba(247, 198, 217, 0.42));
  border: 1px solid rgba(43, 42, 51, 0.05);
}
.goal-title { min-width: 0; flex: 1 1 auto; }
.goal-title h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--ink);
}
.goal-title .meta { margin: 4px 0 0; font-size: 12px; color: var(--muted-2); }

.save-tick {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #FFFFFF;
  background: var(--ok);
  box-shadow: 0 4px 10px rgba(63, 127, 85, 0.28);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.save-tick.show { opacity: 1; transform: scale(1); }

.weekbars { margin: 16px 0 4px; display: flex; flex-direction: column; gap: 9px; }
.wb { display: grid; grid-template-columns: 64px minmax(0, 1fr) 54px; align-items: center; gap: 8px; }
.wb-name {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track {
  height: 7px;
  border-radius: 99px;
  background: rgba(43, 42, 51, 0.07);
  overflow: hidden;
}
.track i {
  display: block;
  height: 100%;
  border-radius: 99px;
  min-width: 0;
  background: linear-gradient(90deg, var(--tone-soft, var(--blue-soft)), var(--tone, var(--blue)));
  transition: width 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.wb-val {
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.players { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 14px; }
.players.one { grid-template-columns: minmax(0, 1fr); }
.player {
  min-width: 0;
  padding: 11px 10px 9px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--cg, rgba(255, 255, 255, 0.6)), rgba(255, 255, 255, 0.75));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.player-name {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--c);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-name .dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }

.stepper { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 2px; }
.step {
  height: 44px;
  width: 44px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 6px rgba(80, 90, 120, 0.06);
  color: var(--c, var(--ink));
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.step:active { background: var(--cg, rgba(169, 217, 242, 0.5)); transform: scale(0.95); }
.val {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  border-radius: 10px;
  color: var(--ink);
}
.val:focus { outline: none; background: rgba(255, 255, 255, 0.85); box-shadow: inset 0 0 0 1px var(--line-strong); }

.note {
  width: 100%;
  min-width: 0;
  height: 44px;
  margin-top: 4px;
  padding: 0 2px;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-size: 13px;
  color: var(--ink);
}
.note::placeholder { color: var(--muted-2); }
.note:disabled { opacity: 0.5; }
.note:focus { outline: none; border-bottom-color: var(--line-strong); }

.toggle {
  width: 100%;
  min-height: 44px;
  padding: 0 6px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.toggle .check { font-size: 12px; opacity: 0; transition: opacity 0.18s ease; }
.toggle.on {
  color: var(--c);
  border-color: var(--c);
  background: var(--cg, rgba(169, 217, 242, 0.45));
}
.toggle.on .check { opacity: 1; }

.empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted-2);
  font-size: 13.5px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.6);
}

/* -------------------------------------------------------------------- board */
.duel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
  padding: 22px 14px 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 130% at 0% 0%, rgba(169, 217, 242, 0.55) 0%, rgba(255, 255, 255, 0) 64%),
    radial-gradient(120% 130% at 100% 0%, rgba(247, 198, 217, 0.55) 0%, rgba(255, 255, 255, 0) 64%),
    var(--card-solid);
  box-shadow: var(--shadow);
}
.duel-side { text-align: center; min-width: 0; padding: 0 2px; }
.duel-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.duel-name .dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; }
.duel-pct {
  margin-top: 6px;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.duel-pct span { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 1px; letter-spacing: 0; }
.duel-bar { height: 5px; border-radius: 99px; background: rgba(43, 42, 51, 0.08); margin-top: 10px; overflow: hidden; }
.duel-bar i { display: block; height: 100%; border-radius: 99px; }
.duel-vs {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
}

.lead { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 0 4px; margin: -2px 0 18px; }
.lead-chip {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--c);
  border: 1px solid var(--c);
  background: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lead .muted { font-size: 11.5px; color: var(--muted-2); }

.card {
  margin-bottom: 14px;
  padding: 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.card-title {
  margin: 0 0 14px;
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.cmp { margin-bottom: 16px; }
.cmp:last-child { margin-bottom: 0; }
.cmp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.cmp-title { font-size: 14px; letter-spacing: -0.005em; color: var(--ink); min-width: 0; }
.cmp-title .em { margin-right: 5px; }
.cmp-target { font-size: 11.5px; color: var(--muted-2); white-space: nowrap; }
.cmp-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) 48px; align-items: center; gap: 8px; margin-top: 5px; }
.cmp-name {
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmp-val { font-size: 11.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.ptable { display: flex; flex-direction: column; }
.prow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 54px;
  align-items: center;
  gap: 8px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.prow:first-child { border-top: none; }
.prow.head {
  padding: 0 0 6px;
  border-top: none;
  font-size: 9.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.prow.head span:not(:first-child) { text-align: right; }
.pname { display: flex; align-items: center; gap: 7px; min-width: 0; font-weight: 500; }
.pname .dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; }
.mono { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mono em { font-style: normal; color: var(--muted-2); font-size: 11px; }

.chart { display: block; width: 100%; height: auto; margin: 2px 0 0; }
.chart-note { margin: 8px 0 0; font-size: 11.5px; color: var(--muted-2); text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 11px; color: var(--muted-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 99px; display: inline-block; }

/* -------------------------------------------------------------------- goals */
.goal-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.goal-row:first-of-type { border-top: none; padding-top: 2px; }
.grow-main { flex: 1 1 auto; min-width: 0; }
.grow-main h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.grow-main p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted-2); }
.grow-actions { display: flex; gap: 6px; flex: 0 0 auto; }

.mini {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 6px rgba(80, 90, 120, 0.05);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.mini:active { background: linear-gradient(135deg, rgba(169, 217, 242, 0.45), rgba(247, 198, 217, 0.45)); }

.form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: block; margin-bottom: 11px; }
.field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
}
.input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  font-size: 16px;
  color: var(--ink);
}
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(169, 217, 242, 0.35); }
select.input { appearance: none; -webkit-appearance: none; background-image: none; }

.btn {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.btn:active { transform: scale(0.99); }
.btn.primary {
  background: linear-gradient(90deg, #A9D9F2 0%, #F7C6D9 100%);
  color: var(--ink);
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(150, 140, 180, 0.2);
}
.btn.wide { width: 100%; }
.btn.ghost { background: rgba(255, 255, 255, 0.7); border: 1px dashed var(--line-strong); color: var(--muted); }
.btn.danger { background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(168, 68, 62, 0.3); color: var(--danger); }
.btn-row { display: flex; gap: 8px; margin-top: 4px; }
.btn-row .btn { flex: 1 1 0; }

/* ----------------------------------------------------------------------- me */
.me-card { display: flex; align-items: center; gap: 14px; }
.me-card .avatar { flex: 0 0 auto; }
.me-card h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.me-card p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted-2); }

.footnote {
  margin: 22px 4px 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted-2);
  text-align: center;
}

/* ------------------------------------------------------------------ tabbar */
.tabbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 7px 9px calc(7px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  backdrop-filter: blur(20px) saturate(130%);
  border-top: 1px solid var(--line);
}
.tab {
  min-height: 54px;
  padding: 6px 0 4px;
  border: none;
  border-radius: 14px;
  background: none;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.02em;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: color 0.16s ease, background 0.2s ease;
}
.tab svg { width: 21px; height: 21px; display: block; }
.tab.on {
  color: var(--ink);
  font-weight: 600;
  background: linear-gradient(135deg, rgba(169, 217, 242, 0.62), rgba(247, 198, 217, 0.62));
}

/* ------------------------------------------------------------------- toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: min(90vw, 380px);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lift);
  color: var(--ink);
  font-size: 13px;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------ kinky corner */
.kk-card {
  position: relative;
  overflow: hidden;
  margin: 0 0 14px;
  padding: 38px 18px 16px;
  border-radius: var(--r-lg);
  border: 1.5px solid transparent;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.9)) padding-box,
    linear-gradient(135deg, #A9D9F2 0%, #D9CCF2 48%, #F7C6D9 100%) border-box;
  box-shadow: 0 14px 34px rgba(120, 130, 170, 0.14);
}
.kk-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(247, 198, 217, 0.26), rgba(255, 255, 255, 0) 62%),
    radial-gradient(120% 80% at 0% 0%, rgba(169, 217, 242, 0.24), rgba(255, 255, 255, 0) 62%);
}
.kk-ribbon {
  position: absolute;
  top: 0;
  left: 0;
  width: auto;
  transform: none;
  text-align: left;
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
  background: linear-gradient(90deg, #A9D9F2, #F7C6D9);
  padding: 5px 14px 5px 18px;
  border-radius: 0 0 14px 0;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(80, 90, 120, 0.12);
}
.kk-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  min-height: 28px;
}
.kk-chip {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(169, 217, 242, 0.45);
  border: 1px solid rgba(43, 42, 51, 0.05);
}
.kk-chip.kk-idea { background: rgba(247, 198, 217, 0.5); }
.kk-chip.kk-question { background: rgba(217, 204, 242, 0.5); }
.kk-chip.kk-joke { background: rgba(255, 229, 196, 0.6); }
.kk-chip.kk-checkin { background: rgba(196, 235, 214, 0.6); }
.kk-chip.kk-aftercare { background: rgba(247, 198, 217, 0.34); }
.kk-date {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.kk-text {
  position: relative;
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.012em;
  color: var(--ink);
  font-weight: 500;
}
.kk-foot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.kk-more {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.kk-more:active { background: linear-gradient(90deg, #A9D9F2, #F7C6D9); }
.kk-more:disabled { opacity: 0.55; }
.kk-cycle { font-size: 13px; color: var(--muted); }
.kk-note { font-size: 10.5px; color: var(--muted-2); letter-spacing: 0.01em; }
.kk-x {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin: -8px -10px -8px 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.kk-dock-host {
  position: fixed;
  right: 28px;
  bottom: calc(26px + env(safe-area-inset-bottom));
  width: 320px;
  max-width: calc(100vw - 32px);
  z-index: 40;
}
.kk-dock-host[hidden] { display: none; }
.kk-dock-host .kk-card { margin: 0; box-shadow: 0 18px 44px rgba(90, 100, 140, 0.18); }

@media (max-width: 1439px) {
  .kk-dock-host { display: none; }
}

/* --------------------------------------------------------------- wide view */
@media (min-width: 720px) {
  .shell {
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.35);
  }
  .view { padding-left: 22px; padding-right: 22px; }
  .login { max-width: 520px; margin: 0 auto; left: 0; right: 0; }
}

/* --------------------------------------------------------------- avatars */
.ava {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: inset 0 0 0 1px rgba(43, 42, 51, 0.06);
}
.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava-top { box-shadow: 0 0 0 2px #fff, 0 4px 12px rgba(80, 90, 120, 0.16); }
.ava-duel { margin: 0 auto 8px; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 8px 20px rgba(80, 90, 120, 0.14); }
.ava-me { border-radius: 22px; box-shadow: 0 0 0 3px #fff, 0 10px 24px rgba(80, 90, 120, 0.14); }
.top-right { display: flex; align-items: center; gap: 8px; }

/* ------------------------------------------------------------------ mood */
.mood-card { position: relative; overflow: hidden; padding-left: 20px; }
.mood-card::before {
  content: "";
  position: absolute;
  left: 0; top: 16px; bottom: 16px;
  width: 4px;
  border-radius: 0 99px 99px 0;
  background: linear-gradient(180deg, var(--blue-soft), var(--pink-soft));
}
.mood-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mood-kicker {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted-2);
}
.mood-day { font-size: 11.5px; color: var(--muted-2); }
.mood-title { margin: 4px 0 10px; font-size: 17px; letter-spacing: -0.02em; color: var(--ink); }
.mood-row { padding: 10px 0; border-top: 1px solid var(--line); }
.mood-row:first-of-type { border-top: none; padding-top: 2px; }
.mood-who { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-width: 0; }
.mood-name { font-size: 12.5px; font-weight: 700; color: var(--c); }
.mood-word { font-size: 11.5px; color: var(--muted-2); margin-left: auto; }
.mood-opts { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.mood-btn {
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  font-size: 21px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.mood-btn:active { transform: scale(0.94); }
.mood-btn.on {
  background: linear-gradient(180deg, rgba(169, 217, 242, 0.55), rgba(247, 198, 217, 0.55));
  border-color: rgba(210, 112, 143, 0.42);
  box-shadow: 0 6px 16px rgba(210, 112, 143, 0.18);
}

/* ------------------------------------------------------------ mood strip */
.mood-strip-head,
.mood-strip-row {
  display: grid;
  grid-template-columns: 96px 1fr 46px;
  gap: 8px;
  align-items: center;
}
.mood-strip-head { margin-bottom: 4px; }
.mood-avg-h {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  text-align: right;
}
.mood-strip-row { padding: 7px 0; border-top: 1px solid var(--line); }
.mood-strip-row:first-of-type { border-top: none; }
.mood-strip-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--c);
}
.mood-strip-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mood-strip-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mood-strip-head .mood-strip-days { text-align: center; }
.mood-strip-head .mood-strip-days span {
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--muted-2);
}
.mood-cell {
  display: grid;
  place-items: center;
  height: 28px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 15px;
  line-height: 1;
}
.mood-cell i { font-style: normal; color: rgba(43, 42, 51, 0.22); font-size: 14px; }
.mood-cell.today { box-shadow: inset 0 0 0 1.5px rgba(210, 112, 143, 0.45); background: #fff; }
.mood-strip-avg { text-align: right; font-size: 16px; line-height: 1.1; }
.mood-strip-avg em {
  display: block;
  font-style: normal;
  font-size: 9.5px;
  color: var(--muted-2);
}

/* ------------------------------------------------------------------ goals */
.goal-desc {
  margin: 4px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted-2);
}
.goal-total {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.goal-total b { color: var(--ink); font-weight: 700; }
.grow-desc {
  margin: 5px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted-2);
  max-width: 46ch;
}
.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--pink-ink);
  background: rgba(247, 198, 217, 0.45);
  vertical-align: middle;
}
.future-card { background: linear-gradient(180deg, rgba(247, 198, 217, 0.16), rgba(255, 255, 255, 0.9)); }
.future-note { margin: 0 0 10px; font-size: 11.5px; color: var(--muted-2); }
.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 13px;
  color: var(--ink);
}
.checkline input { width: 18px; height: 18px; accent-color: var(--pink); }

@media (max-width: 560px) {
  .goal-row { flex-wrap: wrap; align-items: flex-start; }
  .goal-row .grow-actions { width: 100%; margin-top: 10px; }
  .goal-row .grow-actions .mini { flex: 1 1 0; }
}

/* ------------------------------------------------------------------- me */
.me-info { min-width: 0; }
.ava-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.mini.upload { display: inline-flex; align-items: center; justify-content: center; }

@media (max-width: 420px) {
  .mood-strip-head, .mood-strip-row { grid-template-columns: 88px 1fr 34px; gap: 6px; }
  .mood-cell { height: 25px; font-size: 13px; border-radius: 8px; }
  .mood-strip-avg { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==================================================================== themes
   Adriana — blush: the pastel board, with hues that drift slowly.
   Nicolai — noir: deep charcoal, gradient-lit, same slow colour drift.
   ========================================================================= */
[data-theme="blush"] .aurora { animation: aurora-hue 150s ease-in-out infinite alternate; }

[data-theme="noir"] {
  color-scheme: dark;
  --bg: #0A0B10;
  --ink: #F3F4F9;
  --muted: #A9ADC0;
  --muted-2: #878C9F;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.20);
  --card: rgba(20, 22, 31, 0.80);
  --card-solid: #14161F;
  --veil: rgba(255, 255, 255, 0.04);
  --blue: #6FA8CC;
  --blue-ink: #9CC7E4;
  --blue-soft: #24425A;
  --pink: #B69BE2;
  --pink-ink: #CDB6F0;
  --pink-soft: #3A2C52;
  --lilac: #5A4A7A;
  --shadow: 0 16px 38px rgba(0, 0, 0, 0.50);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.40);
  --shadow-lift: 0 18px 44px rgba(0, 0, 0, 0.60);
}
[data-theme="noir"] .aurora { animation: aurora-hue 110s ease-in-out infinite alternate; }
[data-theme="noir"] .aurora i { opacity: 0.55; }
[data-theme="noir"] .aurora i:nth-child(3) { opacity: 0.42; }

[data-theme="noir"] .tabbar { background: rgba(10, 12, 18, 0.84); }
[data-theme="noir"] .chip,
[data-theme="noir"] .mini,
[data-theme="noir"] .btn:not(.primary):not(.danger),
[data-theme="noir"] .input,
[data-theme="noir"] .step,
[data-theme="noir"] .toggle,
[data-theme="noir"] .mood-btn,
[data-theme="noir"] .mood-cell,
[data-theme="noir"] .empty {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}
[data-theme="noir"] .val:focus { background: rgba(255, 255, 255, 0.08); }
[data-theme="noir"] .track,
[data-theme="noir"] .duel-bar { background: rgba(255, 255, 255, 0.10); }
[data-theme="noir"] .player {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
[data-theme="noir"] .kk-card {
  background:
    linear-gradient(180deg, rgba(25, 27, 38, 0.97), rgba(17, 19, 27, 0.94)) padding-box,
    linear-gradient(135deg, #2E4E68 0%, #3B2F58 50%, #5A3550 100%) border-box;
}
[data-theme="noir"] .kk-card::before {
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(182, 155, 226, 0.18), rgba(255, 255, 255, 0) 62%),
    radial-gradient(120% 80% at 0% 0%, rgba(111, 168, 204, 0.16), rgba(255, 255, 255, 0) 62%);
}
[data-theme="noir"] .future-card {
  background: linear-gradient(180deg, rgba(182, 155, 226, 0.10), rgba(20, 22, 31, 0.86));
}
[data-theme="noir"] .mood-btn.on {
  background: linear-gradient(180deg, rgba(111, 168, 204, 0.30), rgba(182, 155, 226, 0.30));
  border-color: rgba(182, 155, 226, 0.55);
}
[data-theme="noir"] .mood-cell.today {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1.5px rgba(182, 155, 226, 0.55);
}
[data-theme="noir"] .mood-cell i { color: rgba(255, 255, 255, 0.25); }
[data-theme="noir"] .ava { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
[data-theme="noir"] .ava-top { box-shadow: 0 0 0 2px #14161F, 0 4px 12px rgba(0, 0, 0, 0.45); }
[data-theme="noir"] .ava-duel { box-shadow: 0 0 0 3px rgba(20, 22, 31, 0.9), 0 8px 20px rgba(0, 0, 0, 0.45); }
[data-theme="noir"] .goal-emoji { background: rgba(255, 255, 255, 0.06); }
[data-theme="noir"] .btn.primary { color: #0B0C12; }
[data-theme="noir"] .badge { background: rgba(182, 155, 226, 0.20); color: var(--pink-ink); }

@keyframes aurora-hue {
  0%   { filter: hue-rotate(0deg) saturate(1); }
  50%  { filter: hue-rotate(20deg) saturate(1.18); }
  100% { filter: hue-rotate(-16deg) saturate(1.06); }
}

/* --------------------------------------------------------------- wardrobe */
.outfit-card { background: linear-gradient(180deg, rgba(247, 198, 217, 0.18), rgba(255, 255, 255, 0.94)); }
.outfit-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.outfit-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.outfit-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-bottom: 12px; }
.outfit-item {
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  text-align: center; font-size: 11px; color: var(--muted);
}
.outfit-item .w-img { width: 100%; }
.w-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.w-item {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, 0.55);
}
.w-item .mini { margin: 8px 10px 10px; }
.w-img {
  display: grid; place-items: center; aspect-ratio: 3 / 4; overflow: hidden;
  background: linear-gradient(160deg, rgba(169, 217, 242, 0.35), rgba(247, 198, 217, 0.35));
}
.w-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.w-img i { font-style: normal; font-size: 26px; opacity: 0.75; }
.w-meta { padding: 9px 10px 2px; }
.w-meta h3 { margin: 0; font-size: 13px; letter-spacing: -0.01em; }
.w-meta p { margin: 3px 0 0; font-size: 10.5px; color: var(--muted-2); }
.w-desc { line-height: 1.4; }
.input.file { padding: 9px 12px; height: auto; min-height: 46px; color: var(--muted); }
[data-theme="noir"] .w-item { background: rgba(255, 255, 255, 0.04); }
[data-theme="noir"] .outfit-card {
  background: linear-gradient(180deg, rgba(182, 155, 226, 0.12), rgba(20, 22, 31, 0.9));
}
[data-theme="noir"] .kk-more,
[data-theme="noir"] .kk-x { background: rgba(255, 255, 255, 0.08); color: var(--ink); }
[data-theme="noir"] .kk-ribbon {
  background: linear-gradient(90deg, rgba(111, 168, 204, 0.40), rgba(182, 155, 226, 0.40));
  color: var(--ink);
}
