/**
 * DS4K 권별 커리큘럼 문제집 — 스카이 블루 테마
 */
:root {
  --bg: #e8f1fb;
  --bg-glow-1: #d4e6fa;
  --bg-glow-2: #e0e7ff;
  --hero-grad: linear-gradient(135deg, #c5dbf5 0%, #dce8f8 55%, #e8e0ff 100%);

  --surface-soft: #eef4fc;
  --surface-problem: #fdfefe;

  --accent: #3b82f6;
  --accent-deep: #1d4ed8;
  --accent-light: #93c5fd;
  --accent-glow: rgba(37, 99, 235, 0.35);

  --ink: #0f2744;
  --heading: #0c2340;
  --muted: #4a6480;
  --line: #c9daf0;
  --rule-line: #e8f0fa;
}

.code-block {
  margin: 10px 0 4px;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.65;
  color: #e8edff;
  background: #1e3a5f;
  border-radius: var(--radius-sm);
  border: 2px solid #0f2744;
  white-space: pre-wrap;
}

.pat-item {
  display: inline-block;
  min-width: 40px;
  padding: 6px 12px;
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 8px;
}

.pat-item.is-hi {
  border-color: var(--accent-deep);
  background: #dbeafe;
}

.arrow-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.arrow-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  font-size: 28px;
  font-weight: 800;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
}

.visual-hint {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.state-row,
.index-row,
.rep-row,
.container-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.state-box {
  padding: 10px 14px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  text-align: center;
}

.catalog-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.view-toggle {
  display: inline-flex;
  padding: 3px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 999px;
}

.view-btn {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
}

.view-btn.active {
  background: var(--accent);
  color: #fff;
}

.shape-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shape-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 10px;
  font-size: 22px;
}

.shape-chip small {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}

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

.compare-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.treasure-box {
  display: grid;
  grid-template-columns: repeat(3, 34px);
  grid-auto-rows: 34px;
  gap: 4px;
  width: calc(3 * 34px + 2 * 4px + 16px);
  padding: 8px;
  background: #fff7ed;
  border: 3px solid #c2410c;
  border-radius: 12px;
  box-sizing: border-box;
  overflow: hidden;
}

.treasure-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  font-size: 20px;
  line-height: 1;
  overflow: hidden;
  background: #fff;
  border-radius: 6px;
}

.box-cap {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-deep);
}

.compare-vs {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--accent-deep);
}

.pixel-grid {
  display: grid;
  gap: 2px;
  padding: 4px;
  background: #cbd5e8;
  border-radius: 6px;
}

.px {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #9aa8c8;
  background: #fff;
}

.px.on {
  color: #fff;
  background: #1e3a5f;
}

.bars-h {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(100%, 360px);
}

.bar-h-row {
  display: grid;
  grid-template-columns: 6.2em 1fr 2em;
  align-items: center;
  gap: 8px;
}

.bar-h-lab {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-h-track {
  height: 22px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.bar-h-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
  min-width: 8px;
}

.bar-h-n {
  font-size: 13px;
  font-weight: 900;
  color: var(--accent-deep);
  text-align: right;
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cgrid {
  display: block;
  background: #fff;
  border-radius: 8px;
}

.cgrid.arrow-grid {
  background: #f8fbff;
  border: 2px solid var(--line);
  max-width: 100%;
  height: auto;
}

.cgrid .gmark {
  font-family: var(--font-display);
  font-size: 12px;
  text-anchor: middle;
}

.cgrid .gruler {
  font-size: 10px;
  font-weight: 700;
  fill: var(--muted);
  text-anchor: middle;
}

.garden-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 22px;
}
.traffic-svg { display: block; }
.cipher-table, .xy-table {
  border-collapse: collapse;
  font-size: 13px;
  font-weight: 800;
}
.cipher-table th, .cipher-table td, .xy-table th, .xy-table td {
  border: 2px solid var(--line);
  padding: 6px 8px;
  text-align: center;
  background: #fff;
}
.cipher-table th, .xy-table th { background: #dbeafe; }
.var-row, .score-row { display: flex; flex-wrap: wrap; gap: 10px; }
.var-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
  padding: 10px 14px;
  background: #fff7ed;
  border: 3px solid #c2410c;
  border-radius: 12px;
}
.var-name { font-size: 12px; font-weight: 800; color: #9a3412; }
.var-val { font-size: 22px; font-weight: 900; }
.score-card {
  width: 44px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 8px;
  font-weight: 900;
  font-size: 18px;
}

.vol-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface-soft);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
  cursor: pointer;
}

.vol-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
}

.vol-card.active {
  border-color: var(--accent-deep);
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--yellow);
}

.vol-card.is-done {
  border-color: #86efac;
}

.vol-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.vol-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-deep);
  background: #dbeafe;
  padding: 3px 8px;
  border-radius: 6px;
}

.vol-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: #047857;
  background: #ecfdf5;
  padding: 3px 8px;
  border-radius: 6px;
}

.vol-title {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0 0 8px;
  color: var(--ink);
}

.vol-meta {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.vol-go {
  display: inline-flex;
  margin-top: 10px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-deep);
}

@media print {
  .code-block {
    color: #000;
    background: #f4f6fc;
    border-color: #999;
  }
}

.dialogue-box {
  margin: 8px 0;
  padding: 10px 12px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  text-align: left;
}

.dialogue-line {
  margin: 4px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
  top: 0;
  z-index: 40;
  margin: 0 0 14px;
  padding: 12px 14px;
  background: rgba(232, 241, 251, 0.96);
  border: 2px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(15, 39, 68, 0.08);
}

.unit-nav-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.unit-nav-title {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  color: var(--heading);
}

.unit-nav-hint {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.unit-nav-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.unit-pill {
  appearance: none;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.unit-pill:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.unit-pill.active {
  background: var(--accent);
  border-color: var(--accent-deep);
  color: #fff;
}

.unit-pill.done {
  border-color: #86efac;
  background: #f0fdf4;
}

.unit-pill.done.active {
  background: var(--accent);
  border-color: var(--accent-deep);
  color: #fff;
}

.unit-pill small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.85;
  margin-top: 2px;
}

.unit-advance-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 80;
  max-width: min(92vw, 420px);
  padding: 14px 18px;
  border-radius: 14px;
  background: #0f2744;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  text-align: center;
  box-shadow: 0 12px 32px rgba(15, 39, 68, 0.35);
  animation: unitToastIn 0.25s ease;
}

@keyframes unitToastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
