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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #f5f0eb;
  color: #333;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1.5rem;
}

.container {
  max-width: 480px;
  width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 2rem 1.5rem;
  text-align: center;
}

.logo {
  width: 80px;
  height: auto;
  margin-bottom: 0.75rem;
}

.logo-small {
  width: 48px;
}

h1 {
  font-size: 1.5rem;
  color: #e09c37;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 0.35rem;
}

input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1.25rem;
  letter-spacing: 0.15em;
  border: 2px solid #ddd;
  border-radius: 8px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  border-color: #e09c37;
}

.error {
  display: block;
  color: #c0392b;
  font-size: 0.8rem;
  margin-top: 0.35rem;
  min-height: 1.2em;
}

.category-buttons {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

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

.btn-local {
  flex: 1;
  background: #e09c37;
  color: #fff;
}

.btn-global {
  flex: 1;
  background: #2c7a7b;
  color: #fff;
}

.btn-submit {
  width: 100%;
  background: #e09c37;
  color: #fff;
  margin-top: 1rem;
  padding: 1rem;
  font-size: 1.1rem;
}

.btn-back {
  display: inline-block;
  margin-top: 0.75rem;
  color: #888;
  font-size: 0.85rem;
  background: none;
  border: 1px solid #ddd;
}

.invalid-numbers {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #fff8f8;
  border-radius: 8px;
  border: 1px solid #ffdddd;
}

.invalid-numbers h3 {
  color: #c0392b;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.invalid-numbers ul {
  list-style-type: none;
  padding: 0;
}

.invalid-numbers li {
  padding: 0.25rem 0;
  color: #666;
  font-size: 0.85rem;
  border-bottom: 1px solid #f0ece6;
}

.invalid-numbers li:last-child {
  border-bottom: none;
}

.btn-back:hover {
  border-color: #999;
  color: #555;
}

.voted {
  opacity: 0.4;
  pointer-events: none;
  position: relative;
}

.voted::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  color: #27ae60;
}

.status {
  font-size: 0.85rem;
  color: #2c7a7b;
  margin-top: 0.5rem;
  min-height: 1.2em;
}

.ranking-form {
  margin-bottom: 1rem;
  text-align: left;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0ece6;
}

.rank-label {
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 5.5rem;
  color: #444;
}

.rank-points {
  font-size: 0.75rem;
  color: #999;
  min-width: 4.5rem;
}

.rank-select {
  flex: 1;
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.rank-select:focus {
  border-color: #e09c37;
}

.rank-select option:disabled {
  color: #ccc;
}

@media (max-width: 400px) {
  .container {
    padding: 1.25rem 1rem;
  }
  .category-buttons {
    flex-direction: column;
  }
  .rank-row {
    flex-wrap: wrap;
  }
}
