/* =========================================================
   《云学校》v2.0 — 二号教学楼的两间专属教室
   音乐教室（手风琴木 + 老式簧风琴）  千禧微机室（大屁股 CRT）
   依然是纯本地 CSS，没有任何外部资源、字体或图片引用。

   画就是界面：两间屋子的舞台都顶天立地铺满视口（`position: absolute; inset: 0`），
   手机上不再有上下两条死黑边；四角只剩几缕核桃墨的雾，
   左上角一枚朱砂印 + 校名 + 回走廊 + whisper，右上角一两枚 frosted 墨雾小圆。
   UI 的字号与间距都跟着 `--u`（= 视口宽度 / 100，夹在 5.2–12.8px）走。
   ========================================================= */

/* ---------------- 两间屋子共用的骨架 ---------------- */

.room {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  color: #fff6e6;
  font-family: var(--font-ui);
  background: #1e160f;
}

.room [hidden] {
  display: none !important;
}

/* 背景图在 cover 之外的余量上做一层虚化延展，画面永远不空 */
.room__backdrop {
  position: absolute;
  inset: -6%;
  z-index: 0;
  pointer-events: none;
  background-position: center;
  background-size: cover;
  filter: blur(30px) brightness(0.34) saturate(0.85);
  transform: scale(1.08);
}

/* 四角那几缕核桃墨的雾：只负责把字托起来，谁也不会看见一块「面板」 */
.room__haze {
  position: absolute;
  z-index: 4;
  width: 44vmin;
  height: 44vmin;
  pointer-events: none;
  opacity: 0.9;
}

.room__haze--tl {
  top: -8%;
  left: -8%;
  background: radial-gradient(circle at 22% 22%, rgba(30, 17, 8, 0.42), transparent 70%);
}

.room__haze--tr {
  top: -8%;
  right: -8%;
  background: radial-gradient(circle at 78% 22%, rgba(30, 17, 8, 0.38), transparent 70%);
}

.room__haze--bl {
  bottom: -8%;
  left: -8%;
  background: radial-gradient(circle at 18% 82%, rgba(30, 17, 8, 0.3), transparent 70%);
}

.room__haze--br {
  bottom: -8%;
  right: -8%;
  background: radial-gradient(circle at 82% 82%, rgba(30, 17, 8, 0.34), transparent 70%);
}

/* ---------------- 左上角：一枚朱砂印 + 校名 + 回走廊 + whisper ---------------- */

.room__brand {
  position: absolute;
  z-index: 9;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: calc(env(safe-area-inset-left, 0px) + 16px);
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  max-width: min(72vw, 460px);
  pointer-events: none;
  filter: drop-shadow(0 2px 10px rgba(18, 12, 8, 0.55));
}

.room__brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

/* 一枚歪着盖上去的朱砂小印：26×26，楷体一个「云」字 */
.room__seal {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  background: rgba(182, 52, 42, 0.9);
  color: #fbefe0;
  font-family: var(--font-hand);
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0;
  box-shadow:
    inset 0 0 0 1px rgba(255, 232, 212, 0.3),
    0 2px 8px rgba(24, 12, 6, 0.45);
  transform: rotate(-2.5deg);
}

.room__title {
  margin: 0;
  font-family: var(--font-hand);
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.2em;
  color: #fff9ec;
  text-shadow: 0 1px 3px rgba(30, 16, 8, 0.66), 0 0 12px rgba(30, 16, 8, 0.42);
  white-space: nowrap;
}

.room__exit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 244, 220, 0.24);
  background: rgba(32, 20, 11, 0.3);
  color: #fff6e6;
  font-family: var(--font-hand);
  font-size: 12px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: auto;
  backdrop-filter: blur(10px) saturate(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(1.05);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.room__exit:hover,
.room__exit:focus-visible {
  background: rgba(58, 40, 24, 0.56);
  border-color: rgba(255, 236, 200, 0.5);
  transform: translateX(-2px);
}

.room__exit-label {
  line-height: 1;
}

/* 所有墨线图标：跟着当前文字的颜色走，绝不自己上色 */
.room__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 0;
}

.room__icon .ui-svg,
.room .ui-svg {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
}

.room__icon {
  width: 15px;
  height: 15px;
}

.room__exit .room__icon {
  width: 14px;
  height: 14px;
  color: #ffe9bc;
}

