:root {
  --green: #1B4D46;
  --green-light: #2A6B61;
  --orange: #E36B47;
  --orange-text: #C9583A;
  --peach: #FFB98D;
  --paper: #F6F4F3;
  --mint: #E2EDEB;
  --ink: #221F1B;
  --muted: #6B655E;
  --line: rgba(34, 31, 27, 0.12);
  --card: #FFFDF8;
  --serif: "Noto Serif TC", serif;
  --sans: system-ui, -apple-system, "PingFang TC", "Noto Sans TC", sans-serif;
  --sidebar: 320px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.55; }

:focus-visible { outline: 3px solid var(--peach); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

#app {
  display: grid;
  grid-template-columns: 1fr var(--sidebar);
  height: 100dvh;
}

/* ---------- 地圖 ---------- */

#stage { position: relative; overflow: hidden; background: var(--mint); }
#game { display: block; width: 100%; height: 100%; }

.pill {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: min(420px, calc(100% - 32px));
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 4px 16px rgba(27, 77, 70, 0.12);
}
#location-where { font-family: var(--serif); font-size: 16px; color: var(--green); }
#location-who { color: var(--muted); font-size: 13px; }

#toolbar {
  position: absolute;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 16px;
  background: var(--green);
  box-shadow: 0 8px 24px rgba(27, 77, 70, 0.3);
  max-width: calc(100% - 32px);
  flex-wrap: wrap;
  justify-content: center;
}
.tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--green-light);
  color: #FFFDF8;
  font-weight: 600;
}
.tool .icon { font-style: normal; }
.tool[aria-pressed="true"] { background: var(--orange); }
.tool.accent { background: var(--peach); color: var(--ink); }
.tool[hidden] { display: none; }
#mic-btn[aria-pressed="false"]:not(:disabled) { background: #5B3B33; }
.tool.status { padding: 0 6px; }
.tool select {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #FFFDF8;
  font-weight: 600;
  max-width: 160px;
}
.tool select option { color: var(--ink); }
.only-narrow { display: none; }

#keys-hint {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}

#seat-hint {
  position: absolute;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.95);
  color: var(--green);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(27, 77, 70, 0.15);
  pointer-events: none;
}
#seat-hint[hidden] { display: none; }

#toast {
  display: flex;
  align-items: center;
  gap: 12px;
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(480px, calc(100% - 32px));
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: #FFFDF8;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#shares {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(280px, 40%);
}
.share-card {
  display: block;
  padding: 0;
  border: 3px solid var(--card);
  border-radius: 12px;
  overflow: hidden;
  background: var(--ink);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  text-align: left;
}
.share-card video { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: contain; background: #000; }
.share-card span { display: block; padding: 6px 10px; background: var(--card); font-size: 12px; font-weight: 600; }

/* ---------- 側邊欄 ---------- */

#sidebar {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: var(--card);
}
#sidebar h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--green);
}
.count {
  display: inline-block;
  min-width: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--mint);
  font-family: var(--sans);
  font-size: 12px;
  text-align: center;
}

#account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--mint);
}
#account strong { font-family: var(--serif); color: var(--green); font-size: 15px; }
.account-actions { display: flex; gap: 6px; }
.account-actions button, .account-actions a {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.account-actions button:hover, .account-actions a:hover { border-color: var(--green); }

#people { padding: 16px 16px 8px; border-bottom: 1px solid var(--line); }
#people-list { list-style: none; margin: 0; padding: 0; max-height: 30vh; overflow-y: auto; }
#people-list button {
  display: grid;
  grid-template-columns: 12px 1fr;
  column-gap: 8px;
  align-items: center;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  text-align: left;
}
#people-list button:not(:disabled):hover { background: var(--mint); }
#people-list button:disabled { opacity: 1; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.person-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#people-list small { grid-column: 2; color: var(--muted); }

