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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #1b1030 0%, #0f1115 100%);
  min-height: 100vh;
  color: #f5f5f7;
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

h1 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 2.2rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hidden {
  display: none !important;
}

/* Setup */
.setup {
  max-width: 480px;
  margin: 0 auto;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 16px;
  padding: 24px;
}

.hint {
  margin-bottom: 16px;
  color: #c9c6d4;
  line-height: 1.5;
}

textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #3a3550;
  background: #17151f;
  color: #f5f5f7;
  padding: 12px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: #8a7bff;
}

.controls {
  margin-top: 16px;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 1rem;
  font-weight: 600;
  background: #8a7bff;
  color: #0f1115;
  transition: transform 0.08s ease, background 0.15s ease;
}

button:hover {
  background: #a498ff;
}

button:active {
  transform: scale(0.97);
}

.error {
  margin-top: 12px;
  color: #ff8b8b;
  min-height: 1.2em;
}

/* Board */
.board-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.stage {
  position: relative;
  width: 100%;
  height: 680px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #2c2740;
  border-radius: 16px;
  overflow: hidden;
  touch-action: none;
}

.tile {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 56px;
  padding: 0 8px;
  background: #efe6c8;
  color: #1a1a1a;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: grab;
  user-select: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  transition: box-shadow 0.15s ease;
}

.tile.dragging {
  cursor: grabbing;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.6);
  z-index: 100;
}
