@font-face { font-family: "Manjari"; src: url("fonts/manjari-malayalam-700-normal.woff2") format("woff2"); font-weight: 700; unicode-range: U+0D00-0D7F, U+200C-200D, U+25CC; font-display: swap; }
@font-face { font-family: "Manjari"; src: url("fonts/manjari-latin-700-normal.woff2") format("woff2"); font-weight: 700; unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; font-display: swap; }

:root { --navy: #0B1230; --gold: #FFD23F; --card: rgba(11, 18, 48, 0.92); --text: #F4F6FF; --dim: #A9B1D6; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--navy); color: var(--text); font-family: "Manjari", system-ui, sans-serif; font-weight: 700; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#hud { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; flex-direction: column; align-items: center; pointer-events: none; text-shadow: 0 2px 8px rgba(0,0,0,0.6); }
.brand { font-size: clamp(26px, 7vw, 40px); color: var(--gold); }
.stats { margin-top: 2px; font-size: 15px; color: var(--text); background: rgba(11,18,48,0.6); padding: 4px 12px; border-radius: 999px; }
.stats .dot { margin: 0 8px; color: var(--gold); }

#card { position: fixed; left: 12px; right: 12px; top: 96px; max-width: 460px; margin: 0 auto; background: var(--card); border: 1px solid rgba(255,210,63,0.4); border-radius: 18px; padding: 16px 18px 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.45); transition: opacity .2s, transform .2s; }
#card.hidden { opacity: 0; transform: translateY(-8px); pointer-events: none; }
#cardClose { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--dim); font-size: 18px; cursor: pointer; }
.cardDay { font-size: 13px; color: var(--gold); }
#cardName { margin: 4px 0 2px; font-size: 24px; }
.cardPlace { font-size: 14px; color: var(--dim); }
.cardFact { font-size: 15px; line-height: 1.55; margin: 10px 0 8px; font-weight: 400; }
.cardFact .kauthukam { color: var(--gold); font-weight: 700; }
.cardBy { font-size: 14px; color: var(--dim); }
.cardBy a { color: var(--gold); text-decoration: none; }

#sheet { position: fixed; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; background: var(--card); border-radius: 18px 18px 0 0; max-height: 46vh; display: flex; flex-direction: column; }
#sheetToggle { display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: 0; color: var(--text); font: inherit; font-size: 16px; padding: 12px 18px; cursor: pointer; }
#list { list-style: none; margin: 0; padding: 0 10px 10px; overflow-y: auto; display: none; }
#sheet.open #list { display: block; }
#list li { display: flex; gap: 10px; align-items: center; padding: 10px 8px; border-radius: 12px; cursor: pointer; }
#list li:hover, #list li:active { background: rgba(255,255,255,0.06); }
#list .d { min-width: 52px; font-size: 12px; color: var(--navy); background: var(--gold); border-radius: 8px; padding: 3px 6px; text-align: center; }
#list .n { font-size: 16px; }
#list .p { font-size: 12px; color: var(--dim); font-weight: 400; }

#cta { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); text-align: center; background: var(--gold); color: var(--navy); text-decoration: none; font-size: 15px; }
#loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--gold); background: var(--navy); transition: opacity .5s; }
#loading.done { opacity: 0; pointer-events: none; }