#chat { display: grid; grid-template-rows: auto auto 1fr auto; min-height: 0; padding: 12px 16px 16px; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--paper); }
.tabs button {
  flex: 1;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-weight: 600;
  color: var(--muted);
}
.tabs button[aria-selected="true"] { background: var(--green); color: #FFFDF8; }
#chat-hint { margin: 8px 2px; color: var(--muted); font-size: 12px; }

#messages { list-style: none; margin: 0; padding: 0 2px; overflow-y: auto; min-height: 0; }
.msg { margin: 0 0 10px; }
.msg-meta { display: flex; gap: 8px; align-items: baseline; }
.msg-meta strong { color: var(--green); }
.msg.mine .msg-meta strong { color: var(--orange-text); }
.msg-meta time { color: var(--muted); font-size: 11px; }
.msg p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }

#chat-form { display: flex; gap: 8px; margin-top: 8px; }
#chat-input {
  flex: 1;
  resize: none;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  line-height: 1.4;
}
#chat-send {
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--orange);
  color: #FFFDF8;
  font-weight: 700;
}

/* ---------- 登入與放大檢視 ---------- */

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(27, 77, 70, 0.92);
  z-index: 10;
}
.overlay[hidden] { display: none; }

.card {
  width: min(400px, 100%);
  padding: 28px 28px 24px;
  border-radius: 20px;
  background: var(--card);
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.card h1 { margin: 8px 0 0; font-family: var(--serif); font-weight: 900; font-size: 26px; color: var(--green); }
.card .sub { margin: 4px 0 20px; color: var(--muted); letter-spacing: 0.04em; }
.field { display: block; margin: 0 0 16px; padding: 0; border: 0; text-align: left; }
.field > span, .field > legend { display: block; margin-bottom: 6px; font-weight: 700; }
.field input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.card-logo { width: 72px; height: auto; }
.error { min-height: 1.2em; margin: 0 0 8px; color: var(--orange-text); font-weight: 600; text-align: left; }
#toast button {
  flex: none;
  padding: 6px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--orange);
  color: #FFFDF8;
  font-weight: 700;
}
.secondary {
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-weight: 700;
}
.secondary[hidden] { display: none; }

