:root { --k: 1; --cyan: #3ef0ff; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: #e9fbff; font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif; overflow: hidden; -webkit-tap-highlight-color: transparent; }
#stage { position: fixed; inset: 0; }
#sphere {
  position: absolute; left: 50%; top: 50%; width: 800px; height: 800px;
  transform: translate(-50%, -50%) scale(var(--k));
  border-radius: 50%; overflow: hidden; background: #000; cursor: pointer;
  box-shadow: 0 0 0 2px #0b0f12, 0 0 0 10px #050607, 0 0 60px rgba(0,0,0,.9);
  isolation: isolate; user-select: none;
}
body.kiosk #sphere { box-shadow: none; }
#sphere::after { /* subtle glass edge */
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; z-index: 20;
  box-shadow: inset 0 0 40px rgba(0,0,0,.85), inset 0 0 2px rgba(255,255,255,.08);
}
.glow { position: absolute; inset: 0; border-radius: 50%; opacity: 0; transition: opacity 1.2s ease;
  background: radial-gradient(circle at 50% 50%, rgba(40,110,255,.55) 0%, rgba(30,80,220,.28) 32%, rgba(10,30,90,.12) 55%, rgba(0,0,0,0) 72%);
  animation: breathe 5s ease-in-out infinite; }
#sphere.asleep .glow { opacity: 1; }
@keyframes breathe { 0%,100% { transform: scale(.92); filter: brightness(.8); } 50% { transform: scale(1.04); filter: brightness(1.15); } }
#eyes, #clock { position: absolute; inset: 0; width: 800px; height: 800px; }
#eyes { transition: opacity .35s; z-index: 2; }
#sphere.panel-open #eyes { opacity: 0; }

.panel { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .45s ease; z-index: 3; }
.panel.show { opacity: 1; pointer-events: auto; }

