:root {
  --bg: #080402;
  --wood-top: rgba(42, 20, 12, 0.84);
  --wood-bot: rgba(23, 10, 6, 0.9);
  --velvet-top: rgba(102, 18, 24, 0.88);
  --velvet-bot: rgba(58, 9, 14, 0.94);
  --spruce-top: rgba(20, 58, 35, 0.86);
  --spruce-bot: rgba(11, 34, 20, 0.92);
  --glass: rgba(30, 14, 9, 0.74);
  --glass-strong: rgba(26, 12, 8, 0.94);
  --line: rgba(226, 176, 94, 0.28);
  --line-bright: rgba(246, 206, 124, 0.62);
  --text: #fff3df;
  --muted: #d5ba98;
  --amber: #f3bd54;
  --gold: #e7b85c;
  --red: #a81c24;
  --green: #1e6b3c;
  --font-serif: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13.5px/1.42 var(--font-sans);
  overflow: hidden;
  user-select: none;
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }

button {
  background: linear-gradient(180deg, rgba(66, 34, 20, 0.72), rgba(38, 18, 10, 0.82));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px 11px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 226, 165, 0.16), 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s, opacity 0.25s;
}
button:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(114, 34, 28, 0.86), rgba(72, 18, 16, 0.92));
  border-color: var(--line-bright);
  box-shadow: inset 0 1px 0 rgba(255, 232, 180, 0.28), 0 4px 12px rgba(0, 0, 0, 0.45);
}
button:active:not(:disabled) { transform: scale(0.97); }
button:disabled { opacity: 0.4; cursor: default; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
}
button.primary {
  background: linear-gradient(180deg, #bf272d 0%, #861218 55%, #690c11 100%);
  border: 1px solid #f0be64;
  border-radius: 11px;
  color: #fff6e6;
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 235, 185, 0.35), 0 6px 18px rgba(168, 28, 36, 0.48);
}
button.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #d43238 0%, #9b161d 60%, #7a0f14 100%);
  border-color: #ffe094;
}
button.cancel {
  background: linear-gradient(180deg, rgba(30, 56, 38, 0.65), rgba(18, 36, 24, 0.82));
  border-color: rgba(140, 200, 155, 0.3);
}
button.cancel:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(40, 78, 52, 0.82), rgba(24, 52, 34, 0.9));
  border-color: rgba(185, 230, 190, 0.55);
}
button.off { opacity: 0.48; text-decoration: line-through; }
button.listening {
  background: linear-gradient(180deg, #d8362a, #9e1b14);
  border-color: #ffd38c;
  box-shadow: 0 0 16px rgba(235, 70, 52, 0.65);
}
input, textarea, select {
  background: rgba(12, 6, 4, 0.68);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 11px;
  width: 100%;
  user-select: text;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
}

/* Full-bleed stage so the 3D cabin fills the entire screen */
#app {
  position: relative;
  width: 100dvw;
  height: 100dvh;
  overflow: hidden;
}
#stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
#scene {
  width: 100%;
  height: 100%;
  display: block;
}
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 52%, transparent 56%, rgba(6, 3, 1, 0.55) 100%),
    linear-gradient(180deg, rgba(10, 5, 3, 0.44) 0%, transparent 14%, transparent 82%, rgba(10, 4, 2, 0.64) 100%);
}

