/* Full-screen worlds with the page floating on top. Layout and colour per world live here. */
:root { --ink: #eef3ff; --mute: #d6def5c9; --accent: #8fa8ff; --glass: #0c122e8c; --edge: #ffffff24; --serif: "Songti TC", "Noto Serif TC", serif; --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang HK", "Noto Sans TC", sans-serif; --world-bg: #05081a; --shadow: 0 2px 12px #000a; }
:root[data-theme="sakura-night"] { --ink: #fbeff4; --mute: #fbeff4c9; --accent: #ffb7d0; --glass: #1a0d2680; --world-bg: #0c0718; }
:root[data-theme="sea-glass"] { --ink: #f6fffd; --mute: #f6fffde6; --accent: #fff3b0; --glass: #03303c73; --edge: #ffffff55; --world-bg: #2f9db4; --shadow: 0 1px 3px #02303ccc, 0 2px 18px #02303c99; }
:root[data-theme="office"] { --ink: #f4f8ff; --mute: #f4f8ffcf; --accent: #ffc23f; --glass: #0a111d99; --world-bg: #05070f; }

html, body { height: 100%; overflow: hidden; }
body { margin: 0; background: var(--world-bg); color: var(--ink); font-family: var(--sans); }
body::before, body::after { display: none; }

.world-stage { position: fixed; inset: 0; z-index: 0; background: var(--world-bg); }
.world-stage .sigh-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.world-stage.world-loading::after { content: "唉"; position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); font: 500 clamp(80px, 16vh, 150px)/1 var(--serif); color: var(--ink); opacity: .5; animation: world-breathe 1.6s ease-in-out infinite; }
@keyframes world-breathe { 50% { opacity: .16; transform: translate(-50%, -50%) scale(.94); } }

/* The whole screen is the button, so a click can be aimed at anything in the world. */
button.sigh-button { position: fixed; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: transparent; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; transform: none; animation: none; outline: 0; }
button.sigh-button::before, button.sigh-button::after { display: none; }
button.sigh-button:hover, button.sigh-button:active, button.sigh-button.pressed { background: transparent; box-shadow: none; transform: none; }
button.sigh-button:disabled { cursor: progress; opacity: 1; }
button.sigh-button:focus-visible { outline: 3px solid var(--accent); outline-offset: -8px; }
:root[data-theme="office"] button.sigh-button { cursor: crosshair; }
.sigh-character, .button-caption { display: none; }

/* Graphics unavailable or paused: a plain, friendly button keeps counting. */
.world-stage[data-motion-state="fallback"] ~ button.sigh-button .sigh-character,
.motion-paused button.sigh-button .sigh-character { display: grid; place-items: center; position: absolute; left: 50%; top: 50%; width: min(46vmin, 240px); height: min(46vmin, 240px); transform: translate(-50%, -50%); border: 1px solid var(--edge); border-radius: 50%; background: var(--glass); color: var(--ink); font: 500 clamp(80px, 18vmin, 130px)/1 var(--serif); }

.preview-banner { position: fixed; inset: 0 0 auto; z-index: 4; display: block; padding: 4px 12px; background: #000a; color: #fff; font-size: 11px; text-align: center; text-decoration: none; }
body.preview .shell { padding-top: 22px; }
.world-overlay { position: fixed; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
#worries, #tags, #pops { position: absolute; inset: 0; overflow: hidden; }

.shell { position: fixed; inset: 0; z-index: 3; display: flex; flex-direction: column; width: auto; max-width: none; margin: 0; padding: 0 max(clamp(16px, 3.4vw, 48px), env(safe-area-inset-right, 0px)) 0 max(clamp(16px, 3.4vw, 48px), env(safe-area-inset-left, 0px)); pointer-events: none; color: var(--ink); text-shadow: var(--shadow); }
.shell a, .shell button, .shell input, .shell select { pointer-events: auto; }
.shell .topbar { flex: none; display: flex; align-items: center; justify-content: space-between; height: auto; min-height: 0; padding: clamp(12px, 2vw, 22px) 0 8px; border: 0; }
.wordmark { color: var(--ink); text-decoration: none; }
.brand-mark, .brand-name, .brand-name small { color: inherit; }
.brand-name small { color: var(--mute); }
.connection { color: var(--mute); }
.icon-button { color: var(--ink); background: var(--glass); border-color: var(--edge); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.theme-switcher { flex: none; align-self: center; margin: 0; padding: 3px; background: var(--glass); border: 1px solid var(--edge); border-radius: 999px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.theme-switcher a { color: var(--mute); text-shadow: none; }
.theme-switcher a[aria-current="page"] { color: var(--ink); background: #ffffff24; }

main { flex: 1 1 auto; position: relative; min-height: 0; }
.hero { position: absolute; inset: 0; display: block; padding: 0; margin: 0; }
.pull { display: inline-block; transform-origin: center; }
.intro { position: absolute; left: 0; top: 50%; width: auto; max-width: 46vw; transform: translateY(-50%); }
.intro > .eyebrow { display: inline-block; margin: 0 0 12px; color: var(--mute); font-size: 13px; letter-spacing: .1em; }
.tiny-line { display: none; }
#hero-title { margin: 0; color: var(--ink); font: 500 clamp(40px, 5.8vw, 72px)/1.3 var(--serif); letter-spacing: 0; }
#hero-title span, #hero-title em { color: inherit; font-style: normal; }
#hero-title em { color: var(--accent); }
:root[data-theme="office"] #hero-title { font: 800 clamp(34px, 4.8vw, 60px)/1.24 var(--sans); }
.intro-copy { display: block; margin: 14px 0 18px; color: var(--mute); font-size: 15px; line-height: 1.8; }
.countdown-card { display: inline-block; width: auto; min-width: 0; margin: 0; padding: 12px 16px; background: var(--glass); border: 1px solid var(--edge); border-radius: 14px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: none; }
.countdown-top { gap: 18px; color: var(--mute); font-size: 12px; white-space: nowrap; }
.countdown-top .text-button { color: var(--mute); }
.countdown { color: var(--ink); gap: 6px; font-size: 26px; font-weight: 300; }
.countdown > span { font-size: inherit; }
.countdown small { color: var(--mute); }
.countdown b { color: var(--mute); }
.countdown-hundredths { display: none; font-size: .68em; font-variant-numeric: tabular-nums; color: var(--accent); }
.time-dilated .countdown-hundredths { display: inline; }
#countdown-note { margin: 6px 0 0; color: var(--mute); font-size: 12px; }
:root[data-theme="sea-glass"] .intro, :root[data-theme="office"] .intro { top: 8%; transform: none; }
:root[data-theme="sakura-night"] .intro { top: auto; bottom: 12%; transform: none; }

.sigh-stage { position: static; display: block; padding: 0; border: 0; background: none; box-shadow: none; }
.sigh-stage::before, .sigh-stage::after { display: none; }
.tally { position: absolute; top: 0; right: 0; text-align: right; }
.collective-label { display: block; margin: 0; color: var(--mute); font-size: 13px; letter-spacing: .06em; }
.spark { display: none; }
.daily-total { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; margin: 2px 0 0; padding: 0; border: 0; color: var(--ink); }
.daily-total > span:first-child { color: var(--ink); font: 300 clamp(38px, 6.2vh, 60px)/1.1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.daily-total .unit { color: var(--mute); font-size: 14px; }
.prompt { position: absolute; right: 0; bottom: 10px; max-width: 52vw; text-align: right; }
.click-hint, .charge-status, .sync-note { margin: 0; color: var(--mute); font-size: 14px; line-height: 1.5; }
.click-hint { padding: 4px 12px; background: var(--glass); border-radius: 999px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); text-shadow: none; }
.charge-status:empty, .sync-note:empty { display: none; }
.charge-status.charging { color: var(--accent); font-size: 22px; font-weight: 600; }
.sync-note { color: var(--ink); font-size: 13px; }

.shell footer { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; padding: 8px 0 max(14px, env(safe-area-inset-bottom, 0px)); border: 0; color: var(--mute); font-size: 12px; }
.shell footer > * { pointer-events: auto; }
.player-chip, .metrics-button { color: var(--ink); background: var(--glass); border: 1px solid var(--edge); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); text-shadow: none; box-shadow: none; }
.player-chip small { color: var(--mute); }
.footer-tools { display: flex; gap: 8px; margin: 0; }
#date-label { margin-left: auto; pointer-events: none; }
.footer-mark { display: none; }

/* Overlays created by the worlds. */
.worry { position: absolute; left: 0; top: 0; color: #dfe7ff; font-size: 15px; font-weight: 500; letter-spacing: .04em; text-shadow: 0 0 10px #000, 0 0 3px #000; white-space: nowrap; will-change: transform, opacity; }
:root[data-theme="sea-glass"] .worry { color: #fff; font-weight: 600; text-shadow: 0 1px 4px #063c49, 0 0 10px #063c49; }
.tag { position: absolute; left: 0; top: 0; padding: 7px 5px 9px; color: #3a1426; background: #f6ead8; box-shadow: 0 3px 8px #0009; font: 600 13px/1 var(--serif); letter-spacing: .08em; writing-mode: vertical-rl; transform-origin: 50% -14px; will-change: transform, opacity; }
.tag::before { content: ""; position: absolute; left: 50%; top: -14px; width: 1px; height: 14px; background: #f6ead8aa; }
.pop { position: absolute; color: #fff; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; text-shadow: 0 1px 8px #0a5262; }
.pop.big { font-size: 48px; font-weight: 400; text-shadow: 0 2px 16px #0a5262; }
:root[data-theme="sakura-night"] .pop { color: #ffe6ef; font: 500 22px/1 var(--serif); text-shadow: 0 0 14px #ff7fae; }
:root[data-theme="sakura-night"] .pop.big { font-size: 46px; text-shadow: 0 0 24px #ff7fae, 0 0 8px #fff; }
.pow { position: absolute; padding: 34px 42px; color: #18120a; background: #ffd23f; clip-path: polygon(50% 0, 60% 16%, 80% 4%, 80% 24%, 100% 26%, 88% 44%, 100% 62%, 80% 66%, 82% 90%, 62% 80%, 50% 100%, 38% 80%, 18% 90%, 20% 66%, 0 62%, 12% 44%, 0 26%, 20% 24%, 20% 4%, 40% 16%); font: 900 34px/1 var(--sans); white-space: nowrap; }
.pow.big { padding: 50px 62px; color: #fff; background: #e2362b; font-size: 58px; }
#combo { position: absolute; left: 50%; top: 74%; opacity: 0; color: var(--accent); font: 800 19px/1 var(--sans); letter-spacing: .08em; text-shadow: 0 2px 8px #000; white-space: nowrap; }
:root[data-theme="sea-glass"] #combo { color: #fff; text-shadow: 0 1px 8px #0a5262; }
#bubble { position: absolute; left: 0; top: 0; opacity: 0; padding: 9px 15px; color: #171a22; background: #fff; border-radius: 16px; box-shadow: 0 6px 18px #0007; font: 800 19px/1.1 var(--sans); white-space: nowrap; transition: opacity .16s; }
#bubble::after { content: ""; position: absolute; left: 50%; bottom: -9px; margin-left: -9px; border: 9px solid transparent; border-bottom: 0; border-top-color: #fff; }
#burst { position: absolute; left: 50%; top: 50%; opacity: 0; color: #fff; font: 300 clamp(72px, 15vh, 150px)/1 var(--sans); font-variant-numeric: tabular-nums; text-shadow: 0 0 40px #8fa8ff, 0 0 12px #fff; }
:root[data-theme="sakura-night"] #burst { color: #fff4f8; font: 400 clamp(72px, 15vh, 150px)/1 var(--serif); text-shadow: 0 0 40px #ff7fae, 0 0 12px #fff; }
:root[data-theme="sea-glass"] #burst { color: #eafffb; text-shadow: 0 0 34px #2fd2d6, 0 0 10px #fff; }
:root[data-theme="office"] #burst { font-weight: 900; text-shadow: 0 0 34px #ff7a2a, 0 4px 0 #b3320c; }

@media (max-aspect-ratio: 105/100) {
  .connection, .brand-name small, .intro > .eyebrow, .intro-copy, #countdown-note, #date-label { display: none; }
  .theme-switcher { margin-top: 2px; }
  .intro, :root[data-theme="sea-glass"] .intro, :root[data-theme="office"] .intro, :root[data-theme="sakura-night"] .intro { top: 6px; bottom: auto; max-width: 64vw; transform: none; }
  #hero-title, :root[data-theme="office"] #hero-title { font-size: 24px; line-height: 1.3; }
  #hero-title br { display: none; }
  .countdown-card { margin-top: 8px; padding: 7px 11px; }
  .countdown-top { gap: 8px; font-size: 11px; }
  .countdown { font-size: 18px; }
  .tally { top: 8px; }
  .collective-label { font-size: 11px; }
  .daily-total > span:first-child { font-size: 30px; }
  .daily-total .unit { display: none; }
  .prompt { right: 0; left: 0; bottom: 6px; max-width: none; text-align: center; }
  .click-hint { font-size: 12px; }
  .charge-status { font-size: 12px; }
  .shell footer { flex-wrap: nowrap; justify-content: space-between; }
  .footer-tools { flex: none; }
  .tag { padding: 5px 4px 7px; font-size: 11px; }
  .pow { padding: 26px 32px; font-size: 24px; }
  .pow.big { padding: 38px 46px; font-size: 40px; }
}
