:root {
  --ink: #111218;
  --muted: #62636d;
  --white: #ffffff;
  --paper: #f7f7f5;
  --line: #111218;
  --primary: #ff3d96;
  --secondary: #7650ff;
  --tertiary: #1bd184;
  --page: #f4f1ff;
  --soft: #eee9ff;
  --primary-text: #ffffff;
  --theme-shadow: #7650ff;
  --danger: #d31946;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Black", sans-serif;
  letter-spacing: .015em;
}

.theme-josh {
  --primary: #2867f0;
  --secondary: #7545e8;
  --tertiary: #16c784;
  --page: #eaf4ff;
  --soft: #dbeafe;
  --primary-text: #ffffff;
  --theme-shadow: #7545e8;
}

.theme-phoebe {
  --primary: #ff3d9a;
  --secondary: #111218;
  --tertiary: #ffffff;
  --page: #fff0f7;
  --soft: #ffd9ea;
  --primary-text: #ffffff;
  --theme-shadow: #111218;
}

.theme-red {
  --primary: #c8102e;
  --secondary: #e31b3d;
  --tertiary: #ffffff;
  --page: #fff1f3;
  --soft: #ffdce2;
  --primary-text: #ffffff;
  --theme-shadow: #6f0719;
}

.eyebrow {
  margin-bottom: 11px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.eyebrow span {
  display: inline-block;
  margin-right: 7px;
  padding: 3px 7px;
  color: var(--primary-text);
  background: var(--primary);
  letter-spacing: .08em;
  transform: skew(-7deg);
}

/* Login: a shared three-colour anime title card. */

.login-page {
  position: relative;
  display: grid;
  place-items: center;
  padding: 30px;
  overflow: hidden;
  background-color: #111218;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.14) 0 1px, transparent 1.5px),
    linear-gradient(126deg, transparent 0 62%, rgba(255,61,150,.78) 62% 70%, transparent 70%),
    linear-gradient(126deg, transparent 0 72%, rgba(40,103,240,.82) 72% 79%, transparent 79%),
    linear-gradient(126deg, transparent 0 82%, rgba(22,199,132,.8) 82% 88%, transparent 88%);
  background-size: 13px 13px, auto, auto, auto;
}

.login-page::before {
  position: fixed;
  top: -210px;
  left: -170px;
  width: 480px;
  height: 480px;
  border: 42px solid rgba(255,255,255,.07);
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff, 0 0 0 58px rgba(255,255,255,.035);
  content: "";
}

.login-page::after {
  position: fixed;
  right: -75px;
  bottom: -95px;
  width: 310px;
  height: 310px;
  background: repeating-conic-gradient(from 6deg, rgba(255,255,255,.1) 0 5deg, transparent 5deg 15deg);
  border-radius: 50%;
  content: "";
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 455px);
  text-align: center;
}

.login-card {
  position: relative;
  padding: 54px 46px 38px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background-color: var(--white);
  background-image:
    linear-gradient(rgba(17,18,24,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,18,24,.045) 1px, transparent 1px);
  background-size: 19px 19px;
  box-shadow: 13px 13px 0 #ff3d96, 18px 18px 0 #2867f0;
  transform: rotate(-.35deg);
}

.login-card::after {
  position: absolute;
  right: -3px;
  bottom: 74px;
  width: 45px;
  height: 13px;
  background: #16c784;
  border: 2px solid var(--ink);
  border-right: 0;
  content: "";
}

.login-issue {
  position: absolute;
  top: 14px;
  right: 16px;
  color: #73747d;
  font-family: monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
}

.login-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 72px;
  margin-bottom: 22px;
  color: #ff3d96;
  font-size: 15px;
}

.login-mark-gift {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  color: white;
  background: var(--ink);
  box-shadow: 5px 5px 0 #ff3d96;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 38px;
  font-style: italic;
  transform: rotate(-5deg);
}

.login-card .eyebrow { margin-bottom: 12px; }
.login-card h1 { margin-bottom: 2px; font-size: clamp(43px, 10vw, 58px); font-style: italic; line-height: .95; text-transform: uppercase; }
.login-japanese { margin: 5px 0 18px; color: #ff3d96; font-size: 12px; font-weight: 900; letter-spacing: .5em; }
.login-sub { margin-bottom: 25px; color: var(--muted); font-size: 14px; font-weight: 650; line-height: 1.55; }

.login-error {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0 0 21px;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  color: #8b1231;
  background: #fff0f4;
  box-shadow: 4px 4px 0 #ff9dc5;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
}

.google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  width: 100%;
  padding: 13px 18px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  color: var(--white);
  background: var(--ink);
  box-shadow: 5px 5px 0 #7650ff;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform .15s ease, box-shadow .15s ease;
}

