:root { --ink: #f6efe2; --muted: #c9bba3; --gold: #e2bf72; --glass: rgba(24, 19, 15, .72); --line: rgba(255, 236, 200, .16); --err: #ffb4a6; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1b1612; color: var(--ink); font: 15px/1.45 "Georgia", "Times New Roman", serif; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }

#loading { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; background: radial-gradient(circle at 50% 40%, #3a2b1d, #140f0b 70%); z-index: 20; text-align: center; padding: 24px; }
.mark { font-size: 34px; color: var(--gold); text-shadow: 0 0 24px rgba(226, 191, 114, .6); }
.mark.small { font-size: 26px; }
.brand { letter-spacing: .5em; font-size: 15px; padding-left: .5em; }
.track { width: min(260px, 70vw); height: 3px; background: rgba(255, 255, 255, .12); border-radius: 3px; overflow: hidden; }
.track i { display: block; height: 100%; width: 2%; background: var(--gold); transition: width .25s; }
#loadText { color: var(--muted); font-size: 14px; max-width: 320px; }
.err { color: var(--err) !important; }

.sheet { position: fixed; inset: 0; z-index: 15; display: flex; padding: 16px; pointer-events: none; }
.sheet.center { align-items: center; justify-content: center; background: rgba(10, 8, 6, .35); pointer-events: auto; }
.sheet.bottom { align-items: flex-end; justify-content: center; padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.card { pointer-events: auto; position: relative; width: min(420px, 100%); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.card h1 { font-weight: 400; font-size: 26px; margin: 4px 0 6px; text-align: center; }
.card p { margin: 0 0 14px; color: var(--muted); text-align: center; }
.close { position: absolute; top: 8px; right: 10px; width: 38px; height: 38px; border: 0; background: none; font-size: 26px; color: var(--muted); }
.looks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 10px; }
.looks button { aspect-ratio: 1; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); font-size: 28px; display: grid; place-items: center; }
.looks button small { display: block; font-size: 11px; color: var(--muted); margin-top: -4px; }
.looks button[aria-pressed="true"], .skins button[aria-pressed="true"] { outline: 2px solid var(--gold); outline-offset: 2px; }
.skins { display: flex; justify-content: center; gap: 10px; margin: 4px 0 14px; }
.skins button { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); }
.agree { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); margin: 6px 2px 14px; text-align: left; }
.agree input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--gold); flex: none; }
.primary { width: 100%; border: 0; border-radius: 14px; padding: 14px; background: linear-gradient(#ecd08e, #d2a752); color: #2a1d0e; font-weight: 700; letter-spacing: .02em; }
.primary:disabled { opacity: .45; cursor: default; }

#hud { position: fixed; top: 0; left: 0; right: 0; display: flex; gap: 8px; align-items: center; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; z-index: 10; pointer-events: none; }
#hud > * { pointer-events: auto; }
.spacer { flex: 1; }
.chip { background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; font-size: 14px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); white-space: nowrap; }
.chip.quiet { color: var(--muted); }
.chip.round { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; font-size: 16px; }

#actions { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(440px, calc(100% - 24px)); padding: 8px; background: var(--glass); border: 1px solid var(--line); border-radius: 22px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); z-index: 10; }
#actions button { border: 0; background: rgba(255, 255, 255, .06); border-radius: 15px; padding: 9px 2px 8px; display: grid; justify-items: center; gap: 2px; min-height: 64px; }
#actions button b { font-size: 24px; font-weight: 400; line-height: 1.1; }
#actions button span { font-size: 12.5px; color: var(--muted); }
#actions button[aria-pressed="true"] { background: rgba(226, 191, 114, .22); }
#actions button[aria-pressed="true"] span { color: var(--ink); }

.hint { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(108px + env(safe-area-inset-bottom)); z-index: 9; color: var(--ink); background: rgba(20, 15, 11, .55); padding: 7px 14px; border-radius: 999px; font-size: 13px; pointer-events: none; white-space: nowrap; transition: opacity .6s; }
.say { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); z-index: 9; font-size: 20px; color: #fff7e6; text-shadow: 0 2px 14px rgba(0, 0, 0, .7); pointer-events: none; text-align: center; transition: opacity .8s; }

.ref { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.verse { font-size: 19px !important; line-height: 1.5; color: var(--ink) !important; text-align: left !important; margin: 0 0 10px !important; }
.verse.en { font-size: 15px !important; color: var(--muted) !important; font-style: italic; }
.row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.row button { width: 46px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); font-size: 22px; }
.muted { color: var(--muted); }
.tiny { font-size: 11.5px !important; margin: 10px 0 0 !important; }
.wall { max-height: 42vh; overflow: auto; display: grid; gap: 8px; }
.wall div { background: rgba(255, 255, 255, .05); border-radius: 12px; padding: 10px 12px; font-size: 14.5px; }
.wall small { display: block; color: var(--muted); margin-top: 4px; font-size: 12px; }

#toast { position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 30; background: var(--glass); border: 1px solid var(--line); padding: 8px 16px; border-radius: 999px; font-size: 14px; opacity: 0; transition: opacity .3s; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
#toast.on { opacity: 1; }

@media (max-width: 420px) { .card { padding: 18px; } .card h1 { font-size: 23px; } #myName { max-width: 120px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
