/* 貓掌陶藝社：下午的陶藝教室，一個溫暖的亮色主題（刻意單一主題） */
:root {
  color-scheme: light;
  --wall: #f5ede1;          /* 米白牆面，頁面底色 */
  --linen: #ece0cf;         /* 亞麻 */
  --clay: #c47c55;          /* 陶土 */
  --clay-wet: #a9623f;      /* 濕的陶土，主要按鈕 */
  --clay-deep: #8f4f31;
  --wheel: #8d8f95;         /* 轉盤灰 */
  --wood: #b88a5b;          /* 木頭 */
  --wood-deep: #8e6a45;
  --sage: #a3b899;          /* 鼠尾草綠 */
  --sage-deep: #557550;
  --ink: #3a302b;           /* 墨色，文字與描邊 */
  --ink-soft: #6b5d53;
  --paper: #fffaf3;
  --paper-2: #f7efe3;
  --seal: #c0452e;          /* 印泥朱紅 */
  --gold: #d9a441;
  --font: "LXGW WenKai TC", "Kaiti TC", "STKaiti", "BiauKai", "DFKai-SB", serif;
  --col-w: 400px;
}

[hidden] { display: none !important; }

html { height: 100%; box-sizing: border-box; background: var(--wall); }
*, *::before, *::after { box-sizing: inherit; }

body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* UI 疊在遊戲欄位上，JS 會把 left / width 對齊欄位 */
#ui {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
}

#ui button { pointer-events: auto; }

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 3px solid var(--sage-deep);
  outline-offset: 3px;
}

/* ---------- 按鈕：手作感的粗描邊 ---------- */
.btn {
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 10px 20px;
  font-family: var(--font);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-indent: 0.12em;
  line-height: 1.25;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.15s ease;
}

