:root { --ink: #f3e6cf; --muted: #b9a68b; --ember: #f08a3c; --ember2: #ffcf7a; --deep: #120b07; --glass: rgba(20, 13, 9, 0.72); --line: rgba(240, 190, 120, 0.22);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--deep); color: var(--ink); font: 15px/1.45 var(--sans); -webkit-tap-highlight-color: transparent; }
canvas#world { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; outline: none; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#ui > * { pointer-events: auto; }
#diag { position: fixed; left: -10000px; top: 0; width: 900px; white-space: pre-wrap; font-size: 10px; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--ink); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; }
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(240, 138, 60, 0.6); outline-offset: 1px; }

#veil { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 70%, #2a1308 0%, #0d0705 60%, #050303 100%); transition: opacity 1.4s ease; }
#veil.gone { opacity: 0; pointer-events: none; }
.veil-inner { text-align: center; padding: 24px; }
.veil-kicker { letter-spacing: 0.42em; text-transform: uppercase; font-size: 12px; color: var(--muted); margin: 18px 0 6px; }
#veil h1 { font: 600 clamp(34px, 7vw, 64px)/1.05 var(--serif); margin: 0; color: #ffe2b0; text-shadow: 0 0 40px rgba(240, 138, 60, 0.45); }
.veil-line { font: italic 17px var(--serif); color: var(--muted); margin: 10px 0 26px; }
#progress { font-size: 13px; color: #d9b27a; min-height: 1.4em; }
.veil-flame { position: relative; width: 70px; height: 90px; margin: 0 auto; }
.veil-flame span { position: absolute; left: 50%; bottom: 0; width: 46px; height: 70px; margin-left: -23px; border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%; background: radial-gradient(ellipse at 50% 80%, #fff3c4 0%, #ffb347 35%, #e25822 70%, transparent 72%); filter: blur(1px); animation: flick 1.3s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.veil-flame span:nth-child(2) { width: 32px; height: 54px; margin-left: -16px; animation-duration: 0.9s; opacity: 0.8; }
.veil-flame span:nth-child(3) { width: 20px; height: 34px; margin-left: -10px; animation-duration: 0.7s; }
@keyframes flick { 0% { transform: scale(1, 1) skewX(0); } 50% { transform: scale(0.94, 1.06) skewX(2deg); } 100% { transform: scale(1.04, 0.96) skewX(-2deg); } }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.45s; z-index: 30; }
#fade.on { opacity: 1; }

.wheel { position: absolute; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); width: 0; height: 0; transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
.wheel.open { transform: translateY(-160px); }
.wheel::before { content: ''; position: fixed; inset: -100vh -100vw; background: radial-gradient(circle at 50% 50%, rgba(10, 5, 2, 0.15), rgba(10, 5, 2, 0.55)); opacity: 0; pointer-events: none; transition: opacity 0.4s; }
.wheel.open::before { opacity: 1; }
.flame { position: absolute; left: -36px; top: -72px; width: 72px; height: 72px; border-radius: 50%; border: 0; background: radial-gradient(circle at 50% 62%, #ffd27a 0%, #f08a3c 34%, #6a2a0f 70%, rgba(40, 16, 6, 0.85) 100%);
  box-shadow: 0 0 22px rgba(255, 140, 60, 0.75), 0 0 60px rgba(255, 110, 40, 0.35), inset 0 -8px 18px rgba(80, 20, 0, 0.6); animation: breathe 3.6s ease-in-out infinite; }
.flame-core { position: absolute; left: 50%; top: 50%; width: 24px; height: 34px; margin: -20px 0 0 -12px; border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%; background: radial-gradient(ellipse at 50% 75%, #fffbe6, #ffd27a 45%, transparent 70%); animation: flick 0.8s infinite alternate; }
.flame-ring { position: absolute; inset: -16px; border-radius: 50%; font: 9px/1 var(--serif); color: rgba(255, 210, 140, 0.55); letter-spacing: 1.6px; display: flex; align-items: center; justify-content: center; animation: spin 40s linear infinite; pointer-events: none;
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%); mask: radial-gradient(circle, transparent 58%, #000 60%); }
.ember { position: absolute; left: 50%; bottom: 60px; width: 3px; height: 3px; border-radius: 50%; background: #ffc46b; box-shadow: 0 0 6px #ff9a3c; opacity: 0; animation: rise 2.8s linear infinite; animation-delay: calc(var(--i) * 0.46s); }
@keyframes rise { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(calc((var(--i) - 2.5) * 9px), -70px); opacity: 0; } }
@keyframes breathe { 50% { box-shadow: 0 0 30px rgba(255, 150, 70, 0.9), 0 0 80px rgba(255, 110, 40, 0.45), inset 0 -8px 18px rgba(80, 20, 0, 0.6); } }
@keyframes spin { to { transform: rotate(360deg); } }
.wheel-items { position: absolute; left: 0; top: -36px; }
.wheel-item { position: absolute; left: -36px; top: -36px; width: 72px; height: 72px; border-radius: 50%; border: 1px solid rgba(255, 200, 130, 0.45); background: radial-gradient(circle at 50% 35%, rgba(70, 36, 18, 0.95), rgba(20, 11, 7, 0.95)); box-shadow: 0 0 16px rgba(240, 138, 60, 0.35);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transform: translate(0, 0) scale(0.3); opacity: 0; pointer-events: none; transition: transform 0.38s cubic-bezier(0.2, 0.9, 0.3, 1.25), opacity 0.25s; transition-delay: var(--d); }
.wheel-item i { font: normal 22px/1 var(--serif); color: var(--ember2); text-shadow: 0 0 8px rgba(255, 160, 80, 0.8); }
.wheel-item span { font-size: 10.5px; color: var(--ink); white-space: nowrap; }
.wheel.open .wheel-item { transform: translate(calc(var(--x) * 132px), calc(var(--y) * 132px)) scale(1); opacity: 1; pointer-events: auto; }
.wheel-item:hover { border-color: var(--ember2); box-shadow: 0 0 24px rgba(255, 170, 90, 0.7); }
.wheel.open .flame { transform: scale(0.92); }
.wheel.hidden { display: none; }

.prompt { position: absolute; left: 50%; bottom: calc(120px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 10px; align-items: center; padding: 9px 16px 9px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(8px); font: 16px var(--serif); white-space: nowrap; }
.prompt kbd { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; background: var(--ember); color: #1a0d05; font: 700 13px var(--sans); }
.toasts { position: absolute; left: 16px; top: calc(14px + env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 8px; max-width: min(420px, 80vw); pointer-events: none !important; }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(8px); font: 15px/1.35 var(--serif); animation: tin 0.5s ease; transition: opacity 0.8s, transform 0.8s; }
.toast i { font-style: normal; } .toast.out { opacity: 0; transform: translateX(-20px); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }
.chatlog { position: absolute; left: 16px; bottom: calc(110px + env(safe-area-inset-bottom)); max-width: min(380px, 70vw); pointer-events: none !important; text-shadow: 0 1px 3px #000; }
.chatlog p { margin: 3px 0; padding: 5px 10px; border-radius: 10px; background: rgba(10, 6, 4, 0.5); transition: opacity 2s; } .chatlog p.fade { opacity: 0; } .chatlog b { color: var(--ember2); }
.chatinput { position: absolute; left: 16px; bottom: calc(66px + env(safe-area-inset-bottom)); width: min(380px, 70vw); background: var(--glass); backdrop-filter: blur(8px); }
.livebadge { position: absolute; right: 16px; top: calc(14px + env(safe-area-inset-top)); border: 1px solid rgba(255, 110, 80, 0.5); border-radius: 999px; padding: 7px 14px; background: rgba(40, 10, 6, 0.75); color: #ffb39a; font-weight: 600; backdrop-filter: blur(6px); }
.joy { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 1px solid rgba(255, 210, 150, 0.35); background: radial-gradient(circle, rgba(255, 160, 80, 0.12), rgba(0, 0, 0, 0.18)); pointer-events: none !important; }
.joy-knob { position: absolute; left: 36px; top: 36px; width: 48px; height: 48px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffd8a0, #c66a2c); box-shadow: 0 0 16px rgba(240, 138, 60, 0.6); }

.sheet { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, 94vw); max-height: 86vh; display: flex; flex-direction: column; border-radius: 20px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(36, 22, 14, 0.94), rgba(16, 10, 7, 0.96)); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 220, 170, 0.08); animation: sin 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
.sheet.wide { width: min(640px, 94vw); }
.sheet.side { left: auto; right: 18px; transform: translateY(-50%); width: min(380px, 94vw); }
@keyframes sin { from { opacity: 0; transform: translate(-50%, -46%) scale(0.98); } }
.sheet.side { animation: none; }
.sheet header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.sheet h2 { margin: 0; font: 600 22px var(--serif); color: #ffe2b0; } .sheet h3 { font: 600 16px var(--serif); color: var(--ember2); margin: 18px 0 8px; } .sheet h4 { margin: 14px 0 6px; font: 600 13px var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.sheet .x { border: 0; background: none; font-size: 18px; color: var(--muted); padding: 6px; }
.sheet-body { padding: 4px 18px 18px; overflow: auto; }
.muted { color: var(--muted); } .row { display: flex; gap: 10px; margin: 12px 0; } .row.wrap { flex-wrap: wrap; } .row.sticky { position: sticky; bottom: -18px; padding: 12px 0; background: linear-gradient(transparent, #120b07 40%); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 220, 170, 0.06); text-decoration: none; color: var(--ink); }
.btn:hover { border-color: rgba(255, 200, 130, 0.5); } .btn.primary { background: linear-gradient(180deg, #f39a4c, #c9611f); border-color: #ffb36b; color: #1d0e05; font-weight: 700; } .btn.ghost { background: none; } .btn.danger { background: #8a2f24; border-color: #c4553f; } .btn.small { padding: 6px 11px; font-size: 13px; }
.linklike { border: 0; background: none; color: var(--ember2); text-decoration: underline; padding: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 220, 170, 0.04); text-align: left; color: var(--ink); text-decoration: none; }
.row-item span { display: flex; flex-direction: column; flex: 1; min-width: 0; } .row-item small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .row-item em { font-style: normal; color: #ffb39a; }
.av { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #8a4b24, #3a1d0e); font: 600 17px var(--serif); font-style: normal; color: #ffe2b0; flex: none; } .av.big { width: 64px; height: 64px; font-size: 28px; }
.me-card { display: flex; gap: 14px; align-items: center; } .me-card h3 { margin: 0; }
.gate, .runestone { display: flex; flex-direction: column; gap: 10px; } label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.socials { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .social em.ok { color: #9fe0a6; font-style: normal; }
.settings { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); } .settings label { flex-direction: row; align-items: center; justify-content: space-between; } .settings select { width: auto; } .settings input[type=checkbox] { width: auto; }
.tailor .slider { flex-direction: row; align-items: center; gap: 12px; } .tailor .slider input { flex: 1; accent-color: var(--ember); padding: 0; }
.swatches, .chips { display: flex; flex-wrap: wrap; gap: 7px; } .sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.15); } .sw.on { border-color: var(--ember2); box-shadow: 0 0 0 2px rgba(240, 138, 60, 0.5); }
.chip { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 220, 170, 0.05); text-transform: capitalize; font-size: 13px; } .chip.on { background: var(--ember); color: #1d0e05; border-color: #ffb36b; font-weight: 600; }
.journal a.row-item:hover { border-color: rgba(255, 200, 130, 0.5); }

.lv-root { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; pointer-events: none; }
.lv-card { pointer-events: auto; position: relative; height: min(88vh, 900px); aspect-ratio: 9 / 16; max-width: 100vw; border-radius: 22px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px rgba(255, 200, 130, 0.25), 0 30px 90px rgba(0, 0, 0, 0.75), 0 0 80px rgba(240, 120, 50, 0.25); }
@media (max-width: 640px) { .lv-card { height: 100%; width: 100%; border-radius: 0; aspect-ratio: auto; } }
.lv-stage { position: absolute; inset: 0; touch-action: none; } .lv-video { width: 100%; height: 100%; object-fit: cover; background: radial-gradient(ellipse at 50% 70%, #3a1a08, #050304); }
.lv-status { position: absolute; left: 0; right: 0; top: 46%; text-align: center; font: 16px var(--serif); color: #ffd9a3; text-shadow: 0 1px 4px #000; }
.lv-unmute { position: absolute; left: 50%; top: 56%; transform: translateX(-50%); border: 1px solid var(--line); background: var(--glass); border-radius: 999px; padding: 8px 14px; }
.lv-head { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 8px; padding: 12px; background: linear-gradient(rgba(0, 0, 0, 0.55), transparent); }
.lv-pill { background: #e0442e; color: #fff; font: 800 11px var(--sans); letter-spacing: 0.08em; padding: 4px 8px; border-radius: 6px; } .lv-viewers { font-size: 13px; }
.lv-top { display: flex; gap: 6px; flex: 1; overflow: hidden; } .lv-gifter { font-size: 12px; background: rgba(0, 0, 0, 0.35); padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.lv-close { margin-left: auto; border: 0; background: rgba(0, 0, 0, 0.4); width: 34px; height: 34px; border-radius: 50%; }
.lv-rail { position: absolute; right: 10px; bottom: 150px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.lv-act { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; text-shadow: 0 1px 3px #000; } .lv-act i { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: rgba(0, 0, 0, 0.38); font: normal 22px var(--serif); color: #ffe2b0; } .lv-act small, .lv-act span { font-size: 12px; }
.lv-host i { background: radial-gradient(circle at 40% 35%, #c9611f, #5a2a10); border: 2px solid #ffd27a; }
.lv-foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 70px 14px 12px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.75)); }
.lv-who b { font: 600 17px var(--serif); display: block; } .lv-who span { font-size: 13px; color: #e6d4b8; }
.lv-chat { max-height: 150px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; margin: 8px 0; -webkit-mask: linear-gradient(transparent, #000 30%); mask: linear-gradient(transparent, #000 30%); } .lv-chat p { margin: 2px 0; font-size: 13.5px; text-shadow: 0 1px 2px #000; } .lv-chat b { color: var(--ember2); } .lv-chat b.host { color: #ff9a7a; }
.lv-input { background: rgba(0, 0, 0, 0.45); border-radius: 999px; }
.lv-hearts { position: absolute; inset: 0; pointer-events: none; } .lv-heart { position: absolute; font-size: 54px; color: #ff4d6d; transform: translate(-50%, -50%); animation: heart 1.2s ease-out forwards; text-shadow: 0 0 16px rgba(255, 60, 90, 0.8); }
@keyframes heart { 0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; } 20% { transform: translate(-50%, -60%) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -220%) scale(0.8); opacity: 0; } }
.lv-giftpop { position: absolute; left: 12px; top: 64px; display: flex; gap: 10px; align-items: center; padding: 8px 14px 8px 8px; border-radius: 999px; background: linear-gradient(90deg, rgba(200, 90, 30, 0.85), rgba(60, 20, 8, 0.4)); animation: gp 3.2s ease forwards; }
.lv-giftpop i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #2a1408; font: normal 20px var(--serif); color: #ffd27a; } .lv-giftpop em { font: italic 800 22px var(--serif); color: #ffe08a; }
@keyframes gp { 0% { transform: translateX(-120%); } 12% { transform: translateX(0); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
.gd-sheet { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px; background: rgba(18, 11, 7, 0.97); border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; animation: up 0.3s ease; } @keyframes up { from { transform: translateY(100%); } }
.gd-sheet header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; } .gd-x { border: 0; background: none; }
.gd-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; } .gd-gift { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 220, 170, 0.04); }
.gd-gift i { font: normal 26px var(--serif); color: #ffd27a; } .gd-gift span { font-size: 11.5px; text-align: center; } .gd-gift small { color: var(--ember2); }
.gd-qty { display: flex; gap: 8px; margin: 12px 0 6px; } .gd-qty button { flex: 1; padding: 7px; border-radius: 10px; border: 1px solid var(--line); background: none; } .gd-qty .on { background: var(--ember); color: #1d0e05; }
.gd-note { font-size: 11.5px; color: var(--muted); margin: 6px 0 0; }
.hs-form { display: flex; flex-direction: column; gap: 10px; } .hs-preview { width: 100%; aspect-ratio: 9/16; max-height: 46vh; object-fit: cover; border-radius: 14px; background: #000; }
.hh-root { position: fixed; right: 16px; bottom: calc(110px + env(safe-area-inset-bottom)); width: 220px; z-index: 15; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(8px); }
.hh-self { width: 100%; aspect-ratio: 9/16; max-height: 300px; object-fit: cover; display: block; background: #000; }
.hh-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; font-size: 13px; } .hh-bar .btn { margin-left: auto; padding: 6px 10px; font-size: 12px; }
.hh-chat { padding: 0 10px 8px; font-size: 12.5px; } .hh-chat p { margin: 2px 0; } .hh-chat b { color: var(--ember2); }
@media (max-width: 640px) { .toasts { top: calc(60px + env(safe-area-inset-top)); left: 10px; right: 10px; max-width: none; } .wheel.open { transform: translateY(-140px); } .wheel.open .wheel-item { transform: translate(calc(var(--x) * 112px), calc(var(--y) * 112px)) scale(0.88); } .sheet.side { right: 0; left: 0; top: auto; bottom: 0; transform: none; width: 100%; max-height: 52vh; border-radius: 20px 20px 0 0; } .socials { grid-template-columns: 1fr; } }
