:root {
  --cream: #f4efe2;
  --paper: #fffcf4;
  --ink: #20231f;
  --muted: #77766d;
  --line: #dcd3bf;
  --red: #a02923;
  --deep: #172b49;
  --gold: #d4ad62;
  --green: #315a8f;
  font-family: Inter, "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --cream: #0b1220;
  --paper: #111c2e;
  --ink: #f5f0e4;
  --muted: #bbb7ac;
  --line: #344660;
  --red: #ff6253;
  --deep: #08111f;
  --gold: #e7c879;
  --green: #79a7e0;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-width: 0;
  min-height: 100%;
  overflow-x: hidden;
}
[data-theme="dark"] body {
  background-color: #0b110e;
}
body {
  background-color: #eee8dc;
  background-image: image-set(
    url("/public/assets/generated/site-04-scratch-pale-data-v2-desktop.avif") type("image/avif"),
    url("/public/assets/generated/site-04-scratch-pale-data-v2-desktop.webp") type("image/webp"),
    url("/public/assets/generated/site-04-scratch-pale-data-v2.png") type("image/png")
  );
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--ink);
}
button {
  font: inherit;
}
.scratch-shell {
  min-height: 100vh;
  padding: 34px max(20px, calc((100vw - 1240px) / 2)) 54px;
  background: linear-gradient(
    100deg,
    rgba(244, 239, 226, 0.96),
    rgba(244, 239, 226, 0.78) 50%,
    rgba(244, 239, 226, 0.9)
  );
}
[data-theme="dark"] .scratch-shell {
  background: linear-gradient(
    100deg,
    rgba(10, 17, 14, 0.97),
    rgba(16, 26, 21, 0.88) 50%,
    rgba(10, 17, 14, 0.95)
  );
}
.scratch-header {
  width: min(100%, 900px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.scratch-header > a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--red);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}
.scratch-header .icon,
.actions .icon {
  width: 1.2em;
  height: 1.2em;
  flex: 0 0 auto;
}
.scratch-header > a:hover {
  text-decoration: underline;
}
.scratch-header h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1;
  letter-spacing: -0.045em;
}
.scratch-layout {
  width: min(100%, 900px);
  margin: 20px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.ticket {
  min-width: 0;
  overflow: hidden;
  border-radius: 28px;
  background: var(--deep);
  color: #fff;
  box-shadow: 0 30px 90px rgba(24, 31, 25, 0.24);
}
.ticket-top,
.ticket-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.ticket-top {
  min-height: 86px;
  padding: 17px 25px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.19);
}
.ticket-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.ticket-brand > b {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--red);
  font-family: serif;
  font-size: 22px;
}
.ticket-brand span,
.issue span,
.issue strong {
  display: block;
}
.ticket-brand strong {
  font-size: 13px;
}
.ticket-brand small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 8px;
  letter-spacing: 0.15em;
}
.issue {
  text-align: right;
}
.issue span {
  color: rgba(255, 255, 255, 0.46);
  font-size: 9px;
}
.issue strong {
  margin-top: 3px;
  color: var(--gold);
  font-family: ui-monospace, monospace;
  font-size: 13px;
}
.ticket-body {
  padding: 24px;
}
.board {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 20px;
  background: #fffaf0;
  touch-action: none;
  user-select: none;
}
.result,
.foil,
.locked {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.result {
  z-index: 1;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #1d2924;
  text-align: center;
  background:
    radial-gradient(
      circle at 50% 35%,
      rgba(212, 173, 98, 0.25),
      transparent 35%
    ),
    repeating-linear-gradient(
      135deg,
      rgba(160, 41, 35, 0.025) 0 1px,
      transparent 1px 11px
    ),
    #fffaf0;
}
.result > span {
  color: #977238;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.17em;
}
.equation {
  margin-top: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1.1vw, 12px);
}
.equation b,
.equation em {
  width: clamp(52px, 7vw, 76px);
  height: clamp(52px, 7vw, 76px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: ui-monospace, monospace;
  font-size: clamp(26px, 4vw, 42px);
  font-style: normal;
  font-weight: 950;
}
.equation b {
  border: 1px solid #ddd2bd;
  background: #fff;
}
.equation em {
  background: var(--red);
  color: #fff;
}
.equation i {
  color: #a58145;
  font-style: normal;
  font-weight: 900;
}
.labels {
  margin-top: 17px;
  display: flex;
  gap: 7px;
}
.labels span {
  min-width: 43px;
  padding: 6px 10px;
  border: 1px solid #e1d7c6;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 10px;
  font-weight: 850;
}
.result > p {
  margin: 12px 0 0;
  color: #74786f;
  font-size: 10px;
}
.foil {
  z-index: 3;
  display: block;
  cursor: crosshair;
  transition:
    opacity 0.38s,
    transform 0.38s;
}
.foil:focus-visible {
  outline: 4px solid var(--gold);
  outline-offset: -6px;
}
.foil.revealed {
  pointer-events: none;
  opacity: 0;
  transform: scale(1.02);
}
.locked {
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: linear-gradient(135deg, #d6d2c7, #f4f0e8 48%, #c8c3b8);
  color: #353b37;
  text-align: center;
}
.locked[hidden] {
  display: none;
}
.lock-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(32, 35, 31, 0.16);
  border-radius: 50%;
}
.lock-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
}
.locked strong {
  margin-top: 13px;
  font-size: 14px;
}
.locked small {
  max-width: 390px;
  margin-top: 7px;
  color: #6f736e;
  font-size: 10px;
  line-height: 1.6;
}
.scratch-shell[data-state="conflict"] .locked {
  background: linear-gradient(135deg, #ead6d2, #f5e9e6, #dcbab4);
}
.scratch-shell[data-state="conflict"] .lock-icon {
  color: var(--red);
}
.progress-row {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}
.progress-row > span {
  color: rgba(255, 255, 255, 0.57);
  font-size: 10px;
}
.progress-row b {
  color: var(--gold);
  font-family: ui-monospace, monospace;
}
.progress-row > div {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.11);
}
.progress-row i {
  width: 0;
  height: 100%;
  display: block;
  background: linear-gradient(90deg, var(--red), var(--gold));
  transition: width 0.1s;
}
.actions {
  margin-top: 17px;
  display: flex;
  gap: 9px;
}
.actions button {
  min-height: 42px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}