.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn-primary { color: #fffaf3; background: var(--clay-wet); }
.btn-primary:hover { background: #b36a45; }
.btn-ghost { color: var(--ink); background: var(--paper); }
.btn-ghost:hover { background: #ffffff; }
.btn-small { font-size: 16px; padding: 8px 18px; }
.btn[disabled] { opacity: 0.55; cursor: default; }

.btn-link {
  border: 0;
  background: none;
  padding: 6px 4px;
  color: var(--clay-deep);
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.icon-btn-small { width: 38px; height: 38px; border-radius: 12px; }
.icon-btn svg { width: 22px; height: 22px; fill: var(--ink); }

.icon-btn svg .stroke {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.js-sound[aria-pressed="true"] .icon-sound-off,
.js-sound[aria-pressed="false"] .icon-sound-on { display: none; }

.screen { position: absolute; inset: 0; }

.toolbar {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: 14px;
  z-index: 3;
  display: flex;
  gap: 10px;
}

/* ---------- 首頁 ---------- */
.title-screen {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-inline: 16px;
  padding-block: calc(env(safe-area-inset-top, 0px) + 66px) calc(env(safe-area-inset-bottom, 0px) + 16px);
}

.title-sign {
  position: relative;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 30px 14px;
  border: 2.5px solid var(--ink);
  border-radius: 20px;
  background:
    repeating-linear-gradient(90deg, rgba(142, 106, 69, 0.06) 0 2px, transparent 2px 9px),
    var(--paper);
  box-shadow: 0 4px 0 var(--ink), 0 14px 30px rgba(90, 60, 35, 0.18);
  transform: rotate(-1.2deg);
  animation: sign-in 0.9s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

.title-sign::before,
.title-sign::after {
  content: "";
  position: absolute;
  top: -44px;
  width: 2px;
  height: 44px;
  background: var(--wood-deep);
}

.title-sign::before { left: 24%; }
.title-sign::after { right: 24%; }

.sign-paw {
  position: absolute;
  top: -14px;
  left: -12px;
  width: 38px;
  height: 38px;
  padding: 5px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--clay-wet);
  fill: #fffaf3;
  transform: rotate(-14deg);
}

.title-main {
  margin: 0;
  font-size: clamp(36px, calc(var(--col-w) * 0.115), 50px);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-indent: 0.1em;
  line-height: 1.2;
  white-space: nowrap;
}

.title-sub {
  margin: 2px 0 0;
  padding: 1px 14px;
  border-radius: 999px;
  background: var(--linen);
  color: var(--ink-soft);
  font-size: 16px;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
}

.title-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: rise-in 0.8s 0.15s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.title-actions {
  width: min(100%, 340px);
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 10px;
}

.title-actions .btn { padding-inline: 10px; font-size: 20px; }

.count {
  display: inline-block;
  min-width: 1.6em;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--linen);
  font-size: 13px;
  letter-spacing: 0;
  text-indent: 0;
  vertical-align: 2px;
}

.title-hint {
  margin: 0;
  padding: 2px 12px;
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.9);
  color: var(--ink-soft);
  font-size: 14px;
}

/* ---------- 選委託單 ---------- */
.select-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 64px) 14px calc(env(safe-area-inset-bottom, 0px) + 14px);
  background: rgba(245, 237, 225, 0.72);
  pointer-events: auto;
  animation: fade-in 0.3s ease both;
}

.select-inner {
  width: 100%;
  max-width: 420px;
  max-height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.select-head { text-align: center; }
.select-title { margin: 0; font-size: 26px; letter-spacing: 0.1em; }
.select-sub { margin: 0; color: var(--ink-soft); font-size: 15px; }

.commission-list {
  list-style: none;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 10px 6px 10px;
  display: grid;
  gap: 12px;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.commission {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  gap: 1px 12px;
  padding: 10px 14px 10px 10px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 3px 0 var(--ink);
  text-align: left;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.commission-list li:nth-child(odd) .commission { transform: rotate(-0.5deg); }
.commission-list li:nth-child(even) .commission { transform: rotate(0.5deg); }
.commission:hover { background: #ffffff; }
.commission-list li .commission:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

/* 紙膠帶 */
.commission::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 54px;
  height: 14px;
  margin-left: -27px;
  background: rgba(163, 184, 153, 0.75);
  transform: rotate(-3deg);
}

.commission.is-free { background: #f3f5ec; }
.commission.is-free::before { background: rgba(196, 124, 85, 0.45); }
.commission canvas { grid-row: 1 / span 4; width: 70px; height: 84px; }
.c-name { font-size: 21px; font-weight: 700; line-height: 1.25; }
.c-client { font-size: 14px; color: var(--clay-deep); }
.c-note { font-size: 15px; color: var(--ink); line-height: 1.45; text-wrap: pretty; }

.c-side {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  margin-top: 2px;
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.paws { display: flex; gap: 1px; }
.paws svg { width: 15px; height: 15px; fill: var(--clay); }
.paws svg.off { fill: rgba(58, 48, 43, 0.16); }

.c-best {
  padding: 0 7px;
  border: 1.5px solid var(--seal);
  border-radius: 6px;
  color: var(--seal);
  font-size: 12.5px;
}

/* ---------- 捏陶資訊列 ---------- */
.hud {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 10px;
  right: 10px;
  display: grid;
  gap: 6px;
  padding: 8px 10px 9px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: rgba(255, 250, 243, 0.94);
  box-shadow: 0 3px 0 var(--ink);
  animation: drop-in 0.4s cubic-bezier(0.2, 1.2, 0.4, 1) both;
}

.hud-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hud-title { flex: 1; min-width: 0; display: grid; line-height: 1.25; }

.hud-name {
  font-size: 19px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-client { font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter { flex: 1; min-width: 0; }
.meter-top { display: flex; align-items: baseline; gap: 4px; line-height: 1.1; }
.meter-label { font-size: 13px; color: var(--ink-soft); margin-right: 2px; }
.meter-num { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 1.4em; text-align: right; }
.meter-top small { font-size: 14px; }

.meter-tier {
  margin-left: auto;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 13px;
  white-space: nowrap;
  color: var(--ink);
}

.meter-bar {
  position: relative;
  height: 8px;
  margin-top: 4px;
  border-radius: 4px;
  background: rgba(58, 48, 43, 0.12);
  overflow: hidden;
}

.meter-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 4px;
  background: var(--clay);
  transition: width 0.25s ease, background-color 0.3s ease;
}

.meter-bar .tick { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(255, 250, 243, 0.9); }
.meter[data-tier="school"] .meter-bar i { background: #8fa35f; }
.meter[data-tier="flavor"] .meter-bar i { background: var(--sage-deep); }
.meter[data-tier="master"] .meter-bar i { background: var(--gold); }
.meter[data-tier="master"] .meter-tier { background: #f6e2b0; }
.meter-tier.is-pop { animation: tier-pop 0.5s cubic-bezier(0.3, 1.8, 0.5, 1) both; }
.hud-free { flex: 1; margin: 0; font-size: 14px; color: var(--ink-soft); }
.btn-done { padding: 8px 18px; font-size: 18px; }

/* 委託人的小紙條 */
.slip {
  position: absolute;
  left: 14px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  max-width: 54%;
  display: grid;
  gap: 1px;
  padding: 10px 14px 9px;
  border: 1.5px solid rgba(58, 48, 43, 0.55);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 6px 14px rgba(90, 60, 35, 0.16);
  transform: rotate(-2deg);
  animation: rise-in 0.5s 0.2s ease both;
}

.slip::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 18px;
  width: 42px;
  height: 14px;
  background: rgba(196, 124, 85, 0.5);
  transform: rotate(4deg);
}

.slip-client { font-size: 13px; color: var(--clay-deep); }
.slip-note { font-size: 15px; line-height: 1.4; text-wrap: pretty; }

.coach {
  position: absolute;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 134px);
  width: max-content;
  max-width: calc(100% - 40px);
  display: grid;
  gap: 2px;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: rgba(255, 250, 243, 0.95);
  box-shadow: 0 3px 0 var(--ink);
  text-align: center;
  transform: translateX(-50%);
  animation: fade-in 0.5s 0.4s ease both;
}

.coach b { font-size: 17px; }
.coach span { font-size: 14px; color: var(--ink-soft); }

.toast {
  position: absolute;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 128px);
  z-index: 4;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 7px 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 3px 0 var(--ink);
  font-size: 15px;
  text-align: center;
  transform: translateX(-50%);
  animation: toast-in 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.toast.is-alert { background: #fbe3d7; }

/* ---------- 選釉色 ---------- */
.glaze-screen { display: flex; flex-direction: column; justify-content: flex-end; }

.sheet {
  pointer-events: auto;
  margin: 0 10px calc(env(safe-area-inset-bottom, 0px) + 10px);
  padding: 14px 16px 16px;
  border: 2px solid var(--ink);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 4px 0 var(--ink), 0 -10px 30px rgba(90, 60, 35, 0.12);
  animation: sheet-in 0.45s cubic-bezier(0.2, 1.1, 0.4, 1) both;
}

.sheet-title { margin: 0 0 8px; text-align: center; font-size: 22px; letter-spacing: 0.08em; }
.glaze-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }

.glaze-chip {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0 4px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: none;
  font-size: 14px;
  line-height: 1.2;
}

.glaze-chip i {
  width: 46px;
  height: 46px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.85) 0 9%, rgba(255, 255, 255, 0) 24%), radial-gradient(circle at 50% 60%, var(--g-base) 0 55%, var(--g-dark) 100%);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.18s cubic-bezier(0.2, 1.5, 0.4, 1);
}

.glaze-chip[aria-checked="true"] { border-color: var(--ink); background: var(--paper-2); }
.glaze-chip[aria-checked="true"] i { transform: translateY(-3px) scale(1.08); }
.glaze-desc { min-height: 2.8em; margin: 8px 2px 10px; color: var(--ink-soft); font-size: 15px; text-align: center; text-wrap: balance; }

/* ---------- 燒窯 ---------- */
.kiln-screen { display: flex; align-items: flex-end; justify-content: center; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12%); }

.kiln-text {
  margin: 0;
  padding: 6px 18px;
  border-radius: 999px;
  background: rgba(58, 40, 30, 0.72);
  color: #ffeedd;
  font-size: 18px;
  letter-spacing: 0.08em;
}

.kiln-text b { font-variant-numeric: tabular-nums; color: #ffd28a; }

/* ---------- 出窯：展品牌 ---------- */
.reveal-screen {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px calc(env(safe-area-inset-bottom, 0px) + 12px);
}

.reveal-head {
  margin: 0;
  padding: 4px 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 3px 0 var(--ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  animation: drop-in 0.5s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

.label-card {
  position: relative;
  pointer-events: auto;
  width: min(100%, 420px);
  max-height: 58%;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 16px 18px 10px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: linear-gradient(180deg, #fffdf8, var(--paper));
  box-shadow: 0 4px 0 var(--ink), 0 16px 34px rgba(90, 60, 35, 0.2);
  animation: rise-in 0.6s 0.15s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.label-museum {
  margin: 0 64px 6px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(58, 48, 43, 0.25);
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.12em;
}

.label-title { margin: 0 64px 4px 0; font-size: 23px; line-height: 1.35; word-break: keep-all; overflow-wrap: anywhere; }
.label-material { margin: 0 0 8px; color: var(--ink-soft); font-size: 14.5px; }
.label-note { margin: 0 0 8px; font-size: 16px; line-height: 1.6; text-wrap: pretty; }
.label-meta { margin: 0 0 10px; color: var(--ink-soft); font-size: 13.5px; }
.label-actions { margin-top: 4px; }
.label-card .btn-link { display: block; margin: 4px auto 0; }
.exhibit-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 14px; }
.label-card .exhibit-links .btn-link { min-height: 44px; margin: 2px 0 0; }

/* 評價印章：兩行直書 */
.stamp {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 2.5px solid var(--seal);
  border-radius: 8px;
  color: var(--seal);
  background: rgba(255, 250, 243, 0.6);
  box-shadow: inset 0 0 0 2.5px rgba(255, 250, 243, 0.9), inset 0 0 0 4px var(--seal);
  transform: rotate(-8deg);
}

.stamp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px 2px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.05;
}

.stamp-grid i { font-style: normal; text-align: center; }

.stamp.is-in { animation: stamp-in 0.5s 0.3s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.stamp-small { width: 54px; height: 54px; }
.stamp-small .stamp-grid { font-size: 17px; }

/* ---------- 展示架 ---------- */
.shelf-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 62px) 10px calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: rgba(245, 237, 225, 0.6);
  pointer-events: auto;
  animation: fade-in 0.3s ease both;
}

.cabinet {
  width: 100%;
  max-width: 440px;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--wood);
  box-shadow: 0 4px 0 var(--ink), 0 18px 40px rgba(90, 60, 35, 0.25);
  padding: 10px;
}

.cabinet-head { padding: 2px 4px 8px; text-align: center; color: #fffaf3; }
.cabinet-title { margin: 0; font-size: 24px; letter-spacing: 0.12em; text-shadow: 0 2px 0 rgba(58, 40, 28, 0.45); }
.cabinet-sub { margin: 0; font-size: 14px; color: #fff3e2; }

.shelf-list {
  list-style: none;
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 10px 6px 4px;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  border: 2px solid var(--wood-deep);
  border-radius: 10px;
  background: linear-gradient(180deg, #efe3d1, #e6d6bf);
  box-shadow: inset 0 6px 14px rgba(90, 60, 35, 0.22);
}

.shelf-row { position: relative; margin-bottom: 14px; }
.shelf-slots { display: grid; grid-template-columns: repeat(var(--per-row, 4), minmax(0, 1fr)); gap: 6px; align-items: end; padding: 0 2px; }

.shelf-plank {
  display: block;
  height: 12px;
  margin: 0 -6px;
  border-radius: 3px;
  background: linear-gradient(180deg, #d2a676 0 30%, var(--wood) 30% 75%, var(--wood-deep) 75%);
  box-shadow: 0 6px 8px rgba(90, 60, 35, 0.25);
}

.shelf-item {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  transition: transform 0.15s ease;
}

.shelf-item:hover { transform: translateY(-3px); }
.shelf-item canvas { display: block; width: 100%; height: auto; }

.shelf-plate {
  max-width: 100%;
  max-height: calc(2.7em + 2px);
  margin: -1px 0 -9px;
  padding: 0 5px;
  border: 1px solid rgba(58, 48, 43, 0.5);
  border-radius: 3px;
  background: linear-gradient(180deg, #f1e2bd, #dcc694);
  color: var(--ink);
  font-size: 10.5px;
  line-height: 1.35;
  text-align: center;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.shelf-badge {
  position: absolute;
  top: 0;
  left: 0;
  padding: 1px 6px 1px 5px;
  border: 1.5px solid var(--ink);
  border-radius: 999px 999px 999px 4px;
  font-size: 10.5px;
  line-height: 1.3;
  transform: rotate(-6deg);
}

.badge-avant { background: linear-gradient(90deg, #f4b8c4, #f6d58f, #a9d3c3); color: var(--ink); }
.badge-master { background: #f6e2b0; color: var(--ink); }
.shelf-empty { height: 40px; margin: 0 8px; border: 1.5px dashed rgba(142, 106, 69, 0.35); border-radius: 8px 8px 0 0; border-bottom: 0; }
.shelf-item.is-new canvas { animation: glow-pop 1.4s ease both; }
.cabinet-note { margin: 6px 4px 0; color: #fff3e2; font-size: 13px; text-align: center; }
.cabinet-actions { display: flex; gap: 10px; margin-top: 10px; }
.cabinet-actions .btn { flex: 1; font-size: 17px; }

/* ---------- 視窗 ---------- */
.modal-layer {
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(58, 40, 30, 0.3);
  pointer-events: auto;
  animation: fade-in 0.25s ease both;
}

.panel {
  width: min(100%, 380px);
  max-height: calc(100% - 16px);
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 20px 18px 18px;
  border: 2px solid var(--ink);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 5px 0 var(--ink);
  animation: panel-in 0.4s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

.panel-title { margin: 0 0 8px; text-align: center; font-size: 24px; letter-spacing: 0.06em; line-height: 1.3; text-wrap: balance; }
.panel-text { margin: 0 0 14px; color: var(--ink-soft); text-align: center; text-wrap: pretty; }
.panel-text.small { margin-top: 12px; font-size: 14px; text-align: left; }
.panel-actions { display: flex; gap: 10px; margin-top: 8px; }
.panel-actions .btn { flex: 1; padding-inline: 8px; font-size: 17px; letter-spacing: 0.08em; text-indent: 0.08em; }

.panel-piece { padding: 12px 14px 16px; width: min(100%, 400px); }
.piece-stage { display: grid; place-items: center; margin: 0 -2px 10px; border-radius: 14px; background: radial-gradient(ellipse at 50% 85%, #f1e4d0, #f8f1e6 70%); }
.label-card-flat { position: relative; max-height: none; overflow: visible; padding: 10px 12px 4px; box-shadow: none; animation: none; border-radius: 6px; }
.shelf-exhibit { display: block; min-height: 44px; margin: 2px auto 0; }

.exhibit-dialog {
  width: min(520px, calc(100% - 26px));
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 26px);
  padding: 14px;
  border: 2px solid #945638;
  border-radius: 20px;
  background: #fff8ed;
  color: var(--ink);
  box-shadow: 0 12px 46px rgba(45, 26, 16, 0.4);
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.exhibit-dialog::backdrop { background: rgba(56, 34, 26, 0.55); }
.exhibit-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.exhibit-head h2 { margin: 0; font-size: 24px; }
.exhibit-preview {
  display: block;
  width: 100%;
  height: min(58dvh, 510px);
  object-fit: contain;
  border-radius: 10px;
  background: #f1e0c9;
}
.exhibit-status { margin: 8px 0; text-align: center; }
.exhibit-status:empty { display: none; }
.exhibit-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
.exhibit-actions a { display: inline-grid; place-items: center; text-decoration: none; }
.exhibit-actions a:focus-visible { outline: 3px solid var(--clay-deep); outline-offset: 3px; }

.help-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 6px; }

.help-steps li {
  counter-increment: step;
  position: relative;
  padding: 7px 10px 7px 40px;
  border-radius: 12px;
  background: var(--paper-2);
  font-size: 14px;
  line-height: 1.45;
}

.help-steps li::before {
  content: counter(step);
  position: absolute;
  left: 10px;
  top: 9px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--clay-wet);
  color: #fffaf3;
  font-size: 14px;
  font-weight: 700;
}

.help-steps b { display: block; font-size: 15.5px; }
.help-stamps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
.help-stamps li { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.help-stamps b { padding: 0 5px; border: 1.5px solid var(--seal); border-radius: 5px; color: var(--seal); font-size: 13px; white-space: nowrap; }

/* ---------- 動畫 ---------- */
@keyframes sign-in { from { opacity: 0; transform: translateY(-30px) rotate(-5deg); } to { opacity: 1; transform: translateY(0) rotate(-1.2deg); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes panel-in { from { opacity: 0; transform: translateY(18px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -10px) scale(0.9); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes stamp-in { 0% { opacity: 0; transform: rotate(-20deg) scale(2.2); } 60% { opacity: 1; transform: rotate(-6deg) scale(0.92); } 100% { opacity: 1; transform: rotate(-8deg) scale(1); } }
@keyframes tier-pop { 0% { transform: scale(1); } 40% { transform: scale(1.25) rotate(-3deg); } 100% { transform: scale(1); } }
@keyframes glow-pop { 0% { filter: drop-shadow(0 0 0 rgba(255, 220, 140, 0)); transform: translateY(-14px); } 40% { filter: drop-shadow(0 0 10px rgba(255, 220, 140, 0.95)); transform: translateY(0); } 100% { filter: drop-shadow(0 0 0 rgba(255, 220, 140, 0)); } }

/* ---------- 橫放的手機：畫面很矮，改成左右排 ---------- */
.is-wide .hud { display: flex; align-items: center; gap: 10px; padding: 6px 10px; }
.is-wide .hud-row { display: contents; }
.is-wide .hud-title { flex: 0 1 auto; max-width: 28%; }
.is-wide .hud-client { display: none; }
.is-wide .meter { flex: 1; }
.is-wide .meter-num { font-size: 21px; }
.is-wide .btn-done { order: 4; padding: 6px 14px; font-size: 16px; }
.is-wide #btnSoundHud { order: 5; }
.is-wide .slip { display: none; }
.is-wide .coach { top: 42%; left: auto; right: 14px; max-width: 34%; transform: none; }
.is-wide .toast { top: calc(env(safe-area-inset-top, 0px) + 64px); }
.is-wide .title-screen { align-items: flex-end; padding: calc(env(safe-area-inset-top, 0px) + 66px) 18px calc(env(safe-area-inset-bottom, 0px) + 14px); }
.is-wide .title-sign { align-self: flex-end; width: 34%; min-width: 250px; padding: 6px 14px 8px; }
.is-wide .title-main { font-size: 28px; }
.is-wide .title-sub { font-size: 13px; }
.is-wide .title-hint { display: none; }
.is-wide .title-bottom { width: 34%; min-width: 250px; }
.is-wide .title-actions { width: 100%; grid-template-columns: 1fr; gap: 8px; }
.is-wide .select-screen, .is-wide .shelf-screen { padding-top: calc(env(safe-area-inset-top, 0px) + 10px); }
.is-wide .select-head { display: none; }
.is-wide .glaze-screen { justify-content: center; align-items: flex-end; }
.is-wide .sheet { width: 46%; margin: 0 10px 0 0; padding: 10px 12px 12px; }
.is-wide .glaze-chip i { width: 38px; height: 38px; }
.is-wide .glaze-desc { min-height: 0; margin: 6px 0 8px; font-size: 14px; }
.is-wide .reveal-screen { flex-direction: row; justify-content: flex-end; align-items: center; padding-block: 10px; }
.is-wide .reveal-head { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 12px; }
.is-wide .label-card { width: 50%; max-height: 100%; }
.is-wide .kiln-screen { padding-bottom: 12px; }

@media (max-height: 640px) {
  .title-screen { padding-top: calc(env(safe-area-inset-top, 0px) + 58px); }
  .title-hint { display: none; }
  .title-main { font-size: 34px; }
  .label-card { max-height: 64%; }
  .label-note { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}