.picker-card { width: min(860px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; }
.picker-body { display: grid; grid-template-columns: 260px 1fr; gap: 20px; margin-top: 12px; text-align: left; }
#picker-preview { width: 100%; height: 300px; border-radius: 16px; background: var(--mint); }
.picker-options h2 { margin: 0 0 8px; font-family: var(--serif); font-size: 15px; color: var(--green); }
.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-bottom: 16px; }
.option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px 6px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--paper);
}
.option:hover { border-color: var(--line); }
.option[aria-pressed="true"] { border-color: var(--orange); background: #FFF3EC; }
.option img { width: 52px; height: 52px; object-fit: contain; }
.option-none { display: grid; place-items: center; width: 52px; height: 52px; color: var(--muted); font-size: 22px; }
.option-label { font-size: 12px; font-weight: 600; }
.option-group { grid-column: 1 / -1; margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.picker-actions { display: flex; justify-content: flex-end; gap: 8px; }
.picker-actions .primary { width: auto; padding: 0 28px; }
@media (max-width: 760px) {
  .picker-body { grid-template-columns: 1fr; }
  #picker-preview { height: 200px; }
}

.primary {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--orange);
  color: #FFFDF8;
  font-weight: 700;
  font-size: 16px;
}
.hint { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

#share-viewer { cursor: zoom-out; background: rgba(0, 0, 0, 0.88); }
#share-viewer video { max-width: 100%; max-height: calc(100dvh - 80px); border-radius: 8px; background: #000; }
#share-viewer p { margin: 8px 0 0; color: #FFFDF8; text-align: center; }

/* ---------- 窄螢幕：聊天變成抽屜 ---------- */

@media (max-width: 760px) {
  #app { grid-template-columns: 1fr; }
  .only-narrow { display: inline-flex; }
  #sidebar {
    position: fixed;
    inset: auto 0 0 0;
    height: 70dvh;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.2s ease;
    z-index: 5;
  }
  .sidebar-open #sidebar { transform: none; }
  #keys-hint { display: none; }
  #toolbar { bottom: 16px; }
  #shares { width: 45%; top: 96px; }
}

/* ---------- 獨立頁面（邀請連結） ---------- */

.page-center {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 16px;
  background: var(--green);
}

/* ---------- 小貓視窗 ---------- */

.cat-dialog {
  position: fixed;
  right: calc(var(--sidebar) + 16px);
  bottom: 110px;
  z-index: 8;
  width: 260px;
  padding: 16px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 12px 32px rgba(27, 77, 70, 0.22);
  text-align: center;
}
.cat-dialog[hidden] { display: none; }
.cat-dialog img { width: 70px; height: auto; }
.cat-dialog h2 { margin: 4px 0 12px; font-family: var(--serif); font-size: 16px; color: var(--green); }
.dialog-close { position: absolute; top: 8px; right: 10px; border: 0; background: none; color: var(--muted); font-size: 16px; }
.cat-form { display: flex; gap: 6px; margin-bottom: 10px; }
.cat-form[hidden] { display: none; }
.cat-form input { flex: 1; min-width: 0; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.btn-small { min-height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--orange); color: #FFFDF8; font-weight: 700; }
.secondary-small { background: var(--mint); color: var(--green); }
.btn-small.pet { width: 100%; background: var(--peach); color: var(--ink); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 10px; }
.option-chip { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 12px; font-weight: 600; }
.option-chip[aria-pressed="true"] { border-color: var(--orange); background: #FFF3EC; color: var(--orange-text); }
@media (max-width: 760px) { .cat-dialog { right: 16px; bottom: 90px; } }

/* ---------- 小遊戲 ---------- */

.game-card { width: min(900px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; }
.game-head { display: flex; align-items: center; gap: 16px; }
.game-head h1 { margin: 0; flex: 1; text-align: left; }
.game-head .secondary { min-height: 40px; }
.game-scores { display: flex; gap: 12px; font-weight: 700; color: var(--green); }
.game-stage { position: relative; }
#game-canvas { display: block; width: 100%; max-height: calc(100dvh - 220px); margin: 0 auto; border-radius: 14px; background: var(--paper); object-fit: contain; }
.game-over {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.88);
}
.game-over[hidden] { display: none; }
.game-over p { margin: 0; font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--green); }
.game-over .primary { width: auto; padding: 0 32px; justify-self: center; }

/* ---------- 教室 ---------- */

.classroom {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: min(920px, calc(100% - 32px));
  max-height: calc(100% - 140px);
  overflow-y: auto;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 10px 30px rgba(27, 77, 70, 0.2);
}
.classroom[hidden] { display: none; }
.in-classroom #location { display: none; }
.class-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.class-head strong { font-family: var(--serif); color: var(--green); font-size: 16px; }
.class-head-text { display: flex; flex-direction: column; gap: 2px; margin-right: auto; min-width: 0; }
.class-head-text small { color: var(--muted); font-size: 12px; }
#class-start[hidden], #class-mute-all[hidden] { display: none; }
.class-cams { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 8px; }
.class-cams[hidden] { display: none; }
.cam-tile { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: var(--ink); aspect-ratio: 4 / 3; }
.cam-tile video { width: 100%; height: 100%; object-fit: cover; }
.cam-tile figcaption { position: absolute; left: 6px; bottom: 6px; padding: 2px 8px; border-radius: 999px; background: rgba(255,253,248,0.9); font-size: 12px; font-weight: 700; }
.class-share-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.annot-layer { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.annot-text { position: absolute; z-index: 2; min-width: 160px; padding: 4px 8px; border: 2px solid var(--orange); border-radius: 6px; font: 700 14px system-ui, sans-serif; }
.annot-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.annot-btn { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 12px; font-weight: 700; }
.annot-btn[aria-pressed="true"] { border-color: var(--orange); background: #FFF3EC; color: var(--orange-text); }
.annot-btn.primary-btn { margin-left: auto; border: 0; background: var(--orange); color: #FFFDF8; }
.annot-swatch { width: 24px; height: 24px; border: 3px solid transparent; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15); }
.annot-swatch[aria-pressed="true"] { border-color: var(--ink); }
.class-people { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.class-people li { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; border-radius: 999px; background: var(--mint); font-size: 12px; font-weight: 600; }
.class-people .btn-small { min-height: 26px; padding: 0 10px; font-size: 12px; }

.board-card { width: min(520px, 100%); text-align: left; }
.board-list { list-style: none; margin: 12px 0 16px; padding: 0; max-height: 60vh; overflow-y: auto; }
.board-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--paper); margin-bottom: 6px; }
.board-list li strong { color: var(--green); }
.board-list li.live { background: #E7F4EC; }
.board-list li.cancelled { opacity: 0.6; text-decoration: line-through; }

.class-details { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 12px; text-align: left; }
.class-details dt { color: var(--muted); font-weight: 600; }
.class-details dd { margin: 0; font-weight: 700; color: var(--ink); }
.class-details[hidden], .class-status[hidden] { display: none; }
.class-status { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--mint); color: var(--green); font-weight: 700; text-align: left; }

/* ---------- Google 登入 ---------- */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  border: 1px solid #DADCE0;
  border-radius: 12px;
  background: #FFFFFF;
  color: #1F1F1F;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 150ms, border-color 150ms;
}
.google-btn:hover { border-color: var(--green); background: var(--mint); }
.google-btn svg { width: 20px; height: 20px; }
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
  color: var(--muted);
  font-size: 12px;
}
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- 學生：我的課 ---------- */
#my-classes { padding: 16px 16px 8px; border-bottom: 1px solid var(--line); }
#my-classes h2 { margin: 0 0 8px; }
#my-classes-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
#my-classes-list li { padding: 8px 10px; border-radius: 10px; background: var(--paper); }
#my-classes-list strong { display: block; color: var(--green); }
#my-classes-list small { color: var(--muted); }
#my-classes-list .open small { color: var(--orange-text); font-weight: 700; }
#my-classes .hint { margin: 8px 0 0; }
.link-button { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.card .google-btn { margin-top: 4px; }
.google-btn[hidden], .link-button[hidden] { display: none; }

/* ---------- 快速移動、縮放 ---------- */
.travel-menu {
  position: absolute;
  left: 50%;
  bottom: 84px;
  z-index: 9;
  width: min(340px, calc(100% - 32px));
  max-height: min(60vh, 520px);
  overflow-y: auto;
  padding: 10px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 12px 32px rgba(27, 77, 70, 0.22);
  transform: translateX(-50%);
}
.travel-menu h3 { margin: 10px 8px 4px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.travel-menu h3:first-child { margin-top: 2px; font-family: var(--serif); font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--green); }
.travel-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
}
.travel-item:hover, .travel-item:focus-visible { background: var(--mint); }
.travel-item small { color: var(--muted); font-weight: 500; }
.zoom-controls {
  position: absolute;
  right: 16px;
  bottom: 84px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 4px 14px rgba(27, 77, 70, 0.16);
}
.zoom-controls button {
  min-width: 44px;
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--green);
  font-weight: 700;
}
.zoom-controls button:hover { background: var(--mint); }
#zoom-level { min-height: 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 11px; }

