@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --bg-primary: #f5f6fa;
  --bg-secondary: #fff;
  --text-primary: #1a1a2e;
  --text-secondary: #555;
  --text-light: #999;
  --border-color: #e2e5ef;
  --shadow: rgba(0,0,0,0.06);
  --primary-color: #4f7df3;
  --primary-light: rgba(79,125,243,0.08);
  --primary-glow: rgba(79,125,243,0.2);
  --gradient-primary: linear-gradient(135deg, #4f7df3, #7c5cf5);
  --danger-color: #ef4444;
  --success-color: #10b981;
  --transition: cubic-bezier(0.4, 0, 0.2, 1);

  --team-a: #4f7df3;
  --team-a-light: rgba(79,125,243,0.10);
  --team-b: #ef4444;
  --team-b-light: rgba(239,68,68,0.10);
  --team-c: #10b981;
  --team-c-light: rgba(16,185,129,0.10);
  --team-d: #f59e0b;
  --team-d-light: rgba(245,158,11,0.10);
  --team-e: #8b5cf6;
  --team-e-light: rgba(139,92,246,0.10);
  --team-f: #ec4899;
  --team-f-light: rgba(236,72,153,0.10);
}

html.dark-mode,
body.dark-mode {
  --bg-primary: #0c0c18;
  --bg-secondary: #161627;
  --text-primary: #eaeaf2;
  --text-secondary: #a0a0b8;
  --text-light: #8686ab;
  --border-color: #252540;
  --shadow: rgba(0,0,0,0.35);
  --primary-light: rgba(79,125,243,0.12);
  --primary-glow: rgba(79,125,243,0.3);
  --team-a-light: rgba(79,125,243,0.15);
  --team-b-light: rgba(239,68,68,0.15);
  --team-c-light: rgba(16,185,129,0.15);
  --team-d-light: rgba(245,158,11,0.15);
  --team-e-light: rgba(139,92,246,0.15);
  --team-f-light: rgba(236,72,153,0.15);
}

body {
  font-family: 'Inter', 'Segoe UI', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.4s var(--transition), color 0.4s var(--transition);
}

body::before {
  content: '';
  position: fixed;
  top: -200px;
  right: -200px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(79,125,243,0.07) 0%, transparent 65%);
  pointer-events: none;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 36px 24px 60px;
  position: relative;
  z-index: 1;
}

/* ── Header ── */
header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 20px;
}

.header-left { flex: 1; }

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--primary-color);
  text-decoration: none;
  margin-bottom: 10px;
  font-weight: 600;
  padding: 4px 12px 4px 8px;
  border-radius: 20px;
  background: var(--primary-light);
  transition: all 0.25s var(--transition);
}

.home-link:hover {
  background: var(--primary-glow);
  transform: translateX(-3px);
}

.header-left h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 6px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

header button {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 1.05rem;
  padding: 9px 12px;
  border-radius: 12px;
  transition: all 0.25s var(--transition);
  color: var(--text-primary);
  line-height: 1;
}

header button:hover {
  background: var(--primary-light);
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

/* 다크모드/도움말/언어 아이콘 버튼 — 홈페이지와 동일한 구조 */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-primary);
  cursor: pointer;
  transition: all 0.25s var(--transition);
  color: var(--text-secondary);
}

.icon-btn:hover {
  border-color: var(--primary-color);
  background: var(--primary-light);
  color: var(--primary-color);
  transform: none;
  box-shadow: none;
}

.theme-icon {
  width: 18px;
  height: 18px;
}

.lang-select {
  position: relative;
}

.lang-toggle {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  padding: 6px;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-secondary);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.2s var(--transition);
  z-index: 200;
}

.lang-select.open .lang-toggle {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 9px 10px;
  border-radius: 8px;
  transition: all 0.2s var(--transition);
}

.lang-option:hover {
  background: var(--primary-light);
  color: var(--primary-color);
}

.lang-option.active {
  color: var(--primary-color);
}

.lang-option .lang-check {
  opacity: 0;
  color: var(--primary-color);
}

.lang-option.active .lang-check {
  opacity: 1;
}

/* ── Input Section ── */
.input-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 24px var(--shadow);
}

.input-row {
  display: flex;
  gap: 10px;
}

.input-row input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: border-color 0.25s var(--transition), box-shadow 0.25s var(--transition);
}

.input-row input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.input-row input::placeholder {
  color: var(--text-light);
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  border: none;
  border-radius: 12px;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s var(--transition);
  box-shadow: 0 3px 10px var(--primary-glow);
  white-space: nowrap;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--primary-glow);
}

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

.primary-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s var(--transition);
}

.action-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--primary-light);
}

/* ── Player List ── */
.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  margin-bottom: 12px;
}

.player-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
}

.player-header h2 span {
  color: var(--text-light);
  font-weight: 500;
}

.player-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
}

.empty-msg {
  color: var(--text-light);
  font-size: 0.85rem;
  padding: 12px 0;
}