/* Floating top mantelpiece HUD islands */
#topbar {
  position: absolute;
  top: 10px;
  left: 14px;
  right: 14px;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
  transition: opacity 0.7s ease;
}
.hud-island {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--wood-top), var(--wood-bot));
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  border: 1px solid rgba(226, 176, 94, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 224, 155, 0.24),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 8px 26px rgba(0, 0, 0, 0.52);
}
/* Delicate twinkling fairy-light beads tucked neatly along top trim */
.hud-island::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  top: -1px;
  height: 2px;
  border-radius: 2px;
  pointer-events: none;
  background: radial-gradient(circle, #ffd86f 0 1.4px, transparent 1.6px) 0 0 / 26px 2px repeat-x;
  opacity: 0.65;
}
.brand {
  font: 700 15.5px var(--font-serif);
  color: #ffe6b8;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85), 0 0 12px rgba(255, 180, 70, 0.25);
}
.divider {
  width: 1px;
  height: 18px;
  background: linear-gradient(180deg, transparent, rgba(226, 176, 94, 0.42), transparent);
}
.pill {
  padding: 3px 10px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--spruce-top), var(--spruce-bot));
  border: 1px solid rgba(116, 206, 146, 0.42);
  font-weight: 600;
  font-size: 12px;
  color: #dffae7;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(190, 255, 210, 0.16);
}
.pill.paid {
  background: linear-gradient(180deg, var(--velvet-top), var(--velvet-bot));
  border-color: rgba(240, 184, 92, 0.55);
  color: #ffe8bd;
}
.fuel {
  position: relative;
  width: 86px;
  height: 22px;
  border-radius: 8px;
  background: rgba(12, 5, 3, 0.72);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.55);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.fuel.low {
  border-color: rgba(255, 110, 80, 0.8);
  box-shadow: 0 0 10px rgba(255, 90, 60, 0.45);
}
#fuel-bar {
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, #8e2412, #ea7622, #f8cc66);
  transition: width 0.6s;
}
#fuel-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px #000;
}
#wallet {
  background: linear-gradient(180deg, rgba(132, 82, 22, 0.45), rgba(74, 42, 10, 0.65));
  border: 1px solid rgba(242, 192, 92, 0.6);
  border-radius: 9px;
  padding: 4px 10px;
  font-size: 12.5px;
  color: #ffedc4;
}
#wallet span {
  color: #ffd36b;
  font-weight: 800;
  margin-left: 2px;
}

.icon-btn {
  padding: 4px 9px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
  border-radius: 9px;
}
.icon-btn.active {
  background: linear-gradient(180deg, rgba(144, 30, 34, 0.78), rgba(88, 16, 20, 0.9));
  border-color: rgba(240, 190, 96, 0.65);
  color: #fff2d8;
}
.badge {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffd36a;
  box-shadow: 0 0 6px var(--amber);
}
#timer-left {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #ffd36b;
  font-size: 12px;
}

/* Carved holiday popovers */
.popover-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 256px;
  padding: 13px 14px;
  border-radius: 14px;
  background: linear-gradient(175deg, rgba(44, 21, 14, 0.96), rgba(22, 10, 7, 0.98));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1.5px solid rgba(232, 184, 92, 0.56);
  box-shadow: inset 0 0 0 3px rgba(255, 224, 155, 0.08), 0 16px 38px rgba(0, 0, 0, 0.72);
  display: grid;
  gap: 9px;
  z-index: 30;
}
.pop-title {
  font: 700 13px var(--font-serif);
  color: #ffe2ac;
  letter-spacing: 0.02em;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(232, 184, 92, 0.25);
}
.pop-row {
  display: flex;
  gap: 6px;
}
.pop-row button { flex: 1; text-align: center; }
.pop-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
}
.small-label { color: var(--muted); font-size: 12px; }
.model-pill { color: #ffd678; font-weight: 700; text-align: right; }
#santa-volume { width: 96px; padding: 0; accent-color: var(--amber); box-shadow: none; background: transparent; border: 0; }

/* Handcrafted wooden-hearth bottom shelf dock */
#dock {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  max-width: calc(100vw - 20px);
  overflow-x: auto;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(44, 20, 12, 0.78), rgba(22, 10, 6, 0.88));
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  border: 1.5px solid rgba(226, 176, 94, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 224, 155, 0.22),
    0 12px 32px rgba(0, 0, 0, 0.56);
  scrollbar-width: none;
  transition: opacity 0.7s ease, transform 0.4s ease;
}
#dock::-webkit-scrollbar { display: none; }
#dock button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(64, 32, 20, 0.72), rgba(38, 17, 10, 0.85));
  border: 1px solid rgba(226, 176, 94, 0.24);
  position: relative;
  overflow: hidden;
}
#dock button:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(132, 26, 30, 0.88), rgba(80, 14, 18, 0.94));
  border-color: rgba(246, 202, 110, 0.72);
  transform: translateY(-2px);
}
#dock .ico { font-size: 15px; line-height: 1; }
#dock .name {
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.015em;
  color: #ffefd6;
}
#dock .cost {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 7px;
  background: rgba(30, 107, 60, 0.45);
  display: none;
}
#dock .cost.paid {
  display: inline-block;
  background: linear-gradient(180deg, rgba(226, 170, 62, 0.32), rgba(162, 104, 24, 0.4));
  border: 1px solid rgba(246, 204, 114, 0.45);
  color: #ffe9b8;
}
#dock .cool {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2.5px;
  background: linear-gradient(90deg, #e7b85c, #ffe394);
}