/* ---------- 海灘的黑膠唱片 ---------- */
.vinyl {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  display: flex;
  gap: 12px;
  width: min(370px, calc(100% - 32px));
  padding: 12px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 10px 28px rgba(27, 77, 70, 0.2);
}
.vinyl[hidden] { display: none; }
.vinyl-deck { position: relative; flex: 0 0 92px; height: 92px; }
.vinyl-disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 17px, rgba(255, 255, 255, 0.08) 18px, transparent 19px),
    repeating-radial-gradient(circle, #222 0 2px, #2C2A27 2px 4px);
  box-shadow: inset 0 0 0 2px #111, 0 3px 8px rgba(0, 0, 0, 0.25);
}
.vinyl-disc::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 45%, transparent 60%, rgba(255, 255, 255, 0.08));
}
.vinyl-label {
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFFDF8 0 3px, var(--orange) 4px);
}
.vinyl.playing .vinyl-disc { animation: vinyl-spin 1.8s linear infinite; }
.vinyl-arm {
  position: absolute;
  top: -4px;
  right: -6px;
  width: 6px;
  height: 58px;
  border-radius: 3px;
  background: linear-gradient(#C9C2B8, #8E877E);
  transform: rotate(14deg);
  transform-origin: top center;
  transition: transform 600ms var(--ease, ease);
}
.vinyl.playing .vinyl-arm { transform: rotate(30deg); }
@keyframes vinyl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .vinyl.playing .vinyl-disc { animation-duration: 8s; } }
.vinyl-body { flex: 1; min-width: 0; }
.vinyl-head { display: flex; align-items: center; justify-content: space-between; }
.vinyl-head strong { font-family: var(--serif); color: var(--green); }
.vinyl-close { border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; }
.vinyl-now { margin: 2px 0 8px; color: var(--muted); font-size: 12px; }
.vinyl-tracks { display: flex; flex-wrap: wrap; gap: 4px; }
.vinyl-group { flex-basis: 100%; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.vinyl-tracks button, .vinyl-off {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}
.vinyl-tracks button[aria-pressed="true"] { border-color: var(--orange); background: var(--orange); color: #FFFDF8; }
.vinyl-controls { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.vinyl-volume { flex: 1; accent-color: var(--orange); }

/* ---------- 2F 整週課表 ---------- */
.week-board-card { width: min(1100px, calc(100vw - 32px)); max-width: none; text-align: left; }
.week-board-card h1 { text-align: left; }
.week-board-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; max-height: 62vh; margin: 12px 0 16px; overflow-y: auto; }
.week-board-day { padding: 8px; border-radius: 12px; background: var(--paper); }
.week-board-day.today { background: var(--mint); box-shadow: inset 0 0 0 2px var(--green); }
.week-board-day h2 { margin: 0 0 6px; font-size: 13px; color: var(--green); }
.week-board-day ol { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.week-board-day li { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border-left: 4px solid var(--orange); border-radius: 8px; background: var(--card); font-size: 12px; line-height: 1.35; }
.week-board-day li strong { color: var(--ink); }
.week-board-day li span { font-weight: 700; color: var(--green); }
.week-board-day li small { color: var(--muted); }
.week-board-day li.live { border-left-color: #3FA977; background: #E7F4EC; }
.week-board-day li.cancelled { opacity: 0.55; text-decoration: line-through; }
.week-board-day li.empty { border-left-color: transparent; background: transparent; color: var(--muted); }
@media (max-width: 860px) { .week-board-grid { grid-template-columns: 1fr; } }
.link-like { margin-top: 8px; padding: 0; border: 0; background: none; color: var(--green); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 教室的分享畫面：觀看的人全螢幕，工具列浮在畫面上 ---------- */
.share-full { position: fixed; inset: 0; z-index: 9; background: #0E1312; }
.share-full[hidden] { display: none; }
.share-full-stage { position: absolute; inset: 0; }
.share-float-bar {
  position: absolute;
  left: 50%;
  bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
  padding: 8px 12px;
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transform: translateX(-50%);
  backdrop-filter: blur(6px);
}
.share-float-bar strong { font-family: var(--serif); color: var(--green); font-size: 14px; white-space: nowrap; }
.share-float-bar .annot-tools { margin-top: 0; }
.share-float-bar .annot-btn.primary-btn { margin-left: 0; }
.share-float-grip { cursor: grab; padding: 4px 2px; color: var(--muted); font-size: 16px; touch-action: none; user-select: none; }
.share-float-grip:active { cursor: grabbing; }
.share-reopen {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--orange);
  color: #FFFDF8;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(227, 107, 71, 0.35);
}
.share-reopen[hidden] { display: none; }
body.share-fullscreen .vinyl, body.share-fullscreen .travel-menu { display: none; }

/* 分享的人的浮動視窗（Picture-in-Picture） */
.pip-body { margin: 0; background: #0E1312; font-family: var(--sans); overflow: hidden; }
.pip-wrap { display: flex; flex-direction: column; height: 100vh; }
.pip-bar { position: static; transform: none; max-width: none; margin: 6px; border-radius: 12px; }
.pip-stage { position: relative; flex: 1; min-height: 0; }

/* ---------- 電梯 ---------- */
.elevator-card { width: min(360px, 100%); }
.elevator-floors { display: grid; gap: 8px; margin: 12px 0; }

/* ---------- 3F J.Mi Café 門口（彩繪咖啡廳配色：暖白、鈷藍、番茄紅、芥末黃） ---------- */
.cafe-overlay {
  background:
    radial-gradient(circle at 12% 18%, #D8432F 0 7px, transparent 8px),
    radial-gradient(circle at 78% 12%, #E8B13A 0 6px, transparent 7px),
    radial-gradient(circle at 88% 70%, #EFB5B8 0 8px, transparent 9px),
    radial-gradient(circle at 22% 82%, #1F7A72 0 6px, transparent 7px),
    #2F5FA8;
  background-size: 180px 180px, 220px 220px, 200px 200px, 240px 240px, auto;
}
.cafe-card { background: #FAF2E4; border: 3px solid #1E1A17; box-shadow: 8px 8px 0 #D8432F; }
.cafe-card h1 { color: #2F5FA8; }
.cafe-card .primary { background: #D8432F; }
.cafe-card .secondary { width: 100%; margin-bottom: 8px; }
.cafe-eyebrow { margin: 0; color: #D8432F; font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }

/* ---------- 3F 文創空間的商品頁 ---------- */
.merch-card { width: min(380px, 100%); background: #FAF6EF; }
.merch-jmi { width: 110px; height: auto; margin: 0 auto 6px; display: block; }
.merch-card h1 { color: var(--orange-text); }
.merch-soon { margin: 8px 0 2px; font-family: var(--serif); font-size: 20px; font-weight: 900; color: var(--green); }

/* ---------- 1F AI Office：AI 員工的工作狀態 ---------- */
.agent-card { width: min(400px, 100%); background: #F4F7F8; text-align: center; }
.agent-portrait { width: 96px; height: auto; margin: 0 auto 4px; display: block; }
.agent-card h1 { color: var(--green); margin-bottom: 0; }
.agent-name { display: flex; align-items: center; justify-content: center; gap: 8px; }
.agent-lead { font-family: system-ui, -apple-system, sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: #3A2418; background: #FFB98D; padding: 2px 8px; border-radius: 4px; }
.agent-zh { margin: 2px 0 2px; color: var(--ink-soft, #6B645C); font-family: var(--serif); }
.agent-team { margin: 0 0 8px; font-size: 13px; color: var(--ink-soft, #6B645C); }
.agent-status { margin: 0 0 8px; font-weight: 700; }
.agent-summary { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: #FFFFFF; text-align: left; line-height: 1.5; }
.agent-card .link-button { margin: 0 auto 10px; }
.agent-tasks-title { margin: 12px 0 6px; font-size: 14px; text-align: left; color: var(--green); }
.agent-tasks { list-style: none; margin: 0 0 14px; padding: 0; text-align: left; }
.agent-tasks li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid rgba(34, 31, 27, 0.08); }
.agent-tasks small { color: #6B645C; white-space: nowrap; }

/* ---------- 知咪幣 J.Mi Coins ---------- */
.coins-btn[hidden] { display: none; }
.coins-btn { font-weight: 700; color: #8A5A12; background: #FFF4D6; border-color: #F0D58A; }
.coins-card { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #FFFBF2; text-align: center; }
.coins-card h1 { margin: 0; color: #8A5A12; }
.coins-today { margin: 2px 0 6px; font-weight: 600; color: var(--green); }
.coins-tabs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 12px 0 4px; }
.coins-tabs .tab { padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(34, 31, 27, 0.15); background: #FFFFFF; font-weight: 600; }
.coins-tabs .tab[aria-pressed="true"] { background: var(--green); color: #FFFDF8; border-color: var(--green); }
.coins-note { margin: 4px 0 10px; color: #6B645C; font-size: 13px; }
.shop-items { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; text-align: left; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border-radius: 12px; background: #FFFFFF; border: 1px solid rgba(34, 31, 27, 0.08); }
.shop-item.owned { border-color: rgba(27, 77, 70, 0.35); background: #F2F8F6; }
.shop-thumb { width: 72px; height: 72px; object-fit: contain; }
.shop-swatch { width: 56px; height: 56px; margin: 8px 0; border-radius: 50%; display: grid; place-items: center; font-size: 22px; }
.shop-info { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.shop-price { color: #8A5A12; font-weight: 700; font-size: 13px; }
.shop-actions { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.shop-item button.small { width: 100%; padding: 6px 8px; font-size: 13px; }
.option.locked img { opacity: 0.55; }
.option-lock { font-size: 11px; font-weight: 700; color: #8A5A12; }
