@font-face { font-family: Kanit; font-weight: 400; font-display: swap; src: url('/kanit-thai-400-normal.woff2') format('woff2'); unicode-range: U+0E01-0E5B,U+200C-200D,U+25CC; }
@font-face { font-family: Kanit; font-weight: 500; font-display: swap; src: url('/kanit-thai-500-normal.woff2') format('woff2'); unicode-range: U+0E01-0E5B,U+200C-200D,U+25CC; }
@font-face { font-family: Kanit; font-weight: 600; font-display: swap; src: url('/kanit-thai-600-normal.woff2') format('woff2'); unicode-range: U+0E01-0E5B,U+200C-200D,U+25CC; }
@font-face { font-family: Kanit; font-weight: 400; font-display: swap; src: url('/kanit-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+2000-206F,U+20AC,U+2212; }
@font-face { font-family: Kanit; font-weight: 500; font-display: swap; src: url('/kanit-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+2000-206F,U+20AC,U+2212; }
@font-face { font-family: Kanit; font-weight: 600; font-display: swap; src: url('/kanit-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+2000-206F,U+20AC,U+2212; }

:root {
  color-scheme: dark;
  --surface: #202722;
  --selected: #29392f;
  --leaf: #a9c3ad;
  --room-radius: 10px;
  --label: var(--muted-foreground);
  --font-sans: Kanit, system-ui, sans-serif;
}

body { background: var(--background); color: var(--foreground); font: 400 16px/1.6 var(--font-sans); }
button:disabled { cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
input::placeholder, textarea::placeholder { color: var(--label); opacity: 1; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }

.shell { width: min(1200px, calc(100% - 100px)); margin: 0 auto; padding-bottom: 22px; }
.site-header { height: 80px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--foreground); text-decoration: none; font-size: 20px; font-weight: 500; }
.lotus { position: relative; width: 29px; height: 26px; display: inline-block; color: var(--primary); }
.lotus:before, .lotus:after, .lotus i {
  content: ''; position: absolute; border: 1px solid currentColor;
  width: 13px; height: 15px; border-radius: 75% 8% 75% 8%; top: 7px;
}
.lotus:before { left: 3px; transform: rotate(-81deg); }
.lotus:after { right: 3px; transform: rotate(-7deg); }
.lotus i { left: 8px; top: 3px; transform: rotate(-44deg); }
.guide-button, .back, .demo { color: var(--label); }

.hero {
  min-height: clamp(425px, 43vw, 548px);
  display: grid;
  grid-template-columns: minmax(330px, .92fr) minmax(0, 1.38fr);
  background: #1d2420;
  border: 1px solid var(--border);
  border-radius: var(--room-radius);
  overflow: hidden;
}
.hero-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 38px clamp(27px, 4.6vw, 66px);
}
.hero h1 {
  font: 500 clamp(52px, 6.1vw, 83px)/.99 var(--font-sans);
  letter-spacing: -.04em;
  color: #f3eee4;
}
.hero-copy { margin: 21px 0 25px; max-width: 29ch; color: #b9c4b9; font-size: 17px; }
.hero-actions { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px 7px; }
.hero-actions .demo { padding-inline: 9px; }
.hero-photo { background: #282e26 url('/river-evening.webp') 63% center / cover no-repeat; }

.error { color: var(--destructive); font-size: 14px; margin-top: 6px; }
.error:empty, .share-feedback:empty { display: none; }
.subtle { font-size: 13px; color: var(--label); margin-top: 8px; }
.festival { font-size: 14px; color: #e6d4ad; }
.festival span { margin-right: 4px; }

.room-grid { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(345px, 1fr); align-items: start; gap: 20px; }
.river, .room-card, .invite-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--room-radius); box-shadow: none; }
.river { position: sticky; top: 18px; overflow: hidden; scroll-margin-top: 12px; }
.river-stage { position: relative; isolation: isolate; aspect-ratio: 3 / 2; background: #202722; }
.river-stage::before, .river-stage::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.river-stage::before {
  background: var(--venue-image, url('/wat-arun.webp')) center / 100% 100% no-repeat;
  filter: saturate(.65) hue-rotate(-12deg) contrast(1.04);
}
.river-environment { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; z-index: 0; pointer-events: none; }
.river-environment[data-ready="true"] { opacity: 1; }
.river-stage::after { z-index: 1; background: linear-gradient(130deg, #152320b5 0%, #1b2b285e 30%, transparent 59%); }
#river-scene { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; }
.river-copy { position: absolute; z-index: 3; inset: 7% 3% auto 6%; }
.river-copy h1 { font: 500 clamp(32px, 4.25vw, 57px)/1.06 var(--font-sans); letter-spacing: -.028em; margin-top: 7px; text-shadow: 0 2px 8px #10181296; }
.river-bar { min-height: 55px; padding: 10px clamp(14px, 2.4vw, 24px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border); color: var(--label); font-size: 14px; }

.back { margin: 0 0 9px -10px; }
.room-card { padding: 22px; }
.room-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 13px; border-bottom: 1px solid var(--border); }
.room-head p { color: var(--label); font-size: 13px; line-height: 1.4; }
.room-heading { min-width: 0; overflow-wrap: anywhere; }
.room-heading h2 { font-size: 23px; line-height: 1.35; font-weight: 500; text-align: start; margin-top: 4px; }
.share-invite { flex-shrink: 0; text-align: right; }
.room-head .share-feedback { margin-top: 5px; color: var(--leaf); }
.status { display: flex; flex-wrap: wrap; gap: 7px; margin: 13px 0 17px; }
.status [data-slot="badge"] { color: var(--label); font-size: 13px; border-radius: 5px; white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.status [data-slot="badge"] span { width: 5px; height: 5px; border-radius: 50%; background: #78857c; flex: 0 0 5px; }
.status [data-ready="true"] { color: #d7ead8; background: var(--selected); border-color: #506757; }
.status [data-ready="true"] span { background: var(--leaf); }
.waiting { color: var(--label); }
.guest-venue { margin-bottom: 13px; color: var(--label); font-size: 14px; }
.shell [data-slot="button"][data-variant="outline"] { border-color: var(--input); }

.design-field { padding: 0; border: 0; min-width: 0; margin: 0 0 10px; }
.design-field legend { color: var(--foreground); font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.venues, .outfits, .characters { margin-bottom: 18px; }
.design-options { display: flex; flex-wrap: wrap; gap: 7px; }
.venue-options, .base-options, .outfit-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.character-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.base-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.design-options .choice {
  display: inline-flex; justify-content: center; align-items: center; min-height: 38px;
  padding: 3px 11px; width: auto; height: auto; aspect-ratio: auto;
  color: var(--label); border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); font-size: 14px; font-weight: 400;
}
.design-options .choice:hover { border-color: #748879; color: var(--foreground); }
.design-options .choice[data-state="checked"] { border-color: #8ba892; background-color: var(--selected); color: #e5f0e3; }
.design-options .choice-venue { flex-direction: column; overflow: hidden; padding: 0 0 7px; gap: 2px; text-align: center; line-height: 1.2; }
.choice-venue img {
  display: block; width: 100%; aspect-ratio: 2.15; height: auto;
  object-fit: cover; object-position: 50% 46%;
  filter: saturate(.65) hue-rotate(-12deg); margin-bottom: 5px;
}
.choice-venue small { color: var(--label); font-size: 12px; }
.design-options .choice-base, .design-options .choice-outfit {
  flex-direction: column; padding: 4px 2px 5px; font-size: 13px;
}
.choice-character canvas { width: 46px; height: auto; }
.choice-base canvas, .choice-outfit canvas { display: block; width: min(100%, 90px); height: auto; }
.design-options .choice-color { width: 40px; padding: 0; }
.color-dot { display: block; width: 17px; height: 17px; border-radius: 50%; box-shadow: inset 0 0 0 1px #ffffff65; }
.choice-color[data-state="checked"] .color-dot { outline: 1px solid var(--leaf); outline-offset: 2px; }
.designer { margin-bottom: 18px; padding-top: 10px; border-top: 1px solid var(--border); }
.design-header { min-height: 75px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.design-header h2, .wish-label { font-size: 21px; line-height: 1.25; font-weight: 500; }
.design-preview { flex: 0 1 147px; min-width: 78px; }
.design-preview canvas { display: block; width: 100%; }
.wish-label { display: block; margin-bottom: 7px; }
#wish-form textarea { min-height: 76px; }
.counter { text-align: right; color: var(--label); font-size: 12px; margin: 4px 0 10px; }
.wish-card { background: var(--surface); border: 0; border-left: 2px solid #688673; border-radius: 0 6px 6px 0; box-shadow: none; margin-top: 9px; padding: 12px 14px; }
.wish-card small { color: var(--leaf); white-space: normal; overflow-wrap: anywhere; }
.wish-card p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 3px; }

.guide-content { position: fixed; background: var(--card); color: var(--foreground); }
.guide-content h2 { font-size: 25px; font-weight: 500; }
.guide-content ol { list-style: decimal; padding-left: 21px; color: var(--label); }
.guide-content li { margin: 8px 0; }
.dialog-close { position: absolute; right: 12px; top: 12px; }
.invite-scene {
  min-height: clamp(490px, 53vw, 610px);
  display: grid; place-items: center; padding: clamp(20px, 7vw, 72px);
  border: 1px solid var(--border); border-radius: var(--room-radius);
  background: linear-gradient(90deg, #141b16cf, #141b165e), url('/river-evening.webp') 65% center / cover;
}
.invite-card { width: min(100%, 406px); padding: clamp(21px, 5vw, 32px); gap: 14px; }
.invite-card h1 { font-size: clamp(37px, 7vw, 53px); line-height: 1.04; font-weight: 500; letter-spacing: -.025em; }
.invite-card .festival { margin-bottom: 9px; }
.invite-form { display: grid; gap: 9px; }
.invite-form label { font-size: 14px; }
.invite-form input { min-height: 42px; }
.invite-form > button { margin-top: 5px; }
.invite-back { align-self: flex-start; color: var(--label); }
.portrait-field { display: flex; align-items: center; gap: 12px; padding: 10px; margin-top: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; }
.portrait-preview { display: grid; place-items: center; flex: 0 0 54px; aspect-ratio: 1; border: 1px solid var(--input); border-radius: 50%; background: var(--selected); color: var(--leaf); overflow: hidden; }
.portrait-preview img { width: 100%; height: 100%; object-fit: cover; }
.portrait-preview svg { width: 21px; height: 21px; }
.portrait-actions { min-width: 0; }
.portrait-actions p { font-size: 14px; margin-bottom: 4px; }
.portrait-actions small { color: var(--label); margin-left: 5px; white-space: nowrap; }
.portrait-actions [data-slot="button"] { margin-right: 5px; }
.portrait-hint { font-size: 12px; color: var(--label); }

@media (max-width: 900px) {
  .shell { width: calc(100% - 48px); }
  .hero { grid-template-columns: minmax(280px, .98fr) minmax(0, 1.05fr); }
}
@media (max-width: 820px) {
  .room-grid { grid-template-columns: 1fr; gap: 13px; }
  .river { position: relative; top: auto; }
  .river-copy h1 { font-size: clamp(34px, 7vw, 54px); }
}
@media (max-width: 580px) {
  .shell { width: calc(100% - 28px); }
  .site-header { height: 63px; }
  .brand { font-size: 18px; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-inner { padding: 27px 21px 23px; }
  .hero h1 { font-size: clamp(51px, 13.3vw, 72px); }
  .hero-copy { font-size: 15px; margin: 15px 0 18px; max-width: 29ch; }
  .hero-photo { min-height: clamp(200px, 62vw, 330px); background-position: center 58%; }
  .room-card { padding: 16px; }
  .river-copy h1 { font-size: clamp(30px, 8.3vw, 44px); }
}
@media(max-width: 480px) {
  .design-options { gap: 5px; }
  .design-options .choice-venue, .design-options .choice-base, .design-options .choice-outfit { font-size: 12px; }
  .design-options .choice { min-height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; }
}