/* Red velvet & gold-bordered Santa proclamation banner */
#banner {
  position: absolute;
  left: 50%;
  bottom: 78px;
  transform: translateX(-50%);
  width: min(620px, 90%);
  padding: 12px 22px;
  text-align: center;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--velvet-top), var(--velvet-bot));
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(235, 188, 92, 0.78);
  box-shadow:
    inset 0 0 0 3px rgba(255, 224, 150, 0.14),
    0 12px 36px rgba(0, 0, 0, 0.65);
  z-index: 8;
}
#banner-title { font: 700 13px var(--font-serif); color: #ffd98a; letter-spacing: 0.04em; }
#banner-text { font: italic 18px/1.34 var(--font-serif); margin-top: 3px; overflow-wrap: anywhere; color: #fff6e6; }

#voice-hint {
  position: absolute;
  left: 50%;
  top: 62px;
  transform: translateX(-50%);
  padding: 7px 16px;
  border-radius: 10px;
  background: linear-gradient(180deg, #be2b24, #841414);
  border: 1px solid #f0be64;
  backdrop-filter: blur(8px);
  max-width: 90%;
  z-index: 12;
}
#hover-tip {
  position: fixed;
  pointer-events: none;
  z-index: 16;
  padding: 6px 12px;
  border-radius: 9px;
  font: 700 12.5px var(--font-serif);
  color: #fff4df;
  background: linear-gradient(180deg, rgba(44, 21, 13, 0.94), rgba(24, 11, 7, 0.96));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(238, 192, 102, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 232, 175, 0.2), 0 8px 22px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  transform: translate(12px, -110%);
}
#toasts {
  position: absolute;
  left: 16px;
  top: 60px;
  display: grid;
  gap: 6px;
  max-width: min(355px, 78%);
  pointer-events: none;
  z-index: 8;
}
.toast {
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 12.5px;
  color: #fff3de;
  background: linear-gradient(180deg, rgba(44, 21, 13, 0.88), rgba(24, 11, 7, 0.94));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(232, 184, 92, 0.42);
  border-left: 3.5px solid #e7b85c;
  animation: toast 5s forwards;
  overflow-wrap: anywhere;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.48);
}
.toast.error {
  border-color: rgba(255, 135, 115, 0.65);
  border-left-color: #ff6e5a;
  background: linear-gradient(180deg, rgba(102, 22, 18, 0.92), rgba(62, 12, 10, 0.95));
}
@keyframes toast {
  0% { opacity: 0; transform: translateY(-6px); }
  6%, 85% { opacity: 1; transform: none; }
  100% { opacity: 0; }
}
#offline {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--glass-strong);
  backdrop-filter: blur(12px);
  border: 1.5px solid var(--line-bright);
  font-family: var(--font-serif);
  z-index: 15;
}
#tv-qr {
  position: absolute;
  right: 20px;
  bottom: 20px;
  display: grid;
  justify-items: center;
  gap: 4px;
  opacity: 0.86;
  font-size: 11px;
  color: #ffe8c4;
  text-shadow: 0 1px 3px #000;
}
#tv-qr img { width: 112px; height: 112px; border-radius: 10px; border: 2px solid rgba(232, 184, 92, 0.6); }

