/* ── Language switcher ── */
.lang-switcher {
  position: fixed;
  top: 18px;
  right: 20px;
  display: flex;
  gap: 6px;
  z-index: 100;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 50px;
  padding: 5px 8px;
  box-shadow: 0 4px 20px rgba(124,92,191,0.15);
}
.lang-btn {
  padding: 5px 12px;
  border: none;
  border-radius: 30px;
  background: transparent;
  color: var(--text-muted, #7a7a9a);
  font-size: 0.78rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.lang-btn:hover { background: #f0ebff; color: #7c5cbf; }
.lang-btn.active {
  background: linear-gradient(135deg, #7c5cbf, #a855f7);
  color: #fff;
}

:root {
  --purple: #7c5cbf;
  --purple-light: #a78bd4;
  --purple-dark: #5a3e9b;
  --pink: #f5576c;
  --green: #43e97b;
  --bg: #f0ecff;
  --card: #ffffff;
  --text: #1a1a2e;
  --text-muted: #7a7a9a;
  --border: #e4deff;
  --radius: 20px;
  --shadow: 0 8px 40px rgba(124, 92, 191, 0.15);
  --shadow-lg: 0 20px 60px rgba(124, 92, 191, 0.2);
}

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

body {
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--bg);
  min-height: 100vh;
  color: var(--text);
  overflow-x: hidden;
}

/* ── Background orbs ── */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}
.orb1 { width: 500px; height: 500px; background: #c4b5f4; top: -150px; left: -150px; }
.orb2 { width: 400px; height: 400px; background: #f9a8d4; bottom: -100px; right: -100px; }
.orb3 { width: 300px; height: 300px; background: #a5f3cf; top: 40%; left: 60%; }

/* ── Page layout ── */
.page {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* ── Hero ── */
.hero {
  text-align: center;
  margin-bottom: 32px;
}
.hero-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(124,92,191,0.3));
  animation: float 3s ease-in-out infinite;
}
.hero-icon.small { font-size: 2rem; margin: 0; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
h1 {
  font-size: 2.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--purple-dark), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.hero-sub {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 400;
}

/* ── Card ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.setup-card { padding: 36px; }
.ladder-card { padding: 28px 20px; }

/* ── Columns ── */
.columns {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
}
.col { flex: 1; min-width: 0; }
.divider {
  width: 1px;
  background: var(--border);
  margin: 0 28px;
  flex-shrink: 0;
}

/* ── Column header ── */
.col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.col-icon { font-size: 1.2rem; }
.col-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.count-badge {
  margin-left: auto;
  background: var(--purple);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.result-badge { background: var(--pink); }

/* ── Input list ── */
.input-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }

.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: rowIn 0.2s ease;
}
@keyframes rowIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.row-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.result-num {
  background: linear-gradient(135deg, var(--pink), #f093fb);
}

input[type="text"] {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text);
  background: #fafafa;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
input[type="text"]:focus {
  border-color: var(--purple-light);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(167, 139, 212, 0.18);
}
input[type="text"]::placeholder { color: #bbb; }

.remove-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: #fff0f0;
  color: #f87272;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.1s;
}
.remove-btn:hover { background: #ffe0e0; transform: scale(1.1); }

/* ── Add button ── */
.add-btn {
  width: 100%;
  padding: 9px;
  border: 1.5px dashed var(--purple-light);
  border-radius: 10px;
  background: none;
  color: var(--purple);
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s, border-color 0.2s;
}
.add-btn:hover { background: #f0ebff; border-color: var(--purple); }
.add-btn.result-add { border-color: #f5a0b5; color: var(--pink); }
.add-btn.result-add:hover { background: #fff0f4; border-color: var(--pink); }
.add-icon { font-size: 1rem; }

/* ── Start button ── */
.start-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #7c5cbf, #a855f7, #f5576c);
  background-size: 200% 200%;
  color: #fff;
  font-size: 1.05rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 24px rgba(124,92,191,0.35);
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
}
.start-btn:hover {
  opacity: 0.93;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(124,92,191,0.4);
}
.start-btn:active { transform: translateY(0); }
.btn-arrow { font-size: 1.1rem; }

/* ── Hidden ── */
.hidden { display: none !important; }

/* ── Game header ── */
.game-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.game-header h1 {
  font-size: 1.6rem;
  flex: 1;
}
.ghost-btn {
  padding: 8px 18px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.ghost-btn:hover { border-color: var(--purple-light); color: var(--purple); background: #f5f0ff; }

/* ── Hint ── */
.hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ── Ladder wrapper & labels ── */
.ladder-wrapper { overflow-x: auto; }

.labels {
  position: relative;
  height: 52px;
}

.label-item {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.15s;
  transform: translateX(-50%);
}
.label-item:hover { transform: translateX(-50%) scale(1.07); }

.label-chip {
  padding: 7px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  transition: box-shadow 0.2s;
  font-family: 'Noto Sans KR', sans-serif;
}
.label-item:hover .label-chip { box-shadow: 0 6px 20px rgba(0,0,0,0.22); }

.result-chip {
  padding: 7px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  background: linear-gradient(135deg, #f093fb, #f5576c);
  box-shadow: 0 4px 14px rgba(245,87,108,0.3);
  font-family: 'Noto Sans KR', sans-serif;
  opacity: 0.4;
  transition: opacity 0.4s, transform 0.3s, box-shadow 0.3s;
}
.label-item.revealed .result-chip {
  opacity: 1;
  animation: popIn 0.45s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes popIn {
  0%   { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

#ladder-canvas {
  display: block;
  margin: 0 auto;
}

/* ── Game actions ── */
.game-actions {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}
.run-btn {
  padding: 14px 40px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #43e97b, #38f9d7);
  color: #1a5c3a;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(67,233,123,0.35);
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}
.run-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(67,233,123,0.4);
}
.run-btn:active { transform: translateY(0); }

/* ── Results display ── */
.results-display {
  margin-top: 28px;
}
.results-title {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--purple-dark);
  margin-bottom: 16px;
}
#results-list { display: flex; flex-direction: column; gap: 10px; }

.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(124,92,191,0.08);
  animation: slideUp 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.result-row .player-chip {
  padding: 5px 14px;
  border-radius: 20px;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}
.result-row .arrow-icon {
  color: #ccc;
  font-size: 1.1rem;
  flex-shrink: 0;
  margin: 0 4px;
}
.result-row .prize-text {
  flex: 1;
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--pink);
}

/* ── AdSense ── */
.ad-wrap {
  margin: 20px 0;
  text-align: center;
  min-height: 100px;
  border-radius: 12px;
  overflow: hidden;
}

/* ── Disqus ── */
.disqus-section {
  margin-top: 28px;
  padding: 28px;
}
.disqus-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--purple-dark);
  margin-bottom: 20px;
}
#disqus_thread { min-height: 100px; }

/* ── Nav ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-logo {
  font-size: 1rem;
  font-weight: 800;
  color: var(--purple-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin-left: auto;
}
.nav-links a {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.nav-links a:hover { background: #f0ebff; color: var(--purple); }

/* ── Content sections ── */
.content-section {
  margin-top: 48px;
}
.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--purple-dark);
  margin-bottom: 20px;
}

/* Steps */
.steps { display: flex; flex-direction: column; gap: 16px; }
.step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(124,92,191,0.07);
}
.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), #a855f7);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-body h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.step-body p  { font-size: 0.92rem; color: var(--text-muted); line-height: 1.6; }
.step-body strong { color: var(--purple); }

/* Use cases */
.use-cases {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.use-case {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  box-shadow: 0 2px 8px rgba(124,92,191,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.use-case:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(124,92,191,0.12); }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(124,92,191,0.06);
  cursor: pointer;
}
.faq-item summary {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::after { content: '＋'; color: var(--purple); font-size: 1.1rem; }
.faq-item[open] summary::after { content: '－'; }
.faq-item p {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Footer ── */
.site-footer {
  background: #1a1a2e;
  color: #aaa;
  margin-top: 60px;
  padding: 36px 20px;
}
.footer-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.footer-logo {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
}
.footer-nav { display: flex; gap: 20px; }
.footer-nav a {
  color: #aaa;
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s;
}
.footer-nav a:hover { color: #fff; }
.footer-copy { font-size: 0.82rem; color: #666; }

/* ── Privacy page ── */
.policy-card { padding: 40px; margin-top: 20px; }
.policy-title {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--purple-dark), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}
.policy-date { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 32px; }
.policy-body h2 {
  font-size: 1.1rem; font-weight: 700;
  color: var(--purple-dark);
  margin: 28px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.policy-body h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin: 16px 0 8px; }
.policy-body p { font-size: 0.93rem; color: #444; line-height: 1.8; margin-bottom: 10px; }
.policy-body ul { padding-left: 20px; margin-bottom: 10px; }
.policy-body li { font-size: 0.93rem; color: #444; line-height: 1.8; }
.policy-body a { color: var(--purple); text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .page { padding: 24px 14px 60px; }
  h1 { font-size: 1.9rem; }
  .setup-card { padding: 22px 16px; }
  .columns { flex-direction: column; }
  .divider { width: 100%; height: 1px; margin: 18px 0; }
}
