* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  background: #fafafa;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 10px;
}
.container {
  background: #ffffff;
  padding: 0;
  border-radius: 3px;
  border: 1px solid #dbdbdb;
  max-width: 470px;
  width: 100%;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
}
h1 {
  text-align: center;
  color: #262626;
  font-size: 16px;
  padding: 16px 20px;
  font-weight: 600;
  letter-spacing: 0;
  word-break: keep-all;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid #efefef;
}
input {
  width: calc(100% - 40px);
  margin: 16px 20px 0 20px;
  padding: 9px 8px 7px 8px;
  border: 1px solid #dbdbdb;
  border-radius: 3px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
  background: #fafafa;
  color: #262626;
  line-height: 18px;
}
input::placeholder {
  color: #8e8e8e;
  font-size: 16px;
}
input:focus {
  border-color: #a8a8a8;
  background: #ffffff;
}
button {
  width: calc(100% - 40px);
  margin: 8px 20px;
  padding: 7px 16px;
  border: none;
  border-radius: 8px;
  background: #0095f6;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
@media (hover: hover) {
  button:hover {
    background: #1877f2;
  }
}
button:active {
  opacity: 0.7;
}
#names {
  margin: 0;
  padding: 12px 20px;
  max-height: 300px;
  overflow-y: auto;
  border-top: 1px solid #efefef;
  border-bottom: 1px solid #efefef;
}
#names:empty {
  display: none;
}
.name {
  background: #ffffff;
  border: 1px solid #dbdbdb;
  color: #262626;
  padding: 10px 12px;
  margin: 6px 0;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 400;
  animation: slideIn 0.15s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}
#result {
  margin: 16px 20px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #dbdbdb;
  color: #262626;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  border-radius: 3px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  word-break: break-word;
  transition: all 0.2s;
}
#result:empty {
  display: none;
}
#result.spinning {
  background: #fafafa;
  border-color: #0095f6;
  color: #8e8e8e;
  font-size: 16px;
}
#result.selected {
  background: #e7f3ff;
  border-color: #0095f6;
  color: #0095f6;
  animation: finalPop 0.3s ease;
}
@keyframes finalPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
