* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #222;
  background: #f5f6f8;
}
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }

.site-header {
  background: #fff;
  border-bottom: 1px solid #e2e5ea;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 22px;
  font-weight: bold;
  color: #1a63c9;
  text-decoration: none;
}
.brand-mark { display: block; width: 30px; height: 34px; }
.site-nav a {
  margin-left: 18px;
  color: #1a63c9;
  text-decoration: none;
  font-size: 15px;
}
.site-nav a:hover { text-decoration: underline; }

.share-row {
  margin: 14px 0 4px;
  font-size: 13px;
  color: #777;
}
.share-row a {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 10px;
  background: #1a63c9;
  color: #fff;
  border-radius: 3px;
  text-decoration: none;
  font-size: 12px;
}

h1 { margin: 10px 0 6px; font-size: 30px; }
.intro { max-width: 860px; line-height: 1.5; color: #444; }

.solver-box {
  background: #fff;
  border: 1px solid #e2e5ea;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  padding: 18px;
  margin: 18px 0 26px;
}

.palette-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef0f3;
  margin-bottom: 14px;
}
.swatch {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 2px solid #b9bec7;
  cursor: pointer;
  padding: 0;
}
.swatch.selected {
  outline: 3px solid #1a63c9;
  outline-offset: 2px;
}
.swatch.eraser {
  background:
    linear-gradient(45deg, transparent 45%, #c33 45%, #c33 55%, transparent 55%),
    #f2f2f2;
  font-size: 0;
}

.solver-main { display: flex; gap: 18px; flex-wrap: wrap; }
.net-pane { flex: 1 1 520px; min-width: 320px; }
#net { width: 100%; height: auto; display: block; }
.side-pane { flex: 0 0 240px; display: flex; flex-direction: column; gap: 12px; }

.hold-card {
  border: 1px solid #eef0f3;
  border-radius: 8px;
  padding: 10px;
  background: #fafbfc;
}
.hold-card h3 { margin: 2px 0 6px; font-size: 15px; }
#hold { width: 100%; height: auto; }
.hold-note { font-size: 12px; color: #555; margin: 6px 0 0; line-height: 1.4; }

.btn-col { display: flex; flex-direction: column; gap: 8px; }
.btn {
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid #c8cdd5;
  border-radius: 6px;
  background: #f4f5f7;
  cursor: pointer;
}
.btn:hover { background: #e9ebee; }
.btn.primary {
  background: #1a63c9;
  border-color: #1a63c9;
  color: #fff;
  font-weight: bold;
}
.btn.primary:hover { background: #144e9f; }
.guarantee { font-size: 12px; color: #2c7a2c; margin: 0; }

.sticker {
  stroke: #59606b;
  stroke-width: 1.5;
  cursor: pointer;
}
.sticker.empty { fill: #e4e6ea; }
.sticker:hover { stroke: #1a63c9; stroke-width: 2.5; }
.sticker.error { stroke: #d21f1f; stroke-width: 3; }
.sticker.hl { stroke: #ff9d00; stroke-width: 4; }
.face-label {
  font-size: 14px;
  fill: #333;
  text-anchor: middle;
  pointer-events: none;
  font-weight: bold;
  opacity: .75;
}
.face-outline { fill: none; stroke: #2b2f36; stroke-width: 2.5; pointer-events: none; }

.message {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.45;
}
.message.error { background: #fdecec; border: 1px solid #f3b8b8; color: #8f1f1f; }
.message.info { background: #eaf3ff; border: 1px solid #bcd7f7; color: #174a86; }
.hidden { display: none; }

.solution { margin-top: 16px; border-top: 1px solid #eef0f3; padding-top: 14px; }
.solution h2 { margin: 0 0 4px; font-size: 20px; }
.scheme { font-size: 13px; color: #555; margin: 0 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
  padding: 6px 12px;
  background: #eef2f8;
  border: 1px solid #c9d6ea;
  border-radius: 16px;
  font-family: "Courier New", monospace;
  font-weight: bold;
  font-size: 15px;
}
.chip.done { opacity: .45; }
.chip.current { background: #1a63c9; color: #fff; border-color: #1a63c9; }

.stepper { display: flex; gap: 10px; align-items: center; }
.step-info {
  flex: 1;
  min-height: 42px;
  font-size: 14px;
  line-height: 1.4;
  display: flex;
  align-items: center;
}
.step-hint { font-size: 12px; color: #777; margin-top: 10px; }

.text-section {
  background: #fff;
  border: 1px solid #e2e5ea;
  border-radius: 8px;
  padding: 6px 18px 14px;
  margin-bottom: 18px;
  line-height: 1.55;
}
.text-section h2 { font-size: 21px; }
.muted { color: #888; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 22px 0;
}
.puzzle-card {
  display: block;
  background: #fff;
  border: 1px solid #e2e5ea;
  border-radius: 8px;
  padding: 18px;
  text-decoration: none;
  color: #222;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.puzzle-card:hover { border-color: #1a63c9; }
.puzzle-card h2 { margin: 0 0 6px; font-size: 19px; color: #1a63c9; }
.puzzle-card p { margin: 0 0 10px; font-size: 14px; color: #555; }
.puzzle-card .card-cta { font-size: 13px; font-weight: bold; color: #1a63c9; }
.puzzle-card.soon { opacity: .62; }
.puzzle-card.soon h2, .puzzle-card.soon .card-cta { color: #777; }

#stage {
  width: 100%;
  border: 1px solid #e2e5ea;
  border-radius: 8px;
  overflow: hidden;
  background: #f2f4f7;
}
#stage canvas { display: block; }
.hover-info {
  font-size: 13px;
  color: #555;
  min-height: 20px;
  margin-top: 6px;
}

.hold-edge { stroke: #444; stroke-width: 2; }
.hold-edge.back { stroke: #b6b9be; stroke-dasharray: 4 3; }
.hold-move-label {
  font-size: 13px;
  font-weight: bold;
  fill: #d2691e;
  text-anchor: middle;
}
.hold-face-label { font-size: 9.5px; fill: #333; text-anchor: middle; }
.hold-face-label.back { fill: #999; }

.site-footer {
  background: #232936;
  color: #cfd4dd;
  margin-top: 30px;
  padding: 22px 0 16px;
  font-size: 13px;
}
.footer-cols { display: flex; gap: 60px; }
.footer-cols h4 { margin: 0 0 8px; color: #fff; }
.footer-cols a { color: #9fc1f2; text-decoration: none; display: block; margin: 3px 0; }
.copyright { margin-top: 16px; color: #8a92a3; }

@media (max-width: 760px) {
  .side-pane { flex: 1 1 auto; }
  .footer-cols { flex-direction: column; gap: 14px; }
}
