/* 網頁版外框：模擬桌面，原本的各個視窗以 iframe 呈現 */
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #2b3036 radial-gradient(circle at 30% 20%, #3a414a 0%, #2b3036 60%, #22262b 100%);
  font-family: "Microsoft JhengHei", "TaipeiSansTCBeta", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#stage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}

.win {
  position: absolute;
  background: #f0f0f0;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45), 0 0 0 1px rgba(0, 0, 0, .25);
  overflow: hidden;
}
.win.hidden { display: none; }
.win iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #f0f0f0;
}
/* 拖曳時讓滑鼠事件穿過 iframe，移動才會順 */
body.dragging .win iframe { pointer-events: none; }
body.dragging { cursor: move; user-select: none; }

/* 全螢幕：主視窗等比例放大置中 */
body.fullscreen { background: #1e1e1e; }

#taskbar {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 100000;
}
#taskbar button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 8px;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
#taskbar img { width: 22px; height: 22px; }

/* ---- 登入 ---- */
body.blocked #stage, body.blocked #taskbar { visibility: hidden; }
#auth-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 200000;
}
#auth-screen[hidden] { display: none; }
.auth-card {
  width: 100%;
  max-width: 340px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 26px 20px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fafa3c 0, #fafa3c 6px, #fffde0 6px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .5);
  color: #222;
}
.auth-card[hidden] { display: none; }
.auth-logo { width: 96px; align-self: center; }
.auth-card h1 { margin: 0 0 4px; text-align: center; font-size: 22px; }
.auth-card h1 span { font-size: 14px; color: #0a8f9a; margin-left: 4px; }
.auth-card h2 { margin: 0; font-size: 18px; text-align: center; }
.auth-card label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: #555; }
.auth-card input {
  font: inherit;
  font-size: 16px;
  padding: 9px 10px;
  border: 1px solid #c9c9a0;
  border-radius: 6px;
  background: #fff;
}
.auth-card input:focus { outline: 2px solid #5bd3e0; border-color: #5bd3e0; }
.auth-error { margin: 0; min-height: 1.2em; color: #d0342c; font-size: 14px; }
.auth-primary, .auth-secondary {
  font: inherit;
  font-size: 16px;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.auth-primary { background: #4caf50; color: #fff; font-weight: bold; }
.auth-secondary { background: #e4e4d0; color: #333; }
.auth-link { align-self: center; color: #0a8f9a; font-size: 14px; }
#transfer-text { margin: 0; line-height: 1.6; font-size: 15px; }
#slot-list { display: flex; flex-direction: column; gap: 8px; }
.slot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid #d6d6a8;
  border-radius: 6px;
  background: #fff;
  font: inherit;
  cursor: pointer;
}
.slot:hover { border-color: #5bd3e0; }
.slot small { grid-column: 1 / -1; color: #777; }
body.auth-busy .auth-card { opacity: .6; pointer-events: none; }

#account-chip {
  position: fixed;
  top: 8px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .14);
  color: #e8e8e8;
  font-size: 13px;
  z-index: 100000;
}
#account-chip[hidden] { display: none; }
#account-chip button {
  font: inherit;
  padding: 3px 10px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .85);
  color: #333;
  cursor: pointer;
}
body.fullscreen #account-chip { display: none; }

#closed-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #fff;
  font-size: 18px;
}
#closed-screen[hidden] { display: none; }
#closed-screen img { width: 120px; }
#closed-screen button {
  padding: 8px 26px;
  border: 0;
  border-radius: 6px;
  background: #e8463c;
  color: #fff;
  font: inherit;
  cursor: pointer;
}