/* 第二行：一句 whisper —— 没有药丸底、没有边框 */
.room__sub {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0.05em;
  color: rgba(255, 246, 228, 0.76);
  text-shadow: 0 1px 3px rgba(30, 16, 8, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room__sub.is-offline {
  color: rgba(255, 226, 178, 0.6);
}

/* ---------------- 右上角：一两枚 frosted 墨雾小圆 ---------------- */

.room__tools {
  position: absolute;
  z-index: 9;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  right: calc(env(safe-area-inset-right, 0px) + 16px);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(56vw, 320px);
  pointer-events: none;
}

.room__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 244, 220, 0.22);
  background: rgba(32, 20, 11, 0.28);
  color: #fff8ea;
  font-family: var(--font-hand);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  backdrop-filter: blur(10px) saturate(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(1.05);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 140ms ease;
}

.room__pill:hover,
.room__pill:focus-visible {
  background: rgba(58, 40, 24, 0.5);
  border-color: rgba(255, 236, 200, 0.44);
}

.room__pill:active {
  transform: translateY(1px) scale(0.98);
}

.room__pill .room__icon {
  width: 17px;
  height: 17px;
  color: #ffe9bc;
}

.room__pill.is-off {
  border-color: rgba(255, 214, 140, 0.5);
  background: rgba(64, 40, 20, 0.5);
  box-shadow: 0 0 14px rgba(255, 196, 112, 0.14) inset;
}

.room__pill.is-on {
  border-color: rgba(255, 226, 174, 0.46);
  color: #ffe9bc;
}

/* 声音那枚只留一个圆：标签留在 DOM 里给读屏，视觉上让位给图标 */
.room__pill--sound {
  width: 32px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}

.room__pill--sound .room__pill-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------------- 舞台：100% 铺满视口，边到边，没有圆角 ---------------- */

.room__main {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  padding: 0;
  display: block;
}

.room__stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  background: #1a130c;
  --u: 6px;
}

.room__scene {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 0;
}

.room__fx {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* ---------------- 同屋校友名牌条（绝不挡琴键） ---------------- */

.room__peers {
  position: absolute;
  left: 1.8%;
  top: calc(env(safe-area-inset-top, 0px) + 78px);
  z-index: 7;
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 0.42);
  max-width: 40%;
  pointer-events: none;
}

.room-peer {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--u) * 0.32);
  padding: calc(var(--u) * 0.24) calc(var(--u) * 0.6);
  border-radius: 999px;
  background: rgba(26, 18, 12, 0.46);
  border: 1px solid rgba(255, 238, 208, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(16, 10, 6, 0.32);
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
}

.room-peer__face {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: clamp(11px, calc(var(--u) * 1.15), 17px);
  height: clamp(11px, calc(var(--u) * 1.15), 17px);
  line-height: 0;
  color: rgba(255, 238, 206, 0.9);
}