.player-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.2s var(--transition);
  animation: tagIn 0.25s var(--transition);
}

@keyframes tagIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

.player-tag:hover {
  border-color: var(--danger-color);
}

.player-tag .remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-light);
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}

.player-tag .remove-btn:hover {
  color: var(--danger-color);
}

/* ── Setting Section ── */
.setting-section {
  margin-top: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 24px var(--shadow);
}

.setting-group {
  margin-bottom: 18px;
}

.setting-group h2 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.preset-btn {
  padding: 10px 4px;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s var(--transition);
  text-align: center;
}

.preset-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--primary-light);
}

.preset-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.per-team-info {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--text-light);
  font-weight: 500;
}

.per-team-info .highlight {
  color: var(--primary-color);
  font-weight: 700;
}

.mode-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.mode-btn {
  flex: 1;
  padding: 10px;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s var(--transition);
}

.mode-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.mode-btn.active {
  background: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
  font-weight: 700;
}

.divider-actions {
  display: flex;
  gap: 10px;
}

.divide-btn {
  flex: 1;
  padding: 14px;
  font-size: 1rem;
}

/* ── Result Section ── */
.result-section {
  margin-top: 20px;
  animation: fadeIn 0.4s var(--transition);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.result-header h2 {
  font-size: 1.1rem;
  font-weight: 800;
}

.teams-grid {
  display: grid;
  gap: 14px;
}

.teams-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.teams-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.teams-grid.cols-4 { grid-template-columns: 1fr 1fr; }

.team-card {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 4px 16px var(--shadow);
  position: relative;
  overflow: hidden;
  animation: cardIn 0.45s var(--transition) both;
}

.team-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.team-card:nth-child(1)::before { background: var(--team-a); }
.team-card:nth-child(2)::before { background: var(--team-b); }
.team-card:nth-child(3)::before { background: var(--team-c); }
.team-card:nth-child(4)::before { background: var(--team-d); }
.team-card:nth-child(5)::before { background: var(--team-e); }
.team-card:nth-child(6)::before { background: var(--team-f); }

.team-card:nth-child(1) { border-top-color: var(--team-a); }
.team-card:nth-child(2) { border-top-color: var(--team-b); }
.team-card:nth-child(3) { border-top-color: var(--team-c); }
.team-card:nth-child(4) { border-top-color: var(--team-d); }
.team-card:nth-child(5) { border-top-color: var(--team-e); }
.team-card:nth-child(6) { border-top-color: var(--team-f); }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.team-card:nth-child(1) { animation-delay: 0s; }
.team-card:nth-child(2) { animation-delay: 0.08s; }
.team-card:nth-child(3) { animation-delay: 0.16s; }
.team-card:nth-child(4) { animation-delay: 0.24s; }
.team-card:nth-child(5) { animation-delay: 0.32s; }
.team-card:nth-child(6) { animation-delay: 0.40s; }

.team-label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-label .team-count {
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.6;
}

.team-card:nth-child(1) .team-label { color: var(--team-a); }
.team-card:nth-child(2) .team-label { color: var(--team-b); }
.team-card:nth-child(3) .team-label { color: var(--team-c); }
.team-card:nth-child(4) .team-label { color: var(--team-d); }
.team-card:nth-child(5) .team-label { color: var(--team-e); }
.team-card:nth-child(6) .team-label { color: var(--team-f); }

.team-name-editable {
  outline: none;
  border-radius: 4px;
  padding: 1px 4px;
  cursor: text;
  transition: background 0.2s;
}

.team-name-editable:hover {
  background: rgba(79, 125, 243, 0.08);
}

.team-name-editable:focus {
  background: rgba(79, 125, 243, 0.12);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.team-members {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  animation: memberIn 0.3s var(--transition) both;
}

.member-row:nth-child(1) { animation-delay: 0.1s; }
.member-row:nth-child(2) { animation-delay: 0.15s; }
.member-row:nth-child(3) { animation-delay: 0.2s; }
.member-row:nth-child(4) { animation-delay: 0.25s; }
.member-row:nth-child(5) { animation-delay: 0.3s; }
.member-row:nth-child(6) { animation-delay: 0.35s; }
.member-row:nth-child(7) { animation-delay: 0.4s; }
.member-row:nth-child(8) { animation-delay: 0.45s; }
.member-row:nth-child(9) { animation-delay: 0.5s; }
.member-row:nth-child(10) { animation-delay: 0.55s; }

@keyframes memberIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.team-card:nth-child(1) .member-row { background: var(--team-a-light); }
.team-card:nth-child(2) .member-row { background: var(--team-b-light); }
.team-card:nth-child(3) .member-row { background: var(--team-c-light); }
.team-card:nth-child(4) .member-row { background: var(--team-d-light); }
.team-card:nth-child(5) .member-row { background: var(--team-e-light); }
.team-card:nth-child(6) .member-row { background: var(--team-f-light); }

.member-num {
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0.4;
  min-width: 16px;
}

/* ── Versus Badge ── */
.vs-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-light);
  padding: 8px 0;
  letter-spacing: 2px;
}

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeBg 0.2s ease;
  padding: 20px;
}

