:root {
  --stage-width: 1024;
  --stage-height: 715;
  --fill-duration: 1800ms;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background-image: url("/images/background.jpg");
}

#entirePage {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

#page-header {
  flex: 0 0 auto;
  z-index: 10;
}

.game-container-wrap {
  flex: 1 1 auto;
  position: relative;
  width: 100%;
  height: 100%;
  margin-top: var(--game-top, 0px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.compPageTitle {
  color: #3e52d6;
  width: 100%;
  text-align: center;
  position: absolute;
  top: -45px;
  left: 0;
  font-size: 2.2rem;
  font-weight: bold;
  font-family: "Assistant", "sans-serif";
  margin: 0;
  pointer-events: none;
  z-index: 5;
}

.stage-shell {
  position: relative;
  direction: ltr;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.game-canvas {
  position: absolute;
  inset: 0;
  width: 1024px;
  height: 715px;
  overflow: hidden;
  background: #dff7ff;
  transform-origin: top left;
  user-select: none;
}

.layout-element {
  position: absolute;
  display: block;
  object-fit: contain;
  -webkit-user-drag: none;
}

.layer-background {
  z-index: 10;
}

.layer-liquid {
  z-index: 20;
}

.layer-stream {
  z-index: 30;
}

.layer-pour-stream {
  z-index: 36;
  pointer-events: none;
}

.layer-mix-animation {
  z-index: 37;
  pointer-events: none;
}

.layer-bowl-fill {
  z-index: 35;
  pointer-events: none;
}

.layer-marks {
  z-index: 40;
  pointer-events: none;
}

.layer-character {
  z-index: 50;
}

.professor-entry {
  transition: transform 1000ms ease-out, opacity 1000ms ease-out;
}

.professor-entry.is-offstage-left {
  opacity: 0;
  transform: translateX(-260px);
}

.layer-ui {
  z-index: 60;
}

.recipe-display {
  position: absolute;
  z-index: 65;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #123047;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
  pointer-events: none;
}

.potion-score {
  position: absolute;
  right: -14px;
  top: 50%;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  transform: translateY(-50%);
}

.potion-bottle {
  width: 25px;
  height: 36px;
  object-fit: contain;
}

.recipe-help {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.recipe-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.recipe-label {
  font-size: 18px;
  letter-spacing: 0;
}

.recipe-part {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.recipe-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.65), 0 1px 3px rgba(0, 0, 0, 0.25);
}

.recipe-dot.is-blue {
  background: #1fa7ff;
}

.recipe-dot.is-yellow {
  background: #ffd229;
}

.start-label {
  position: absolute;
  z-index: 67;
  display: grid;
  place-items: center;
  border: 0;
  color: #ffffff;
  background: transparent;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.32);
}

.info-overlay {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(18, 48, 71, 0.34);
  pointer-events: auto;
}

.info-panel {
  position: relative;
  width: 520px;
  max-width: calc(100% - 80px);
  padding: 26px 34px 28px;
  border: 4px solid #f6c65b;
  border-radius: 8px;
  color: #123047;
  background: rgba(226, 250, 255, 0.97);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3), inset 0 0 0 2px rgba(255, 255, 255, 0.74);
  direction: ltr;
  font-family: Arial, Helvetica, sans-serif;
  text-align: left;
}

.info-panel h2 {
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 1;
}

.info-panel p,
.info-panel li {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.28;
}

.info-panel p {
  margin: 10px 0;
}

.info-panel ol {
  margin: 12px 0;
  padding-left: 28px;
}

.info-example {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(255, 210, 41, 0.45);
}

.info-close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #123047;
  background: #ffd229;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.7), 0 2px 5px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  font-size: 26px;
  font-weight: 900;
  line-height: 34px;
}

.end-overlay {
  position: absolute;
  inset: 0;
  z-index: 92;
  display: grid;
  justify-items: center;
  align-items: start;
  padding-top: 78px;
  background: rgba(18, 48, 71, 0.24);
  pointer-events: auto;
}

.end-panel {
  width: 430px;
  padding: 24px 28px 26px;
  border: 4px solid #f6c65b;
  border-radius: 8px;
  color: #123047;
  background: rgba(226, 250, 255, 0.97);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28), inset 0 0 0 2px rgba(255, 255, 255, 0.74);
  direction: ltr;
  font-family: Arial, Helvetica, sans-serif;
  text-align: center;
}

.end-panel h2 {
  margin: 0 0 18px;
  font-size: 34px;
  line-height: 1;
}

.end-flasks {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 14px 0 24px;
}

.end-flask {
  width: 42px;
  height: 60px;
  object-fit: contain;
}

.end-flask.is-empty {
  filter: grayscale(1);
  opacity: 0.26;
}

.end-flask.is-filled {
  animation: flask-celebrate 900ms ease-in-out infinite alternate;
}

.end-flask.is-filled:nth-child(2n) {
  animation-delay: 140ms;
}

.end-play-again {
  min-width: 150px;
  height: 46px;
  border: 0;
  border-radius: 8px;
  color: #123047;
  background: #ffd229;
  box-shadow: inset 0 3px 5px rgba(255, 255, 255, 0.72), 0 3px 7px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
}

@keyframes flask-celebrate {
  from {
    transform: translateY(0) rotate(-2deg);
    filter: drop-shadow(0 0 0 rgba(21, 196, 107, 0));
  }

  to {
    transform: translateY(-7px) rotate(2deg);
    filter: drop-shadow(0 0 8px rgba(21, 196, 107, 0.55));
  }
}

.layout-element.is-button {
  cursor: pointer;
}

.is-hidden-state,
.layout-element.is-hidden-state {
  display: none;
}

.liquid-clip,
.stream-clip {
  position: absolute;
  overflow: hidden;
  pointer-events: none;
}

.liquid-clip {
  opacity: 0.88;
}

.liquid-fill,
.stream-fx {
  position: absolute;
  left: 0;
  bottom: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  -webkit-user-drag: none;
}

.liquid-fill {
  transform-origin: bottom center;
  transition: transform var(--fill-duration) ease-in-out;
}

.stream-clip {
  opacity: 0;
  transition: height var(--fill-duration) ease-in-out, opacity 180ms ease;
}

.stream-clip.is-active {
  opacity: 1;
}

.stream-fx {
  top: 0;
  bottom: auto;
  transform: none;
}

.layout-load-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  color: #123;
  background: #f8fbff;
  direction: ltr;
  text-align: center;
  font-size: 18px;
}
