.xartis-page { max-width: 1100px; margin: 0 auto; padding: 32px 16px 64px; }
.xartis-page h1 { margin: 0 0 6px; color: var(--tan); font-size: 28px; }
.xartis-lede { margin: 0 0 20px; opacity: 0.85; }

/* Map */
.map-stage { position: relative; background: #0d2531; border-radius: 14px; overflow: hidden; padding: 8px; }
.map-host svg { display: block; width: 100%; height: auto; }
.map-host path {
  fill: #1b3a4a;
  stroke: #0d2531;
  stroke-width: 0.5;
  vector-effect: non-scaling-stroke;
  transition: fill 0.25s ease, filter 0.25s ease;
}
.map-host path.c-planned { fill: #3a6a80; stroke: #7fb0c4; cursor: pointer; }
.map-host path.c-current { fill: var(--orange); stroke: #ffd9b8; cursor: pointer; }
.map-host path.c-read { fill: var(--tan); stroke: var(--orange); cursor: pointer; }
.map-host path.c-planned:hover, .map-host path.c-current:hover, .map-host path.c-read:hover,
.map-host path.c-lit { filter: brightness(1.18) drop-shadow(0 0 5px rgba(244, 241, 234, 0.7)); stroke: #fff; stroke-width: 1.4; }
.map-host path:focus-visible { outline: none; stroke: #fff; stroke-width: 2; }

.c-in { animation: c-in 0.6s ease var(--d, 0s) both; }
.c-current.c-in { animation: c-in 0.6s ease var(--d, 0s) both, c-pulse 2.4s ease-in-out calc(var(--d, 0s) + 0.6s) infinite; }
@keyframes c-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes c-pulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(217, 125, 61, 0)); }
  50% { filter: drop-shadow(0 0 8px rgba(217, 125, 61, 0.95)); }
}

.map-tip {
  position: absolute; z-index: 5; pointer-events: none;
  background: rgba(18, 50, 64, 0.95); color: var(--tan);
  padding: 4px 10px; border-radius: 6px; font-size: 13px; font-weight: 600;
  border: 1px solid rgba(244, 241, 234, 0.25);
}

/* Country card */
.country-card {
  position: absolute; top: 12px; right: 12px; z-index: 6; width: 300px;
  max-height: calc(100% - 24px); overflow: auto;
  background: rgba(18, 50, 64, 0.97); border: 1px solid rgba(244, 241, 234, 0.2);
  border-radius: 12px; padding: 16px; animation: card-in 0.35s ease;
}
@keyframes card-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.country-card h3 { margin: 0 28px 4px 0; color: var(--tan); }
.card-close {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; padding: 0;
  background: transparent; color: var(--tan); border: 1px solid rgba(244, 241, 234, 0.3);
  border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer;
}
.card-book { display: flex; gap: 12px; margin-top: 12px; color: inherit; text-decoration: none; }
.card-book img { width: 56px; height: auto; border-radius: 4px; flex-shrink: 0; align-self: flex-start; }
.card-book strong { display: block; color: var(--tan); }
.card-book span { display: block; font-size: 13px; opacity: 0.8; }
.badge { display: inline-block; margin-top: 4px; font-size: 11px; font-style: normal; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.badge-read { background: var(--tan); color: var(--teal-dark); }
.badge-current { background: var(--orange); color: #fff; }
.badge-planned { background: rgba(127, 176, 196, 0.25); color: #bfe0ee; }

/* Puzzle */
.puzzle-section { margin-top: 32px; }
.puzzle-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.puzzle-head h2 { margin: 0; color: var(--tan); }
.puzzle-count { color: var(--orange); font-weight: 700; }
.puzzle-card { position: relative; background: #fff; border-radius: 14px; padding: 12px; max-width: 620px; margin: 14px auto 0; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25); }
.puzzle-card svg { display: block; width: 100%; height: auto; }
.puzzle-empty { color: #2b2b2b; text-align: center; margin: 0; padding: 12px; }
.puzzle-tile { fill: #dfe7ec; stroke: #fff; stroke-width: 3; transition: opacity 0.9s ease, transform 0.9s ease, fill 0.2s ease; transform-box: fill-box; transform-origin: center; }
.puzzle-tile.revealed { opacity: 0; transform: scale(0.6); }
.puzzle-tile.lit { fill: #f3d9bf; }
.puzzle-hit { fill: transparent; cursor: pointer; }
.puzzle-card.complete { animation: puzzle-glow 2.6s ease-in-out infinite; }
@keyframes puzzle-glow {
  0%, 100% { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25); }
  50% { box-shadow: 0 0 38px 8px rgba(217, 125, 61, 0.65); }
}
.spark {
  position: fixed; z-index: 60; width: 14px; height: 14px; border-radius: 50%; pointer-events: none;
  background: var(--orange); box-shadow: 0 0 14px 6px rgba(217, 125, 61, 0.8);
  transition: transform 0.9s cubic-bezier(0.5, 0, 0.2, 1), opacity 0.25s ease;
}

@media (max-width: 700px) {
  .country-card { position: relative; top: auto; right: auto; width: auto; margin: 8px; animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .xartis-page *, .xartis-page *::before, .xartis-page *::after { animation: none !important; transition: none !important; }
  .spark { display: none; }
}
