:root {
  --bg: #0a0b0f;
  --card: #14161c;
  --card-hi: #1c1f27;
  --well: #0c0d12;
  --ink: #f1f2f6;
  --muted: #878c9c;
  --line: #272b35;
  --accent: #5b8cff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background:
    radial-gradient(60% 46% at 50% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    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;
  place-items: center;
  padding: clamp(10px, 3vw, 28px);
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.card {
  position: relative;
  width: min(760px, 100%);
  padding: clamp(14px, 4vh, 28px) clamp(14px, 3.4vw, 28px) clamp(12px, 3.4vh, 24px);
  border-radius: clamp(20px, 3vw, 28px);
  background: linear-gradient(180deg, var(--card-hi), var(--card));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 0 1px var(--line),
    0 30px 60px -30px rgba(0, 0, 0, 0.9),
    0 50px 90px -50px color-mix(in srgb, var(--accent) 40%, transparent);
}

.head { display: flex; align-items: center; gap: 10px; }
.head__icon {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 18%, #14161c);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 38%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.head__icon svg { width: 18px; height: 18px; fill: none; stroke: color-mix(in srgb, var(--accent) 70%, #ffffff); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.head h1 { font-size: clamp(16px, min(4.4vw, 4.8vh), 23px); font-weight: 620; letter-spacing: -0.012em; }
.head__env {
  margin-left: auto;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: #c3c7d3;
  font-size: 12px;
  font-weight: 580;
  line-height: 24px;
}

/* ---- the well with the key ---- */
.well {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: clamp(10px, 3vh, 20px);
  padding: 0 6px 0 clamp(10px, 2.6vw, 18px);
  height: clamp(48px, 13vh, 78px);
  border-radius: 16px;
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 2px 6px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.key {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: clamp(11.5px, min(3.5vw, 2.05vw + 4px), 27px);
  font-weight: 500;
  white-space: nowrap;
  cursor: default;
  touch-action: pan-y;
}
.ch { display: inline-block; width: 0.64em; text-align: center; will-change: transform; }
.ch--fixed { color: var(--muted); }
.ch__clip { display: block; height: 1.5em; line-height: 1.5em; overflow: hidden; }
.ch__in { display: block; }
/* the light that runs under the characters with the wave */
.well__light {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 120px;
  height: 100%;
  margin-left: -60px;
  background: radial-gradient(60px 26px at 50% 100%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%);
  opacity: 0;
  pointer-events: none;
}

.copy {
  position: relative;
  flex: none;
  width: clamp(36px, 10vh, 44px);
  height: clamp(36px, 10vh, 44px);
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  color: #cfd3de;
  cursor: pointer;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.copy.is-hot, .copy.is-done { background: rgba(255, 255, 255, 0.1); color: #ffffff; }
@media (hover: hover) { .copy:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; } }
.copy:focus-visible, .rotate:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.copy svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.copy__tick { stroke: var(--accent) !important; stroke-width: 2.1 !important; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
.copy__tip {
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  margin-top: -13px;
  height: 26px;
  padding: 0 9px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 22%, #14161c);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
  color: #ffffff;
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 26px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---- the foot ---- */
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: clamp(10px, 3vh, 18px);
}
.foot__when { font-size: clamp(13px, 1.15vw, 15px); color: var(--muted); white-space: nowrap; min-width: 0; }
.foot__roll { display: block; height: 20px; line-height: 20px; overflow: hidden; }
.foot__roll span { display: block; }
.rotate {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: clamp(36px, 10vh, 42px);
  padding: 0 15px 0 12px;
  border: 0;
  border-radius: 999px;
  background: #f1f2f6;
  color: #111318;
  font: inherit;
  font-size: clamp(13.5px, 1.15vw, 15px);
  font-weight: 620;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 8px 18px -10px rgba(255, 255, 255, 0.5);
  transition: font-stretch 0.35s cubic-bezier(0.3, 1.4, 0.5, 1), background-color 0.25s ease;
}
.rotate.is-hot { font-stretch: 110%; background: #ffffff; }
@media (hover: hover) { .rotate:hover { font-stretch: 110%; background: #ffffff; } }
.rotate svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #ffffff;
  stroke: #000000;
  stroke-width: 1.2;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}