/* Cabin Guestbook floating corner — low & translucent at rest, rich spruce/velvet trim on hover */
#sidebar {
  position: absolute;
  right: 14px;
  bottom: 68px;
  width: 254px;
  height: min(244px, 34dvh);
  z-index: 9;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(20, 9, 6, 0.28);
  backdrop-filter: blur(5px) saturate(1.08);
  -webkit-backdrop-filter: blur(5px) saturate(1.08);
  border: 1px solid rgba(226, 176, 94, 0.24);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.36);
  transition: opacity 0.5s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), filter 0.5s ease, background 0.3s ease;
}
#sidebar:hover, #sidebar:focus-within {
  background: linear-gradient(180deg, rgba(36, 16, 11, 0.78), rgba(20, 9, 6, 0.86));
  border-color: rgba(235, 188, 96, 0.54);
}
body.chat-closed #sidebar {
  opacity: 0;
  pointer-events: none;
  transform: translateX(24px) scale(0.97);
}
body.clean #dock,
body.clean #sidebar,
body.clean #toasts {
  opacity: 0 !important;
  pointer-events: none !important;
}
body.clean #topbar { opacity: 0.25; }
body.clean #topbar:hover { opacity: 1; }
.side-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 11px;
  background: linear-gradient(90deg, rgba(102, 18, 24, 0.65), rgba(26, 62, 38, 0.55));
  border-bottom: 1px solid rgba(226, 176, 94, 0.32);
  font: 700 13.5px var(--font-serif);
  color: #ffe5b5;
}
.side-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
#btn-name {
  font: 11.5px var(--font-sans);
  padding: 3px 8px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.icon-sm {
  padding: 3px 7px;
  font-size: 11px;
  color: var(--muted);
}
#chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 8px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  user-select: text;
  scrollbar-width: thin;
}
.msg { overflow-wrap: anywhere; font-size: 13px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.72); }
.msg b { color: #ffd478; margin-right: 5px; }
.msg.system { color: var(--muted); font-style: italic; font-size: 12px; }
#lock-note { padding: 3px 12px; font-size: 11.5px; color: #a7ebbf; }
#chat-form {
  display: flex;
  gap: 6px;
  padding: 7px 9px;
  border-top: 1px solid rgba(226, 176, 94, 0.22);
  background: rgba(14, 6, 4, 0.35);
}
#chat-input {
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 13px;
  background: rgba(10, 5, 3, 0.52);
}
#chat-send {
  font-family: var(--font-serif);
  font-weight: 700;
  padding: 6px 12px;
  font-size: 12.5px;
  background: linear-gradient(180deg, rgba(168, 28, 36, 0.85), rgba(108, 14, 20, 0.92));
  border-color: rgba(240, 188, 92, 0.58);
}

/* Gentle auto-blending when idle or in focus break mode */
body.idle #topbar,
body.idle #dock,
body.idle #guestbook-slip { opacity: 0.38; }
body.idle #sidebar:not(:hover):not(:focus-within) { opacity: 0.28; }
body.idle #topbar:hover,
body.idle #dock:hover,
body.idle #guestbook-slip:hover,
body.idle #topbar:focus-within,
body.idle #dock:focus-within { opacity: 1; }
body.focus #sidebar { opacity: 0.14; filter: saturate(0.4); }
body.focus #sidebar:hover, body.focus #sidebar:focus-within { opacity: 0.96; filter: none; }

body.tv #topbar, body.tv #sidebar, body.tv #dock, body.tv #guestbook-slip, body.tv #dev, body.tv #admin, body.tv #toasts { display: none; }
body.tv #banner { bottom: 36px; }
body.tv { cursor: none; }

