/* Game 17 « Au camping » - Styles */
#game-camping {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  color: var(--title-color, #1e293b);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
}
#game-camping[hidden] { display: none; }

.cp-container {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  width: 100%; max-width: 1100px; margin: 0 auto; box-sizing: border-box;
}

/* Title bar */
.cp-title-bar {
  background: var(--title-bg, #ffffff); border-radius: 8px;
  padding: 4px 14px; text-align: center; flex-shrink: 0;
  box-shadow: var(--shadow, 0 1px 3px rgba(0, 0, 0, 0.08));
}
.cp-title-bar h1 {
  font-size: 1.02rem; font-weight: 700; margin: 0; line-height: 1.25;
  color: var(--title-color, #1e293b);
}
.cp-title-bar .cp-hint {
  font-size: 0.74rem; color: var(--hint-color, #64748b); margin-top: 2px;
}

/* Control bar */
.cp-control-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; flex-shrink: 0; margin-top: 4px; padding: 2px 0;
}
.cp-ctrl-left, .cp-ctrl-right { display: flex; align-items: center; gap: 6px; }

.cp-btn-play {
  background: var(--play-bg, #2563eb); color: var(--play-color, #ffffff);
  border: 1.5px solid transparent; border-radius: 6px;
  padding: 4px 12px; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  transition: background-color 0.15s ease;
}
.cp-btn-play:hover { background: var(--play-hover-bg, #1d4ed8); }
.cp-step-info { font-size: 0.82rem; font-weight: 700; color: var(--title-color, #1e293b); }

.cp-btn, .cp-btn-toggle {
  background: var(--btn-bg, #ffffff); color: var(--btn-color, #334155);
  border: 1.5px solid var(--ctrl-border, #cbd5e1); border-radius: 6px;
  padding: 3px 8px; font-size: 0.78rem; cursor: pointer;
  transition: all 0.15s ease;
}
.cp-btn:hover, .cp-btn-toggle:hover { border-color: var(--play-bg, #2563eb); }
.cp-btn-toggle[aria-pressed="true"], .cp-btn-toggle.cp-active {
  background: var(--play-bg, #2563eb); color: #ffffff; border-color: var(--play-bg, #2563eb);
}

/* Ribbon strip */
.cp-ribbon {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  height: 52px; flex-shrink: 0; margin-top: 4px; overflow-x: auto;
  padding: 2px; box-sizing: border-box;
}
.cp-ribbon-slot {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 6px;
  border: 1.5px solid var(--card-border, #e2e8f0); background: var(--card-bg, #ffffff);
  display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.cp-ribbon-slot svg { width: 100%; height: 100%; display: block; }
.cp-ribbon-slot.cp-ribbon-current {
  border-color: var(--play-bg, #2563eb); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}
.cp-ribbon-slot.cp-ribbon-future { border-style: dotted; opacity: 0.45; }
.cp-ribbon-slot.cp-ribbon-passed { opacity: 0.55; border-style: dotted; }

/* Reserved feedback row */
.cp-feedback-row {
  height: 28px; min-height: 28px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; margin-top: 2px;
}
.cp-feedback {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 6px;
  padding: 2px 12px; font-size: 0.8rem; font-weight: 600; line-height: 1.3;
}
.cp-feedback.cp-feedback-correct {
  background: var(--banner-correct-bg, #dcfce7); border: 1.5px solid var(--banner-correct-border, #86efac);
  color: var(--banner-correct-color, #166534);
}
.cp-feedback.cp-feedback-wrong {
  background: var(--banner-wrong-bg, #fee2e2); border: 1.5px solid var(--banner-wrong-border, #fca5a5);
  color: var(--banner-wrong-color, #991b1b);
}
.cp-btn-hint {
  background: #ffffff; color: #991b1b; border: 1px solid #fca5a5;
  border-radius: 4px; padding: 1px 7px; font-size: 0.72rem; font-weight: 600; cursor: pointer;
}
.cp-btn-hint:hover { background: #fee2e2; }

/* Reserved hint row */
.cp-hint-row {
  height: 20px; min-height: 20px; display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; color: var(--hint-color, #64748b); flex-shrink: 0;
  text-align: center; padding: 0 8px; box-sizing: border-box;
}

/* Subtitle bar */
.cp-sub-row {
  min-height: 22px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; flex-shrink: 0; margin-top: 2px;
}
.cp-sub-pill {
  background: var(--sub-bg, #ffffff); color: var(--sub-color, #1e293b);
  border: 1px solid var(--card-border, #cbd5e1); border-radius: 9999px;
  padding: 2px 14px; font-size: 0.78rem; box-shadow: var(--shadow, 0 1px 3px rgba(0, 0, 0, 0.08));
  display: inline-block; text-align: center;
}
.cp-sub-yue { font-size: 0.72rem; color: var(--hint-color, #64748b); margin-top: 1px; text-align: center; }

/* Stage wrapper and SVG camping */
.cp-camping-wrap {
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  position: relative; width: 100%; transform-origin: center center; box-sizing: border-box;
}
.cp-camping-wrap.cp-folding {
  transform: scaleX(0.08); opacity: 0.3; transition: transform 150ms ease-in, opacity 150ms ease-in;
}
.cp-camping-wrap.cp-unfolding {
  transform: scaleX(1); opacity: 1; transition: transform 150ms ease-out, opacity 150ms ease-out;
}
.cp-camping {
  width: 100%; height: auto; max-height: 100%; aspect-ratio: 1000 / 600;
  touch-action: none; user-select: none; border-radius: 10px;
  box-shadow: var(--shadow, 0 1px 4px rgba(0, 0, 0, 0.1)); display: block;
}

/* Stage elements */
.cp-actor, .cp-obj, .cp-target, .cp-node { cursor: pointer; outline: none; }
.cp-actor:focus-visible, .cp-obj:focus-visible, .cp-target:focus-visible, .cp-node:focus-visible {
  outline: 3px solid var(--play-bg, #2563eb); outline-offset: 3px;
}
.cp-actor.cp-selected, .cp-obj.cp-selected {
  outline: 3px dashed var(--play-bg, #2563eb); outline-offset: 3px;
}
.cp-camping .cp-label { display: none; }
.cp-camping-wrap.cp-show-text .cp-camping .cp-label { display: block; }

.cp-shake { animation: cp-shake-keyframes 0.4s ease-in-out; }
@keyframes cp-shake-keyframes {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-8px, 0); }
  40% { transform: translate(8px, 0); }
  60% { transform: translate(-6px, 0); }
  80% { transform: translate(6px, 0); }
}

.cp-drag-ghost {
  position: fixed; pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%); opacity: 0.85;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

/* End card */
.cp-end-card {
  flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start; overflow-y: auto; padding: 12px;
  background: var(--card-bg, #ffffff); border: 1.5px solid var(--card-border, #e2e8f0);
  border-radius: 10px; box-shadow: var(--shadow, 0 1px 4px rgba(0, 0, 0, 0.1));
  width: 100%; box-sizing: border-box;
}
.cp-score {
  color: var(--score-color, #16a34a); font-size: 1.25rem; font-weight: 700; margin: 6px 0 2px 0;
}
.cp-end-card h3 {
  font-size: 1rem; font-weight: 600; margin: 4px 0 10px 0; color: var(--title-color, #1e293b);
}
.cp-album {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
  width: 100%; max-width: 960px; margin: 4px 0 12px 0;
}
.cp-album-card {
  margin: 0; padding: 6px 4px; background: var(--card-bg, #ffffff);
  border: 1px solid var(--card-border, #e2e8f0); border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; text-align: center; box-sizing: border-box;
}
.cp-album-card svg { width: 48px; height: 48px; display: block; }
.cp-album-card figcaption {
  font-size: 0.68rem; margin-top: 4px; color: var(--title-color, #1e293b); line-height: 1.25;
}
.cp-end-actions { display: flex; gap: 12px; margin-top: 8px; margin-bottom: 8px; }

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .cp-camping-wrap.cp-folding, .cp-camping-wrap.cp-unfolding {
    transform: none !important; opacity: 1 !important; transition: none !important;
  }
  .cp-shake { animation: none !important; }
  .cp-btn-play, .cp-btn, .cp-btn-toggle, .cp-ribbon-slot { transition: none !important; }
}

/* Mobile responsive (375x812 and screens <= 700px) */
@media (max-width: 700px) {
  .cp-title-bar { padding: 3px 8px; }
  .cp-title-bar h1 { font-size: 0.88rem; }
  .cp-title-bar .cp-hint { font-size: 0.68rem; }
  .cp-control-bar { gap: 4px; }
  .cp-btn-play { font-size: 0.74rem; padding: 3px 8px; }
  .cp-step-info { font-size: 0.74rem; }
  .cp-btn, .cp-btn-toggle { font-size: 0.72rem; padding: 2px 6px; }
  .cp-ribbon { height: 26px; gap: 2px; }
  .cp-ribbon-slot { width: 20px; height: 20px; border-radius: 4px; }
  .cp-feedback-row { height: 24px; min-height: 24px; }
  .cp-feedback { font-size: 0.74rem; padding: 1px 8px; }
  .cp-hint-row { font-size: 0.7rem; height: 18px; min-height: 18px; }
  .cp-sub-pill { font-size: 0.72rem; padding: 1px 10px; }
  .cp-album { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .cp-album-card { padding: 4px 2px; }
  .cp-album-card svg { width: 36px; height: 36px; }
  .cp-album-card figcaption { font-size: 0.62rem; }
}
