:root {
  --night: #09090b;
  --panel: #131316;
  --panel-hi: #1a1a1e;
  --line: rgba(255, 255, 255, 0.075);
  --line-hi: rgba(255, 255, 255, 0.16);
  --ink: #f3f2f0;
  --ink-soft: #9c9ba3;
  --ink-faint: #67666e;
  --accent: #b3a4ff;
  --mercury: #c9ccd4;
  --font: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  --pool-h: clamp(104px, 27vh, 228px);
  --row-h: clamp(38px, 6.6vh, 48px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--night);
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 300px;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(60% 50% at 50% 38%, rgba(179, 164, 255, 0.07), transparent 70%),
    radial-gradient(80% 60% at 50% 110%, rgba(255, 255, 255, 0.035), transparent 70%),
    var(--night);
}

/* ---------------------------------------------------------------- the panel */
.panel {
  position: relative;
  width: min(580px, 92vw);
  padding: clamp(12px, 2.4vh, 20px);
  display: grid;
  gap: clamp(9px, 1.9vh, 16px);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 38%),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 0 0 1px var(--line),
    0 1px 1px rgba(0, 0, 0, 0.5),
    0 10px 24px -8px rgba(0, 0, 0, 0.6),
    0 40px 80px -30px rgba(0, 0, 0, 0.8);
}

/* a fine grain on the panel, so the dark is not flat */
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.panel__head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mark {
  flex: none;
  width: 34px;
  height: 34px;
  padding: 7px;
  border-radius: 10px;
  background: linear-gradient(160deg, #26252c, #141417);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 0 1px var(--line), 0 2px 6px rgba(0, 0, 0, 0.5);
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.panel__titles { min-width: 0; flex: 1; }

.panel__title {
  font-size: clamp(14px, 2.2vh, 16px);
  font-weight: 600;
  font-variation-settings: "wdth" 104;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel__sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel__scope {
  flex: none;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 5px 10px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line-hi);
}

/* ---------------------------------------------------------------- the pool */
.pool {
  position: relative;
  display: block;
  height: var(--pool-h);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background: #0c0c0e;
  /* the edge of the basin: a dark lip, and a hairline of light on its lower side */
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 1px 0 rgba(255, 255, 255, 0.07);
  -webkit-tap-highlight-color: transparent;
}

.pool__metal {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
}

/* without WebGL: a still pool of chrome bands in CSS, and a soft dip that follows the pointer */
.pool__flat {
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(circle at var(--px, 50%) var(--py, 50%), rgba(0, 0, 0, var(--dip, 0)) 0 7%, rgba(255, 255, 255, calc(var(--dip, 0) * 0.5)) 9%, transparent 16%),
    linear-gradient(180deg, #2a2b30 0%, #6c6f78 18%, #e9ebf0 30%, #8a8d96 38%, #26272b 55%, #3a3b41 72%, #9b9ea7 82%, #2c2d31 100%);
}
.no-gl .pool__flat { opacity: 1; }

/* the inner edge: the metal curls down at the wall of the basin */
.pool__rim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 10px 18px -12px rgba(0, 0, 0, 0.9),
    inset 0 -8px 14px -12px rgba(0, 0, 0, 0.8);
  transition: box-shadow 0.4s ease;
}
.pool.is-hold .pool__rim {
  box-shadow:
    inset 0 0 0 1px rgba(179, 164, 255, 0.55),
    inset 0 0 22px -6px rgba(179, 164, 255, 0.45),
    inset 0 10px 18px -12px rgba(0, 0, 0, 0.9);
}

.pool__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.pool:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }

.pool__hint {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  color: #f4f3f6;
  translate: -50% -50%;
  background: rgba(16, 16, 20, 0.58);
  -webkit-backdrop-filter: blur(8px) saturate(1.3);
  backdrop-filter: blur(8px) saturate(1.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 6px 18px -6px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.pool__icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pool__words { display: grid; }
.pool__word { grid-area: 1 / 1; }
.pool__word[data-word="hold"] { opacity: 0; color: #e3ddff; }
.pool__word em { font-style: normal; color: var(--accent); }

/* ---------------------------------------------------------------- the list */
.files {
  list-style: none;
  display: grid;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--line);
  background: rgba(255, 255, 255, 0.015);
  overflow: hidden;
}

.file {
  position: relative;
  height: var(--row-h);
  overflow: hidden;
}
.file + .file::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 1px;
  background: var(--line);
}

.file__body {
  height: var(--row-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 0 12px;
  font-size: 12.5px;
}

.file__doc {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.3;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.file__lines { stroke: var(--ink-faint); }

.file__name {
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.file__size {
  flex: none;
  color: var(--ink-faint);
  font-size: 11.5px;
}

.file__state {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 92px;
  color: var(--ink-soft);
  font-size: 11.5px;
}
.file__state.is-done { color: #d9d4ff; }

.file__tick {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.file__bar {
  position: absolute;
  left: 40px;
  right: 14px;
  bottom: 7px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.file__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, rgba(179, 164, 255, 0.4), var(--accent) 70%, #fff);
}

/* the new row starts closed */
.file--new { height: 0; }

/* ---------------------------------------------------------------- footer */
.panel__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--ink-faint);
  white-space: nowrap;
}
.panel__foot b { color: var(--ink-soft); font-weight: 600; }
.panel__private { display: inline-flex; align-items: center; gap: 5px; }
.panel__private svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; }

/* ---------------------------------------------------------------- the carried file and the drawn pointer */
.chip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px 7px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  background: linear-gradient(180deg, #2a2a30, #1c1c21);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 2px 4px rgba(0, 0, 0, 0.4),
    0 14px 28px -8px rgba(0, 0, 0, 0.75);
  opacity: 0;
  pointer-events: none;
  will-change: transform;
}
.chip__doc { width: 16px; height: 16px; fill: none; stroke: var(--accent); stroke-width: 1.3; stroke-linejoin: round; }

.ghost {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  width: 20px;
  height: 20px;
  fill: #fff;
  stroke: #111;
  stroke-width: 1;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 460px) {
  .panel { border-radius: 18px; }
  .panel__scope { display: none; }
  .file__size { display: none; }
  .file__state { min-width: 76px; }
  .panel__private { display: none; }
  .pool__hint { font-size: 12px; padding: 7px 12px 7px 10px; }
}