/* Nordic Yule Keepsake Dialogs — double gold filigree inlay, holly corner sprig & velvet warmth */
dialog {
  position: relative;
  overflow: visible;
  background:
    radial-gradient(circle at 50% 0%, rgba(160, 28, 34, 0.24), transparent 58%),
    linear-gradient(170deg, rgba(46, 20, 14, 0.97), rgba(21, 9, 6, 0.985));
  backdrop-filter: blur(20px);
  color: var(--text);
  border: 2px solid rgba(235, 186, 94, 0.72);
  border-radius: 18px;
  padding: 24px 26px 22px;
  width: min(454px, 92vw);
  box-shadow:
    inset 0 0 0 4px rgba(18, 8, 5, 0.65),
    inset 0 0 0 5px rgba(235, 186, 94, 0.28),
    0 26px 70px rgba(0, 0, 0, 0.88);
}
/* Hand-drawn SVG holly & berry corner ornament */
dialog::before {
  content: '';
  position: absolute;
  top: -12px;
  right: 18px;
  width: 68px;
  height: 36px;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 42'%3E%3Cpath d='M38 22 C24 8 10 12 4 24 C15 24 22 30 38 22 Z' fill='%23226c3b' stroke='%23e8b952' stroke-width='1.4'/%3E%3Cpath d='M42 22 C56 8 70 12 76 24 C65 24 58 30 42 22 Z' fill='%2319542d' stroke='%23e8b952' stroke-width='1.4'/%3E%3Ccircle cx='36' cy='21' r='4.5' fill='%23cf232b'/%3E%3Ccircle cx='44' cy='21' r='4.5' fill='%23cf232b'/%3E%3Ccircle cx='40' cy='15' r='4.5' fill='%23e43038'/%3E%3Ccircle cx='39' cy='14' r='1.3' fill='%23ffd8c8'/%3E%3C/svg%3E") no-repeat center / contain;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.55));
}
dialog::backdrop { background: rgba(6, 2, 1, 0.62); backdrop-filter: blur(5px); }
dialog h1, dialog h2 {
  font-family: var(--font-serif);
  margin: 0 0 10px;
  color: #ffe3ab;
  letter-spacing: 0.015em;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(235, 186, 94, 0.25);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}
