/* Coding Caravan */
#ccStage[data-state="play"], #ccStage[data-state="win"] {
  background-image: none;
  background-color: #fef3c7;
}
#ccStage[data-state="welcome"] { background: linear-gradient(180deg, #fde68a, #fef3c7 55%, #fde68a); }
.cc-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.cc-chip {
  background: #fffbeb; border: 2px solid #fde68a; color: #92400e;
  font-size: 13px; font-weight: 1000; padding: 7px 12px; border-radius: 999px;
}
.cc-mission {
  text-align: center; font-size: clamp(15px, 3vw, 20px); font-weight: 1000;
  color: #173653; padding: 10px 14px 2px; min-height: 32px;
}
/* Level select chips */
.cc-levels { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; padding: 8px 10px 0; }
.cc-level-chip {
  font: inherit; cursor: pointer; min-width: 46px; min-height: 42px;
  border: 2px solid #fbbf24; background: #fffbeb; color: #92400e;
  border-radius: 13px; padding: 4px 8px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; line-height: 1.05;
}
.cc-level-chip b { font-size: 15px; font-weight: 1000; }
.cc-level-chip small { font-size: 9px; letter-spacing: -1px; }
.cc-level-chip[aria-pressed="true"] { background: #f59e0b; border-color: #b45309; color: #fff; }
.cc-level-chip:disabled { opacity: .45; cursor: default; }
/* Board */
.cc-boardwrap {
  position: relative; width: min(92vw, 460px); margin: 10px auto 0;
  border: 4px solid #b45309; border-radius: 18px; overflow: hidden;
  box-shadow: 0 6px 0 #92400e33; background: #fde68a;
}
.cc-board { display: grid; width: 100%; height: 100%; }
.cc-cell {
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(15px, 5.4vw, 27px); line-height: 1; position: relative;
}
.cc-cell.sand { background: linear-gradient(145deg, #fef3c7, #fde68a); box-shadow: inset 0 0 0 1px #f59e0b26; }
.cc-cell.wall { background: linear-gradient(145deg, #d6a860, #b45309); }
.cc-cell.start { background: linear-gradient(145deg, #fef9c3, #fde68a); }
.cc-cell .cc-flag { position: absolute; top: 2px; left: 3px; font-size: .52em; }
.cc-cell.goal {
  background: radial-gradient(circle at 50% 62%, #38bdf8 0 34%, #7dd3fc 42%, #fde68a 78%);
  box-shadow: inset 0 0 0 2px #0ea5e9;
}
.cc-cell .cc-oasis { font-size: .92em; filter: drop-shadow(0 2px 2px #0369a155); }
.cc-cell.date .cc-palm { transition: opacity .3s, transform .3s; }
.cc-cell.date.got .cc-palm { opacity: .18; transform: scale(.8); }
/* Camel */
.cc-camel {
  position: absolute; top: 0; left: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  transition: transform .38s ease-in-out;
  pointer-events: none;
}
.cc-camel-body { font-size: clamp(19px, 7vw, 36px); line-height: 1; filter: drop-shadow(0 3px 2px #92400e55); }
.cc-camel-arrow {
  position: absolute; top: 1px; right: 2px;
  font-size: clamp(9px, 2.6vw, 13px); color: #fff; background: #b45309;
  border: 2px solid #fff; border-radius: 999px; width: 1.9em; height: 1.9em;
  display: flex; align-items: center; justify-content: center;
  transition: transform .3s ease;
}
.cc-camel.bump { animation: ccBump .45s ease-in-out; }
@keyframes ccBump {
  0%, 100% { margin-left: 0; }
  25% { margin-left: -5px; }
  55% { margin-left: 5px; }
  80% { margin-left: -3px; }
}
/* Caravan log */
.cc-log {
  width: min(92vw, 460px); margin: 10px auto 0; text-align: center;
  background: #fffbeb; border: 2px dashed #f59e0b; border-radius: 13px;
  padding: 8px 12px; font-size: 13.5px; font-weight: 800; color: #92400e; line-height: 1.4;
}
/* Program panel */
.cc-program-panel {
  width: min(94vw, 520px); margin: 14px auto 12px; background: #ffffffef;
  border: 2px solid #fde68a; border-radius: 18px; padding: 12px;
}
.cc-program-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  font-weight: 1000; color: #173653; font-size: 14.5px; margin-bottom: 8px;
}
.cc-par { font-size: 11.5px; color: #92400e; font-weight: 900; text-align: right; }
.cc-strip {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  min-height: 54px; background: #fef3c7; border: 2px inset #fde68a;
  border-radius: 13px; padding: 7px;
}
.cc-strip-empty { font-size: 13px; font-weight: 800; color: #a16207; padding: 4px 6px; }
.cc-block {
  font: inherit; cursor: pointer; position: relative;
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; color: #fff; border: 2px solid #00000022;
  box-shadow: 0 3px 0 #00000030;
}
.cc-block small {
  position: absolute; bottom: 1px; right: 4px; font-size: 9px; font-weight: 1000; opacity: .9;
}
.cc-block-f { background: #0284c7; }
.cc-block-l { background: #7c3aed; }
.cc-block-r { background: #db2777; }
.cc-block.active { outline: 4px solid #f59e0b; outline-offset: 1px; transform: scale(1.1); }
.cc-block:disabled { opacity: .55; cursor: default; }
.cc-pad { display: flex; gap: 8px; margin-top: 10px; }
.cc-cmd {
  font: inherit; flex: 1; cursor: pointer; min-height: 62px;
  border-radius: 15px; border: 2px solid #00000022; color: #fff;
  font-size: 13.5px; font-weight: 1000; box-shadow: 0 4px 0 #00000030;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.cc-cmd span { font-size: 23px; line-height: 1; }
.cc-cmd:active { transform: translateY(2px); box-shadow: 0 2px 0 #00000030; }
.cc-cmd:disabled { opacity: .55; cursor: default; }
#ccAddF { background: #0284c7; }
#ccAddL { background: #7c3aed; }
#ccAddR { background: #db2777; }
.cc-runrow { display: flex; gap: 8px; margin-top: 10px; }
.cc-runrow button {
  font: inherit; cursor: pointer; border-radius: 15px; min-height: 56px;
  font-weight: 1000; border: 2px solid #00000022;
}
#ccClear { flex: 0 0 34%; background: #f1f5f9; color: #475569; font-size: 14px; }
#ccClear:disabled, .cc-run:disabled { opacity: .55; cursor: default; }
.cc-run {
  flex: 1; background: #16a34a; color: #fff; font-size: 20px; letter-spacing: .04em;
  box-shadow: 0 5px 0 #14532d;
}
.cc-run:active { transform: translateY(2px); box-shadow: 0 3px 0 #14532d; }
.cc-tip { margin: 8px 2px 0; font-size: 11.5px; font-weight: 800; color: #64748b; text-align: center; }
@media (max-width: 480px) {
  .cc-boardwrap { width: min(94vw, 460px); }
  .cc-block { width: 42px; height: 42px; font-size: 19px; }
  .cc-cmd { min-height: 58px; font-size: 12.5px; }
  .cc-par { display: none; }
}

/* ---- v2: worlds, rivers, repeat blocks, welcome alt buttons ---- */
.cc-world-label {
  flex: 0 0 100%; text-align: center; margin-top: 5px;
  font-size: 12.5px; font-weight: 1000; letter-spacing: .05em; color: #92400e;
}
.cc-cell.river {
  background: linear-gradient(145deg, #7dd3fc, #0284c7);
  box-shadow: inset 0 0 0 1px #0369a155;
}
.cc-block .cc-times {
  position: absolute; top: 1px; left: 3px;
  font-size: 10.5px; font-weight: 1000; line-height: 1.35;
  background: #00000038; border-radius: 6px; padding: 0 4px;
}
#ccRepeat { background: #0d9488; }
.cc-welcome-alt { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.cc-alt-btn {
  font: inherit; cursor: pointer; min-height: 52px; padding: 10px 18px;
  border-radius: 15px; border: 2px solid #b45309; background: #fffbeb;
  color: #92400e; font-weight: 1000; box-shadow: 0 4px 0 #b4530933;
}
.cc-alt-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #b4530933; }
