:root {
  color-scheme: light;
  --red: #d92d2d;
  --deep: #4b1719;
  --ink: #241f20;
  --muted: #776d6e;
  --line: #eadfdd;
  --bg: #faf7f3;
  --cream: #fffdf8;
  --moon: #f7c934;
  --purple: #8d5ac7;
  --good: #2d9a6e;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(circle at 10% 0, #ffe9df 0, transparent 28rem), linear-gradient(180deg, #fffaf5, var(--bg) 32rem);
  color: var(--ink);
  font: 15px/1.65 system-ui, -apple-system, "Microsoft YaHei", sans-serif;
}

button { font: inherit; }
a { color: var(--red); text-decoration: none; }
.wrap { width: min(1160px, calc(100% - 28px)); margin: auto; }

.top {
  background: #fffdfbea;
  border-bottom: 1px solid #ead8d4;
  backdrop-filter: blur(16px);
}
.topin { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 950; color: var(--deep); }
.brand > span:not(.brand-mark) { display: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 31px;
  border-radius: 52% 52% 44% 44%;
  background: var(--red);
  color: #fff;
  font: 900 19px/1 Georgia;
  box-shadow: inset 0 -4px #ad1f24, 0 4px 12px #d92d2d2b;
  transform: rotate(-3deg);
}
.account-area { display: flex; align-items: center; gap: 8px; min-width: 0; margin-left: auto; color: var(--muted); font-size: 13px; }
.account-name { font-weight: 850; color: var(--deep); }
.account-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border: 1px solid #e4c6bf;
  border-radius: 999px;
  padding: 0 12px;
  background: linear-gradient(180deg, #fffaf7, #f9ebe6);
  color: var(--red);
  box-shadow: 0 2px 8px #6d201512;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.account-button:hover { border-color: #d99d92; background: #fff4ef; transform: translateY(-1px); }
.account-button:focus-visible { outline: 3px solid #f7c934; outline-offset: 2px; }
.account-button:disabled { opacity: .55; cursor: wait; }

.hero {
  position: relative;
  overflow: hidden;
  margin: 28px 0 20px;
  padding: clamp(28px, 6vw, 58px);
  border-radius: 26px;
  background: linear-gradient(130deg, #a91e27, #df3135 60%, #f05c48);
  color: #fff;
  box-shadow: 0 20px 55px #7e1e2524;
}
.hero::before {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  border: 22px solid #f9d658;
  border-top-color: transparent;
  border-right-color: transparent;
  border-radius: 50%;
  right: 7%;
  top: -46px;
  transform: rotate(-28deg);
  opacity: .95;
}
.hero::after {
  content: "M";
  position: absolute;
  display: grid;
  place-items: center;
  width: 88px;
  height: 72px;
  border-radius: 55% 55% 43% 43%;
  right: 18%;
  bottom: -19px;
  background: #fff;
  color: var(--red);
  font: 900 42px/1 Georgia;
  transform: rotate(8deg);
  box-shadow: 0 10px 28px #64141a40;
}
.eyebrow { font-size: 12px; font-weight: 850; letter-spacing: .18em; color: #ffe58b; }
.hero h1 { position: relative; margin: 7px 0 8px; font-size: clamp(30px, 5vw, 52px); line-height: 1.13; letter-spacing: -.03em; }
.hero p { position: relative; margin: 0; color: #fff3ed; max-width: 650px; }

.progress-track { height: 7px; background: #eee5e2; border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress-track i { display: block; height: 100%; width: 0; border-radius: inherit; transition: .25s; }
.moon-bar i { background: linear-gradient(90deg, #edab18, var(--moon)); }
.coin-bar i { background: linear-gradient(90deg, #7544ad, #ac79dd); }
.empty { text-align: center; padding: 44px; color: var(--muted); }

.auth-layer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #3a1016cc;
  backdrop-filter: blur(9px);
}
.auth-layer[hidden] { display: none; }
.auth-card {
  position: relative;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 28px 90px #21070a66;
}
.auth-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: 700 25px/1 system-ui, sans-serif;
  cursor: pointer;
}
.auth-close:hover { background: var(--bg); color: var(--deep); }
.auth-close:focus-visible { outline: 3px solid var(--moon); outline-offset: 2px; }
.auth-logo { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; font-weight: 950; font-size: 18px; color: var(--deep); }
.auth-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 34px;
  border-radius: 52% 52% 44% 44%;
  background: #d92d2d;
  color: #fff;
  font: 900 21px/1 Georgia;
  box-shadow: inset 0 -4px #ad1f24;
}
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; margin-bottom: 18px; border-radius: 12px; background: var(--bg); }
.auth-tab { border: 0; border-radius: 9px; padding: 9px; background: transparent; color: var(--muted); font: inherit; font-weight: 850; cursor: pointer; }
.auth-tab.active { background: var(--cream); color: var(--deep); box-shadow: 0 2px 8px #0002; }
.auth-card label { display: block; margin: 12px 0 5px; font-weight: 800; font-size: 13px; }
.auth-card input[type="text"],
.auth-card input[type="password"] { width: 100%; height: 45px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--bg); color: var(--ink); font: inherit; outline: 0; }
.auth-card input:focus { border-color: var(--red); box-shadow: 0 0 0 3px #d92d2d1f; }
.auth-help { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.auth-submit { width: 100%; height: 46px; margin-top: 16px; border: 0; border-radius: 11px; background: linear-gradient(135deg, #b8222a, #e13a3d); color: #fff; font: inherit; font-weight: 900; cursor: pointer; }
.auth-submit:disabled { opacity: .55; cursor: wait; }
.auth-error { min-height: 22px; margin: 10px 0 -4px; color: var(--red); font-size: 13px; font-weight: 700; }
.auth-note { margin: 16px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.sync-description { margin: 0 0 18px; color: var(--muted); }
.sync-actions { display: grid; gap: 9px; }
.sync-button {
  min-height: 44px;
  border: 1px solid #e4c6bf;
  border-radius: 11px;
  padding: 9px 13px;
  background: var(--cream);
  color: var(--deep);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}
.sync-button:hover { border-color: #d99d92; background: #fff4ef; }
.sync-button.primary { border-color: transparent; background: linear-gradient(135deg, #b8222a, #e13a3d); color: #fff; }
.sync-button:focus-visible { outline: 3px solid var(--moon); outline-offset: 2px; }
.sync-button:disabled { opacity: .55; cursor: wait; }
.app-toast {
  position: fixed;
  z-index: 1100;
  left: 50%;
  bottom: 22px;
  max-width: min(520px, calc(100% - 32px));
  transform: translate(-50%, 18px);
  border-radius: 12px;
  padding: 11px 16px;
  background: #351416ee;
  color: #fff;
  box-shadow: 0 12px 35px #21070a4d;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.app-toast.visible { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 760px) {
  .hero::after { right: 4%; opacity: .16; }
  .hero::before { right: -30px; }
}

@media (max-width: 560px) {
  .topin { gap: 8px; }
  .account-area { flex: 0 1 auto; }
  .guest .account-name { display: block; flex: none; white-space: nowrap; }
  .signed-in .account-name { display: block; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-button { flex: none; white-space: nowrap; }
  .hero { margin-top: 14px; padding: 26px 21px; }
}

@media (max-width: 340px) {
  .topin { gap: 6px; }
  .account-area { gap: 4px; }
  .account-button { padding-inline: 8px; }
}