dialog h1 { font-size: 24px; }
dialog h2 { font-size: 19.5px; }
dialog p { margin: 6px 0 10px; color: #edd7bc; }
dialog label { display: grid; gap: 5px; margin: 12px 0; font-size: 13px; color: var(--muted); font-family: var(--font-serif); }
dialog .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
dialog .row.end { justify-content: flex-end; }
dialog .small { font-size: 12px; color: var(--muted); }
dialog .price { font-weight: 700; color: #a7ebbf; }
dialog .error { color: #ff9e8e; font-weight: 600; }
#btn-enter { width: 100%; padding: 11px; font-size: 15.5px; margin-top: 6px; }

.salts { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 8px; }
.salts button {
  padding: 12px;
  font-family: var(--font-serif);
  font-weight: 700;
  border-radius: 12px;
  border-color: rgba(255, 232, 175, 0.45);
}
.salts .emerald { background: linear-gradient(135deg, #0d6934, #28bd62); }
.salts .ruby { background: linear-gradient(135deg, #7d0a18, #e63046); }
.salts .violet { background: linear-gradient(135deg, #3c178c, #9b52f5); }
.salts .gold { background: linear-gradient(135deg, #8a5608, #eeb22a); color: #fff8e2; }

#packs { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 6px; }
#packs button {
  display: grid;
  gap: 4px;
  padding: 12px 12px;
  border-radius: 12px;
  position: relative;
  text-align: center;
  background: linear-gradient(175deg, rgba(64, 24, 18, 0.85), rgba(34, 13, 10, 0.94));
  border: 1.5px solid rgba(235, 186, 94, 0.48);
}
#packs button:hover:not(:disabled) {
  background: linear-gradient(175deg, rgba(124, 24, 28, 0.92), rgba(74, 13, 16, 0.96));
  border-color: #ffe094;
}
#packs button:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
#packs b { font: 700 18px var(--font-serif); color: #ffd97a; }
#packs .pack-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: #dffae7;
  background: linear-gradient(180deg, var(--spruce-top), var(--spruce-bot));
  border: 1px solid rgba(130, 214, 156, 0.48);
  border-radius: 7px;
  padding: 1px 8px;
  justify-self: center;
}
.shop-tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 4px 0 10px;
}
.shop-tiers span {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(255, 210, 140, 0.08);
  border: 1px solid rgba(232, 184, 92, 0.28);
  color: #f6e0c2;
}

.spin-btn.ready {
  background: linear-gradient(180deg, rgba(188, 126, 26, 0.58), rgba(118, 72, 12, 0.72));
  border-color: rgba(255, 215, 118, 0.82);
  color: #fff2c8;
  box-shadow: 0 0 14px rgba(243, 189, 84, 0.35);
}
.wheel-wrap {
  position: relative;
  width: 304px;
  height: 304px;
  margin: 10px auto 6px;
  display: grid;
  place-items: center;
}
#spin-canvas {
  width: 296px;
  height: 296px;
  border-radius: 50%;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.72), 0 0 28px rgba(243, 189, 84, 0.32);
}
.wheel-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 24px;
  line-height: 1;
  color: #ffd86e;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  z-index: 2;
}
.spin-status {
  text-align: center;
  font: 700 13.5px var(--font-serif);
  color: #ffe3b0;
  min-height: 1.4em;
}

#banned { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(5, 2, 1, 0.94); z-index: 50; font: 22px var(--font-serif); }
#dev, #admin {
  position: fixed;
  left: 14px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  padding: 5px 10px;
  font-size: 11.5px;
  background: rgba(14, 24, 38, 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(102, 162, 214, 0.48);
  border-radius: 11px;
  max-width: calc(100vw - 28px);
}
#dev {
  top: 52px;
  right: 14px;
  left: auto;
  opacity: 0.74;
  transition: opacity 0.25s;
}
#dev:hover, #dev:focus-within { opacity: 1; }
#dev button, #admin button { padding: 2px 8px; }
#dev select, #admin input { width: auto; padding: 2px 8px; border-radius: 8px; }
#admin { top: 58px; background: rgba(56, 12, 12, 0.92); border-color: #d96b58; border-radius: 12px; }
#admin-list { flex-basis: 100%; max-height: 200px; overflow: auto; display: grid; gap: 2px; }
#admin-list div { display: flex; gap: 8px; align-items: center; }
#admin-list code { color: #ffb0a0; }

@media (max-width: 900px) {
  #dock { padding: 4px 6px; gap: 4px; }
  #dock button { padding: 5px 7px; }
  #dock .name { font-size: 11px; }
}
@media (max-width: 860px) {
  .brand span { display: none; }
  .divider { display: none; }
  .fuel { width: 74px; }
  #guestbook-slip { display: none; }
  #sidebar {
    width: min(260px, calc(100vw - 24px));
    height: min(210px, 32dvh);
    bottom: 62px;
  }
  #banner-text { font-size: 15.5px; }
  #timer-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .toast { animation-duration: 5s; }
  #fuel-bar { transition: none; }
}

/* Vintage aged ruled-paper Vieraskirja guestbook slip & open ledger sheet */
#guestbook-slip {
  position: absolute;
  left: 16px;
  bottom: 72px;
  z-index: 9;
  display: grid;
  justify-items: start;
  gap: 1px;
  min-width: 128px;
  padding: 11px 14px 10px 24px;
  border-radius: 4px 10px 7px 4px;
  transform: rotate(-1.6deg);
  transition: transform 0.25s ease, opacity 0.6s ease, box-shadow 0.25s ease;
  background-color: #f4e8ca;
  background-image:
    linear-gradient(90deg, transparent 17px, rgba(182, 46, 46, 0.45) 17px, rgba(182, 46, 46, 0.45) 19px, transparent 19px),
    repeating-linear-gradient(180deg, transparent 0 18px, rgba(96, 114, 146, 0.25) 18px 19px),
    linear-gradient(170deg, #f9f0d8 0%, #ead8b1 100%);
  border: 1px solid #bfa678;
  color: #2c1910;
  font-family: var(--font-serif);
  box-shadow:
    inset 0 0 12px rgba(138, 94, 42, 0.16),
    2px 6px 16px rgba(0, 0, 0, 0.56);
}
#guestbook-slip:hover {
  transform: rotate(0deg) translateY(-2px);
  border-color: #9e7e46;
  box-shadow:
    inset 0 0 14px rgba(138, 94, 42, 0.22),
    4px 10px 22px rgba(0, 0, 0, 0.68);
}
#guestbook-slip .paper-pin {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 11px;
  height: 11px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe69a, #b87e20 75%, #5c3b09);
  border: 1px solid rgba(72, 40, 8, 0.7);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
}
#guestbook-slip .gb-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7c201d;
}
#guestbook-slip .gb-count {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  color: #24130a;
  font-variant-numeric: tabular-nums;
  border-bottom: 1.5px solid rgba(124, 32, 29, 0.38);
  padding-bottom: 1px;
}
#guestbook-slip .gb-sub {
  font-size: 11px;
  font-style: italic;
  color: #5b3b24;
  margin-top: 2px;
}