.reveal {
  border: 0;
  background: var(--red);
  color: #fff;
}
.refresh {
  border: 1px solid rgba(255, 255, 255, 0.17);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.actions button:disabled {
  opacity: 0.43;
  cursor: not-allowed;
}
.ticket-foot {
  min-height: 68px;
  padding: 13px 25px;
  border-top: 1px dashed rgba(255, 255, 255, 0.19);
  background: rgba(0, 0, 0, 0.13);
}
.ticket-foot p {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 10px;
}
.ticket-foot > div {
  text-align: right;
}
.ticket-foot span,
.ticket-foot strong {
  display: block;
}
.ticket-foot span {
  color: rgba(255, 255, 255, 0.46);
  font-size: 9px;
}
.ticket-foot span b {
  color: rgba(255, 255, 255, 0.73);
}
.ticket-foot > div > strong {
  margin-top: 2px;
  color: var(--gold);
  font-family: ui-monospace, monospace;
  font-size: 16px;
}
.scratch-safe-belt {
  width: min(100%, 900px);
  min-height: 72px;
  margin: 14px auto 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}
.scratch-chat-dock {
  min-width: 214px;
  min-height: 56px;
  padding: 10px 13px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--red) 38%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  color: var(--ink);
  box-shadow: 0 16px 42px rgba(26, 36, 31, 0.16);
  text-decoration: none;
}
.scratch-chat-dock:hover {
  border-color: var(--red);
  transform: translateY(-1px);
}
.scratch-chat-dock:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.scratch-chat-dock > svg {
  width: 28px;
  height: 28px;
  padding: 6px;
  border-radius: 9px;
  background: var(--red);
  fill: none;
  stroke: #fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}
.scratch-chat-dock span {
  flex: 1;
}
.scratch-chat-dock small,
.scratch-chat-dock strong {
  display: block;
}
.scratch-chat-dock small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}
.scratch-chat-dock strong {
  margin-top: 2px;
  font-size: 12px;
}
.scratch-chat-dock > b {
  color: var(--red);
  font-size: 16px;
}
@media (max-width: 520px) {
  body {
    background-image: image-set(
      url("/public/assets/generated/site-04-scratch-pale-data-v2-mobile.avif") type("image/avif"),
      url("/public/assets/generated/site-04-scratch-pale-data-v2-mobile.webp") type("image/webp"),
      url("/public/assets/generated/site-04-scratch-pale-data-v2.png") type("image/png")
    );
  }
  .scratch-shell {
    padding: 18px 12px 28px;
  }
  .scratch-header {
    gap: 14px;
  }
  .scratch-header h1 {
    font-size: 30px;
  }
  .scratch-layout {
    margin-top: 14px;
  }
  .ticket {
    border-radius: 20px;
  }
  .ticket-top {
    min-height: 72px;
    padding: 13px 14px;
  }
  .ticket-brand > b {
    width: 37px;
    height: 37px;
    border-radius: 11px;
  }
  .ticket-brand small {
    display: none;
  }
  .ticket-body {
    padding: 12px;
  }
  .board {
    min-height: 255px;
    border-radius: 14px;
  }
  .result {
    padding: 20px 6px;
  }
  .equation {
    gap: 3px;
  }
  .equation b,
  .equation em {
    width: 48px;
    height: 48px;
    font-size: 25px;
  }
  .equation i {
    font-size: 11px;
  }
  .progress-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .actions button {
    padding: 0 8px;
  }
  .ticket-foot {
    min-height: 75px;
    padding: 12px 14px;
  }
  .ticket-foot p {
    max-width: 190px;
    line-height: 1.45;
  }
  .scratch-safe-belt {
    min-height: 68px;
    margin-top: 14px;
  }
  .scratch-chat-dock {
    width: 100%;
    min-width: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .foil,
  .progress-row i,
  .scratch-chat-dock {
    transition: none;
  }
}
