:root {
  --bg: #f3f0e9;
  --card: #fbfaf6;
  --ink: #1d1c19;
  --soft: rgba(29, 28, 25, 0.58);
  --faint: rgba(29, 28, 25, 0.3);
  --line: rgba(29, 28, 25, 0.1);
  --door: #e9e5db;
  --accent: #2f6bff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 12px;
}

.lk { position: relative; width: min(324px, 100%); padding: 14px; border-radius: 26px; background: var(--card); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(29, 28, 25, 0.05), 0 28px 46px -28px rgba(29, 28, 25, 0.35); }

.lk__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 2px; }
.lk__name { min-width: 0; display: grid; }
.lk__name b { font-size: 16px; line-height: 21px; font-weight: 740; font-stretch: 108%; letter-spacing: -0.012em; }
.lk__name span { font-size: 11.500px; line-height: 15px; font-weight: 540; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk__free { flex: none; display: flex; align-items: baseline; gap: 5px; font-variant-numeric: tabular-nums; }
.lk__free b { display: block; height: 28px; overflow: hidden; font-size: 24px; line-height: 28px; font-weight: 760; letter-spacing: -0.02em; }
.lk__free b span { display: block; }
.lk__free > span { font-size: 11.500px; font-weight: 580; color: var(--soft); }

.lk__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin-top: 12px; padding: 5px; border-radius: 14px; background: #dedacf; box-shadow: inset 0 1px 2px rgba(29, 28, 25, 0.18); }
.lk__cell { position: relative; height: 42px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; outline: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.lk__cell:disabled { cursor: default; }
.lk__cell:focus-visible, .lk__go:focus-visible { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
/* what is behind the door */
.lk__in { position: absolute; inset: 0; border-radius: 7px; background: linear-gradient(90deg, #2a2823, #45423a 70%); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5); }
.lk__in::after { content: ""; position: absolute; left: 22%; right: 12%; top: 34%; height: 1.500px; border-radius: 1px; background: rgba(255, 255, 255, 0.16); }
.lk__door { position: absolute; inset: 0; display: block; border-radius: 7px; background: linear-gradient(180deg, #f6f3ec, var(--door)); box-shadow: inset 0 0 0 1px rgba(29, 28, 25, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 1.500px rgba(29, 28, 25, 0.2); transform-origin: 0 50%; backface-visibility: hidden; transition: background 0.3s ease, box-shadow 0.3s ease; }
.lk__door b { position: absolute; left: 0; right: 0; top: 15px; font-size: 12.500px; line-height: 16px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; transition: color 0.3s ease, opacity 0.3s ease; }
/* the air slots at the top of every door */
.lk__vents { position: absolute; left: 50%; top: 6px; width: 16px; height: 5px; margin-left: -8px; background: linear-gradient(rgba(29, 28, 25, 0.26), rgba(29, 28, 25, 0.26)) 0 0 / 100% 1.500px no-repeat, linear-gradient(rgba(29, 28, 25, 0.26), rgba(29, 28, 25, 0.26)) 0 100% / 100% 1.500px no-repeat; }
.lk__handle { position: absolute; right: 5px; top: 50%; width: 2.500px; height: 12px; margin-top: -6px; border-radius: 1.500px; background: rgba(29, 28, 25, 0.3); transition: background-color 0.3s ease; }
.lk__lock { position: absolute; left: 50%; bottom: 3px; width: 11px; height: 11px; margin-left: -5.500px; fill: none; stroke: currentColor; stroke-width: 1.500; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity 0.25s ease; }
.lk__cell.is-taken .lk__door { background: linear-gradient(180deg, #d5d0c4, #cbc6b9); box-shadow: inset 0 0 0 1px rgba(29, 28, 25, 0.08), 0 1px 1px rgba(29, 28, 25, 0.12); }
.lk__cell.is-taken .lk__door b { top: 11px; opacity: 0.38; }
.lk__cell.is-taken .lk__lock { opacity: 0.4; }
.lk__cell.is-open .lk__door { box-shadow: inset 0 0 0 1.500px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.9), 6px 2px 8px -3px rgba(0, 0, 0, 0.45); }
.lk__cell.is-open .lk__door b { color: var(--accent); }
.lk__cell.is-mine .lk__door { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #ffffff), var(--accent)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 8px -4px color-mix(in srgb, var(--accent) 80%, #000000); }
.lk__cell.is-mine .lk__door b { top: 11px; color: #ffffff; }
.lk__cell.is-mine .lk__lock { opacity: 1; color: #ffffff; }
.lk__cell.is-mine .lk__vents { opacity: 0.6; filter: invert(1); }
.lk__cell.is-mine .lk__handle { background: rgba(255, 255, 255, 0.6); }
@media (hover: hover) { .lk__cell:not(:disabled):not(.is-open):not(.is-mine):hover .lk__door { background: #ffffff; } }

.lk__panel { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 11px; padding: 0 2px; }
.lk__what { min-width: 0; display: grid; }
.lk__roll { display: block; height: 19px; overflow: hidden; font-size: 14px; line-height: 19px; font-weight: 700; white-space: nowrap; }
.lk__roll span { display: block; overflow: hidden; text-overflow: ellipsis; }
.lk__roll--sub { height: 15px; font-size: 11.500px; line-height: 15px; font-weight: 540; color: var(--soft); }
.lk__code { flex: none; display: flex; gap: 4px; }
.lk__code i { position: relative; display: block; width: 26px; height: 34px; border-radius: 8px; background: #eeeae0; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; font-style: normal; transition: background-color 0.3s ease, box-shadow 0.3s ease; }
.lk__code i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 16px; height: 2px; border-radius: 1px; background: var(--faint); transition: opacity 0.2s ease; }
.lk__code b { display: block; font-size: 18px; line-height: 34px; font-weight: 740; text-align: center; font-variant-numeric: tabular-nums; }
.lk.has-code .lk__code i { background: color-mix(in srgb, var(--accent) 9%, #ffffff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.lk.has-code .lk__code i::after { opacity: 0; }

.lk__go { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 44px; margin-top: 11px; border: 0; border-radius: 14px; background: var(--ink); color: #ffffff; font: inherit; font-size: 13.500px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; outline: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 14px 22px -14px rgba(29, 28, 25, 0.7); transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.lk__go svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.500; stroke-linecap: round; stroke-linejoin: round; }
.lk__go:disabled { background: #ebe7dd; color: var(--soft); box-shadow: inset 0 0 0 1px var(--line); cursor: default; }
.lk.is-locked .lk__go { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.500px rgba(29, 28, 25, 0.22); }
.lk__gotext { display: block; height: 20px; line-height: 20px; overflow: hidden; }
.lk__gotext span { display: block; white-space: nowrap; }
@media (hover: hover) { .lk:not(.is-locked) .lk__go:not(:disabled):hover { background: #34322d; } .lk.is-locked .lk__go:hover { background: rgba(29, 28, 25, 0.05); } }

.lk__live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; transform-origin: 20% 15%; pointer-events: none; opacity: 0; fill: #1d1c19; stroke: #ffffff; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)); z-index: 6; }
