/* Studio corner tools: see tools.js. Home, Clear and Hint float over the
   view's top-left corner; Undo, Redo and the big Play/Stop over its
   top-right. Clear asks first in a small card under it, and the hint card
   floats over the top of the view. From Clatter Lab. Uses the tokens and
   .button-icon from base.css. The view they sit on must be
   position: relative. */
.studio-tools {
  position: absolute;
  top: var(--content-gap);
  display: flex;
  gap: var(--content-gap);
  align-items: flex-start; /* Undo and Redo stay small beside the big Play */
}
.studio-tools-left { left: var(--content-gap); }
.studio-tools-right { right: var(--content-gap); }
.studio-tools > .button-icon {
  background: var(--color-surface);
  border: var(--border-width) var(--border-style) var(--color-border);
  box-shadow: var(--shadow-drop);
}
.studio-tools > .button-icon:disabled { opacity: 0.5; cursor: not-allowed; }

/* Pan or Select (studio/tray.js, opts.modeButton): an open hand, a
   dashed box */
.studio-tools > .studio-mode .icon-select,
.studio-tools > .studio-mode.select .icon-pan { display: none; }
.studio-tools > .studio-mode.select .icon-select { display: inline-flex; }

/* Play is filled in the accent so it stands out, and twice the size of the
   other buttons: it's the main thing to press. It shows a stop square while
   playing (.playing, set by StudioTools.setPlaying). */
.studio-tools > .studio-play,
.studio-tools > .studio-play:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-on-accent);
}
.studio-tools > .studio-play {
  width: calc(2 * var(--height-input));
  height: calc(2 * var(--height-input));
  border-radius: var(--radius-lg);
}
.studio-play svg { width: 35px; height: 35px; }
.studio-play .icon-stop, .studio-play.playing .icon-play { display: none; }
.studio-play.playing .icon-stop { display: block; }

/* A card: the confirm, the hint, and any other card a game floats over
   the view (it sets the place and padding) */
.studio-pop {
  background: var(--color-surface);
  border: var(--border-width) var(--border-style) var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-drop);
}
.studio-pop-title { font-weight: var(--font-weight-bold); }
.studio-pop-text { color: var(--color-text-dark); }

/* "Are you sure?" under Clear */
.studio-confirm {
  position: absolute;
  top: calc(var(--height-input) + var(--content-gap));
  left: 0;
  width: 240px;
  padding: var(--content-gap);
  display: flex;
  flex-direction: column;
  gap: var(--content-gap);
}
.studio-confirm-buttons { display: flex; gap: var(--content-gap); justify-content: flex-end; }

/* The hint card: below the corner buttons, centred over the view. A tap
   anywhere closes it. */
.studio-hint {
  position: absolute;
  left: 50%;
  top: calc(var(--height-input) + 2 * var(--content-gap));
  transform: translateX(-50%);
  width: min(360px, calc(100% - 2 * var(--content-gap)));
  padding: var(--content-gap);
  display: flex;
  flex-direction: column;
  gap: var(--content-gap);
  border-color: var(--color-accent);
  transform-origin: center center;
  cursor: pointer;
}
.studio-hint .studio-pop-text { color: var(--color-text); white-space: pre-line; } /* a blank line splits it in two */
@media (max-width: 720px) {
  .studio-hint { top: calc(2 * var(--height-input) + 2 * var(--content-gap)); } /* below the big Play button */
}

/* A short message (a win, signed out, couldn't reach Level Lab): blue,
   bold, below the corner buttons like the hint card, over it. Show it by
   clearing \`hidden\`; the game hides it again after a moment. */
.studio-toast {
  position: absolute;
  left: 50%;
  top: calc(var(--height-input) + 2 * var(--content-gap));
  transform: translateX(-50%);
  max-width: calc(100% - 2 * var(--content-gap));
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
  line-height: 30px; /* 25px text needs more than the 20px text line */
  text-align: center;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-drop);
  pointer-events: none;
  z-index: 45; /* over the hint card and a game's own cards; under the Menu */
}
/* What StudioTools.say gives a screen reader: in the page, out of sight */
.studio-said { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* A button's icon in the message, as big as its text */
.studio-toast .studio-inline-icon { width: 28px; height: 28px; vertical-align: middle; }
.studio-toast .studio-inline-icon svg { width: 22px; height: 22px; }
@media (max-width: 720px) {
  .studio-toast { top: calc(2 * var(--height-input) + 2 * var(--content-gap)); } /* below the big Play button */
}

/* A button's icon drawn inside text (StudioTools.fill) */
.studio-inline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  vertical-align: text-bottom; /* its bottom on the bottom of the text */
  background: var(--color-surface-light);
  border: var(--border-width) var(--border-style) var(--color-accent);
  border-radius: var(--radius-sm);
}
.studio-inline-icon svg { width: 16px; height: 16px; }
