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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: white url('/static/cranes.webp') no-repeat top center;
  background-size: 100% auto;
  min-height: 100vh;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  padding: 30px;
  max-width: 600px;
  width: 100%;
}

h1 {
  color: #333;
  margin-bottom: 20px;
  text-align: center;
  font-size: 28px;
}

.haiku-display {
  background: white;
  border: 1px dashed grey;
  padding: 24px;
  margin-bottom: 24px;
  min-height: 120px;
  font-size: 18px;
  line-height: 1.8;
}

.haiku-line {
  margin-bottom: 8px;
  color: #2d3748;
  padding-left: 2em;
  text-indent: -2em;
}

.haiku-line.active {
  color: #667eea;
  font-weight: 500;
}

.undo-inline {
  margin-left: 8px;
  color: #fc8181;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  font-size: 16px;
}

.undo-inline:hover {
  color: #f56565;
}

.search-box {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  font-size: 16px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.search-box:focus {
  outline: none;
  border-color: #667eea;
}

.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.word-btn {
  padding: 12px 16px;
  background: #667eea;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s;
  font-weight: 500;
  text-decoration: none;
  display: block;
  text-align: center;
}

.word-btn:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.word-btn:active {
  transform: translateY(0);
}

.word-placeholder {
  background: #e2e8f0;
  cursor: default;
  pointer-events: none;
}

.word-placeholder:hover {
  transform: none;
  box-shadow: none;
}

.controls {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.btn {
  flex: 1;
  padding: 12px;
  border: none;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: block;
  text-align: center;
}

.btn-undo {
  background: #e2e8f0;
  color: #2d3748;
}

.btn-undo:hover:not(:disabled) {
  background: #cbd5e0;
}

.btn-publish {
  background: #48bb78;
  color: white;
}

.btn-publish:hover {
  background: #38a169;
}

.btn-reset {
  background: #fc8181;
  color: white;
}

.btn-reset:hover {
  background: #f56565;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status {
  text-align: center;
  padding: 12px;
  color: #718096;
  font-size: 14px;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #718096;
}

.error {
  background: #fed7d7;
  color: #c53030;
  padding: 12px;
  margin-bottom: 16px;
  text-align: center;
}

.complete {
  background: #c6f6d5;
  color: #22543d;
  padding: 16px;
  text-align: center;
  font-weight: 500;
  margin-top: 16px;
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .container {
    padding: 20px;
  }

  h1 {
    font-size: 20px;
  }

  .haiku-display {
    font-size: 15px;
  }

  .word-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .word-btn {
    font-size: 13px;
    padding: 10px 12px;
  }

  .search-box {
    font-size: 14px;
  }
}
