/* Christmas Cabin HUD · shared palette, surfaces and controls */
:root {
  --hud-ivory: #fff0d8;
  --hud-muted: #e4cbae;
  --hud-gold: #f2c68b;
  --hud-line: #f7d7af38;
  --hud-line-active: #ffd69ac2;
  --hud-glass: linear-gradient(145deg, #49362acf, #211917dc 66%, #302219e8);
  --hud-glass-soft: #1f1816bf;
  --hud-well: #100d0b55;
  --hud-well-hover: #dcb18424;
  --hud-accent: linear-gradient(140deg, #76502cca, #482a1bea 58%, #5d3b24e8);
  --hud-sheen: inset 0 1px 0 #fff1d31e;
  --hud-glow: inset 0 0 14px #ffbf5a32, 0 0 12px #d28d442b;
  --hud-blur: blur(16px) saturate(1.05);
  --hud-pill: 999px;
  --hud-panel: 25px;
  --hud-tile: 13px;
  --hud-serif: Georgia, 'Songti SC', 'STSong', 'Noto Serif CJK SC', serif;
  --hud-body: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --hud-snow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.35' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2v20M3.34 7l17.32 10M3.34 17 20.66 7M9 4l3 3 3-3M9 20l3-3 3 3M3.5 10.5l4-1.1-1.1-4M17.6 18.6l-1.1-4 4-1.1M3.5 13.5l4 1.1-1.1 4M17.6 5.4l-1.1 4 4 1.1'/%3E%3C/svg%3E");
  --hud-tree: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 40' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 5-6 9 3-.5-7 8 5-1L3 30l11-2v8h4v-8l11 2-8-9.5 5 1-7-8 3 .5ZM16 1v2M14 2h4'/%3E%3C/svg%3E");
}
body { font-family: var(--hud-body); --ink: var(--hud-ivory); --muted: var(--hud-muted); --line: var(--hud-line); }
button { touch-action: manipulation; }
:where(button, a):focus-visible,
#diy button:focus-visible {
  outline: 2px solid var(--hud-gold);
  outline-offset: 3px;
}
#cabin .wordmark { color: #fff4e4; gap: 12px; align-items: center; }
#cabin .wordmark > svg { display: none; }
#cabin .wordmark::before {
  content: '';
  width: 38px;
  height: 47px;
  flex: 0 0 auto;
  background: var(--hud-gold);
  mask: var(--hud-tree) center / contain no-repeat;
}
#cabin .wordmark > span {
  font: italic clamp(26px, 4vw, 49px)/.98 var(--hud-serif);
  text-shadow: 0 2px 12px #160e0a90;
}
#cabin .wordmark small {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--hud-muted);
  font: 12px/1.4 var(--hud-body);
  letter-spacing: .31em;
  margin-top: 9px;
}
#cabin .wordmark small::before,
#cabin .wordmark small::after {
  content: '';
  height: 1px;
  width: 26px;
  background: var(--hud-line-active);
}
#cabin .header-actions #motion::before {
  content: '';
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: var(--hud-snow) center / contain no-repeat;
}
#cabin .header-actions .quiet, #cabin .scene-nav .quiet,
#diy .diy-quiet, #diy .primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  border: 1px solid var(--hud-line);
  border-radius: var(--hud-pill);
  background: var(--hud-glass-soft);
  color: var(--hud-ivory);
  box-shadow: var(--hud-sheen);
  backdrop-filter: var(--hud-blur);
}
#cabin .header-actions .quiet { color: var(--hud-gold); }
#cabin .header-actions .quiet:hover:not(:disabled), #cabin .scene-nav .quiet:hover,
#diy .diy-quiet:hover:not(:disabled), #diy .primary:hover:not(:disabled) { border-color: var(--hud-line-active); }
#cabin .invitation {
  display: block;
  left: 50%;
  right: auto;
  bottom: clamp(24px, 4.6vh, 58px);
  transform: translateX(-50%);
  width: min(454px, calc(100% - 42px));
}
#cabin .invitation-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.28fr;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--hud-line);
  border-radius: var(--hud-pill);
  background: var(--hud-glass);
  box-shadow: var(--hud-sheen);
  backdrop-filter: var(--hud-blur);
}
#cabin .invitation-actions > button {
  min-width: 0;
  min-height: 44px;
  padding: 6px 9px;
  gap: 6px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--hud-pill);
  background: transparent;
  color: var(--hud-gold);
  font: 500 13px/1.1 var(--hud-body);
  letter-spacing: .03em;
}
#cabin .invitation-actions > button:nth-child(2) { position: relative; }
#cabin .invitation-actions > button:nth-child(2)::before {
  content: '';
  position: absolute;
  left: -3px;
  inset-block: 10px;
  width: 1px;
  background: var(--hud-line);
  pointer-events: none;
}
#cabin .invitation-actions button > svg { width: 18px; height: 18px; }
#cabin .invitation-actions > button:hover:not(:disabled) { background: var(--hud-well-hover); }
#cabin .invitation-actions > #decorate-prompt,
#diy #diy-finish {
  border-color: var(--hud-line-active);
  background: var(--hud-accent);
  color: var(--hud-ivory);
  box-shadow: var(--hud-glow);
}
#cabin .invitation-actions > #decorate-prompt { gap: 8px; box-shadow: inset 0 0 9px #ffbf5a22; }
#cabin footer { pointer-events: none; }
#cabin footer button { pointer-events: auto; color: var(--hud-muted); }
#cabin .shade { background: linear-gradient(180deg,#100a0778,transparent 20%,transparent 69%,#100a0780); }
#cabin #notice, #cabin #load-error, #cabin #credit-dialog,
#diy #diy-status, #diy #diy-drop-guide {
  border: 1px solid var(--hud-line);
  border-radius: var(--hud-panel);
  background: var(--hud-glass);
  color: var(--hud-ivory);
  backdrop-filter: var(--hud-blur);
}
#diy > header { pointer-events: none; z-index: 2; }
#diy > header > :is(button, .diy-header-actions) { pointer-events: auto; }
#diy .diy-header h1 {
  color: var(--hud-ivory);
  font-family: var(--hud-serif);
  letter-spacing: .075em;
  text-shadow: 0 2px 14px #090705a0;
}
#diy .diy-header p, #diy #diy-hint { color: var(--hud-muted); }
#diy .diy-header-actions { gap: 7px; }
#diy #diy-materials {
  border: 1px solid var(--hud-line);
  border-radius: var(--hud-panel);
  background: var(--hud-glass);
  backdrop-filter: var(--hud-blur);
  box-shadow: var(--hud-sheen);
}
#diy .diy-material-heading h2 { color: var(--hud-gold); font: 600 15px/1.35 var(--hud-serif); }
#diy .diy-asset {
  border-radius: var(--hud-tile);
  border-color: transparent;
  background: var(--hud-well);
  color: var(--hud-muted);
}
#diy .diy-asset:hover:not(:disabled) { background: var(--hud-well-hover); }
#diy .diy-asset[aria-pressed="true"] {
  border-color: var(--hud-line-active);
  background: var(--hud-well-hover);
  color: var(--hud-ivory);
}
#diy .diy-editbar { gap: 8px; }
#diy #diy-remove { color: #ffd0b8; }
#diy #diy-materials .private-palette-filter { gap: 3px; padding: 3px; border-radius: var(--hud-pill); background: var(--hud-well); }
#diy #diy-materials .private-palette-filter button,
#diy .private-blind-redraw {
  border-radius: var(--hud-pill);
  border: 1px solid transparent;
  padding-inline: 9px;
  color: var(--hud-muted);
  background: transparent;
  min-height: 38px;
}
#diy #diy-materials .private-palette-filter button:hover,
#diy .private-blind-redraw:hover { background: var(--hud-well-hover); }
#diy #diy-materials .private-palette-filter [aria-pressed="true"],
#diy .private-blind-redraw {
  color: var(--hud-ivory);
  border-color: var(--hud-line-active);
  background: var(--hud-accent);
}
#diy .private-box-mode #diy-assets {
  border-radius: var(--hud-tile);
  background: radial-gradient(ellipse at 50% 68%,#73503138,transparent 75%),var(--hud-well);
}
#diy .private-box-mode #diy-assets:has(.private-secret-effect:not([hidden])) {
  box-shadow: inset 0 0 0 1px var(--hud-line-active), inset 0 0 23px #bd782724;
}
#diy .private-secret-copy {
  border: 1px solid var(--hud-line-active);
  border-radius: var(--hud-pill);
  background: #392419f2;
  color: var(--hud-ivory);
  box-shadow: var(--hud-glow);
}
@media (min-width: 1120px) and (min-height: 541px) {
  #diy #diy-materials:not(.private-box-mode) { width: 245px; }
  #diy #diy-materials:not(.private-box-mode) #diy-assets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  #cabin > header { padding: 16px 14px; gap: 6px; align-items: flex-start; }
  #cabin .wordmark { gap: 5px; }
  #cabin .wordmark::before { width: 21px; height: 29px; }
  #cabin .wordmark > span { font-size: clamp(17px, 5vw, 27px); }
  #cabin .wordmark small { gap: 5px; font-size: 9px; letter-spacing: .15em; margin-top: 6px; }
  #cabin .wordmark small::before, #cabin .wordmark small::after { width: 10px; }
  #cabin .header-actions { gap: 4px; }
  #cabin .header-actions .quiet { min-height: 36px; padding: 6px 7px; font-size: 10px; white-space: nowrap; }
  #cabin .header-actions #motion::before, #cabin .header-actions svg { width: 13px; height: 13px; }
  #cabin .invitation { bottom: 110px; width: min(332px, calc(100% - 26px)); }
  #cabin .invitation-actions { gap: 4px; padding: 5px; }
  #cabin .invitation-actions > button { min-height: 44px; padding: 5px 3px; font-size: 10px; }
  #cabin .invitation-actions button > svg { width: 15px; height: 15px; }
  #cabin .invitation-actions > #decorate-prompt { gap: 4px; }
  #cabin .invitation-actions > button:nth-child(2)::before { left: -3px; }
  #diy > header { padding: 12px; gap: 7px; }
  #diy .diy-header h1 { font-size: 17px; }
  #diy .diy-header p { font-size: 9px; }
  #diy .diy-header-actions { gap: 3px; max-width: 160px; }
  #diy .diy-header :is(.diy-quiet,.primary) { padding: 8px; font-size: 10px; min-height: 38px; }
  #diy #diy-materials { border-radius: 20px; }
}
@media (max-width: 360px) and (orientation: portrait) {
  #diy .diy-editbar { display: flex; }
  #diy #diy-undo { position: static; }
  #cabin .header-actions #motion::before { display: none; }
  #cabin .header-actions .quiet { padding-inline: 6px; }
}
@media (max-height: 540px) and (orientation: landscape) {
  #cabin .invitation { bottom: 19px; width: min(365px, 70vw); }
  #cabin .invitation-actions > button { min-height: 44px; flex-direction: row; gap: 5px; }
  #cabin .invitation-actions > button > svg { width: 17px; height: 17px; }
}

#diy .private-box-mode #diy-assets [data-asset]:not([aria-pressed="true"]):not(:hover) {
  background: transparent;
}
@media (min-width: 1000px) and (min-height: 541px) {
  #cabin .invitation { width: min(492px, calc(100% - 42px)); }
  #cabin .invitation-actions > button { min-height: 46px; font-size: 13px; }
  #cabin .invitation-actions button > svg { width: 19px; height: 19px; }
}
@media (max-width: 900px) and (orientation: portrait) {
  body #diy .diy-editbar { bottom: 164px; }
  body #diy:has(.private-palette-filter) .diy-editbar { bottom: 198px; }
  body #diy:has(.private-box-mode) .diy-editbar { bottom: 284px; }
  body #diy:has(.private-box-mode .private-blind-redraw:not([hidden])) .diy-editbar { bottom: 323px; }
}

#diy #diy-hint {
  border-radius: 6px;
  transition: color .45s ease, background-color .45s ease, box-shadow .45s ease;
}
#diy #diy-hint.diy-hint-highlight {
  color: var(--hud-ivory);
  background-color: #75502f;
  box-shadow: 0 0 0 4px #75502f, 0 0 14px 3px #eab66d53;
}
#diy #diy-hint.diy-hint-still { transition: none; }