.google-button svg { padding: 2px; border-radius: 50%; background: #fff; }
.google-button:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 #7650ff; }
.login-private { margin: 22px 0 0; color: #73747d; font-family: monospace; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.login-private span { color: #ff3d96; }
.login-footnote { margin: 24px 0 0; color: white; font-size: 11px; font-weight: 900; letter-spacing: .28em; }
.login-footnote span { color: #ff3d96; }

/* Signed-in shell */

.app-page {
  position: relative;
  background-color: var(--page);
  background-image:
    radial-gradient(circle at 8% 11%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 25rem),
    radial-gradient(circle, color-mix(in srgb, var(--secondary) 15%, transparent) 0 1px, transparent 1.5px);
  background-size: auto, 14px 14px;
}

.app-page::before {
  position: fixed;
  z-index: -1;
  right: -150px;
  bottom: -170px;
  width: 480px;
  height: 480px;
  border: 68px solid color-mix(in srgb, var(--primary) 10%, transparent);
  border-radius: 50%;
  content: "";
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 10px max(24px, calc((100vw - 1160px) / 2));
  border-bottom: 3px solid var(--ink);
  background: rgba(255,255,255,.92);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--primary) 75%, transparent);
  backdrop-filter: blur(10px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  color: var(--primary-text);
  background: var(--primary);
  box-shadow: 3px 3px 0 var(--secondary);
  font-size: 15px;
  transform: rotate(-6deg);
}
.brand-copy { display: flex; flex-direction: column; }
.brand-copy strong { font-family: Impact, "Arial Black", sans-serif; font-size: 20px; font-style: italic; letter-spacing: .025em; line-height: 1; text-transform: uppercase; }
.brand-copy small { margin-top: 3px; color: var(--primary); font-size: 8px; font-weight: 900; letter-spacing: .25em; }

.account { display: flex; align-items: center; gap: 10px; }
.avatar, .mini-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: white;
  background: var(--primary);
  font-weight: 900;
}
.avatar { width: 38px; height: 38px; box-shadow: 3px 3px 0 var(--secondary); font-size: 12px; }
.mini-avatar { width: 24px; height: 24px; border-width: 1.5px; font-size: 10px; }
.avatar-josh, .wish-josh .mini-avatar { background: #2867f0; box-shadow-color: #7545e8; }
.avatar-phoebe, .wish-phoebe .mini-avatar { background: #ff3d9a; box-shadow-color: #111218; }
.avatar-red { background: #c8102e; box-shadow-color: #6f0719; }
.account-copy { display: flex; flex-direction: column; line-height: 1.15; }
.account-copy strong { font-size: 12px; font-weight: 900; text-transform: uppercase; }
.account-copy small { margin-top: 4px; color: var(--primary); font-family: monospace; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.signout { margin-left: 9px; padding: 6px 9px; border: 1.5px solid var(--ink); color: var(--ink); background: white; font-size: 9px; font-weight: 900; text-decoration: none; text-transform: uppercase; }
.signout:hover { color: white; background: var(--ink); }

.app-shell { width: min(calc(100% - 40px), 1160px); margin: 0 auto; padding: 65px 0 85px; }

.welcome {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 46px;
}

.welcome::after {
  position: absolute;
  z-index: -1;
  top: -42px;
  right: 5%;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 8deg, color-mix(in srgb, var(--tertiary) 28%, transparent) 0 5deg, transparent 5deg 15deg);
  content: "";
}

.welcome-copy-block { max-width: 760px; }
.welcome h1 {
  max-width: 750px;
  margin-bottom: 13px;
  font-size: clamp(45px, 6.3vw, 76px);
  font-style: italic;
  line-height: .9;
  text-transform: uppercase;
  text-shadow: 4px 4px 0 var(--white), 7px 7px 0 color-mix(in srgb, var(--primary) 60%, transparent);
}
.welcome-copy { margin: 0; color: var(--muted); font-size: 14px; font-weight: 650; }

.add-button, .save-button {
  border: 2px solid var(--ink);
  border-radius: 4px;
  color: var(--primary-text);
  background: var(--primary);
  box-shadow: 6px 6px 0 var(--secondary);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
  transition: transform .15s ease, box-shadow .15s ease;
}
.add-button { flex: 0 0 auto; padding: 13px 20px; transform: skew(-5deg); }
.add-button span { margin-right: 5px; font-size: 16px; }
.add-button:hover, .save-button:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--secondary); }

.readonly-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  color: white;
  background: var(--primary);
  box-shadow: 5px 5px 0 var(--secondary);
  font-family: monospace;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  transform: skew(-5deg);
}
.readonly-pill span { color: var(--tertiary); }

.list-panel {
  position: relative;
  min-height: 430px;
  padding: 32px;
  border: 3px solid var(--ink);
  border-radius: 7px;
  background-color: rgba(255,255,255,.94);
  background-image: linear-gradient(135deg, color-mix(in srgb, var(--primary) 5%, transparent) 25%, transparent 25% 50%, color-mix(in srgb, var(--primary) 5%, transparent) 50% 75%, transparent 75%);
  background-size: 28px 28px;
  box-shadow: 12px 12px 0 color-mix(in srgb, var(--secondary) 68%, transparent);
}

.panel-code {
  position: absolute;
  top: -13px;
  right: 23px;
  padding: 5px 10px;
  border: 2px solid var(--ink);
  color: white;
  background: var(--ink);
  font-family: monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .11em;
}

.filters { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 35px; }
.occasion-tabs, .owner-filter { display: flex; gap: 0; border: 2px solid var(--ink); background: white; box-shadow: 4px 4px 0 color-mix(in srgb, var(--primary) 32%, transparent); }
.occasion-tabs button, .owner-filter button {
  border: 0;
  border-right: 1.5px solid var(--ink);
  color: var(--ink);
  background: transparent;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
}
.occasion-tabs button:last-child, .owner-filter button:last-child { border-right: 0; }
.occasion-tabs button { padding: 10px 16px; }
.owner-filter button { padding: 8px 14px; }
.occasion-tabs button span { margin-right: 5px; color: var(--primary); }
.occasion-tabs button[aria-pressed="true"], .owner-filter button[aria-pressed="true"] { color: var(--primary-text); background: var(--primary); }
.occasion-tabs button[aria-pressed="true"] span { color: var(--tertiary); }
body[data-occasion="birthday"] .occasion-tabs button[aria-pressed="true"] { background: var(--secondary); }

.list-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding-bottom: 19px; border-bottom: 3px solid var(--ink); }
.list-kicker { margin-bottom: 6px; color: var(--primary); font-family: monospace; font-size: 9px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.list-heading h2 { margin: 0; font-size: clamp(29px, 4vw, 40px); font-style: italic; line-height: 1; text-transform: uppercase; }
.list-summary { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border: 1.5px solid var(--ink); color: var(--muted); background: white; font-family: monospace; font-size: 10px; }
.list-summary strong { color: var(--primary); font-size: 13px; }

.wish-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; margin: 23px 0 0; padding: 0; list-style: none; }
.wish-card {
  --owner: #2867f0;
  --owner-secondary: #16c784;
  position: relative;
  min-width: 0;
  padding: 20px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: white;
  box-shadow: 5px 5px 0 var(--owner-secondary);
  transition: transform .15s ease, box-shadow .15s ease;
}
.wish-card.wish-josh { --owner: #2867f0; --owner-secondary: #16c784; }
.wish-card.wish-phoebe { --owner: #ff3d9a; --owner-secondary: #111218; }
.wish-card::before { position: absolute; top: 0; left: 0; width: 7px; height: 100%; background: var(--owner); content: ""; }
.wish-card::after { position: absolute; top: 0; right: 0; width: 78px; height: 8px; background: repeating-linear-gradient(90deg, var(--owner) 0 10px, var(--owner-secondary) 10px 20px); content: ""; }
.wish-card:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--owner-secondary); }
.wish-topline { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.owner-chip { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.wish-cost { flex: 0 0 auto; color: var(--owner); font-family: Impact, "Arial Black", sans-serif; font-size: 18px; font-style: italic; letter-spacing: .04em; }
.wish-card h3 { margin: 18px 0 20px; font-size: 22px; line-height: 1.08; text-transform: uppercase; overflow-wrap: anywhere; }
.wish-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.wish-actions > a { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink); font-family: monospace; font-size: 10px; font-weight: 900; text-decoration: underline; text-decoration-color: var(--owner); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.wish-actions > a span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-actions { display: flex; flex: 0 0 auto; gap: 5px; }
.owner-actions button, .load-error button, .empty-add, .dialog-actions > button:first-child, .icon-button {
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  color: var(--ink);
  background: white;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
}
.owner-actions button { padding: 5px 8px; }
.owner-actions button:hover { color: white; background: var(--ink); }
.owner-actions .delete-button:hover { color: white; border-color: var(--danger); background: var(--danger); }

.empty-state { max-width: 390px; margin: 62px auto 48px; text-align: center; }
.empty-glyph { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 18px; border: 2px solid var(--ink); border-radius: 50%; color: white; background: var(--primary); box-shadow: 5px 5px 0 var(--secondary); font-size: 25px; }
.empty-state h3 { margin-bottom: 8px; font-size: 24px; font-style: italic; text-transform: uppercase; }
.empty-state p { margin-bottom: 19px; color: var(--muted); font-size: 12px; font-weight: 650; }
.empty-add { padding: 9px 13px; box-shadow: 3px 3px 0 var(--primary); }
.empty-add:hover { color: white; background: var(--ink); }

.load-error { display: flex; align-items: center; gap: 9px; margin-top: 20px; padding: 13px; border: 2px solid var(--ink); color: #8b1231; background: #fff0f4; box-shadow: 4px 4px 0 #ff9db6; font-size: 11px; }
.load-error button { margin-left: auto; padding: 6px 9px; }

/* Wish editor */

.item-dialog {
  width: min(calc(100% - 30px), 550px);
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: 6px;
  color: var(--ink);
  background: white;
  box-shadow: 12px 12px 0 var(--secondary);
}
.item-dialog::backdrop { background: rgba(17,18,24,.78); backdrop-filter: blur(3px); }
.item-dialog form { padding: 30px; background-image: radial-gradient(circle, color-mix(in srgb, var(--primary) 12%, transparent) 0 1px, transparent 1.5px); background-size: 13px 13px; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 25px; padding-bottom: 18px; border-bottom: 3px solid var(--ink); }
.dialog-head h2 { margin: 0; font-size: 31px; font-style: italic; text-transform: uppercase; }
.icon-button { width: 34px; height: 34px; padding: 0; font-size: 21px; }
.icon-button:hover { color: white; background: var(--ink); }
.form-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 17px; }
.form-field label { color: var(--ink); font-size: 10px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.form-field input, .form-field select {
  width: 100%;
  min-height: 45px;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  color: var(--ink);
  background: white;
  outline: none;
}
.form-field input:focus, .form-field select:focus { border-color: var(--primary); box-shadow: 4px 4px 0 color-mix(in srgb, var(--primary) 35%, transparent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.money-input { position: relative; }
.money-input span { position: absolute; top: 50%; left: 13px; color: var(--primary); font-size: 13px; font-weight: 900; transform: translateY(-50%); }
.money-input input { padding-left: 29px; }
.form-error { margin: -1px 0 16px; padding: 10px 12px; border: 2px solid var(--ink); color: #8b1231; background: #fff0f4; box-shadow: 3px 3px 0 #ff9db6; font-size: 11px; }
.dialog-actions { display: flex; justify-content: end; gap: 9px; margin-top: 8px; padding-top: 19px; border-top: 2px solid var(--ink); }
.dialog-actions button { padding: 10px 17px; }
.dialog-actions > button:first-child { font-size: 10px; }
.save-button { font-size: 10px; }
.save-button:disabled { opacity: .55; cursor: wait; transform: none; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--tertiary); outline-offset: 3px; }

@media (max-width: 720px) {
  .topbar { min-height: 68px; padding: 9px 16px; }
  .account-copy { display: none; }
  .signout { margin-left: 1px; }
  .app-shell { width: min(calc(100% - 28px), 1160px); padding: 45px 0 60px; }
  .welcome { align-items: start; margin-bottom: 35px; }
  .welcome h1 { font-size: 45px; }
  .welcome-copy { max-width: 340px; }
  .add-button { padding: 11px 14px; }
  .list-panel { padding: 20px; box-shadow: 8px 8px 0 color-mix(in srgb, var(--secondary) 68%, transparent); }
  .filters { align-items: stretch; flex-direction: column; margin-bottom: 29px; }
  .occasion-tabs, .owner-filter { width: 100%; }
  .occasion-tabs button, .owner-filter button { flex: 1; }
  .wish-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .login-page { padding: 17px; }
  .login-card { padding: 49px 23px 31px; box-shadow: 8px 8px 0 #ff3d96, 12px 12px 0 #2867f0; }
  .login-mark { margin-bottom: 18px; }
  .brand-copy strong { font-size: 17px; }
  .brand-copy small { display: none; }
  .brand-mark { width: 30px; height: 30px; }
  .avatar { width: 32px; height: 32px; }
  .welcome { display: block; }
  .welcome::after { right: -20px; width: 145px; height: 145px; }
  .welcome h1 { max-width: 355px; font-size: 42px; text-shadow: 3px 3px 0 white, 5px 5px 0 color-mix(in srgb, var(--primary) 55%, transparent); }
  .welcome .add-button, .readonly-pill { margin-top: 22px; }
  .panel-code { right: 12px; }
  .list-heading { align-items: start; flex-direction: column; gap: 12px; }
  .wish-card { padding: 18px; }
  .wish-actions { align-items: start; flex-direction: column; }
  .owner-actions { width: 100%; }
  .owner-actions button { flex: 1; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .item-dialog form { padding: 24px 19px; }
}

@supports not (color: color-mix(in srgb, red, blue)) {
  .app-page { background-color: var(--page); }
  .list-panel { background-color: white; box-shadow: 12px 12px 0 var(--secondary); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