.room-peer__name {
  font-size: clamp(9px, calc(var(--u) * 0.8), 14px);
  letter-spacing: 0.04em;
  color: #fff4e0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-peer__act {
  font-size: clamp(8px, calc(var(--u) * 0.72), 13px);
  color: rgba(255, 230, 190, 0.74);
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-peer__act::before {
  content: "· ";
  opacity: 0.6;
}

.room__toast {
  position: absolute;
  left: 50%;
  bottom: 30%;
  transform: translate(-50%, 8px);
  z-index: 9;
  max-width: 78%;
  padding: clamp(6px, 0.9vw, 10px) clamp(12px, 1.6vw, 20px);
  border-radius: 999px;
  background: rgba(28, 20, 13, 0.74);
  border: 1px solid rgba(255, 236, 202, 0.28);
  color: #fff6e4;
  font-size: clamp(10px, 1vw, 13px);
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-align: center;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.room__toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* =========================================================
   音乐教室
   ========================================================= */

.room--music .room__stage {
  background: #241a12;
}

.music__sun {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(38% 56% at 79% 20%, rgba(255, 236, 190, 0.3), rgba(255, 236, 190, 0) 72%),
    radial-gradient(50% 40% at 50% 96%, rgba(48, 28, 12, 0.34), rgba(48, 28, 12, 0) 70%);
  mix-blend-mode: screen;
}

/* 左侧三角铁热区：一圈阳光落在纸上的萤火，而不是一颗药丸 */
.music__triangle {
  position: absolute;
  left: 2.2%;
  top: 42%;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: calc(var(--u) * 0.34);
  min-height: 30px;
  padding: 0 calc(var(--u) * 0.7) 0 calc(var(--u) * 0.55);
  border-radius: 999px;
  background:
    radial-gradient(120% 180% at 22% 50%, rgba(255, 226, 168, 0.24), rgba(28, 20, 13, 0.34) 68%);
  border: 1px solid rgba(255, 226, 168, 0.3);
  color: #fff5e2;
  font-family: var(--font-hand);
  font-size: clamp(10px, calc(var(--u) * 0.8), 13px);
  letter-spacing: 0.05em;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(22, 13, 6, 0.34), 0 0 18px rgba(255, 214, 140, 0.14);
  transform-origin: 50% 20%;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.music__triangle:hover,
.music__triangle:focus-visible {
  border-color: rgba(255, 226, 168, 0.66);
  background:
    radial-gradient(120% 180% at 22% 50%, rgba(255, 232, 184, 0.36), rgba(56, 38, 22, 0.5) 70%);
  box-shadow: 0 4px 18px rgba(22, 13, 6, 0.4), 0 0 26px rgba(255, 214, 140, 0.26);
}

.music__triangle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: clamp(13px, calc(var(--u) * 1.25), 19px);
  height: clamp(13px, calc(var(--u) * 1.25), 19px);
  color: #ffe9bc;
  line-height: 1;
  transform-origin: 50% 12%;
}

.music__triangle-icon .ui-svg {
  width: 100%;
  height: 100%;
}

.music__triangle.is-ringing .music__triangle-icon {
  animation: triangle-ring 620ms ease-out;
}

@keyframes triangle-ring {
  0% { transform: rotate(0deg) scale(1); }
  12% { transform: rotate(-16deg) scale(1.14); }
  28% { transform: rotate(13deg) scale(1.08); }
  44% { transform: rotate(-9deg) scale(1.05); }
  62% { transform: rotate(6deg) scale(1.02); }
  82% { transform: rotate(-3deg) scale(1); }
  100% { transform: rotate(0deg) scale(1); }
}

.music__triangle-key {
  padding: 0 calc(var(--u) * 0.3);
  border-radius: calc(var(--u) * 0.26);
  border: 1px solid rgba(255, 238, 206, 0.34);
  font-size: clamp(8px, calc(var(--u) * 0.66), 11px);
  color: rgba(255, 240, 214, 0.8);
}

/* 窗边旧歌本 */
.music__songbook {
  position: absolute;
  right: 2.2%;
  top: calc(env(safe-area-inset-top, 0px) + 68px);
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: calc(var(--u) * 0.5);
  max-width: 62%;
}

/* 一张 frosted 米浆纸：不是按钮，是一页摊开在窗边的旧歌本 */
.music__songbook-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(252, 246, 230, 0.94), rgba(238, 227, 202, 0.94));
  border: 1px solid rgba(150, 118, 74, 0.42);
  color: #5a432a;
  font-family: var(--font-hand);
  font-size: clamp(10px, calc(var(--u) * 0.8), 13px);
  letter-spacing: 0.05em;
  white-space: nowrap;
  box-shadow:
    0 6px 18px rgba(22, 13, 6, 0.3),
    inset 0 1px 0 rgba(255, 255, 250, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 150ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.music__songbook-toggle:hover,
.music__songbook-toggle:focus-visible {
  border-color: rgba(150, 110, 62, 0.7);
  box-shadow:
    0 8px 22px rgba(22, 13, 6, 0.34),
    0 0 16px rgba(255, 226, 168, 0.3),
    inset 0 1px 0 rgba(255, 255, 250, 0.8);
}

.music__songbook-toggle:active {
  transform: translateY(1px) scale(0.99);
}

.music__songbook-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: rgba(96, 68, 36, 0.86);
  line-height: 0;
}

.music__songbook-icon .ui-svg {
  width: 100%;
  height: 100%;
}

.music__card {
  width: min(340px, 100%);
  padding: calc(var(--u) * 0.7);
  border-radius: calc(var(--u) * 0.7);
  background:
    linear-gradient(180deg, rgba(255, 251, 238, 0.97), rgba(242, 231, 206, 0.97));
  border: 1px solid rgba(158, 128, 88, 0.5);
  box-shadow: 0 14px 30px rgba(20, 12, 6, 0.4);
  color: #4a3a26;
  text-align: left;
  transform-origin: top right;
  animation: card-in 180ms ease-out;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(-6px) rotate(-1.2deg); }
  to { opacity: 1; transform: translateY(0) rotate(0deg); }
}

.music__card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-hand);
  font-size: clamp(12px, calc(var(--u) * 0.92), 16px);
  letter-spacing: 0.1em;
  color: #6a4f2f;
  padding-bottom: calc(var(--u) * 0.4);
  border-bottom: 1px dashed rgba(150, 118, 76, 0.45);
}

.music__card-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(20px, calc(var(--u) * 1.5), 26px);
  height: clamp(20px, calc(var(--u) * 1.5), 26px);
  padding: 0;
  border-radius: 50%;
  background: rgba(120, 92, 58, 0.16);
  color: #6a4f2f;
  line-height: 0;
}

.music__card-close .ui-svg {
  width: 13px;
  height: 13px;
}

.music__card-close:hover,
.music__card-close:focus-visible {
  background: rgba(120, 92, 58, 0.28);
}

.music__tabs {
  display: flex;
  gap: calc(var(--u) * 0.3);
  margin: calc(var(--u) * 0.5) 0 calc(var(--u) * 0.35);
  flex-wrap: wrap;
}

.music__tab {
  padding: calc(var(--u) * 0.2) calc(var(--u) * 0.62);
  border-radius: 999px;
  border: 1px solid rgba(150, 118, 76, 0.42);
  background: rgba(255, 255, 255, 0.4);
  color: #6a4f2f;
  font-size: clamp(9px, calc(var(--u) * 0.7), 12px);
  letter-spacing: 0.06em;
}

.music__tab.is-on {
  background: #c0623f;
  border-color: #a94e2e;
  color: #fff8ec;
}

.music__score {
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 0.2);
}

.music__score-title {
  margin: 0;
  font-family: var(--font-hand);
  font-size: clamp(12px, calc(var(--u) * 0.95), 17px);
  letter-spacing: 0.08em;
}

.music__score-line {
  margin: 0;
  font-family: var(--font-hand);
  font-size: clamp(13px, calc(var(--u) * 1.15), 22px);
  letter-spacing: 0.26em;
  color: #3f3323;
  white-space: nowrap;
  overflow-x: auto;
}

