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

body {
  font-family: "Arial", sans-serif;
  min-height: 100vh;
}

.game-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.back-button {
  padding: 0.55rem 1rem;
  border-radius: 50px;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.back-button:hover {
  transform: scale(1.05);
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.screen-intro {
  margin-bottom: 1.5rem;
  text-align: center;
}

.make-layout,
.play-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 860px) {
  .make-layout,
  .play-layout {
    flex-direction: row;
    align-items: flex-start;
  }
}

.mixing-station,
.slime-stage {
  flex: 1.1;
  background: #1e1e1e;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.ingredients-panel,
.play-controls {
  flex: 1;
  background: #1e1e1e;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.bowl-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px;
}

#bowl-canvas {
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 12px;
  cursor: crosshair;
  touch-action: none;
}

.mix-hint {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.65);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  pointer-events: none;
  white-space: nowrap;
}

.mix-meter {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
}

.mix-meter label {
  font-size: 0.9rem;
  min-width: 5.5rem;
}

.meter-track {
  flex: 1;
  height: 12px;
  background: #2a2a2a;
  border-radius: 999px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2dd4bf, #14b8a6);
  border-radius: 999px;
  transition: width 0.15s ease;
}

#mix-percent {
  min-width: 2.5rem;
  font-weight: bold;
}

.panel-block {
  margin-bottom: 1.25rem;
}

.panel-block:last-child {
  margin-bottom: 0;
}

.panel-block h2 {
  font-size: 1rem;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.option-btn,
.ingredient-btn,
.action-grid button,
.primary-btn {
  background: #2a2a2a;
  color: white;
  border: 2px solid transparent;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.option-btn:hover,
.ingredient-btn:hover,
.action-grid button:hover {
  background: #353535;
}

.option-btn.active {
  border-color: #2dd4bf;
  background: rgba(123, 255, 123, 0.15);
}

.ingredient-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.ingredient-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  position: relative;
}

.ing-icon {
  font-size: 1.6rem;
}

.ing-count {
  position: absolute;
  top: 6px;
  right: 8px;
  background: #2dd4bf;
  color: #0d1a0d;
  font-size: 0.7rem;
  font-weight: bold;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#slime-color {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: none;
}

.preset-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.color-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #333;
  background: var(--c);
  cursor: pointer;
}

.color-dot.active,
.color-dot:hover {
  border-color: white;
  transform: scale(1.08);
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.slider-row label {
  min-width: 4.5rem;
  font-size: 0.9rem;
}

.slider-row input[type="range"] {
  flex: 1;
  accent-color: #2dd4bf;
}

.primary-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.9rem;
  font-weight: bold;
  font-size: 1rem;
  background: linear-gradient(90deg, #2dd4bf, #14b8a6);
  color: #0d1a0d;
}

.primary-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.primary-btn:not(:disabled):hover {
  transform: scale(1.02);
}

#slime-canvas {
  width: 100%;
  height: min(55vh, 420px);
  display: block;
  border-radius: 12px;
  background: #151515;
  cursor: grab;
  touch-action: none;
}

#slime-canvas:active {
  cursor: grabbing;
}

.play-tip {
  text-align: center;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

.slime-preview-card {
  text-align: center;
  padding: 1rem;
  background: #151515;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.mini-slime {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 0.5rem;
  box-shadow: 0 0 20px rgba(123, 255, 123, 0.4);
}

#slime-name {
  font-weight: bold;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}

.save-row {
  display: flex;
  gap: 0.5rem;
}

.save-row input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 2px solid #333;
  border-radius: 10px;
  background: #151515;
  color: #fff;
  font-size: 0.9rem;
}

.save-row input:focus {
  outline: none;
  border-color: #2dd4bf;
}

.save-btn {
  background: linear-gradient(90deg, #2dd4bf, #14b8a6) !important;
  color: #0d1a0d !important;
  font-weight: bold;
  white-space: nowrap;
}

.save-message {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  min-height: 1.2em;
}

.saved-slimes-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
}

.empty-saves {
  font-size: 0.85rem;
  line-height: 1.4;
}

.saved-slime-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  background: #151515;
  border-radius: 10px;
  border: 1px solid #2a2a2a;
}

.saved-slime-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(123, 255, 123, 0.25);
}

.saved-slime-info {
  flex: 1;
  min-width: 0;
}

.saved-slime-info strong {
  display: block;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-slime-info span {
  font-size: 0.75rem;
  text-transform: capitalize;
}

.saved-slime-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.saved-slime-actions button {
  padding: 0.35rem 0.55rem;
  font-size: 0.75rem;
}

.saved-slime-actions .play-saved-btn {
  background: rgba(123, 255, 123, 0.2);
  border: 1px solid #2dd4bf;
}

.saved-slime-actions .delete-saved-btn {
  background: transparent;
  border: 1px solid #333;
}

.saved-slime-actions .delete-saved-btn:hover {
  color: #2dd4bf;
  border-color: #2dd4bf;
}

.addon-hint {
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.addon-color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}

.glitter-swatch,
.charm-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #333;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s, border-color 0.15s;
}

.glitter-swatch {
  border-radius: 6px;
  transform: rotate(45deg);
}

.glitter-swatch::after {
  content: "✦";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-45deg);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

.glitter-swatch:hover,
.charm-swatch:hover {
  transform: scale(1.1);
  border-color: #fff;
}

.glitter-swatch:hover {
  transform: rotate(45deg) scale(1.1);
}

.charm-swatch.active {
  border-color: #2dd4bf;
  box-shadow: 0 0 8px rgba(123, 255, 123, 0.5);
}

.glitter-swatch .swatch-count,
.charm-swatch .swatch-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 1rem;
  height: 1rem;
  padding: 0 3px;
  border-radius: 999px;
  background: #2dd4bf;
  color: #0d1a0d;
  font-size: 0.65rem;
  font-weight: bold;
  display: none;
  align-items: center;
  justify-content: center;
  transform: rotate(-45deg);
  z-index: 1;
}

.charm-swatch .swatch-count {
  transform: none;
}

.glitter-swatch.has-count .swatch-count,
.charm-swatch.has-count .swatch-count {
  display: flex;
}

.addon-add-btn {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem;
  background: rgba(123, 255, 123, 0.15);
  border: 1px solid #2dd4bf;
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
}

.addon-add-btn:hover {
  background: rgba(123, 255, 123, 0.28);
}

.addon-summary {
  font-size: 0.8rem;
  color: #2dd4bf;
  margin-top: 0.4rem;
  min-height: 1.1em;
}