@keyframes fadeBg {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-box {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 20px;
  padding: 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.35s var(--transition);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.modal-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

@keyframes modalIn {
  from { transform: translateY(24px) scale(0.95); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-box h2 {
  margin-bottom: 18px;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.shortcuts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  padding: 8px 12px;
  background: var(--bg-primary);
  border-radius: 10px;
  transition: background 0.2s;
}

.shortcut-item:hover {
  background: var(--primary-light);
}

.shortcut-item kbd {
  background: var(--gradient-primary);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'Inter', monospace;
  box-shadow: 0 2px 6px var(--primary-glow);
  letter-spacing: 0.3px;
}

.shortcut-item span {
  color: var(--text-secondary);
  font-weight: 500;
}

.modal-close-btn {
  width: 100%;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 3px 10px var(--primary-glow);
}

.modal-close-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--primary-glow);
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 200;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  border: 1px solid var(--border-color);
  animation: toastIn 0.35s var(--transition);
}

@keyframes toastIn {
  from { transform: translateX(-50%) translateY(16px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 6px; }

::selection {
  background: var(--primary-glow);
  color: var(--text-primary);
}

*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ── Fav Names (in input-section) ── */
.fav-names-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
}

.fav-names-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.fav-names-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fav-name-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: var(--bg-primary);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.fav-name-chip:hover:not(.in-players) {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--primary-light);
}

.fav-name-chip.in-players {
  opacity: 0.4;
  cursor: default;
}

.fav-name-del {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 0.72rem;
  color: #f59e0b;
  cursor: pointer;
  transition: transform 0.15s;
  line-height: 1;
  flex-shrink: 0;
}

.fav-name-del:hover { transform: scale(1.25); }

/* Star button inside player-tag */
.fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
  line-height: 1;
  color: var(--text-light);
  transition: all 0.15s;
  opacity: 0;
}

.player-tag:hover .fav-btn { opacity: 1; }

.fav-btn.is-fav {
  color: #f59e0b;
  opacity: 1;
}

.fav-btn:hover { transform: scale(1.2); }

/* ── Preset inline edit ── */
.preset-edit-input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid var(--primary-color);
  border-radius: 6px;
  padding: 3px 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-secondary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-light);
}

.preset-confirm-btn,
.preset-cancel-btn {
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}

.preset-confirm-btn {
  background: var(--primary-color);
  color: #fff;
}

.preset-confirm-btn:hover { opacity: 0.85; }

.preset-cancel-btn {
  background: var(--bg-primary);
  color: var(--text-light);
  border: 1px solid var(--border-color);
}

.preset-cancel-btn:hover {
  border-color: var(--danger-color);
  color: var(--danger-color);
}

.preset-edit-btn {
  padding: 5px 8px;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  background: transparent;
  color: var(--text-light);
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.preset-edit-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ── Preset Section ── */
.saved-presets-section {
  margin-top: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow: 0 4px 24px var(--shadow);
}

.saved-presets-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.saved-presets-header h2 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.preset-save-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.preset-save-row input {
  flex: 1;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.preset-save-row input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.preset-save-row input::placeholder { color: var(--text-light); }

.preset-saved-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.preset-empty {
  font-size: 0.82rem;
  color: var(--text-light);
  padding: 2px 0;
}

.preset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  gap: 10px;
  transition: border-color 0.2s;
}

.preset-item:hover { border-color: var(--primary-color); }

.preset-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.preset-item-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-item-count {
  font-size: 0.75rem;
  color: var(--text-light);
  white-space: nowrap;
  flex-shrink: 0;
}

.preset-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.preset-load-btn {
  padding: 6px 12px;
  border: 1.5px solid var(--primary-color);
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary-color);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-load-btn:hover {
  background: var(--primary-color);
  color: #fff;
}

.preset-del-btn {
  padding: 6px 10px;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  background: transparent;
  color: var(--text-light);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-del-btn:hover {
  border-color: var(--danger-color);
  color: var(--danger-color);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .container { padding: 24px 16px 50px; }
  .header-left h1 { font-size: 1.5rem; }
  .lang-toggle { min-width: 140px; right: -4px; }
  .lang-option { padding: 8px 8px; font-size: 0.8rem; }
  .teams-grid.cols-2,
  .teams-grid.cols-3 { grid-template-columns: 1fr; }
  .teams-grid.cols-4 { grid-template-columns: 1fr; }
  .mode-btns { flex-wrap: wrap; }
  .preset-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .preset-btn { padding: 10px 4px; font-size: 0.8rem; }
}

/* 모바일 가로 스크롤 방지 — 배경 장식(fixed blob)이 뷰포트 밖으로 넘쳐도 가로 스크롤이 생기지 않게 한다 */
html { overflow-x: hidden; }
