.cr-page { max-width: 980px; }
.cr-intro { max-width: 820px; }

.cr-shell {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 18px 48px rgba(28, 33, 26, .08);
}

.cr-topbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
  background: #fafbf7;
}
.cr-stat {
  min-height: 74px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  padding: 12px;
  border-right: 1px solid var(--line);
}
.cr-stat:last-child { border-right: 0; }
.cr-stat span {
  color: var(--muted);
  font-size: .69rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.cr-stat strong {
  font-size: 1.34rem;
  letter-spacing: -.04em;
}
.cr-lives {
  display: flex;
  gap: 4px;
  min-height: 30px;
  align-items: center;
}
.cr-life-cup {
  width: 28px;
  height: 28px;
  object-fit: contain;
  transition: opacity .18s ease, filter .18s ease, transform .18s ease;
}
.cr-life-cup.is-lost { opacity: .18; filter: grayscale(1); transform: scale(.88); }

.cr-phasebar {
  min-height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  background: var(--dark);
  color: #fff;
}
.cr-phasebar > div { min-width: 0; }
.cr-phasebar strong {
  display: block;
  font-size: .79rem;
  color: var(--accent);
  letter-spacing: .13em;
}
.cr-phasebar span:not(.cr-look-time) {
  display: block;
  margin-top: 3px;
  color: rgba(255,255,255,.74);
  font-size: .9rem;
}
.cr-look-time {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  font-weight: 900;
  font-size: .77rem;
  letter-spacing: .08em;
}
.cr-look-time.is-serve { color: var(--accent); border-color: rgba(229,255,80,.42); }

.cr-stage-wrap { padding: 18px; background: #eef0e9; }
.cr-stage {
  position: relative;
  min-height: 445px;
  padding: 18px 18px 18px;
  overflow: hidden;
  border: 1px solid #d5d9cf;
  border-radius: 20px;
  background:
    linear-gradient(rgba(28,33,26,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28,33,26,.035) 1px, transparent 1px),
    #f8f9f5;
  background-size: 24px 24px;
}
.cr-stage::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  height: 6px;
  border-radius: 999px;
  background: #c9cec3;
}

.cr-crew {
  position: relative;
  z-index: 2;
  min-height: 395px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
}
.cr-worker {
  position: relative;
  min-width: 0;
  height: 375px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  border: 2px solid transparent;
  border-radius: 18px;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, opacity .16s ease;
}
.cr-worker.is-empty { visibility: hidden; pointer-events: none; }
.cr-worker.is-drop-target { border-color: #b9beb3; background: rgba(255,255,255,.56); }
.cr-worker.is-hovered { border-color: #9aa094; background: #fff; transform: translateY(-3px); }
.cr-worker.is-correct { border-color: #8ba22d; background: #f5ffd2; }
.cr-worker.is-wrong { border-color: #be4b49; background: #fff0ef; animation: cr-shake .28s linear 1; }
.cr-worker.is-served { opacity: .57; }
.cr-worker.is-served::after {
  content: "DELIVERED";
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%) rotate(-7deg);
  padding: 6px 9px;
  border: 2px solid #758a29;
  border-radius: 7px;
  background: rgba(245,255,210,.94);
  color: #53661a;
  font-size: .68rem;
  font-weight: 950;
  letter-spacing: .11em;
}
.cr-worker-img {
  display: block;
  width: min(100%, 190px);
  height: 310px;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
  user-select: none;
}
.cr-speech {
  position: absolute;
  z-index: 4;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 112px;
  max-width: 150px;
  padding: 10px 11px;
  text-align: center;
  background: #fff;
  border: 2px solid var(--dark);
  border-radius: 14px;
  box-shadow: 0 6px 0 rgba(28,33,26,.08);
  font-size: .84rem;
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -.02em;
}
.cr-speech::after {
  content: "";
  position: absolute;
  bottom: -9px;
  left: 50%;
  width: 14px;
  height: 14px;
  background: #fff;
  border-right: 2px solid var(--dark);
  border-bottom: 2px solid var(--dark);
  transform: translateX(-50%) rotate(45deg);
}
.cr-speech.hidden { display: none; }

.cr-start-card,
.cr-round-complete {
  position: absolute;
  z-index: 8;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100% - 36px));
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 24px 70px rgba(28,33,26,.19);
}
.cr-start-card h2 { margin-bottom: 12px; font-size: clamp(1.5rem, 4vw, 2.2rem); }
.cr-start-card > p:last-child { margin-bottom: 0; color: var(--muted); font-size: .9rem; line-height: 1.52; }
.cr-start-rules { display: grid; gap: 7px; margin: 0 0 14px; }
.cr-start-rules span { font-size: .9rem; }
.cr-round-complete { width: auto; text-align: center; padding: 21px 28px; }
.cr-round-complete span { display: block; color: var(--muted); font-size: .7rem; font-weight: 900; letter-spacing: .12em; }
.cr-round-complete strong { display: block; margin-top: 5px; font-size: 1.42rem; letter-spacing: -.04em; }

.cr-tray {
  min-height: 170px;
  display: grid;
  grid-template-columns: 1fr 190px;
  align-items: center;
  gap: 22px;
  margin-top: 14px;
  padding: 14px 18px;
  border: 1px solid #d5d9cf;
  border-radius: 18px;
  background: #fff;
}
.cr-tray.is-hidden { visibility: hidden; }
.cr-tray-copy span {
  display: block;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .13em;
}
.cr-tray-copy strong {
  display: block;
  margin-top: 4px;
  font-size: 1.55rem;
  letter-spacing: -.04em;
}
.cr-tray-copy small { display: block; margin-top: 4px; color: var(--muted); }
.cr-cup-home {
  position: relative;
  min-height: 138px;
  display: grid;
  place-items: center;
  border: 2px dashed #d4d8cd;
  border-radius: 16px;
  background: #f8f9f5;
}
.cr-cup {
  width: 128px;
  height: 128px;
  object-fit: contain;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  transition: transform .14s ease, filter .14s ease, opacity .14s ease;
}
.cr-cup:hover { transform: translateY(-2px) rotate(-1deg); }
.cr-cup:active { cursor: grabbing; }
.cr-cup.is-locked { opacity: .45; cursor: default; }
.cr-drag-ghost {
  position: fixed;
  z-index: 9999;
  width: 126px;
  height: 126px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 18px 16px rgba(28,33,26,.22));
  transform: translate(-50%, -50%) scale(1.05);
}

.cr-feedback {
  margin: 15px 18px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f5f6f2;
  text-align: center;
  font-weight: 850;
  font-size: .88rem;
}
.cr-feedback.good { background: #f1f9cf; color: #516318; }
.cr-feedback.bad { background: #fff0ef; color: #8b2f2d; }
.cr-primary { display: block; margin: 18px auto 22px; }

.cr-game-over {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(28,33,26,.72);
  backdrop-filter: blur(4px);
}
.cr-game-over-card {
  width: min(560px, 100%);
  padding: 26px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
}
.cr-game-over-card h2 { margin-bottom: 8px; font-size: 2rem; }
.cr-game-over-message { color: var(--muted); }
.cr-game-over-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.cr-game-over-stats span { padding: 12px; text-align: center; font-size: .75rem; color: var(--muted); border-right: 1px solid var(--line); }
.cr-game-over-stats span:last-child { border-right: 0; }
.cr-game-over-stats strong { display: block; margin-top: 2px; color: var(--text); font-size: 1.25rem; }
.cr-game-over-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cr-share-status { margin: 10px 0 0; min-height: 20px; color: var(--muted); font-size: .8rem; }
.cr-challenge-result { margin: 0 0 12px; padding: 9px 11px; border-radius: 10px; background: var(--accent-soft); font-weight: 850; font-size: .84rem; }

.cr-challenge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: -8px 0 16px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--dark);
  color: #fff;
  font-size: .78rem;
}
.cr-challenge span { color: var(--accent); font-weight: 900; letter-spacing: .08em; }
.cr-challenge strong { font-size: 1rem; }
.cr-challenge em { color: rgba(255,255,255,.7); font-style: normal; }

.cr-coffee-key {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 20px;
}
.cr-coffee-key > div {
  display: grid;
  grid-template-columns: 58px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.cr-coffee-key img { grid-row: 1 / span 2; width: 58px; height: 58px; object-fit: contain; }
.cr-coffee-key strong { align-self: end; font-size: .86rem; }
.cr-coffee-key small { align-self: start; color: var(--muted); font-size: .72rem; }

@keyframes cr-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@media (max-width: 760px) {
  .cr-page { padding-top: 34px; }
  .cr-stage-wrap { padding: 10px; }
  .cr-stage { min-height: 340px; padding: 8px 8px 10px; }
  .cr-crew { min-height: 300px; gap: 4px; }
  .cr-worker { height: 288px; }
  .cr-worker-img { height: 250px; width: min(100%, 150px); transform: scale(1.04); transform-origin: center bottom; }
  .cr-speech { top: 9px; min-width: 90px; max-width: 112px; padding: 8px 7px; font-size: .72rem; }
  .cr-tray { grid-template-columns: 1fr 140px; min-height: 145px; padding: 12px; }
  .cr-cup-home { min-height: 118px; }
  .cr-cup { width: 108px; height: 108px; }
  .cr-drag-ghost { width: 108px; height: 108px; }
  .cr-coffee-key { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .cr-intro { margin-bottom: 20px; }
  .cr-intro h1 { font-size: clamp(2.15rem, 11vw, 3.1rem); }
  .cr-topbar { grid-template-columns: repeat(2, 1fr); }
  .cr-stat:nth-child(2) { border-right: 0; }
  .cr-stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .cr-stat { min-height: 54px; padding: 7px 8px; }
  .cr-stat strong { font-size: 1.15rem; }
  .cr-life-cup { width: 24px; height: 24px; }
  .cr-phasebar { min-height: 56px; padding: 9px 12px; }
  .cr-phasebar span:not(.cr-look-time) { font-size: .78rem; }
  .cr-look-time { font-size: .67rem; padding: 6px 8px; }
  .cr-stage { min-height: 280px; }
  .cr-crew { min-height: 246px; }
  .cr-worker { height: 236px; border-radius: 12px; }
  .cr-worker-img { height: 215px; width: min(100%, 126px); transform: scale(1.06); transform-origin: center bottom; }
  .cr-speech { top: 8px; min-width: 72px; max-width: 92px; padding: 7px 5px 8px; border-width: 1.5px; font-size: .62rem; }
  .cr-speech::after { width: 11px; height: 11px; bottom: -7px; border-width: 0 1.5px 1.5px 0; }
  .cr-worker.is-served::after { font-size: .52rem; padding: 4px 5px; border-width: 1.5px; }
  .cr-start-card {
    position: relative;
    inset: auto;
    transform: none;
    width: 100%;
    margin: 0 0 10px;
    padding: 18px;
    box-shadow: none;
  }
  .cr-start-card + .cr-round-complete { position: absolute; }
  .cr-stage:has(.cr-start-card:not(.hidden)) { min-height: 0; padding: 8px; }
  .cr-stage:has(.cr-start-card:not(.hidden)) .cr-crew { display: none; }
  .cr-tray { grid-template-columns: 1fr 110px; min-height: 116px; gap: 8px; margin-top: 7px; padding: 10px; }
  .cr-tray-copy strong { font-size: 1.18rem; }
  .cr-tray-copy small { font-size: .7rem; }
  .cr-cup-home { min-height: 90px; }
  .cr-cup { width: 88px; height: 88px; }
  .cr-drag-ghost { width: 88px; height: 88px; }
  .cr-game-over { padding: 12px; }
  .cr-game-over-card { padding: 19px; }
  .cr-game-over-card h2 { font-size: 1.6rem; }
  .cr-game-over-actions { flex-direction: column; }
  .cr-game-over-actions button { width: 100%; }
  .cr-coffee-key { gap: 8px; }
  .cr-coffee-key > div { grid-template-columns: 46px 1fr; padding: 9px; }
  .cr-coffee-key img { width: 46px; height: 46px; }
  .cr-coffee-key small { font-size: .66rem; }
}

@media (max-width: 390px) {
  .cr-stage { min-height: 258px; }
  .cr-crew { min-height: 226px; }
  .cr-worker { height: 216px; }
  .cr-worker-img { height: 198px; transform: scale(1.07); transform-origin: center bottom; }
  .cr-speech { top: 7px; min-width: 64px; max-width: 80px; font-size: .56rem; }
  .cr-tray { grid-template-columns: 1fr 96px; min-height: 108px; }
  .cr-cup, .cr-drag-ghost { width: 80px; height: 80px; }
  .cr-cup-home { min-height: 82px; }
}
