@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+Thai:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --page: #f5f5f9;
  --paper: #fff;
  --text: #181824;
  --muted: #626274;
  --accent: #5441d6;
  --line: #e7e6f0;
  --radius: 24px;
  --shadow: 0 1px 2px #24204406, 0 12px 30px #2822490b;
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Noto Sans Thai", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(ellipse at 66% 0, #eae6ff 0, transparent 500px), var(--page);
  font: 400 1rem/1.55 var(--font);
}
button, input, textarea, select { font: inherit; }
button, a, input, textarea { touch-action: manipulation; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; cursor: pointer; }
button[disabled] { cursor: wait; opacity: .65; }
:focus-visible { outline: 2px solid #6b53ee; outline-offset: 3px; }
p, h1, h2, h3 { margin: 0; }
svg { display: block; width: 1.2rem; height: 1.2rem; flex: none; }
.wrap { width: min(1040px, calc(100% - 48px)); margin-inline: auto; }
.public-main { padding-block: 26px 34px; }
.loading { padding: 24px 0; color: var(--muted); }
.muted { color: var(--muted); }

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 16px 18px;
  margin-bottom: 16px;
  border: 1px solid #fff;
  border-radius: var(--radius);
  background: linear-gradient(112deg, #fff 42%, #f5f2ff 100%);
  box-shadow: var(--shadow);
}
.profile { display: flex; align-items: center; gap: 14px; min-width: 0; }
.avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 68px;
  height: 68px;
  border: 1px solid #dfd7fd;
  border-radius: 20px;
  color: #6a54cd;
  background: #eae2ff;
  box-shadow: 0 5px 16px #6854c328;
}
.avatar > svg { width: 28px; height: 28px; }
.avatar-image {
  position: absolute;
  inset: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  border-radius: 17px;
  object-fit: cover;
}
.hero h1 {
  margin-bottom: 1px;
  font-size: clamp(1.6rem, 3.7vw, 2.35rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}
.hero h1 em { color: var(--accent); font-style: normal; white-space: nowrap; }
.handle { color: var(--accent); font-size: .875rem; font-weight: 650; overflow-wrap: anywhere; }
.bio { margin-top: 2px; color: var(--muted); overflow-wrap: anywhere; }
.profile-socials { display: flex; align-items: center; gap: 7px; }
.social-link {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #e9e3fc;
  border-radius: 13px;
  background: #fff;
  color: var(--accent);
  box-shadow: 0 2px 7px #3222640a;
  transition: color .2s, background .2s, transform .2s, box-shadow .2s;
}
.social-link:is(:hover, :focus-visible):not(.social-unset) {
  color: #fff;
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 5px 14px #5441d63a;
}
.social-unset { color: #635a79; }
.social-logo { width: 17px; height: 17px; background: currentColor; mask: var(--social-icon) center / contain no-repeat; }

.hero.has-sponsor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 1fr auto;
  column-gap: 16px;
  row-gap: 9px;
}
.has-sponsor .profile-socials { grid-column: 1; margin-left: 82px; padding-bottom: 2px; }
.sponsor-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: center;
  gap: 3px;
  width: 132px;
  min-width: 0;
  aspect-ratio: 1;
  padding: 7px 6px;
  border: 1px solid #ffe5ab;
  border-radius: 19px;
  color: #47300c;
  text-align: center;
  background: radial-gradient(ellipse at 54% 53%, #fff9dc, transparent 68%), linear-gradient(155deg, #fffaf0, #ffedc7 92%);
  box-shadow: 0 5px 14px #9d681321, inset 0 1px #fff;
  transition: box-shadow .2s, transform .2s;
}
.sponsor-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  transform: translateX(-105%);
  background: linear-gradient(112deg, transparent 28%, #fff9 50%, transparent 71%);
  animation: sheen 1.3s .45s ease-out;
  pointer-events: none;
}
a.sponsor-card:is(:hover, :focus-visible) { transform: translateY(-2px); box-shadow: 0 9px 19px #9d681337; }
a.sponsor-card:active { transform: scale(.975); }
.sponsor-label {
  padding: 2px 7px;
  border-radius: 99px;
  color: #744705;
  background: #f8d9968a;
  font-size: .6875rem;
  font-weight: 750;
  line-height: 1.35;
}
.sponsor-image {
  display: grid;
  place-items: center;
  align-self: center;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: 1;
  color: #8d5c16;
}
.sponsor-image img { width: 100%; height: 100%; min-height: 0; object-fit: contain; filter: drop-shadow(0 3px 4px #9a63232d); }
.sponsor-image > svg { width: 32px; height: 32px; }
.sponsor-title {
  display: -webkit-box;
  overflow: hidden;
  max-width: 100%;
  color: #58350c;
  font-size: .875rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.dashboard { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.dashboard-main { display: grid; gap: 14px; min-width: 0; }
.panel {
  border: 1px solid #fff;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
h2 { font-size: 1.125rem; font-weight: 750; line-height: 1.35; letter-spacing: -.025em; }

.goal {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 16px 18px 18px;
  color: #fff;
  border-color: #7966e2;
  background: radial-gradient(ellipse at 95% 0, #8e72ee 0%, transparent 60%), linear-gradient(125deg, #6952e7, #5140bf 90%);
  box-shadow: 0 15px 32px #6751db36, inset 0 1px #ffffff35;
}
.goal::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(ellipse at 94% 120%, #d5b7ff71, transparent 56%);
  pointer-events: none;
}
.goal h2 { color: #fff; }
.goal-percent {
  flex: none;
  padding: 3px 9px;
  border-radius: 99px;
  background: #30228a63;
  color: #fff;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}
.goal-numbers { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 9px; margin: 4px 0 12px; font-variant-numeric: tabular-nums; }
.goal-numbers strong { font-size: clamp(2.15rem, 5.4vw, 3.65rem); font-weight: 750; line-height: 1.07; letter-spacing: -.055em; }
.goal-numbers span { font-size: 1rem; font-weight: 550; color: #f3eeff; overflow-wrap: anywhere; }
.meter {
  position: relative;
  overflow: hidden;
  height: 13px;
  border-radius: 99px;
  background: linear-gradient(180deg, #2d207f95 0%, #3e2e9e8f 44%, #6f59d4a6 100%);
  box-shadow: inset 0 1px 3px #21135a3e, 0 1px #ffffff58;
}
.meter span {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress);
  border-radius: inherit;
  background: linear-gradient(180deg, #fff9, transparent 52%), linear-gradient(90deg, #f1cfff, #d2c2ff 60%, #b8f0ff);
  box-shadow: inset 0 1px #fff, 0 0 11px #dfd2ffc9;
  transform-origin: left;
  animation: meter-fill .95s .14s cubic-bezier(.18,.72,.25,1) backwards;
}
.meter::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(108deg, transparent 36%, #fff5 49%, transparent 62%);
  transform: translateX(-105%);
  animation: sheen 2.3s .65s ease-out 3;
  pointer-events: none;
}
.goal-meta { margin-top: 8px; color: #f5edff; font-size: .875rem; }

.schedule { padding: 15px; }
.schedule-range { color: var(--muted); font-size: .875rem; text-align: right; }
.days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-top: 10px;
}
.day {
  display: flex;
  flex-flow: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  min-height: 51px;
  padding: 3px 0;
  border: 1px solid #eceaf3;
  border-radius: 11px;
  background: #f8f8fb;
  color: #57556a;
  transition: background .2s, color .2s, box-shadow .2s, transform .2s;
}
.day:hover { background: #f0ebff; color: var(--accent); }
.day span { font-size: .8125rem; line-height: 1.15; white-space: nowrap; }
.day strong { color: #212032; font-size: 1.125rem; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; }
.day i { height: 4px; width: 4px; margin-top: 2px; border-radius: 50%; }
.day .dot-event { background: #664be5; }
.day.selected {
  border-color: #7159e9;
  color: #fff;
  background: linear-gradient(160deg, #8869fb, #5b45d7);
  box-shadow: 0 4px 10px #7358e949;
}
.day.selected strong { color: #fff; }
.day.selected .dot-event { background: #fff; }
.day:active { transform: scale(.96); }
.schedule-items { display: grid; gap: 6px; margin-top: 9px; }
.event {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 61px;
  padding: 5px 7px;
  border: 1px solid #eeedf4;
  border-radius: 13px;
  background: #f8f8fb;
  animation: enter .28s ease-out backwards;
}
.event-image { width: 85px; height: 49px; flex: none; object-fit: cover; object-position: 62% 37%; border-radius: 8px; }
.event-copy { min-width: 0; overflow-wrap: anywhere; }
.event-copy h3 { font-size: 1rem; font-weight: 750; line-height: 1.3; }
.event-time { display: inline-flex; align-items: center; gap: 5px; color: #5845c6; font-size: .875rem; font-weight: 650; }
.event-time svg { width: 14px; height: 14px; }
.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 47px;
  padding: 6px 9px;
  border-radius: 12px;
  color: var(--muted);
  background: #f8f8fb;
  font-size: .875rem;
  text-align: center;
}
.empty a { color: var(--accent); }

.community { min-width: 0; }
.community-title { display: flex; align-items: center; gap: 10px; margin: 1px 0 9px; }
.community-title span { height: 1px; flex: 1; background: #dddbe9; }
.community-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 8px; }
.feature {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: block;
  width: 100%;
  text-align: left;
  transition: box-shadow .22s, transform .22s;
}
.feature::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(112deg, transparent 25%, #ffffff7d 51%, transparent 72%);
  transform: translateX(-105%);
  animation: sheen 1.1s .65s ease-out;
  pointer-events: none;
}
.card-art {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  transition: transform .48s cubic-bezier(.18,.7,.22,1);
}
.feature-title { display: block; font-size: 1rem; font-weight: 750; line-height: 1.3; }
.support {
  min-height: 152px;
  padding: 17px;
  border-color: #ffe6ce;
  background: linear-gradient(110deg, #fff3e7, #ffdfbc);
  box-shadow: 0 9px 23px #b8571b17;
}
.support .card-art {
  inset: 0 0 0 auto;
  width: 60%;
  object-position: 62% 52%;
  mask-image: linear-gradient(90deg, transparent, #000 29%);
  transform-origin: 80% 60%;
}
.support-content { display: grid; gap: 4px; width: 59%; }
.support .feature-title { color: #452213; font-size: 1.075rem; }
.support-description { color: #764425; font-size: .875rem; font-weight: 550; }
.mini { display: flex; align-items: flex-end; aspect-ratio: 1; padding: 8px; border-radius: 17px; }
.mini .card-art { height: 100%; mask-image: linear-gradient(#000 36%, #000 51%, transparent 83%); object-position: 50% 5%; }
.mini .feature-title { font-size: .875rem; overflow-wrap: anywhere; }
.notification { background: #eee8ff; color: #342369; border-color: #f4eeff; }
.discord { background: #e7e6ff; color: #2e287d; border-color: #f0efff; }
.gang { background: #dfefe9; color: #264a3d; border-color: #eefaf4; }
.notification::after { animation-delay: .75s; }
.discord::after { animation-delay: .85s; }
.gang::after { animation-delay: .95s; }
.feature:active { transform: scale(.975); }
.feature:is(:active, :focus-visible) .card-art { transform: scale(1.055); }
@media (hover:hover) {
  .feature:hover { transform: translateY(-3px); box-shadow: 0 12px 24px #443a641e; }
  .feature:hover .card-art { transform: scale(1.07); }
  .feature:active { transform: scale(.975); }
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: .875rem;
  font-weight: 750;
  text-align: center;
  transition: background .2s, transform .2s;
}
.button:active { transform: scale(.97); }
.primary { background: var(--accent); color: #fff; }
.primary:hover { background: #4733bf; }
.secondary { border-color: #eae6f8; background: #f0edfc; color: #453495; }
.secondary:hover { background: #e7e1fa; }
.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #eceaf2;
  border-radius: 11px;
  color: #514b64;
  background: #f6f5fb;
}
.icon-btn:hover { color: var(--accent); background: #eeebfa; }
.icon-btn svg { width: 17px; height: 17px; }
.glyph { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 10px; background: #eeebff; color: var(--accent); }
.glyph svg { width: 17px; height: 17px; }
dialog {
  width: min(427px, calc(100% - 32px));
  padding: 18px;
  border: 1px solid #fff;
  border-radius: 22px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 18px 55px #28204131;
}
dialog[open] { animation: enter .24s ease-out; }
dialog::backdrop { background: #26213b5c; backdrop-filter: blur(5px); }
.modal-top { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 8px; }
.modal-top h2 { display: flex; align-items: center; gap: 8px; }
dialog p { margin: 7px 0; }
dialog .button { margin: 8px 6px 0 0; }
.toast {
  position: fixed;
  z-index: 5;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 10px 15px;
  border: 1px solid #fff;
  border-radius: 13px;
  color: #352479;
  background: #f2edff;
  box-shadow: 0 8px 24px #37265a2a;
  font-size: .9rem;
}

.enter { animation: enter .46s ease-out backwards; }
.goal { animation-delay: .05s; }
.schedule { animation-delay: .12s; }
.community { animation-delay: .17s; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes meter-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes sheen { from { transform: translateX(-105%); } to { transform: translateX(105%); } }

.top { background: #ffffffd8; border-bottom: 1px solid #eeeaf6; backdrop-filter: blur(12px); }
.top-inner { height: 63px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: #fff; background: #6b52e5; border-radius: 11px; }
.brand-mark svg { width: 19px; height: 19px; }
.brand-live { color: var(--accent); font-weight: 800; }
.admin-main { width: min(830px, calc(100% - 36px)); padding: 24px 0 50px; }
.admin-main h1 { font-size: 2rem; line-height: 1.25; letter-spacing: -.035em; }
.admin-main > p { margin: 5px 0 17px; }
.admin-form { display: grid; gap: 12px; }
.admin-section { padding: 17px; }
.admin-section h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.admin-section h2 svg { color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: .9rem; font-weight: 650; }
.field input, .field textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid #e5e2ee;
  border-radius: 10px;
  color: var(--text);
  background: #f8f8fb;
  font-size: 1rem;
}
.field textarea { min-height: 76px; resize: vertical; }
.field small { font-weight: 400; color: var(--muted); font-size: .8125rem; }
.wide { grid-column: 1 / -1; }
.sponsor-settings-image { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.sponsor-settings-preview { width: 86px; height: 86px; flex: none; border: 1px solid #eee7d7; border-radius: 13px; object-fit: contain; background: #fff8ea; padding: 5px; }
.sponsor-settings-controls { flex: 1 1 240px; min-width: 0; display: grid; gap: 8px; }
.sponsor-settings-controls > .button { justify-self: start; }
.sponsor-settings-visibility { flex-direction: row; align-items: center; gap: 8px; min-height: 36px; }
.sponsor-settings-visibility input { width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; accent-color: var(--accent); }
.admin-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.admin-section-heading h2 { margin: 0; }
.event-editor { margin-top: 7px; padding: 11px; border: 1px solid #ebe8f3; border-radius: 13px; background: #fbfaff; }
.event-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.remove { padding: 4px 9px; border: 1px solid #f7d8df; border-radius: 8px; color: #9f2b44; background: #fff1f4; font-size: .875rem; }
.save-row { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; justify-content: flex-end; }
.form-error { color: #aa2944; }
.posted { color: #176449; }
.auth-box { max-width: 480px; padding: 19px; }
.auth-box p { margin: 8px 0; }
.auth-box .button { margin-top: 9px; }

@media (max-width: 760px) {
  .wrap { width: calc(100% - 28px); }
  .public-main { padding-top: 15px; }
  .dashboard { grid-template-columns: minmax(0,1fr); gap: 15px; }
  .dashboard-main { gap: 12px; }
  .hero { margin-bottom: 12px; padding: 13px; }
  .avatar { width: 58px; height: 58px; border-radius: 17px; }
  .avatar-image { border-radius: 14px; }
  .profile { gap: 10px; }
  .has-sponsor .profile-socials { margin-left: 68px; }
  .support { min-height: 138px; }
}
@media (max-width: 449px) {
  .hero { gap: 9px; }
  .profile-socials { margin-left: 68px; }
  .social-link { width: 34px; height: 34px; border-radius: 11px; }
  .social-logo { width: 16px; height: 16px; }
  .hero.has-sponsor { column-gap: 8px; }
  .has-sponsor .profile { gap: 7px; }
  .has-sponsor .avatar { width: 40px; height: 40px; border-radius: 12px; }
  .has-sponsor .avatar-image { border-radius: 9px; }
  .has-sponsor h1 { font-size: clamp(1.125rem, 5.3vw, 1.6rem); }
  .has-sponsor .bio { font-size: .8125rem; }
  .has-sponsor .profile-socials { margin-left: 0; gap: 4px; }
  .has-sponsor .social-link { width: 30px; height: 30px; }
  .sponsor-card { width: clamp(98px, 28vw, 118px); border-radius: 15px; }
  .sponsor-title { font-size: .8125rem; }
  .goal { padding: 14px; }
  .goal-numbers { margin-bottom: 9px; }
  .schedule { padding: 12px; }
  .days { gap: 3px; }
  .day { border-radius: 9px; min-height: 48px; }
  .schedule-range { font-size: .8125rem; }
  .community-cards { gap: 6px; }
  .mini { padding: 6px 7px; border-radius: 14px; }
  .mini .feature-title { font-size: .8125rem; }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .admin-section { padding: 13px; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
}
