/* ReGaia Tavern overlay. Canvas 1920x1080, scaled to fit the window.
   CPU rule: no backdrop-filter. Frosted panels use a pre-blurred copy of the scene (made once per scene in JS). */

@font-face { font-family: "Nunito"; src: url("/fonts/Nunito.ttf") format("truetype"); font-weight: 200 1000; font-display: block; }
/* Japanese glyphs only (Nunito has none): rounded M+ matches Nunito's look. Loaded only when needed. */
@font-face { font-family: "MPlusRounded"; src: url("/fonts/MPLUSRounded1c-Bold.ttf") format("truetype"); font-weight: 400 1000; font-display: swap;
  unicode-range: U+3000-30FF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF; }
@font-face { font-family: "Cormorant"; src: url("/fonts/CormorantGaramond.ttf") format("truetype"); font-weight: 300 700; font-display: block; }

:root {
  --gold: #F6D68C;
  --cream: #FFF6E4;
  --red: #E62E3C;
  --ink: rgba(20, 14, 30, 0.58);
  --border: rgba(246, 214, 140, 0.67);
  --fade: 2.5s;
  --pulse: 1.8s; /* LIVE dot + LIVE text share this so they blink in sync */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; }
body { font-family: "Nunito", "MPlusRounded", "Noto Sans CJK JP", "Noto Sans CJK KR", "Noto Sans CJK SC", sans-serif; color: var(--cream); -webkit-font-smoothing: antialiased; cursor: none; }

#stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; overflow: hidden; transform-origin: 0 0; background: #120c1c; }

/* ---------- scene + vignette ---------- */
.scene { position: absolute; inset: 0; background-size: 1920px 1080px; background-position: 0 0; opacity: 0; transition: opacity var(--fade) ease-in-out; }
.scene.on { opacity: 1; }
#vig-top { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 1050px 640px at 200px 10px, rgba(10,6,20,0.62) 0%, rgba(10,6,20,0.42) 45%, rgba(10,6,20,0) 100%); }
#vig-right { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 760px 380px at 1760px 60px, rgba(10,6,20,0.40) 0%, rgba(10,6,20,0.22) 50%, rgba(10,6,20,0) 100%); }
#vig-bottom { position: absolute; left: 0; right: 0; bottom: 0; height: 400px; pointer-events: none;
  background: linear-gradient(to top, rgba(10,6,20,0.48) 0%, rgba(10,6,20,0.40) 30%, rgba(10,6,20,0) 100%); }

/* ---------- show/hide ---------- */
.el { position: absolute; transition: opacity 0.6s ease; }
.el.off { opacity: 0; }
.hidden { display: none !important; }
.swap { transition: opacity 0.6s ease; }
.swap.fading { opacity: 0; }

/* ---------- glass panels ---------- */
.glass { position: absolute; overflow: hidden; border: 2px solid var(--border); border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.30); }
.glass .frost { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }
.glass .frost > div { position: absolute; width: 1920px; height: 1080px; background-size: 1920px 1080px;
  left: var(--fx, 0); top: var(--fy, 0); opacity: 0; transition: opacity var(--fade) ease-in-out; }
.glass .frost > div.on { opacity: 1; }
.glass .frost::after { content: ""; position: absolute; inset: 0; background: var(--ink); }
.glass .content { position: relative; z-index: 1; width: 100%; height: 100%; }

