@font-face { font-family: Cubic; src: url(/fonts/cubic11.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Jersey; src: url(/fonts/jersey10.woff2) format("woff2"); font-display: swap; }
:root {
  --desk: #f7d5d5; --cream: #faf1e8; --cream-lite: #fdf8f4; --line: #d8cfc8; --note: #faf5c6;
  --pink: #f6d6d5; --pink-dn: #ddc1c0; --teal: #afe5dd; --teal-dn: #9ecec7; --tag: #dcdcdc;
  --ink: #1f1a1a; --accent: #e2557f; --red: #e8423f;
  --font: Cubic, "PingFang TC", "Noto Sans TC", sans-serif;
  --shadow: 0 50px 80px -50px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.5 var(--font); color: var(--ink); overflow: hidden;
  background: var(--desk) url(/icons/bg.svg) 0 0 / 8px 8px; -webkit-font-smoothing: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
img { image-rendering: pixelated; }
input, select, textarea {
  font: inherit; color: inherit; width: 100%; padding: 5px 8px; background: #fff;
  border: 1px solid var(--ink); border-radius: 4px; outline: none;
}
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 2px var(--teal); }

/* ---------- menubar: corner tabs ---------- */
#menubar { position: fixed; inset: 0 0 auto; height: 31px; display: flex; justify-content: space-between; z-index: 9999; pointer-events: none; }
.bar { display: flex; align-items: stretch; background: var(--cream); border: 1px solid var(--ink); border-top: 0; pointer-events: auto; text-transform: uppercase; letter-spacing: .5px; }
.bar.left { border-left: 0; border-bottom-right-radius: 6px; }
.bar.right { border-right: 0; border-bottom-left-radius: 6px; }
.bar > * { display: flex; align-items: center; gap: 6px; padding: 0 12px; }
.bar > * + * { border-left: 1px solid var(--ink); }
.bar button { background: none; border-top: 0; border-right: 0; border-bottom: 0; }
.bar button:hover { background: var(--cream-lite); }
.logo { width: 31px; justify-content: center; padding: 0; background: var(--ink); user-select: none; }

/* ---------- desktop + hero player ---------- */
#desktop { position: fixed; inset: 31px 0 71px; padding: 16px; display: flex; align-items: center; justify-content: center; overflow: auto; }
.window {
  position: absolute; display: flex; flex-direction: column; min-width: 280px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 110px);
  background: var(--note); border: 1px solid var(--ink); border-radius: 6px; box-shadow: var(--shadow);
}
#hero { position: relative; width: 600px; max-width: 100%; max-height: none; margin: auto; padding: 0 6px 8px; gap: 5px; background: var(--cream); }
#hero .titlebar { height: 32px; padding: 0; cursor: default; }
.sq { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 3px; background: var(--ink); display: grid; place-items: center; }
#site-title { margin: 0 2px 0 auto; font: 26px/1 Jersey, var(--font); text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.screen { border: 1px solid var(--ink); border-radius: 4px; overflow: hidden; background: var(--ink); }
.stage { height: clamp(200px, 50dvh, 420px); display: flex; align-items: center; justify-content: center; }
#hero .stage { height: clamp(180px, calc(100dvh - 360px), 430px); cursor: zoom-in; }
.stage img, .stage video { width: 100%; height: 100%; object-fit: contain; display: block; }
#hero .stage img, #hero .stage video { object-fit: cover; }
.strip { height: 18px; display: flex; align-items: center; gap: 8px; padding-left: 8px; color: #fff; border-top: 1px solid var(--ink); }
.strip .cap { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip span:last-child { padding-right: 8px; }
.expand { width: 18px; height: 17px; flex: none; padding: 0; border: 0; border-left: 1px solid #fff; background: var(--ink) url(/icons/expand.svg) center no-repeat; }

.panel { background: #fff; border: 1px solid var(--ink); border-bottom-width: 3px; border-radius: 5px; padding: 8px 10px; }
#announce-box { padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
#announce { margin: 2px 0 0; white-space: pre-wrap; max-height: 6em; overflow: auto; }
.dot { display: inline-block; width: 6px; height: 6px; margin: 0 0 1px 4px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px #fcd3d3; animation: blink 1.6s steps(1) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.ctl { display: flex; align-items: center; gap: 6px; }
.status { flex: 1; min-width: 0; font-weight: bold; }
.status::before { content: ""; display: block; width: 0; margin-bottom: 2px; border-left: 4px solid var(--ink); border-block: 3px solid transparent; }

/* ---------- buttons ---------- */
.btn, .seg, .field, .tabs button { border: 1px solid var(--ink); border-radius: 5px; box-shadow: 0 2px 0 var(--ink); }
.btn { background: var(--cream); padding: 4px 12px; }
.btn:active, .tabs button:active, .seg button:active { translate: 0 2px; box-shadow: none; }
.btn.pink { background: var(--pink); } .btn.pink:hover { background: var(--pink-dn); }
.btn.primary { background: var(--teal); } .btn.primary:hover { background: var(--teal-dn); }
.btn.wide { width: 100%; padding: 6px; }
.btn.sm { padding: 0 8px; margin: 1px 2px 3px 0; }
.btn:disabled { opacity: .4; cursor: default; }
.seg { display: flex; overflow: hidden; background: var(--cream); flex: none; }
.seg button { width: 42px; height: 26px; padding: 0; border: 0; background: none; display: grid; place-items: center; }
.seg button + button { border-left: 1px solid var(--ink); }
.seg button:hover { background: var(--cream-lite); }
.seg .play { width: 52px; background: var(--teal); } .seg .play:hover { background: var(--teal-dn); }

.field { display: flex; align-items: center; gap: 6px; height: 26px; margin-bottom: 2px; padding: 0 8px; background: var(--cream); }
.field select { flex: 1; width: auto; min-width: 0; padding: 0; border: 0; background: none; appearance: none; box-shadow: none; cursor: pointer; }
.tag { padding: 0 4px; border-radius: 2px; background: var(--tag); }
.field::after { content: ""; width: 7px; height: 4px; background: url(/icons/caret.svg); }

/* ---------- dock ---------- */
#dock { position: fixed; bottom: 0; left: 50%; translate: -50% 0; display: flex; z-index: 5; }
.icon {
  width: 80px; height: 71px; margin-left: -1px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: var(--cream); border: 1px solid var(--ink); border-bottom: 0;
}
.icon:first-child { border-top-left-radius: 6px; } .icon:last-child { border-top-right-radius: 6px; }
.icon:hover { background: var(--cream-lite); }
.icon:active img { translate: 0 1px; }
.icon img { width: 32px; height: 32px; }

/* ---------- content windows ---------- */
.window .titlebar { height: 26px; flex: none; display: flex; align-items: center; padding: 0 6px; cursor: grab; user-select: none; touch-action: none; }
.btn-close { width: 18px; height: 18px; padding: 0; border: 0; background: url(/icons/close.svg) center no-repeat; }
.btn-close:hover { background-color: rgba(0, 0, 0, .08); border-radius: 3px; }
.body { flex: 1; min-height: 0; overflow: auto; padding: 0 20px 20px; }
.body::-webkit-scrollbar { width: 13px; }
.body::-webkit-scrollbar-track { background: var(--cream-lite); border-left: 1px solid var(--ink); }
.body::-webkit-scrollbar-thumb { background: var(--cream); border: 1px solid var(--ink); border-radius: 3px; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.head h2 { margin: 4px 0 0; font-size: 40px; line-height: 1.1; font-weight: normal; }
.head img { width: 48px; height: 48px; flex: none; }
.window.max { inset: 40px 8px 80px !important; width: auto !important; max-width: none; max-height: none; }

.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 4px; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.msg { min-height: 1.5em; color: var(--accent); }
.info { white-space: pre-wrap; margin: 0; font: inherit; line-height: 1.8; }

.price { list-style: none; margin: 0 0 16px; padding: 0; }
.price li { display: flex; align-items: baseline; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--ink); }
.price span { flex: 1; }
.price small { opacity: .6; font-size: inherit; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { background: var(--cream); padding: 2px 10px; }
.tabs button.on { background: var(--teal); }
.gallery-ctl { display: flex; gap: 8px; align-items: center; margin: 8px 0 6px; }
.thumbs { flex: 1; min-width: 0; display: flex; gap: 4px; overflow-x: auto; padding: 2px; }
.thumbs img { width: 56px; height: 42px; object-fit: cover; flex: none; cursor: pointer; border: 1px solid var(--ink); border-radius: 3px; image-rendering: auto; }
.thumbs img.on { outline: 2px solid var(--accent); }

table { border-collapse: collapse; width: 100%; background: #fff; font-size: 14px; }
th, td { border: 1px solid var(--ink); padding: 3px 6px; text-align: left; vertical-align: top; }
th { background: var(--cream); }
td input { padding: 1px 4px; }
.toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.toolbar select, .toolbar input { width: auto; }
.status-pending { color: #b8860b; } .status-accepted { color: #1a7f37; } .status-rejected { color: #c00; } .status-done { color: #666; }

/* ---------- booking wizard ---------- */
.steps { display: flex; gap: 4px; margin-bottom: 12px; }
.steps button { flex: 1; padding: 3px 0; border: 1px solid var(--ink); border-radius: 4px; background: var(--cream); white-space: nowrap; opacity: .5; }
.steps button.on { background: var(--teal); opacity: 1; } .steps button.done { opacity: 1; }
.step-body { min-height: 220px; }
.list { display: grid; gap: 8px; }
.svc { display: flex; align-items: baseline; gap: 8px; padding: 10px; text-align: left; background: #fff; border: 1px solid var(--ink); border-radius: 5px; box-shadow: 0 2px 0 var(--ink); }
.svc b { flex: 1; font-weight: normal; } .svc small { opacity: .6; }
.svc.on { background: var(--teal); }
.addons { display: grid; gap: 6px; margin: -2px 0 4px 16px; padding-left: 8px; border-left: 2px solid var(--ink); }
.addons small { opacity: .6; }
.svc.add { padding: 6px 10px; } .svc.add::before { content: ""; width: 10px; height: 10px; border: 1px solid var(--ink); background: #fff; align-self: center; }
.svc.add.on { background: var(--teal); } .svc.add.on::before { background: var(--ink); }
.total { display: flex; flex-direction: column; justify-content: center; line-height: 1.2; padding: 0 4px; } .total b { font-weight: normal; font-size: 1.3em; }
tr.sub td { background: var(--cream-lite); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.cal i { font-style: normal; opacity: .6; }
.cal button, .slots button { padding: 4px 0; border: 1px solid var(--ink); border-radius: 4px; background: #fff; }
.cal button.on, .slots button.on { background: var(--teal); }
.slots button { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.slots small { font-size: 11px; }
.slots .green { background: #bfe9c4; } .slots .yellow { background: #fbe58a; } .slots .red { background: #f4a3a0; }
.slots button.on { outline: 2px solid var(--ink); outline-offset: 1px; }
.slots button.gray:disabled { background: #e4e1dc; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 12px; font-size: 12px; }
.legend i { width: 10px; height: 10px; border: 1px solid var(--ink); margin-left: 6px; } .legend i:first-child { margin-left: 0; }
.legend .green { background: #bfe9c4; } .legend .yellow { background: #fbe58a; } .legend .red { background: #f4a3a0; } .legend .gray { background: #e4e1dc; }
.warn { margin-top: 10px; padding: 8px 10px; background: #fff3c4; border: 1px solid var(--ink); border-radius: 5px; }
.svc small { margin-left: auto; }
.total small { opacity: .7; font-size: 12px; }
.cal button:disabled, .slots button:disabled { border-color: var(--line); color: #bbb; background: transparent; cursor: default; }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 12px; }
.confirm { display: grid; gap: 6px; background: #fff; border: 1px solid var(--ink); border-radius: 5px; padding: 10px 12px; }
.confirm div { display: flex; gap: 12px; } .confirm small { width: 3em; opacity: .6; } .confirm b { font-weight: normal; white-space: pre-wrap; word-break: break-all; }
.actions { display: flex; gap: 8px; margin-top: 8px; position: sticky; bottom: -20px; padding: 8px 0 12px; background: var(--note); } .actions .btn { flex: 1; padding: 6px; } .actions .total { flex: none; }
.done-card { text-align: center; padding: 24px 0; } .done-card img { width: 64px; height: 64px; } .done-card p { white-space: pre-line; }

/* ---------- phone ---------- */
@media (max-width: 600px) {
  body { font-size: 18px; }
  #menubar { inset: 8px 8px auto; height: 40px; }
  .bar { border: 1px solid var(--ink) !important; border-radius: 6px !important; box-shadow: 0 2px 0 var(--ink); overflow: hidden; }
  .logo { width: 40px; }
  #date { display: none !important; }
  #desktop { inset: 58px 0 calc(96px + env(safe-area-inset-bottom)); padding: 8px 16px; align-items: flex-start; }
  .stage { height: clamp(200px, calc(100dvh - 440px), 120vw); }
  #hero .stage { height: clamp(200px, calc(100dvh - 430px), 120vw); }
  .icon:hover, .bar button:hover { background: none; }
  .strip, .tag, .icon { font-size: 14px; }
  .strip { height: 20px; }
  .seg button { width: 40px; height: 34px; }
  .seg .play { width: 48px; }
  .btn { padding: 6px 12px; }
  .btn.sm { padding: 2px 10px; }
  .field { height: 34px; }
  #dock {
    left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); translate: none; justify-content: space-around; padding: 8px 4px;
    background: var(--cream); border: 1px solid var(--ink); border-radius: 8px; box-shadow: 0 2px 0 var(--ink);
  }
  .icon { flex: 1; width: auto; height: auto; margin: 0; border: 0; border-radius: 0 !important; background: none; gap: 4px; }
  .window:not(#hero) { position: fixed; inset: 58px 8px calc(104px + env(safe-area-inset-bottom)) !important; width: auto !important; max-width: none; max-height: none; }
  .window .titlebar { height: 34px; cursor: default; }
  .btn-close { width: 30px; height: 30px; }
  .body { padding: 0 16px 16px; }
  .row { flex-direction: column; }
  table { font-size: 13px; }
  .body:has(table) { overflow-x: auto; }
}
.slots button.red:disabled { background: #f4a3a0; border-color: var(--ink); color: var(--ink); opacity: .85; }

/* ---------- short screens: scale everything down proportionally ---------- */
@media (max-height: 760px) {
  html { zoom: .9; }
}
@media (max-height: 680px) {
  html { zoom: .8; }
}
@media (max-height: 600px) {
  html { zoom: .7; }
}