dialog.paper-dialog {
  color: #2b180e;
  border: 2px solid #8a6434;
  padding: 24px 28px 22px 44px;
  background-color: #f6ebd1;
  background-image:
    linear-gradient(90deg, transparent 30px, rgba(182, 46, 46, 0.45) 30px, rgba(182, 46, 46, 0.45) 32px, transparent 32px),
    repeating-linear-gradient(180deg, transparent 0 29px, rgba(96, 114, 146, 0.24) 29px 30px),
    linear-gradient(175deg, #fbf3df 0%, #ead7b0 100%);
  box-shadow:
    inset 0 0 24px rgba(132, 86, 36, 0.18),
    0 24px 66px rgba(0, 0, 0, 0.86);
}
dialog.paper-dialog::before { opacity: 0.92; }
dialog.paper-dialog h2 {
  color: #6e1c18;
  border-bottom: 1.5px solid rgba(120, 32, 28, 0.35);
  text-shadow: none;
}
dialog.paper-dialog p { color: #3a2314; }
.gb-stamp-box {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 14px;
  padding: 10px 14px;
  border: 1.5px dashed rgba(118, 28, 26, 0.55);
  border-radius: 6px;
  background: rgba(255, 250, 236, 0.55);
  font-family: var(--font-serif);
}
.gb-stamp-box span { font-size: 13.5px; font-style: italic; color: #4a2d1b; }
.gb-stamp-box strong {
  font-size: 26px;
  color: #7c1c1a;
  font-variant-numeric: tabular-nums;
}
.gb-subhead { font: 700 13px var(--font-serif); color: #6e1c18; margin: 4px 0 6px; }
.gb-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  display: grid;
}
.gb-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  min-height: 30px;
  padding: 4px 2px;
  font: italic 14px var(--font-serif);
  color: #29170d;
  border-bottom: 1px solid rgba(96, 114, 146, 0.22);
}
.gb-list li span.gb-no { font-style: normal; font-weight: 700; color: #7c201d; margin-right: 6px; }
.gb-list li time { font-style: normal; font-size: 11.5px; color: #6b4c33; white-space: nowrap; }
dialog.paper-dialog button.cancel {
  background: linear-gradient(180deg, #8b2024, #631316);
  border-color: #b57b3c;
  color: #fff3dd;
}