/* ---------- rotation timer bar (drains until the next item) ---------- */
.timer { position: absolute; left: 22px; right: 22px; bottom: 7px; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.12); overflow: hidden; }
.timer i { display: block; width: 100%; height: 100%; border-radius: 2px; background: var(--gold); opacity: 0.8; transform-origin: left center; transform: scaleX(1); }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- LIVE 24/7 ---------- */
#live_badge { left: 56px; top: 50px; display: flex; gap: 10px; }
.pill { height: 54px; border-radius: 27px; display: flex; align-items: center; font-weight: 900; font-size: 30px; letter-spacing: 0.5px; white-space: nowrap; }
.pill-live { background: var(--red); color: #fff; padding: 0 26px 0 20px; box-shadow: 0 0 18px 3px rgba(230,46,60,0.55); }
.pill-live .dot { width: 16px; height: 16px; border-radius: 50%; background: #fff; margin-right: 12px; animation: pulse var(--pulse) ease-in-out infinite; }
#live_text { animation: blink var(--pulse) ease-in-out infinite; }
.pill-tag { background: rgba(20,14,30,0.82); border: 2px solid var(--gold); color: var(--gold); padding: 0 22px; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.8); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ---------- title ---------- */
#title { left: 56px; top: 112px; }
#title h1 { font-family: "Cormorant", serif; font-weight: 700; font-size: 78px; line-height: 1; letter-spacing: 1px; white-space: nowrap;
  color: var(--cream); text-shadow: 3px 3px 0 rgba(0,0,0,0.55), 0 0 22px rgba(0,0,0,0.35); }
.title-sparkles { position: relative; display: inline-block; width: 44px; height: 60px; vertical-align: top; }
.title-sparkles svg { position: absolute; fill: var(--gold); filter: drop-shadow(0 0 4px rgba(246,214,140,0.7)); animation: twinkle 3.2s ease-in-out infinite; }
.title-sparkles .s1 { width: 26px; height: 26px; left: 10px; top: 4px; }
.title-sparkles .s2 { width: 14px; height: 14px; left: 32px; top: 34px; fill: var(--cream); animation-delay: 1.4s; }
#subtitle_text { margin-top: 10px; margin-left: 4px; font-size: 26px; font-weight: 600; letter-spacing: 0.3px; color: var(--gold); white-space: nowrap;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.55), 0 0 10px rgba(0,0,0,0.4); }

/* ---------- clock (cycles through cities, in step with the message) ---------- */
#clock { right: 56px; top: 50px; height: 54px; min-width: 260px; border-radius: 27px; }
#clock .content { display: flex; align-items: center; gap: 16px; padding: 0 28px 0 24px; }
.clock-sym { width: 24px; height: 24px; flex: none; color: var(--gold); }
.clock-label { font-size: 26px; font-weight: 600; letter-spacing: 0.4px; white-space: nowrap; transition: opacity 0.5s ease; }
.clock-label.fading { opacity: 0; }
#clock_time { font-variant-numeric: tabular-nums; }
#clock_city { margin-left: 12px; color: var(--gold); }

/* ---------- rotating message (top-right, under the clock) ---------- */
#message { right: 56px; top: 122px; width: 600px; }
.msg { position: relative; width: 100%; border-radius: 20px; }
.msg .content { display: flex; align-items: center; gap: 14px; padding: 13px 24px 17px 18px; min-height: 64px; }
.msg .chat { width: 28px; height: 28px; flex: none; color: var(--gold); }
#msg_text { font-size: 22px; font-weight: 700; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- now playing ---------- */
#now_playing { left: 56px; top: 884px; width: 640px; height: 140px; }
#now_playing .content > * { position: absolute; }
.disc { left: 22px; top: 24px; width: 88px; height: 88px; border-radius: 50%; background: #342446; border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 14px rgba(246,214,140,0.25); }
.disc svg { width: 46px; height: 46px; color: var(--gold); margin-left: -2px; }
.np-label { left: 134px; top: 22px; font-size: 20px; font-weight: 800; letter-spacing: 1px; color: var(--gold); text-transform: uppercase; }
.np-title { left: 134px; top: 50px; width: 336px; font-size: 32px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eq { left: 488px; top: 26px; height: 44px; display: flex; align-items: center; gap: 7px; }
.eq i { display: block; width: 9px; border-radius: 4px; background: var(--gold); transform-origin: center; animation: eq 1.1s ease-in-out infinite alternate; }
.eq i:nth-child(1) { height: 18px; animation-duration: 0.9s; }
.eq i:nth-child(2) { height: 34px; animation-duration: 1.2s; animation-delay: -0.3s; }
.eq i:nth-child(3) { height: 24px; animation-duration: 0.8s; animation-delay: -0.6s; }
.eq i:nth-child(4) { height: 40px; animation-duration: 1.3s; animation-delay: -0.2s; }
.eq i:nth-child(5) { height: 14px; animation-duration: 0.95s; animation-delay: -0.5s; }
.eq i:nth-child(6) { height: 30px; animation-duration: 1.15s; animation-delay: -0.8s; }
.eq i:nth-child(7) { height: 22px; animation-duration: 1.0s; animation-delay: -0.4s; }
@keyframes eq { 0% { transform: scaleY(0.35); } 100% { transform: scaleY(1); } }
.progress { left: 134px; top: 104px; width: 470px; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.27); }
.progress .fill { position: relative; height: 100%; width: 0; border-radius: 4px; background: var(--gold); transition: width 1s linear; }
.progress .knob { position: absolute; right: -9px; top: -5px; width: 18px; height: 18px; border-radius: 50%; background: var(--cream); box-shadow: 0 0 6px rgba(0,0,0,0.4); }

/* ---------- badge drop (rotating) ---------- */
#badge_drop { right: 56px; top: 914px; height: 110px; width: fit-content; min-width: 540px; max-width: 760px; }
#badge_drop .content { padding: 18px 30px 0 118px; }
.medal { position: absolute; left: 24px; top: 17px; width: 72px; height: 72px; border-radius: 50%; background: #78461e; border: 3px solid var(--gold);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 14px rgba(246,214,140,0.3); }
.medal .ring { position: absolute; inset: 7px; border-radius: 50%; border: 2px solid rgba(246,214,140,0.78); }
.medal svg { width: 36px; height: 36px; fill: var(--gold); animation: twinkle 4s ease-in-out infinite; }
.bd-label { font-size: 20px; font-weight: 800; letter-spacing: 1px; color: var(--gold); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-text { margin-top: 4px; font-size: 26px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#badge_drop .timer { left: 118px; right: 30px; bottom: 12px; }

/* ---------- sparkles ---------- */
#sparkles { inset: 0; pointer-events: none; }
#sparkles svg { position: absolute; fill: #FFF0C8; filter: drop-shadow(0 0 5px rgba(246,214,140,0.8)); animation: twinkle 4s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0.85; transform: scale(1); } 50% { opacity: 0.25; transform: scale(0.6); } }

.nokey { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 18px 26px; border-radius: 16px;
  background: rgba(20,14,30,0.85); border: 2px solid var(--border); color: var(--cream); font: 600 18px "Nunito", sans-serif; z-index: 10; }
