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

:root {
  color-scheme: light;
  --bg: #f8f9fa;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1a202c;
  --text-muted: #718096;
  --accent: #3b82f6;
  --accent-light: #eff6ff;
  --gold: #f59e0b;
  --silver: #94a3b8;
  --bronze: #cd7f32;
  --green: #10b981;
  --tag-bg: #f1f5f9;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
}

body {
  font-family: 'Pretendard', 'Apple SD Gothic Neo', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding: 2rem 1rem 4rem;
}

.container { max-width: 1100px; margin: 0 auto; }

header {
  text-align: center;
  margin-bottom: 3rem;
}

header .badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .05em;
  padding: .25rem .75rem;
  border-radius: 99px;
  margin-bottom: .75rem;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: .5rem;
}

header p {
  color: var(--text-muted);
  font-size: .9rem;
}

/* Criteria weights */
.criteria-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow);
}

.criteria-section h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.criteria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .75rem;
}

.criterion {
  background: var(--tag-bg);
  border-radius: 8px;
  padding: .75rem;
  text-align: center;
}

.criterion .weight {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
}

.criterion .name {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .15rem;
}

/* Cards */
.cards {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.card.rank-1 { border-left: 4px solid var(--gold); }
.card.rank-2 { border-left: 4px solid var(--silver); }
.card.rank-3 { border-left: 4px solid var(--bronze); }

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.rank-badge {
  min-width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 900;
  font-size: .95rem;
  flex-shrink: 0;
}

.rank-1 .rank-badge { background: #fef3c7; color: #d97706; }
.rank-2 .rank-badge { background: #f1f5f9; color: #64748b; }
.rank-3 .rank-badge { background: #fdf2e9; color: #a0522d; }
.rank-4 .rank-badge, .rank-5 .rank-badge, .rank-6 .rank-badge, .rank-7 .rank-badge { background: var(--tag-bg); color: var(--text-muted); }

.card-title { flex: 1; }

.card-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: .2rem;
}

.card-title .meta {
  font-size: .8rem;
  color: var(--text-muted);
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

.total-score {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent);
  white-space: nowrap;
}

/* Score bars */
.score-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem .75rem;
  margin-bottom: 1rem;
}

@container (max-width: 500px) {
  .score-bars { grid-template-columns: 1fr; }
}

.score-item { }

.score-item .label {
  display: flex;
  justify-content: space-between;
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: .2rem;
}

.score-item .label strong {
  color: var(--text);
  font-weight: 600;
}

.bar-track {
  height: 6px;
  background: var(--tag-bg);
  border-radius: 99px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  transition: width .4s ease;
}

.rank-1 .bar-fill { background: var(--gold); }
.rank-2 .bar-fill { background: var(--silver); }
.rank-3 .bar-fill { background: #cd7f32; }

/* Pros/Cons */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

@container (max-width: 500px) {
  .pros-cons { grid-template-columns: 1fr; }
}

.pros h4, .cons h4 {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .4rem;
}

.pros h4 { color: var(--green); }
.cons h4 { color: #ef4444; }

.pros ul, .cons ul {
  list-style: none;
  font-size: .82rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.pros li::before { content: '✓ '; color: var(--green); font-weight: 700; }
.cons li::before { content: '✗ '; color: #ef4444; font-weight: 700; }

/* Recommendation box */
.recommendation {
  background: var(--accent-light);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.recommendation h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: .75rem;
}

.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .75rem;
}

.rec-item {
  background: white;
  border-radius: 8px;
  padding: .875rem 1rem;
}

.rec-item .situation {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .2rem;
}

.rec-item .choice {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
}

/* Table */
.table-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

th {
  background: var(--tag-bg);
  font-weight: 700;
  text-align: left;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: var(--bg); }

.score-cell {
  font-weight: 700;
  color: var(--accent);
}

.top1 .score-cell { color: var(--gold); }

footer {
  text-align: center;
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 3rem;
}