.music__score-caption {
  margin: calc(var(--u) * 0.2) 0 0;
  font-size: clamp(8px, calc(var(--u) * 0.66), 11px);
  color: rgba(96, 76, 50, 0.82);
  letter-spacing: 0.04em;
}

.music__card-foot {
  margin: calc(var(--u) * 0.42) 0 0;
  font-size: clamp(8px, calc(var(--u) * 0.62), 11px);
  color: rgba(120, 96, 64, 0.8);
}

/* ---------------- 老式簧风琴：手擦红木 + 深红毛毡 + 米白象牙键 + 黄铜踏板 ---------------- */

.organ {
  position: absolute;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom, 0px) + 10px);
  transform: translateX(-50%);
  width: min(94vw, 880px);
  height: clamp(168px, 26vh, 232px);
  z-index: 6;
  display: flex;
  flex-direction: column;
  padding: 7px 12px 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, #5e3a1e 0%, #432712 48%, #2c180a 100%);
  box-shadow:
    0 18px 40px rgba(18, 9, 3, 0.62),
    inset 0 1px 0 rgba(255, 222, 172, 0.36),
    inset 0 -2px 0 rgba(14, 7, 2, 0.7),
    inset 0 0 0 1px rgba(24, 12, 4, 0.55);
}

.organ__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 21px;
  padding: 0 1px 2px;
  font-size: clamp(8px, 1.05vw, 12px);
  letter-spacing: 0.08em;
  color: rgba(255, 228, 188, 0.84);
  text-shadow: 0 1px 2px rgba(30, 14, 2, 0.65);
}

/* 黄铜铭牌：刻上去的字，带一点被摸旧的暖光 */
.organ__brand {
  flex: 0 0 auto;
  padding: 1px 10px;
  border-radius: 3px;
  border: 1px solid rgba(196, 158, 96, 0.44);
  background: linear-gradient(180deg, rgba(74, 48, 22, 0.86), rgba(38, 22, 9, 0.9));
  font-family: var(--font-hand);
  font-size: clamp(9px, 1.08vw, 13px);
  letter-spacing: 0.16em;
  color: #f0d49a;
  text-shadow: 0 1px 0 rgba(56, 30, 8, 0.92), 0 0 8px rgba(255, 220, 150, 0.22);
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 178, 0.26),
    0 1px 2px rgba(0, 0, 0, 0.55);
}

.organ__tip {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255, 226, 186, 0.62);
}

