:root {
  --bg: #090909;
  --panel: #111111;
  --text: #f5f5f2;
  --muted: #7d7d78;
  --line: #252525;
  --soft: #1b1b1b;
  --accent: #f5f5f2;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -25%;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,.055), transparent 22%),
    radial-gradient(circle at 52% 58%, rgba(255,255,255,.022), transparent 38%);
  filter: blur(8px);
}

.shell {
  width: min(960px, calc(100% - 40px));
  min-height: 620px;
  display: flex;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,.006));
  box-shadow: 0 30px 100px rgba(0,0,0,.45);
  position: relative;
  isolation: isolate;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}

.brand {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .24em;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  background: #0d0d0d;
  border-radius: 999px;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 15px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: .18s ease;
}

.tab.active {
  background: var(--text);
  color: #0b0b0b;
}

.mode-note {
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.stage {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 54px 16px 36px;
}

.name-wrap {
  width: 100%;
  max-width: 820px;
}

.editable-shell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
}

#name {
  min-width: 1ch;
  max-width: 100%;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: clamp(58px, 11vw, 138px);
  line-height: .92;
  letter-spacing: -.065em;
  font-weight: 650;
  text-align: center;
  outline: none;
  overflow-wrap: anywhere;
  transition:
    opacity .18s ease,
    transform .28s cubic-bezier(.2,.8,.2,1),
    filter .22s ease,
    border-color .18s ease,
    background .18s ease;
}

#name:hover {
  border-color: #2d2d2d;
  background: rgba(255,255,255,.015);
}

#name:focus {
  border-color: #444;
  background: rgba(255,255,255,.025);
}

#name.changing {
  opacity: .1;
  transform: translateY(8px) scale(.985);
  filter: blur(8px);
}

.sub {
  min-height: 16px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

button.action {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 15px 19px;
  background: var(--soft);
  color: var(--text);
  font: inherit;
  font-weight: 750;
  font-size: 13px;
  letter-spacing: .02em;
  cursor: pointer;
  transition:
    transform .16s ease,
    background .16s ease,
    border-color .16s ease,
    opacity .16s ease;
}

button.action:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #3a3a3a;
  background: #202020;
}

button.primary {
  min-width: 220px;
  background: var(--accent);
  color: #0b0b0b;
  border-color: var(--accent);
}

button.primary:hover:not(:disabled) {
  background: #fff;
  border-color: #fff;
}

button.action:active:not(:disabled) {
  transform: translateY(0) scale(.985);
}

button:disabled {
  opacity: .55;
  cursor: wait;
}

button:focus-visible {
  outline: 2px solid white;
  outline-offset: 4px;
}

.status {
  min-height: 18px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 760px) {
  .shell {
    min-height: calc(100vh - 24px);
    width: calc(100% - 24px);
    padding: 18px;
    border-radius: 22px;
  }

  .topbar {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .brand {
    justify-self: start;
  }

  .tabs {
    order: 3;
  }

  .mode-note {
    position: absolute;
    right: 18px;
    top: 20px;
  }

  .stage {
    padding: 42px 0 28px;
  }

  #name {
    font-size: clamp(50px, 18vw, 88px);
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  button.primary {
    grid-column: 1 / -1;
    width: 100%;
  }

  .action {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  #name,
  button,
  .tab {
    transition: none !important;
  }
}
