:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #080a0e;
  color: #f7f7f8;
  --cyan: #22e6cf;
  --pink: #ff365f;
  --panel: #11141a;
  --muted: #9299a6;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: #080a0e; }
button, input { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.live-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) 390px; overflow: hidden; }
.stage { position: relative; min-width: 0; height: 100vh; overflow: hidden; background: #020304; }
.minecraft-stream { width: 100%; height: 100%; border: 0; background: #000; }
.stage-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(2,3,6,.58), transparent 22%, transparent 64%, rgba(2,3,6,.8)); }

.live-header { position: absolute; z-index: 3; top: max(22px, env(safe-area-inset-top)); left: 24px; display: flex; align-items: center; gap: 11px; filter: drop-shadow(0 2px 8px #000); }
.avatar, .speech-avatar { display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: linear-gradient(145deg, #f4d8ff, #8769ff 54%, #332070); color: #fff; font-weight: 900; }
.avatar { width: 45px; height: 45px; border: 2px solid #fff; font-size: 20px; }
.channel-line { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.live-pill { padding: 3px 6px; border-radius: 4px; background: var(--pink); font-size: 10px; letter-spacing: .08em; }
.viewer-count { display: flex; align-items: center; gap: 5px; margin-top: 4px; color: #e0e2e7; font-size: 12px; }
.online-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.settings-link { display: grid; place-items: center; width: 36px; height: 36px; margin-left: 4px; border: 1px solid #ffffff3d; border-radius: 50%; background: #090b10a6; color: #fff; text-decoration: none; }

.minecraft-status { position: absolute; z-index: 3; top: 25px; right: 24px; display: flex; align-items: center; gap: 12px; max-width: 54%; padding: 9px 12px; border: 1px solid #ffffff20; border-radius: 12px; background: #080a0eb3; backdrop-filter: blur(12px); font-size: 12px; }
.minecraft-status span:first-child { color: #ff6a7d; }
.minecraft-status span:nth-child(2) { color: #ffc35a; }
.minecraft-status .activity { overflow: hidden; color: #d7dbe2; text-overflow: ellipsis; white-space: nowrap; }

.speech-card { position: absolute; z-index: 4; left: 24px; bottom: 42px; display: flex; gap: 10px; width: min(580px, calc(100% - 48px)); padding: 12px 16px 13px 12px; border: 1px solid #ffffff26; border-radius: 16px; background: #090b10d9; box-shadow: 0 16px 50px #0009; backdrop-filter: blur(16px); animation: rise .25s ease-out; }
.speech-avatar { width: 34px; height: 34px; font-size: 14px; }
.speech-card small { color: var(--cyan); font-weight: 800; }
.speech-card p { margin: 3px 0 0; line-height: 1.45; }
.sound-button { position: absolute; z-index: 5; right: 24px; bottom: 42px; padding: 11px 16px; border: 1px solid #ffffff38; border-radius: 999px; background: #080a0ed9; cursor: pointer; box-shadow: 0 8px 24px #0008; }
.sound-button.enabled { border-color: #22e6cf73; color: var(--cyan); }
.mobile-chat { display: none; }

.chat-panel { height: 100vh; display: flex; flex-direction: column; border-left: 1px solid #ffffff12; background: var(--panel); }
.chat-heading { display: flex; align-items: center; justify-content: space-between; padding: 23px 22px 17px; border-bottom: 1px solid #ffffff10; }
.eyebrow { color: var(--pink); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.chat-heading h1 { margin: 4px 0 0; font-size: 20px; }
.brain-state { color: #aeb4bf; font-size: 11px; }
.brain-state i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.chat-notice { margin: 13px 16px 0; padding: 10px 12px; border: 1px solid #ffffff0f; border-radius: 10px; background: #ffffff07; color: #8f97a4; font-size: 11px; line-height: 1.45; }
.comments { flex: 1; overflow-y: auto; padding: 14px 18px; scrollbar-width: thin; }
.comment { display: flex; gap: 9px; padding: 8px 0; animation: rise .18s ease-out; }
.comment-avatar { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 auto; border-radius: 50%; background: #252a34; color: #bdc3ce; font-size: 11px; font-weight: 800; }
.comment-body { min-width: 0; font-size: 13px; line-height: 1.42; }
.comment-name { margin-right: 5px; color: #9da5b2; font-weight: 700; }
.comment.yue { margin: 5px 0; padding: 10px; border: 1px solid #22e6cf22; border-radius: 12px; background: #22e6cf0a; }
.comment.yue .comment-avatar { background: linear-gradient(145deg, #a582ff, #4e38a7); color: #fff; }
.comment.yue .comment-name { color: var(--cyan); }
.score { margin-left: 5px; color: #59616e; font-size: 10px; }
.director-badge { margin-left: 6px; padding: 2px 5px; border-radius: 4px; background: #ff365f20; color: #ff6683; font-size: 9px; font-weight: 900; }

.director-panel { margin: 0 16px 10px; border: 1px solid #ff365f2e; border-radius: 12px; background: #ff365f08; }
.director-panel summary { padding: 10px 12px; color: #ff6a86; font-size: 11px; font-weight: 800; cursor: pointer; }
.director-panel form { padding: 0 12px 12px; }
.director-panel label { display: block; margin-top: 8px; color: #868e9a; font-size: 10px; }
.director-panel label span { color: #59616e; }
.director-panel input, .director-panel textarea { width: 100%; margin-top: 5px; padding: 8px 9px; border: 1px solid #ffffff13; border-radius: 8px; outline: 0; background: #090b10; color: #eef0f3; font-size: 11px; }
.director-panel textarea { min-height: 55px; resize: vertical; }
.director-panel input:focus, .director-panel textarea:focus { border-color: #ff365f55; }
.director-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.director-action { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.director-action small { color: #68717e; font-size: 9px; }
.director-action button { padding: 7px 9px; border: 0; border-radius: 7px; background: #ff365f; font-size: 10px; font-weight: 800; cursor: pointer; }

.comment-form { padding: 13px 16px max(18px, env(safe-area-inset-bottom)); border-top: 1px solid #ffffff12; background: #0d1015; }
.viewer-field { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 9px; color: #747d8a; font-size: 10px; }
.viewer-field input { width: 115px; border: 0; border-bottom: 1px solid #ffffff20; outline: 0; background: transparent; color: #cbd0d8; text-align: right; }
.comment-row { display: flex; gap: 8px; }
.comment-row input { min-width: 0; flex: 1; padding: 12px 13px; border: 1px solid #ffffff16; border-radius: 999px; outline: 0; background: #181c23; }
.comment-row input:focus { border-color: #22e6cf55; }
.comment-row button { width: 43px; border: 0; border-radius: 50%; background: linear-gradient(145deg, var(--pink), #e423b6); cursor: pointer; }
.quick-comments { display: flex; gap: 6px; margin-top: 9px; overflow-x: auto; }
.quick-comments button { flex: 0 0 auto; padding: 6px 9px; border: 1px solid #ffffff14; border-radius: 999px; background: transparent; color: #838b98; font-size: 10px; cursor: pointer; }

@keyframes rise { from { opacity: 0; transform: translateY(7px); } }

@media (max-width: 900px) {
  .live-shell { display: block; }
  .stage { height: 100svh; }
  .minecraft-stream { position: absolute; left: 50%; width: max(100vw, calc(100svh * 1.7778)); transform: translateX(-50%); }
  .chat-panel { position: absolute; inset: auto 0 0; height: auto; border: 0; background: transparent; pointer-events: none; }
  .chat-heading, .chat-notice, .comments, .viewer-field { display: none; }
  .director-panel { display: none; }
  .comment-form { pointer-events: auto; padding: 10px 12px max(12px, env(safe-area-inset-bottom)); border: 0; background: linear-gradient(transparent, #050609d9 26%); }
  .comment-row { margin-top: 25px; }
  .comment-row input { background: #10131ab8; backdrop-filter: blur(12px); }
  .quick-comments { display: none; }
  .minecraft-status { top: 82px; right: 12px; max-width: calc(100% - 24px); }
  .minecraft-status .activity { display: none; }
  .live-header { left: 12px; }
  .speech-card { left: 12px; bottom: 126px; width: calc(100% - 24px); }
  .sound-button { right: 12px; bottom: 86px; padding: 8px 12px; font-size: 12px; }
  .mobile-chat { position: absolute; z-index: 3; left: 12px; bottom: 194px; display: block; width: min(78%, 420px); max-height: 27vh; overflow: hidden; mask-image: linear-gradient(transparent, #000 28%); }
  .mobile-chat .comment { text-shadow: 0 1px 4px #000; }
}
