:root {
  color-scheme: light;
  --bg: #fbf5f1;
  --surface: #fffdfb;
  --surface-muted: #f5ebe5;
  --ink: #4b302d;
  --muted: #806762;
  --faint: #a68e88;
  --line: #eadbd4;
  --me: #d96f73;
  --me-deep: #b65359;
  --me-soft: #fae8e7;
  --partner: #73988d;
  --partner-deep: #53756b;
  --partner-soft: #e7f0ec;
  --gold: #d39a45;
  --gold-soft: #fff2d9;
  --danger: #bb4f4f;
  --danger-soft: #fdecec;
  --shadow: 0 18px 50px rgba(83, 49, 43, 0.13);
  --shadow-soft: 0 8px 24px rgba(83, 49, 43, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family:
    Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
label,
input {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(217, 111, 115, 0.24);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.icon-lg {
  width: 24px;
  height: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #ffffff;
  background: var(--me);
  border-radius: 8px;
  box-shadow: 0 7px 18px rgba(217, 111, 115, 0.25);
}

.brand-name {
  font-size: 17px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-weight: 750;
  cursor: pointer;
  transition:
    transform 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.button-primary {
  color: #ffffff;
  background: var(--ink);
  box-shadow: 0 9px 20px rgba(75, 48, 45, 0.18);
}

.button-primary:hover {
  background: #60413d;
}

.button-me {
  color: #ffffff;
  background: var(--me);
  box-shadow: 0 9px 20px rgba(217, 111, 115, 0.22);
}

.button-me:hover {
  background: var(--me-deep);
}

.button-danger {
  color: #ffffff;
  background: var(--danger);
  box-shadow: 0 9px 20px rgba(187, 79, 79, 0.2);
}

.button-danger:hover {
  background: #9e3e3e;
}

.button-outline {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
}

.button-outline:hover {
  border-color: #d9c3ba;
  background: #fffaf7;
}

.button-ghost {
  min-height: 36px;
  padding: 0 10px;
  color: rgba(255, 255, 255, 0.82);
}

.button-ghost:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  transition:
    color 150ms ease,
    border-color 150ms ease,
    background-color 150ms ease,
    transform 150ms ease;
}

.icon-button:hover {
  color: var(--ink);
  border-color: #d8c3ba;
  background: #fffaf7;
  transform: translateY(-1px);
}

.icon-button.danger:hover {
  color: var(--danger);
  border-color: #efc9c9;
  background: #fff5f5;
}

.text-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fffaf7;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

.text-input::placeholder {
  color: #b09b95;
}

.text-input:hover {
  border-color: #d8c4bb;
}

.text-input:focus {
  border-color: var(--partner);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(115, 152, 141, 0.12);
  outline: none;
}

.auth-shell {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 42px 32px;
  background: #4b302d;
}

.auth-shell::before,
.auth-shell::after {
  position: absolute;
  inset: 0;
  content: "";
}

.auth-shell::before {
  background-image: url("/assets/love-background.jpg");
  background-position: center;
  background-size: cover;
  transform: scale(1.02);
}

.auth-shell::after {
  background: rgba(62, 38, 35, 0.34);
}

.auth-layout {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(100%, 1120px);
  grid-template-columns: minmax(0, 1fr) minmax(360px, 470px);
  align-items: center;
  gap: 72px;
}

.auth-intro {
  color: #ffffff;
  text-shadow: 0 2px 18px rgba(51, 29, 27, 0.32);
}

.auth-intro .brand {
  margin-bottom: 28px;
}

.auth-brand {
  color: #ffffff;
}

.auth-title {
  max-width: 580px;
  margin: 0;
  font-size: clamp(35px, 4vw, 54px);
  line-height: 1.08;
}

.auth-title-accent {
  color: #ffd7cc;
}

.auth-note {
  max-width: 460px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 16px;
  line-height: 1.8;
}

.love-days-preview {
  max-width: 440px;
  margin-top: 28px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(83, 48, 44, 0.31);
  box-shadow: 0 16px 42px rgba(47, 25, 23, 0.2);
  color: #ffffff;
  backdrop-filter: blur(12px);
}

.love-preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 800;
}

.love-preview-number {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 8px;
}

.love-preview-number > span {
  font-size: 14px;
  font-weight: 800;
}

.love-preview-number strong {
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
}

.love-days-preview p {
  margin: 9px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
}

.love-days-preview small {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 11px;
}

.love-preview-couple {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.love-preview-heart {
  color: #ffd2c8;
}

.auth-preview {
  display: grid;
  max-width: 500px;
  margin-top: 20px;
  grid-template-columns: 1fr 42px 1fr;
  align-items: center;
}

.preview-person {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  backdrop-filter: blur(10px);
}

.preview-person.me {
  border-top: 3px solid var(--me);
}

.preview-person.partner {
  border-top: 3px solid var(--partner);
}

.preview-person-name {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
}

.preview-score {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 850;
}

.preview-score span {
  margin-left: 3px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  font-weight: 650;
}

.versus {
  display: grid;
  place-items: center;
}

.versus-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(75, 48, 45, 0.28);
  font-size: 11px;
  font-weight: 850;
}

.auth-card {
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  background: rgba(255, 253, 251, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.auth-card-head {
  margin-bottom: 22px;
}

.auth-card h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}

.auth-card-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.segmented {
  display: grid;
  margin-bottom: 22px;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: var(--surface-muted);
}

.segment {
  height: 36px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.segment.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 3px 10px rgba(83, 49, 43, 0.1);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  font-size: 13px;
  font-weight: 750;
}

.field-hint {
  margin: -1px 0 0;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.5;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-error {
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}

.dashboard-shell {
  width: min(100% - 32px, 1240px);
  margin: 0 auto;
  padding: 24px 0 54px;
}

.love-banner {
  position: relative;
  width: min(100%, 960px);
  aspect-ratio: 4 / 3;
  margin: 0 auto 18px;
  overflow: hidden;
  border: 1px solid rgba(105, 67, 58, 0.2);
  border-radius: 8px;
  background-color: #61463e;
  background-image: url("/assets/love-background.jpg");
  background-position: center 62%;
  background-size: cover;
  box-shadow: var(--shadow);
}

.love-banner.custom-background {
  background-position: center;
}

.love-banner.editing {
  width: min(100%, 1120px);
  aspect-ratio: auto;
}

.love-banner::before {
  position: absolute;
  inset: 0;
  background: rgba(55, 32, 30, 0.39);
  content: "";
}

.love-banner-content {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100%;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 30px;
  color: #ffffff;
  text-shadow: 0 2px 16px rgba(43, 24, 22, 0.32);
}

.love-banner.editing .love-banner-content {
  min-height: 360px;
}

.love-avatars {
  display: flex;
  align-items: center;
  gap: 16px;
}

.love-avatars .cute-avatar {
  transform: scale(1.18);
}

.love-couple-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  color: #ffd5ca;
  background: rgba(77, 44, 40, 0.35);
}

.love-banner-copy {
  min-width: 0;
}

.love-banner-copy h2 {
  margin: 0;
  font-size: clamp(27px, 3.1vw, 43px);
  line-height: 1.18;
}

.love-banner-copy h2 strong {
  color: #ffe1c4;
  font-size: 1.34em;
  font-weight: 950;
}

.love-banner-copy p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  font-weight: 750;
}

.love-banner-copy small {
  display: block;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.love-date-button {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  color: #ffffff;
  background: rgba(77, 44, 40, 0.35);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.love-date-button:hover {
  background: rgba(77, 44, 40, 0.55);
}

.settings-form {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 14px;
  padding: 18px 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  background: rgba(60, 34, 31, 0.72);
  backdrop-filter: blur(12px);
}

.settings-fields {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(210px, 1fr) minmax(210px, 1fr);
  gap: 12px;
}

.settings-fields > label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
}

.settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-actions > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.settings-week {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.file-field {
  position: relative;
  grid-template-columns: 1fr auto;
}

.file-field > span {
  grid-column: 1 / -1;
}

.file-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-field em {
  display: block;
  overflow: hidden;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 40px;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.settings-form .text-input {
  height: 42px;
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.settings-form .text-input:focus {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

.crop-panel:empty {
  display: none;
}

.crop-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: center;
  gap: 16px;
}

.crop-stage {
  position: relative;
  overflow: hidden;
  width: min(100%, 620px);
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background: #3f2b28;
  cursor: grab;
  touch-action: none;
}

.crop-stage.dragging {
  cursor: grabbing;
}

.crop-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.crop-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 8px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(57, 34, 31, 0.62);
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

.crop-zoom {
  display: grid;
  gap: 8px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  font-weight: 800;
}

.crop-zoom input {
  width: 100%;
  accent-color: var(--me);
}

.app-header {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-pill,
.status-pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.live::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--partner);
  content: "";
  box-shadow: 0 0 0 4px rgba(115, 152, 141, 0.12);
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.player-header-copy h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.player-header-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.panel-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.panel-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.plan-refresh {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.scoreboard {
  display: grid;
  margin-bottom: 18px;
  grid-template-columns: minmax(0, 1fr) 66px minmax(0, 1fr);
  align-items: stretch;
}

.player-score {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(116, 76, 67, 0.18);
  border-radius: 8px;
  background-color: #fff8ef;
  background-image: url("/assets/score-background.jpg");
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow-soft);
}

.player-score::before {
  position: absolute;
  inset: 0;
  background: rgba(255, 252, 247, 0.56);
  content: "";
}

.player-score > * {
  position: relative;
  z-index: 1;
}

.player-score.me {
  border-top: 4px solid var(--me);
}

.player-score.partner {
  border-top: 4px solid var(--partner);
}

.score-person {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.cute-avatar {
  display: inline-grid;
  width: 50px;
  height: 50px;
  min-width: 50px;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background: #fff8f2;
  box-shadow: 0 7px 18px rgba(76, 48, 45, 0.13);
}

.cute-avatar svg,
.cute-avatar img {
  display: block;
  width: 100%;
  height: 100%;
}

.cute-avatar img {
  object-fit: cover;
}

.love-avatars .cute-avatar {
  width: 62px;
  height: 62px;
  min-width: 62px;
  border-color: rgba(255, 255, 255, 0.72);
}

.love-preview-couple .cute-avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
}

.score-person-copy {
  min-width: 0;
}

.score-label {
  color: #765e58;
  font-size: 12px;
  font-weight: 750;
}

.score-name {
  overflow: hidden;
  margin-top: 2px;
  font-size: 15px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-main {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 18px;
}

.score-number {
  color: var(--me-deep);
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
}

.player-score.partner .score-number {
  color: var(--partner-deep);
}

.score-number.negative {
  color: var(--danger);
}

.score-unit {
  color: #8f7670;
  font-size: 13px;
  font-weight: 700;
}

.score-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 14px;
  color: #765e58;
  font-size: 13px;
}

.score-summary strong {
  color: var(--ink);
}

.battle-message {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 13px 16px;
  border: 1px solid #f1ddb0;
  border-radius: 8px;
  background: var(--gold-soft);
}

.battle-message.neutral {
  border-color: var(--line);
  background: var(--surface);
}

.battle-copy {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.battle-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #8e6411;
  background: rgba(211, 154, 69, 0.2);
}

.battle-message.neutral .battle-icon {
  color: var(--muted);
  background: var(--surface-muted);
}

.battle-title {
  font-size: 14px;
  font-weight: 800;
}

.battle-detail {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.rounds-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.habit-panel,
.wish-section {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.habit-panel.me {
  border-top: 4px solid var(--me);
}

.habit-panel.partner {
  border-top: 4px solid var(--partner);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 15px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.panel-title-copy {
  min-width: 0;
}

.panel-title h2 {
  overflow: hidden;
  margin: 0;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-title p {
  margin: 3px 0 0;
  color: var(--faint);
  font-size: 12px;
}

.panel-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--me);
}

.habit-panel.partner .panel-dot {
  background: var(--partner);
}

.habit-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.habit-item {
  display: grid;
  min-height: 68px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid #f0e5df;
  transition: background-color 160ms ease;
}

.habit-item:last-child {
  border-bottom: 0;
}

.habit-item:hover {
  background: #fffaf7;
}

.habit-item.penalty {
  background: #fff9f8;
}

.habit-check {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1.5px solid #cbd6dd;
  border-radius: 8px;
  color: transparent;
  background: #ffffff;
  cursor: pointer;
  transition:
    color 150ms ease,
    border-color 150ms ease,
    background-color 150ms ease,
    transform 150ms ease;
}

.habit-check:hover {
  border-color: var(--me);
  color: rgba(217, 111, 115, 0.42);
  transform: scale(1.04);
}

.habit-check.checked {
  border-color: var(--me);
  color: #ffffff;
  background: var(--me);
}

.habit-item.penalty .habit-check:hover {
  border-color: var(--danger);
  color: rgba(187, 79, 79, 0.45);
}

.habit-item.penalty .habit-check.checked {
  border-color: var(--danger);
  background: var(--danger);
}

.habit-panel.partner .habit-check {
  cursor: default;
}

.habit-panel.partner .habit-check:hover {
  border-color: #cbd6dd;
  color: transparent;
  transform: none;
}

.habit-panel.partner .habit-item.penalty .habit-check {
  cursor: pointer;
}

.habit-panel.partner .habit-item.penalty .habit-check:hover {
  border-color: var(--danger);
  color: rgba(187, 79, 79, 0.45);
  transform: scale(1.04);
}

.habit-panel.partner .habit-check.checked,
.habit-panel.partner .habit-check.checked:hover {
  border-color: var(--partner);
  color: #ffffff;
  background: var(--partner);
}

.habit-panel.partner .habit-item.penalty .habit-check.checked,
.habit-panel.partner .habit-item.penalty .habit-check.checked:hover {
  border-color: var(--danger);
  background: var(--danger);
}

.habit-copy {
  min-width: 0;
}

.habit-title {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.habit-item.completed .habit-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.habit-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  color: var(--faint);
  font-size: 11px;
}

.point-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--me-deep);
  background: var(--me-soft);
  font-weight: 800;
}

.habit-panel.partner .point-badge {
  color: var(--partner-deep);
  background: var(--partner-soft);
}

.habit-item.penalty .point-badge,
.habit-panel.partner .habit-item.penalty .point-badge {
  color: var(--danger);
  background: var(--danger-soft);
}

.habit-actions {
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 150ms ease;
}

.habit-item:hover .habit-actions,
.habit-actions:focus-within {
  opacity: 1;
}

.habit-panel.partner .habit-item.shared-penalty .habit-actions {
  opacity: 1;
}

.habit-delete {
  width: 32px;
  height: 32px;
}

.empty-panel {
  padding: 30px 20px 26px;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 8px;
  color: var(--me);
  background: var(--me-soft);
}

.habit-panel.partner .empty-icon {
  color: var(--partner);
  background: var(--partner-soft);
}

.empty-panel h3 {
  margin: 0;
  font-size: 16px;
}

.empty-panel p {
  max-width: 340px;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.preset-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 17px;
}

.preset-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.preset-button:hover {
  border-color: #e9b8b1;
  color: var(--me-deep);
  background: var(--me-soft);
}

.preset-button.penalty:hover {
  border-color: #efc9c9;
  color: var(--danger);
  background: var(--danger-soft);
}

.add-habit-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px auto;
  gap: 9px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
  background: #fffaf7;
}

.partner-penalty-form {
  background: #fff8f8;
}

.habit-kind-toggle {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: var(--surface-muted);
}

.habit-kind-toggle button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.habit-kind-toggle button.active {
  color: var(--me-deep);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(83, 49, 43, 0.08);
}

.habit-kind-toggle button.active.penalty {
  color: var(--danger);
}

.points-input {
  display: grid;
  grid-template-columns: auto 42px;
  align-items: center;
  gap: 7px;
  height: 46px;
  padding: 0 9px 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
  font-weight: 750;
}

.points-input input {
  width: 42px;
  height: 30px;
  padding: 0 4px;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface-muted);
  font-weight: 850;
  text-align: center;
}

.invite-box {
  max-width: 320px;
  margin: 22px auto 0;
  padding: 13px;
  border: 1px dashed #d7beb4;
  border-radius: 8px;
  background: #fffaf7;
}

.invite-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.invite-code {
  margin: 5px 0 11px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.wish-section {
  margin-top: 18px;
}

.wish-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
}

.wish-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wish-heading h2 {
  margin: 0;
  font-size: 16px;
}

.wish-heading p {
  margin: 3px 0 0;
  color: var(--faint);
  font-size: 12px;
}

.wish-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--gold-soft);
}

.wish-composer.locked {
  background: #f8f1ed;
}

.wish-composer.locked .text-input {
  color: var(--faint);
  cursor: not-allowed;
}

.wish-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.wish-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid #f0e5df;
}

.wish-item:last-child {
  border-bottom: 0;
}

.wish-item.editing {
  background: #fffaf7;
}

.wish-copy {
  min-width: 0;
}

.wish-text {
  margin: 0;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.wish-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  color: var(--faint);
  font-size: 11px;
}

.wish-status {
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: #88600e;
  background: var(--gold-soft);
  font-weight: 800;
}

.wish-status.done {
  color: var(--partner-deep);
  background: var(--partner-soft);
}

.wish-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wish-actions .button-ghost {
  color: var(--muted);
}

.wish-actions .button-ghost:hover {
  color: var(--ink);
  background: var(--surface-muted);
}

.wish-edit-form {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.wish-empty {
  padding: 22px 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: #f0e4de;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  content: "";
  transform: translateX(-100%);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

.loading-shell {
  width: min(100% - 32px, 1240px);
  margin: 0 auto;
  padding: 30px 0;
}

.loading-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.loading-card {
  height: 220px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 15px;
  border: 1px solid rgba(75, 48, 45, 0.08);
  border-radius: 8px;
  color: #ffffff;
  background: #543a36;
  box-shadow: 0 14px 35px rgba(75, 48, 45, 0.22);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.shake {
  animation: shake 320ms ease;
}

@keyframes shake {
  25% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-2px);
  }
}

@media (max-width: 980px) {
  .auth-shell {
    padding: 28px 20px 42px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .auth-intro {
    text-align: center;
  }

  .auth-intro .brand,
  .auth-title,
  .auth-note,
  .love-days-preview,
  .auth-preview {
    margin-right: auto;
    margin-left: auto;
  }

  .auth-intro .brand {
    justify-content: center;
  }

  .auth-card {
    width: min(100%, 480px);
    margin: 0 auto;
  }

  .settings-fields {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .rounds-grid,
  .loading-row {
    grid-template-columns: 1fr;
  }

  .love-banner-content {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 18px;
    padding: 24px;
  }
}

@media (max-width: 650px) {
  .dashboard-shell,
  .loading-shell {
    width: min(100% - 20px, 1240px);
  }

  .auth-shell {
    padding: 20px 12px 34px;
  }

  .dashboard-shell {
    padding-top: 14px;
  }

  .app-header {
    align-items: flex-start;
    margin-bottom: 18px;
  }

  .brand-name {
    display: none;
  }

  .header-meta {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .date-pill {
    display: none;
  }

  .player-header {
    align-items: flex-end;
  }

  .player-header-copy h1 {
    font-size: 20px;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-tools {
    width: 100%;
    justify-content: space-between;
  }

  .plan-refresh {
    min-height: 34px;
  }

  .love-banner {
    width: 100%;
    aspect-ratio: 16 / 10;
    min-height: 0;
    background-position: center 66%;
  }

  .love-banner-content {
    min-height: 100%;
    grid-template-columns: 1fr;
    justify-items: center;
    align-content: center;
    gap: 10px;
    padding: 20px 18px;
    text-align: center;
  }

  .love-banner.editing .love-banner-content {
    min-height: 470px;
  }

  .crop-editor {
    grid-template-columns: 1fr;
  }

  .love-avatars {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .love-banner-copy h2 {
    font-size: 25px;
  }

  .love-banner-copy p {
    margin-top: 4px;
    font-size: 13px;
  }

  .love-banner-copy small {
    margin-top: 7px;
    font-size: 10px;
  }

  .love-date-button {
    position: absolute;
    top: 14px;
    right: 14px;
  }

  .settings-fields {
    grid-template-columns: 1fr;
  }

  .settings-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-actions > div {
    justify-content: stretch;
  }

  .settings-actions .button {
    flex: 1;
  }

  .scoreboard {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .versus {
    display: none;
  }

  .player-score {
    min-height: 176px;
    padding: 16px;
  }

  .score-number {
    font-size: 31px;
  }

  .score-main {
    margin-top: 15px;
  }

  .score-summary {
    display: grid;
    gap: 4px;
    font-size: 12px;
  }

  .battle-message,
  .player-header {
    align-items: stretch;
    flex-direction: column;
  }

  .battle-message {
    gap: 12px;
  }

  .battle-message .button {
    width: 100%;
  }

  .wish-composer,
  .add-habit-form {
    grid-template-columns: 1fr;
  }

  .wish-composer .button,
  .add-habit-form .button {
    width: 100%;
  }

  .wish-edit-form {
    grid-template-columns: 1fr;
  }

  .wish-edit-form .wish-actions {
    justify-content: flex-end;
  }

  .habit-kind-toggle {
    grid-column: auto;
  }

  .points-input {
    width: 100%;
  }

  .habit-item {
    padding-right: 12px;
    padding-left: 12px;
  }

  .habit-actions {
    opacity: 1;
  }
}

@media (max-width: 430px) {
  .auth-title {
    font-size: 31px;
  }

  .auth-note {
    font-size: 14px;
  }

  .auth-preview {
    grid-template-columns: 1fr 22px 1fr;
  }

  .auth-card {
    padding: 20px;
  }

  .love-preview-number {
    display: block;
  }

  .love-preview-number strong {
    display: block;
    margin: 2px 0;
    font-size: 44px;
  }

  .love-banner-content {
    padding: 20px 16px;
  }

  .love-banner-copy h2 {
    font-size: 26px;
  }

  .love-avatars {
    gap: 10px;
  }

  .love-avatars .cute-avatar {
    width: 54px;
    height: 54px;
    min-width: 54px;
  }

  .cute-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .wish-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .wish-item .button {
    width: 100%;
  }
}

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