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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #fafafa;
  color: #1e1b4b;
  line-height: 1.5;
  min-height: 100dvh;
  padding: 24px 16px;
}

.app {
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.header {
  text-align: center;
  padding-top: 12px;
}
.header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 2px;
}

.progress-area {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.progress-text {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 10px;
}

.progress-numbers {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #1e1b4b;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #4f46e5;
  border-radius: 9999px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.compare {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 32px 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.compare-prompt {
  font-size: 1rem;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 24px;
}

.compare-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.choice-btn {
  flex: 1;
  max-width: 200px;
  padding: 14px 24px;
  font-size: 1.125rem;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background: #4f46e5;
  border: 2px solid #4f46e5;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.choice-btn:hover {
  background: #4338ca;
  border-color: #4338ca;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}
.choice-btn:active {
  transform: scale(0.97);
  box-shadow: none;
}
.choice-btn:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

.vs {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  flex-shrink: 0;
}

.results {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 28px 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.results-title {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
}

.ranking-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: #fafafa;
  border-radius: 6px;
}
.ranking-item.gold {
  background: #fef3c7;
  border: 1px solid #fde68a;
}
.ranking-item.gold .rank-number {
  background: #f59e0b;
  color: #fff;
}
.ranking-item.silver {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
}
.ranking-item.silver .rank-number {
  background: #9ca3af;
  color: #fff;
}
.ranking-item.bronze {
  background: #fef0e4;
  border: 1px solid #fbd5ae;
}
.ranking-item.bronze .rank-number {
  background: #cd7f32;
  color: #fff;
}

.rank-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9999px;
  background: #e5e7eb;
  font-size: 0.8rem;
  font-weight: 700;
  color: #6b7280;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.rank-name {
  font-size: 1rem;
  font-weight: 500;
}

.no-compare {
  text-align: center;
  color: #6b7280;
  padding: 20px 0;
}

.items {
  padding-top: 4px;
}

.items-heading {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin-bottom: 10px;
}

.items-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.item-tag {
  display: inline-block;
  padding: 4px 12px;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.input-form {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 32px 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-title {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
}

.input-hint {
  font-size: 0.875rem;
  color: #6b7280;
  text-align: center;
}

.item-textarea {
  width: 100%;
  min-height: 160px;
  padding: 12px 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #1e1b4b;
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  resize: vertical;
  transition: border-color 0.15s ease;
}
.item-textarea:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.item-textarea::placeholder {
  color: #9ca3af;
}

.start-btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 1.125rem;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background: #4f46e5;
  border: 2px solid #4f46e5;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.start-btn:hover:not(:disabled) {
  background: #4338ca;
  border-color: #4338ca;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}
.start-btn:active:not(:disabled) {
  transform: scale(0.97);
  box-shadow: none;
}
.start-btn:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}
.start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  body {
    padding: 16px 12px;
  }
  .app {
    gap: 20px;
  }
  .compare,
  .input-form {
    padding: 24px 16px;
  }
  .compare-buttons {
    flex-direction: column;
    gap: 12px;
  }
  .choice-btn {
    max-width: 100%;
    width: 100%;
  }
  .vs {
    display: none;
  }
}