/* 琴键顶上那道深红毛毡：1990 年代簧风琴最认得的一条边 */
.organ__felt {
  flex: 0 0 auto;
  height: 6px;
  margin: 3px 0;
  border-radius: 2px;
  background: linear-gradient(180deg, #5a1512, #8e2923 55%, #631814);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* 手机竖屏：`#music-keys` 至少 460px 宽，390px 的屏上每个白键 >= 46px；
   桌面 1280 宽时整排琴键刚好 100% 装下，一点也不用滑 */
.organ__manual {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  border-radius: 3px;
  background: linear-gradient(180deg, #2a180b, #140b04);
  box-shadow:
    inset 0 3px 7px rgba(0, 0, 0, 0.82),
    inset 0 -1px 0 rgba(255, 214, 160, 0.1);
}

.organ__manual::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.organ__keys {
  position: relative;
  flex: 1 1 auto;
  min-width: 460px;
  display: flex;
  border-radius: 3px;
  overflow: hidden;
  background: linear-gradient(180deg, #351f0c, #23140a);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7);
}

.organ__key {
  position: relative;
  padding: 0;
  font-family: var(--font-ui);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* 温润的旧象牙白键：一条 4px 的象牙唇，键与键之间是暖木色的阴影 */
.organ__key--white {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 3px;
  padding-bottom: 5px;
  border: 0;
  border-right: 1px solid rgba(96, 64, 30, 0.42);
  border-bottom: 4px solid #b89d72;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(180deg, #fcf6e8 0%, #f3e7ce 74%, #e2cfa8 94%, #c4ac82 100%);
  box-shadow:
    inset 0 -2px 4px rgba(120, 88, 46, 0.18),
    inset 1px 0 0 rgba(255, 255, 250, 0.72);
  transform-origin: top center;
  transition: transform 90ms ease, background 90ms ease, box-shadow 90ms ease;
}

.organ__key--white:last-of-type {
  border-right: 0;
}

/* 磨砂黑键：一道真 3D 的斜边，顶上一线暖反光，底下是 5px 的倒角 */
.organ__key--black {
  position: absolute;
  top: 0;
  width: 6%;
  height: 60%;
  padding: 0 0 6px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(180deg, #3d3128 0%, #211914 68%, #120d0a 100%);
  border-bottom: 5px solid #0b0806;
  box-shadow:
    0 3px 5px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 226, 180, 0.34),
    inset 1px 0 0 rgba(255, 236, 200, 0.14),
    inset -1px 0 0 rgba(0, 0, 0, 0.5);
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transform-origin: top center;
  transition: transform 90ms ease, box-shadow 90ms ease, filter 90ms ease;
}

.organ__key-hint {
  font-size: clamp(7px, calc(var(--u) * 0.52), 12px);
  letter-spacing: 0.04em;
  color: rgba(78, 56, 32, 0.6);
  line-height: 1;
}

.organ__key--black .organ__key-hint {
  color: rgba(255, 224, 182, 0.66);
}

.organ__key-jianpu {
  font-family: var(--font-hand);
  font-size: clamp(9px, calc(var(--u) * 0.78), 16px);
  line-height: 1;
  color: #4a3720;
}

.organ__key--white.is-down,
.organ__key--white.is-down-remote {
  transform: scaleY(0.94) translateY(1px);
  background: linear-gradient(180deg, #e8d9b7 0%, #d3bd93 70%, #bda88a 100%);
  box-shadow: inset 0 5px 9px rgba(96, 64, 26, 0.4);
}

.organ__key--black.is-down,
.organ__key--black.is-down-remote {
  transform: scaleY(0.92);
  filter: brightness(1.18);
  box-shadow: inset 0 -1px 2px rgba(255, 214, 160, 0.3);
}

.organ__key--white.is-down-remote {
  background: linear-gradient(180deg, #f2ead6 0%, #e2d6ba 70%, #cdbc99 100%);
}

/* 黄铜踏板：竖着一道道防滑纹 */
.organ__pedals {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  gap: 18px;
  height: 24%;
  min-height: 24px;
  align-items: flex-end;
  padding-top: 7px;
}

.organ__pedal {
  width: 26%;
  max-width: 150px;
  height: 100%;
  border-radius: 3px 3px 2px 2px;
  background:
    repeating-linear-gradient(90deg,
      rgba(255, 238, 180, 0.16) 0,
      rgba(255, 238, 180, 0.16) 2px,
      rgba(92, 64, 18, 0.26) 2px,
      rgba(92, 64, 18, 0.26) 4px),
    linear-gradient(180deg, #cfae62 0%, #a8863a 46%, #6f5216 100%);
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 240, 190, 0.6),
    inset 0 -2px 3px rgba(30, 18, 4, 0.62);
  transform-origin: top center;
  transition: transform 140ms ease, filter 140ms ease;
}

.organ__pedal.is-down {
  transform: perspective(60px) rotateX(16deg) translateY(2px);
  filter: brightness(1.14);
}

@media (prefers-reduced-motion: reduce) {
  .organ__key--white,
  .organ__key--black,
  .organ__pedal,
  .music__card {
    transition: none;
    animation: none;
  }

  .music__triangle.is-ringing .music__triangle-icon {
    animation: none;
    filter: brightness(1.25);
  }
}

/* =========================================================
   千禧微机室
   ========================================================= */

.room--computer .room__toast {
  bottom: 8%;
  max-width: 60%;
}

.computer__dim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(58% 62% at 50% 46%, rgba(6, 8, 14, 0.4), rgba(6, 8, 14, 0.1) 62%, rgba(6, 8, 14, 0) 80%);
}

/* 尺寸由 resizeStage() 按可见视口算好：min(92vw, (vh - 120px) * 1.18, 720px) */
.crt {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  z-index: 6;
}

.crt__bezel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 3.4% 3.6% 0;
  border-radius: 5% / 6%;
  background:
    linear-gradient(165deg, #efe7d2 0%, #ddd2b6 42%, #c8bb9c 78%, #b3a686 100%);
  box-shadow:
    0 16px 40px rgba(10, 8, 6, 0.55),
    inset 0 2px 0 rgba(255, 253, 244, 0.9),
    inset 0 -3px 8px rgba(120, 106, 78, 0.4);
}

.crt__glass {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 3.5% / 5%;
  background: #070a10;
  overflow: hidden;
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.9),
    inset 0 0 0 2px rgba(38, 32, 24, 0.85);
}

.crt__screen {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.crt__scan {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.045) 0px,
    rgba(255, 255, 255, 0.045) 1px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 3px
  );
  opacity: 0.55;
  mix-blend-mode: overlay;
}

.crt__glare {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(50% 42% at 26% 12%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 70%),
    radial-gradient(70% 80% at 96% 92%, rgba(140, 190, 255, 0.08), rgba(255, 255, 255, 0) 70%);
  border-radius: inherit;
}

.crt__degauss {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(120% 120% at 50% 50%,
      rgba(255, 60, 60, 0.42) 0%,
      rgba(255, 210, 60, 0.32) 26%,
      rgba(60, 255, 160, 0.28) 48%,
      rgba(60, 140, 255, 0.34) 70%,
      rgba(120, 60, 255, 0.24) 100%);
  mix-blend-mode: screen;
}

.crt__degauss.is-on {
  animation: degauss-warp 650ms cubic-bezier(0.3, 0.9, 0.2, 1) 1;
}

@keyframes degauss-warp {
  0% { opacity: 0; transform: scale(1); filter: blur(0); }
  12% { opacity: 0.95; transform: scale(1.05) skewX(1.4deg); filter: blur(1px); }
  38% { opacity: 0.7; transform: scale(0.94) skewX(-1deg); filter: blur(0.6px); }
  62% { opacity: 0.55; transform: scale(1.03); filter: blur(0.4px); }
  84% { opacity: 0.22; transform: scale(0.995); }
  100% { opacity: 0; transform: scale(1); filter: blur(0); }
}

.crt__glass.is-degaussing {
  animation: degauss-shudder 650ms cubic-bezier(0.3, 0.9, 0.2, 1) 1;
}

@keyframes degauss-shudder {
  0% { transform: translate(0, 0); filter: saturate(1); }
  18% { transform: translate(-0.5%, 0.4%); filter: saturate(1.6) hue-rotate(8deg); }
  40% { transform: translate(0.4%, -0.3%); filter: saturate(1.3) hue-rotate(-6deg); }
  64% { transform: translate(-0.2%, 0.2%); filter: saturate(1.15); }
  100% { transform: translate(0, 0); filter: saturate(1); }
}

/* 减弱动态时：只做一下柔和的色温闪动，绝不剧烈抖动 */
@keyframes degauss-soft {
  0% { opacity: 0; }
  35% { opacity: 0.32; }
  100% { opacity: 0; }
}

@keyframes degauss-soft-tint {
  0% { filter: saturate(1) brightness(1); }
  35% { filter: saturate(1.1) brightness(1.08) hue-rotate(6deg); }
  100% { filter: saturate(1) brightness(1); }
}

@media (prefers-reduced-motion: reduce) {
  .crt__degauss.is-on {
    animation: degauss-soft 650ms ease-out 1;
  }

  .crt__glass.is-degaussing {
    animation: degauss-soft-tint 650ms ease-out 1;
  }
}

.crt__chin {
  flex: 0 0 auto;
  height: 15%;
  min-height: 22px;
  display: flex;
  align-items: center;
  gap: 2.4%;
  padding: 0 1.2%;
}

.crt__led {
  flex: 0 0 auto;
  width: clamp(4px, 0.5%, 8px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #58e06a;
  box-shadow: 0 0 6px rgba(88, 224, 106, 0.9), 0 0 12px rgba(88, 224, 106, 0.5);
}

.crt__led.is-busy {
  animation: led-pulse 1.6s ease-in-out infinite;
}

@keyframes led-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(88, 224, 106, 0.9); }
  50% { opacity: 0.45; box-shadow: 0 0 3px rgba(88, 224, 106, 0.5); }
}

.crt__modes {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: 1.4%;
  align-items: center;
}

.crt__mode {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0.28em 0.4em;
  border-radius: 999px;
  border: 1px solid rgba(122, 104, 74, 0.4);
  background: rgba(255, 252, 242, 0.5);
  color: #5a4a32;
  font-size: clamp(7px, 0.62vw, 11px);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.crt__mode-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  line-height: 0;
  color: rgba(90, 74, 50, 0.86);
}

.crt__mode-icon .ui-svg {
  width: 100%;
  height: 100%;
}

.crt__mode-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crt__mode.is-on .crt__mode-icon {
  color: #eaf2ff;
}

.crt__mode:hover,
.crt__mode:focus-visible {
  border-color: rgba(150, 120, 70, 0.8);
}

.crt__mode.is-on {
  background: #3b4a6b;
  border-color: #2c3853;
  color: #f4f8ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.crt__degauss-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.28em 0.62em;
  border-radius: 999px;
  border: 1px solid rgba(150, 96, 60, 0.55);
  background: linear-gradient(180deg, #c0623f, #9c4526);
  color: #fff4e4;
  font-size: clamp(7px, 0.62vw, 11px);
  letter-spacing: 0.06em;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(70, 30, 10, 0.35);
}

.crt__degauss-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  line-height: 0;
  color: #ffe9c4;
}

.crt__degauss-icon .ui-svg {
  width: 100%;
  height: 100%;
}

.crt__degauss-label {
  line-height: 1;
}

.crt__degauss-btn:hover,
.crt__degauss-btn:focus-visible {
  filter: brightness(1.08);
}

.crt__overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.crt__hint {
  position: absolute;
  left: 2.4%;
  bottom: 2%;
  margin: 0;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  background: rgba(4, 8, 16, 0.55);
  color: rgba(206, 232, 255, 0.82);
  font-size: clamp(7px, 0.58vw, 11px);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 88%;
}

.crt__paint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 2%;
  padding: 2.2%;
  background: linear-gradient(180deg, #d9d6cc, #bdb9ad);
  pointer-events: auto;
}

.crt__paint-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.crt__palette {
  display: flex;
  gap: clamp(2px, 0.4%, 5px);
  flex-wrap: wrap;
}

.crt__swatch {
  width: clamp(10px, 2.4%, 20px);
  aspect-ratio: 1;
  border-radius: 3px;
  border: 1px solid rgba(60, 52, 40, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.crt__swatch.is-on {
  outline: 2px solid #c0623f;
  outline-offset: 1px;
}

.crt__paint-tools {
  display: flex;
  gap: 4px;
}

.crt__paint-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0.2em 0.5em;
  border-radius: 4px;
  border: 1px solid rgba(90, 78, 58, 0.5);
  background: linear-gradient(180deg, #f4f1e8, #d9d5c8);
  color: #4a4032;
  font-size: clamp(7px, 0.58vw, 11px);
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.crt__paint-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  line-height: 0;
  color: rgba(74, 64, 50, 0.9);
}

.crt__paint-icon .ui-svg {
  width: 100%;
  height: 100%;
}

.crt__paint-btn.is-on .crt__paint-icon {
  color: #fff6ea;
}

.crt__paint-btn.is-on {
  background: linear-gradient(180deg, #c0623f, #9c4526);
  border-color: #8a3d21;
  color: #fff6ea;
}

.crt__paint-canvas {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  background: #f4f0e4;
  border: 1px solid rgba(70, 62, 48, 0.6);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  cursor: crosshair;
  touch-action: none;
}

/* 右侧机械鼠标热区 */
.computer__mouse {
  position: absolute;
  right: max(12px, env(safe-area-inset-right, 0px) + 10px);
  bottom: max(10px, env(safe-area-inset-bottom, 0px) + 8px);
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  background: rgba(28, 20, 13, 0.42);
  border: 1px solid rgba(255, 238, 206, 0.24);
  color: #fff3df;
  font-family: var(--font-hand);
  font-size: clamp(10px, calc(var(--u) * 0.8), 13px);
  letter-spacing: 0.05em;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(14, 8, 3, 0.34);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.computer__mouse-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  line-height: 0;
  color: #ffe9bc;
}

.computer__mouse-icon .ui-svg {
  width: 100%;
  height: 100%;
}

.computer__mouse-label {
  line-height: 1;
}

.computer__mouse:hover,
.computer__mouse:focus-visible {
  border-color: rgba(255, 226, 168, 0.66);
  background: rgba(56, 38, 22, 0.6);
  transform: translateY(-1px);
}

/* ---------------- 窄屏微调（390×844 也不横向溢出） ---------------- */

@media (max-width: 720px) {
  .room__title {
    letter-spacing: 0.14em;
  }

  .room__sub {
    max-width: min(74vw, 320px);
    letter-spacing: 0.03em;
  }

  .room__peers {
    max-width: 46%;
  }

  .room-peer__act {
    display: none;
  }

  .organ__tip {
    display: none;
  }

  .music__card {
    width: min(260px, 100%);
  }

  .music__songbook {
    max-width: 76%;
  }

  /* 390px 的屏上：三角铁那行 whisper 让它窄一点，别把琴压住 */
  .music__triangle {
    top: 38%;
  }

  .crt__chin {
    height: 17%;
    min-height: 26px;
  }

  /* 微机室的提示条要避开右下角的鼠标热区 */
  .room--computer .room__toast {
    bottom: 12%;
    max-width: 84%;
  }

  .room__toast {
    bottom: 31%;
    max-width: 88%;
  }
}

@media (max-width: 420px) {
  .room__brand {
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    left: calc(env(safe-area-inset-left, 0px) + 10px);
    max-width: 66vw;
  }

  .room__tools {
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    right: calc(env(safe-area-inset-right, 0px) + 10px);
    max-width: 40vw;
  }

  .room__seal {
    width: 22px;
    height: 22px;
    font-size: 13px;
  }

  .room__title {
    font-size: 16px;
  }

  .room__exit {
    min-height: 24px;
    padding: 0 8px 0 6px;
    font-size: 11px;
  }

  .room__pill {
    min-height: 28px;
    padding: 0 9px;
    font-size: 11px;
  }

  .room__pill--sound {
    width: 28px;
    padding: 0;
  }

  .room__sub {
    font-size: 11px;
    max-width: min(70vw, 260px);
  }

  .music__score-line {
    letter-spacing: 0.16em;
  }

  .music__triangle-key {
    display: none;
  }

  .computer__mouse-label {
    display: none;
  }

  .computer__mouse {
    width: 30px;
    min-height: 30px;
    padding: 0;
    justify-content: center;
  }
}

/* ---------------- v6.5：1 号楼阳光教室 · 同桌三八线课间弹橡皮入口 ---------------- */

.tool-btn--eraser {
  border-color: rgba(255, 222, 152, 0.48) !important;
  background: linear-gradient(180deg, rgba(96, 58, 28, 0.82), rgba(54, 32, 16, 0.86)) !important;
  color: #fff0cc !important;
}

.eraser-desk-pill {
  position: fixed;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%);
  z-index: 16;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  color: #2c1905;
  border: 1px solid rgba(255, 244, 212, 0.82);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffedb8, #e0ac52);
  box-shadow: 0 10px 26px rgba(18, 10, 4, 0.45), 0 1px 0 rgba(255, 252, 238, 0.65) inset;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.14s ease;
}

.eraser-desk-pill:hover {
  transform: translateX(-50%) translateY(-1px);
  filter: brightness(1.05);
}

.eraser-desk-pill__icon {
  display: inline-flex;
  width: 17px;
  height: 17px;
}

.eraser-desk-pill__icon svg {
  width: 100%;
  height: 100%;
}

/* ---------------- v6.8：80后微机室 CRT 内嵌扫雷 / 警察抓小偷 / DOS 老板键 ---------------- */

.crt__boss-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0.28em 0.58em;
  border-radius: 999px;
  border: 1px solid rgba(56, 168, 92, 0.65);
  background: linear-gradient(180deg, #1b4328, #0f2918);
  color: #79ffa1;
  font-family: ui-monospace, Consolas, monospace;
  font-size: clamp(7px, 0.6vw, 10.5px);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.crt__boss-btn.is-on {
  background: linear-gradient(180deg, #2d8a4b, #1b5c30);
  color: #eafff0;
}

.crt-80s-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: auto;
}
.crt-80s-layer[hidden], .crt-80s-pane[hidden] { display: none !important; }
.crt-80s-pane { width: 100%; height: 100%; }

.w98-desktop {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  background: #008080;
  font-family: Tahoma, "Microsoft YaHei", sans-serif;
  user-select: none;
}

.w98-win {
  display: flex;
  flex-direction: column;
  padding: 3px;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #2b2b2b;
  border-bottom: 2px solid #2b2b2b;
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.45);
  max-width: 96%;
}

.w98-win--chase { width: min(446px, 95%); }

.w98-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 2px 6px;
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

.w98-win-btns { display: inline-flex; gap: 2px; align-items: center; }
.w98-win-btns i, .w98-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 14px;
  padding: 0 3px;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: #000;
  background: #c0c0c0;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
  cursor: pointer;
}

.w98-menubar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  background: #c0c0c0;
  border-bottom: 1px solid #9a9a9a;
}

.w98-menu-link {
  padding: 1px 5px;
  border: 0;
  background: transparent;
  color: #111;
  font-size: 10.5px;
  cursor: pointer;
}
.w98-menu-link.is-active {
  background: #000080;
  color: #fff;
  font-weight: 700;
}

.w98-sunken-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 4px 5px;
  padding: 3px 6px;
  background: #bdbdbd;
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

.w98-led {
  min-width: 38px;
  padding: 1px 4px;
  background: #1a0000;
  color: #ff1e1e;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1px;
  text-align: center;
  border-top: 1px solid #404040;
  border-left: 1px solid #404040;
}

.w98-smiley {
  width: 24px;
  height: 24px;
  padding: 1px;
  background: #c0c0c0;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #555;
  border-bottom: 2px solid #555;
  cursor: pointer;
}
.w98-smiley svg { width: 100%; height: 100%; display: block; }

.w98-grid {
  display: grid;
  grid-template-columns: repeat(9, 22px);
  grid-template-rows: repeat(9, 22px);
  margin: 0 auto;
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

.w98-cell {
  width: 22px;
  height: 22px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 12.5px;
  font-weight: 900;
}

.w98-cell--up {
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #707070;
  border-bottom: 2px solid #707070;
  cursor: pointer;
}

.w98-cell--down {
  background: #bdbdbd;
  border: 0.5px solid #8e8e8e;
}
.w98-cell--down.is-boom { background: #ff2626; }

.w98-foot {
  margin: 4px 4px 2px;
  color: #1f1f1f;
  font-size: 10px;
  text-align: center;
}

.tt-stats-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  background: #dfdfdf;
  color: #111;
  font-size: 11px;
  border-bottom: 1px solid #999;
}

.tt-canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #2b3036;
}

.tt-word-box {
  margin: 6px 8px 4px;
  padding: 6px 10px;
  background: #ffffff;
  border: 2px inset #999;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2px;
  text-align: center;
}
.tt-typed { color: #15803d; }
.tt-cur { background: #fde047; color: #000; padding: 0 2px; border-bottom: 2px solid #b91c1c; }
.tt-rest { color: #334155; }

.tt-actions, .tt-win-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 8px 6px;
  flex-wrap: wrap;
}
.tt-win-box { color: #991b1b; font-size: 11.5px; font-weight: 700; }

.tt-btn {
  padding: 3px 9px;
  background: #d4d0c8;
  color: #111;
  border-top: 1.5px solid #fff;
  border-left: 1.5px solid #fff;
  border-right: 1.5px solid #555;
  border-bottom: 1.5px solid #555;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.tt-btn--primary { color: #000080; }

.dos-screen {
  width: 100%;
  height: 100%;
  padding: 12px 16px;
  background: #040a05;
  color: #35ff69;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: ui-monospace, "Courier New", Consolas, monospace;
}
.dos-pre {
  margin: 0;
  font-size: clamp(9px, 1.05vw, 12.5px);
  line-height: 1.42;
  white-space: pre-wrap;
  text-shadow: 0 0 6px rgba(53, 255, 105, 0.45);
}
@keyframes dosBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.dos-cursor { animation: dosBlink 0.9s steps(1) infinite; font-weight: 900; }
.dos-resume-btn {
  align-self: flex-end;
  padding: 5px 12px;
  color: #041207;
  background: #35ff69;
  border: 0;
  border-radius: 4px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