#panel-weather { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: radial-gradient(circle at 50% 30%, #154b78 0%, #0a2340 55%, #030a14 100%); }
#panel-weather.night { background: radial-gradient(circle at 50% 30%, #1d2550 0%, #0b1030 55%, #02040e 100%); }
#panel-weather.wet { background: radial-gradient(circle at 50% 30%, #34495a 0%, #17232e 55%, #05090d 100%); }
.w-place { font-size: 34px; letter-spacing: 3px; text-transform: uppercase; color: var(--cyan); margin-top: -10px; }
.w-icon svg { display: block; margin: 0 auto; filter: drop-shadow(0 6px 18px rgba(0,0,0,.4)); }
.w-icon .sun { transform-origin: 100px 100px; animation: spin 30s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.w-temp { font-size: 150px; font-weight: 200; line-height: .95; }
.w-desc { font-size: 38px; text-transform: capitalize; opacity: .9; margin-top: 6px; }
.w-hilo { font-size: 34px; margin-top: 14px; opacity: .85; }
.w-hilo b { color: #ffb36b; font-weight: 500; } .w-hilo i { color: #7fd6ff; font-style: normal; font-weight: 500; }

#panel-video { background: #000; }
#yt-wrap { position: absolute; left: 50%; top: 50%; width: 1260px; height: 709px; transform: translate(-50%, -50%); }
#yt-wrap iframe, #yt { width: 100%; height: 100%; border: 0; pointer-events: none; }
.media-icon { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); width: 64px; height: 64px; border-radius: 50%;
  background: rgba(0,0,0,.55); z-index: 5; opacity: .85; display: flex; align-items: center; justify-content: center; }
.media-icon::before, .media-icon::after { content: ""; display: block; width: 9px; height: 26px; background: #fff; margin: 0 4px; border-radius: 2px; }
.media-icon.paused::before { width: 0; height: 0; background: none; border-left: 24px solid #fff; border-top: 15px solid transparent; border-bottom: 15px solid transparent; margin-left: 8px; border-radius: 0; }
.media-icon.paused::after { display: none; }

#panel-podcast { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: radial-gradient(circle at 50% 35%, #2a1c40 0%, #120b1e 60%, #040208 100%); }
#pod-art { width: 330px; height: 330px; border-radius: 28px; object-fit: cover; box-shadow: 0 18px 50px rgba(0,0,0,.6); margin-top: -40px; }
.pod-show { font-size: 30px; color: var(--cyan); margin-top: 26px; max-width: 560px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod-ep { font-size: 28px; opacity: .9; margin-top: 8px; max-width: 520px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#panel-podcast .media-icon { bottom: 40px; }
.ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring-bg { stroke: rgba(255,255,255,.08); }
.ring-fg { stroke: var(--cyan); stroke-linecap: round; stroke-dasharray: 2419; stroke-dashoffset: 2419; transition: stroke-dashoffset .9s linear; }

#panel-msg { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 140px;
  background: radial-gradient(circle at 50% 40%, #0d2733 0%, #03090d 75%); }
.msg-icon { font-size: 90px; margin-bottom: 20px; }
.msg { font-size: 40px; line-height: 1.3; }

#caption { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); width: 560px; text-align: center; z-index: 8;
  font-size: 30px; line-height: 1.3; color: #fff; text-shadow: 0 2px 8px #000, 0 0 2px #000; opacity: 0; transition: opacity .4s; pointer-events: none;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
#caption.show { opacity: .92; }
#caption.you { color: #9feeff; font-style: italic; }

#tap-hint { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 9; pointer-events: none; transition: opacity .5s; }
.tap-title { font-size: 56px; font-weight: 300; letter-spacing: 1px; }
.tap-sub { font-size: 32px; opacity: .75; margin-top: 12px; }
body.started #tap-hint { opacity: 0; }
#play-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 9; background: rgba(0,0,0,.7); padding: 24px 40px; border-radius: 40px; font-size: 40px; }

#toolbar { position: fixed; right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: center; z-index: 30; opacity: .55; transition: opacity .2s; }
#toolbar:hover, #toolbar:focus-within { opacity: 1; }
#toolbar button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid #234; background: #0b1218; color: #cfefff; font-size: 20px; cursor: pointer; }
#mic-dot { width: 12px; height: 12px; border-radius: 50%; background: #333; margin-right: 4px; }
#mic-dot.listening { background: #2ee66b; box-shadow: 0 0 8px #2ee66b; }
#mic-dot.paused { background: #e6c12e; }
#mic-dot.denied, #mic-dot.nomic, #mic-dot.network { background: #e64b2e; }
body.kiosk #toolbar { display: none; }

#typebox { position: fixed; left: 50%; bottom: max(64px, calc(env(safe-area-inset-bottom) + 60px)); transform: translateX(-50%); width: min(560px, 94vw); display: flex; gap: 8px; z-index: 31; }
#typebox[hidden] { display: none; }
#typebox input { flex: 1; font-size: 17px; padding: 12px 16px; border-radius: 24px; border: 1px solid #2a4552; background: #071017; color: #fff; outline: none; }
#typebox button { padding: 0 18px; border-radius: 24px; border: 0; background: var(--cyan); color: #00222a; font-weight: 600; font-size: 16px; }

#transcript { position: fixed; left: max(10px, env(safe-area-inset-left)); top: 10px; width: min(360px, 60vw); max-height: 45vh; overflow: auto; z-index: 29;
  background: rgba(6,14,20,.88); border: 1px solid #1d3442; border-radius: 12px; padding: 8px 12px; font-size: 14px; }
#transcript[hidden] { display: none; }
.t-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; color: var(--cyan); margin-bottom: 4px; }
.t-head button { background: none; border: 1px solid #2a4552; color: #9cc; border-radius: 8px; font-size: 12px; padding: 2px 8px; }
#t-list { list-style: none; margin: 0; padding: 0; }
#t-list li { padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
#t-list .who { font-weight: 600; margin-right: 4px; }
#t-list .you .who { color: #9feeff; } #t-list .sphere .who { color: #ffd6a0; } #t-list .sys { color: #789; font-size: 12px; }

dialog { background: #0b1419; color: #e9fbff; border: 1px solid #23414f; border-radius: 16px; width: min(420px, 92vw); padding: 20px 22px; }
dialog::backdrop { background: rgba(0,0,0,.75); }
dialog h2 { margin: 0 0 8px; font-weight: 500; color: var(--cyan); }
dialog label { display: block; margin: 12px 0; font-size: 15px; }
dialog label.row { display: flex; gap: 8px; align-items: center; }
dialog select, dialog input[type=text] { display: block; width: 100%; margin-top: 4px; padding: 9px; border-radius: 8px; border: 1px solid #2a4552; background: #050b0f; color: #fff; font-size: 15px; }
dialog input[type=range] { width: 100%; }
#passin { display: block; width: 100%; font-size: 34px; letter-spacing: 12px; text-align: center; padding: 10px; border-radius: 10px; border: 1px solid #2a4552; background: #050b0f; color: #fff; }
dialog button { padding: 10px 16px; border-radius: 10px; border: 0; background: var(--cyan); color: #00222a; font-weight: 600; font-size: 15px; cursor: pointer; }
dialog .btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
dialog .btns button[type=button] { background: #17303b; color: #cfefff; }
.err { color: #ff8a70; min-height: 1.2em; }
.small { font-size: 12px; color: #8ab; }
#sphere.panel-open #caption { opacity: 0 !important; }
