/* Float or Sink - a sunny poolside water lab */

html,
body {
  height: 100%;
}

body {
  background: linear-gradient(180deg, #4FC3F7 0%, #81D4FA 40%, #FFE0B2 100%);
  overflow: hidden;
}

.game-container {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: 0 10px;
}

/* Object shelf: progress badges during the experiment, buttons in free play */
.shelf[hidden] {
  display: none;
}

.shelf {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 8px;
  max-width: min(92vw, 560px);
}

.shelf-item {
  position: relative;
  width: 54px;
  height: 54px;
  min-width: 48px;
  min-height: 48px;
  font-size: 1.7rem;
  line-height: 1;
  background: var(--color-paper);
  border: var(--border-width) solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.shelf-item:disabled {
  opacity: 0.55;
}

.shelf-item:not(:disabled):active {
  transform: scale(0.92);
}

.shelf-item .badge {
  position: absolute;
  right: -6px;
  top: -8px;
  font-size: 0.95rem;
}

.shelf-item.current {
  background: var(--color-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

#canvas-container {
  position: relative;
  flex: 1;
  min-height: 220px;
  margin: 0 auto;
  width: min(100%, 900px);
  border: var(--border-width) solid var(--border-color);
  border-radius: 20px;
  background: linear-gradient(180deg, #E1F5FE 0%, #B3E5FC 100%);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

#canvas-container canvas {
  display: block;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 10px 0 max(10px, env(safe-area-inset-bottom));
}

@media (max-height: 480px) {
  .gravity-prompt {
    margin-bottom: 4px;
    padding: 4px 10px;
  }

  .shelf {
    gap: 5px;
  }

  .shelf-item {
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
  }

  .controls {
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  }

  #canvas-container {
    min-height: 150px;
  }
}
