.cngrg-root,
.cngrg-root * { box-sizing: border-box; }
.cngrg-root {
  --cngrg-brown: #5a321b;
  --cngrg-deep: #27130a;
  --cngrg-cream: #fff6e8;
  --cngrg-soft: #ffe8c6;
  --cngrg-orange: #ef7e23;
  --cngrg-green: #6aa657;
  --cngrg-blue: #5ba7c7;
  width: 100%;
  max-width: 1440px;
  margin: 24px auto;
  color: var(--cngrg-brown);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.cngrg-root button { font: inherit; }
.cngrg-root [hidden] { display: none !important; }

.cngrg-start {
  position: relative;
  min-height: min(760px, 78vh);
  overflow: hidden;
  border-radius: 34px;
  background: linear-gradient(135deg, #f9ecd5, #f6d1a8 52%, #b76b36);
  box-shadow: 0 26px 90px rgba(48, 21, 8, .18);
  isolation: isolate;
}
.cngrg-start-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: .98;
  z-index: -2;
}
.cngrg-start::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(43, 19, 8, .08), rgba(43, 19, 8, .02), rgba(43, 19, 8, .10));
  z-index: -1;
  pointer-events: none;
}
.cngrg-start-card {
  width: min(520px, calc(100% - 32px));
  margin: 28px 0 28px 40px;
  padding: clamp(22px, 3vw, 36px);
  min-height: 620px;
  border-radius: 36px;
  background: rgba(255, 249, 236, .92);
  border: 2px solid rgba(126, 75, 33, .12);
  box-shadow: 0 22px 70px rgba(67, 31, 11, .22), inset 0 1px 0 rgba(255,255,255,.85);
  text-align: center;
}
.cngrg-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff5df, #ffe1ba);
  border: 1px solid rgba(187, 105, 42, .25);
  color: #b85c22;
  font-weight: 900;
}
.cngrg-start-card h2 {
  margin: 18px 0 12px;
  font-size: clamp(52px, 7vw, 96px);
  line-height: .84;
  color: #7b3c1f;
  text-shadow: 0 3px 0 rgba(255,255,255,.6), 0 8px 22px rgba(135, 68, 22, .18);
  letter-spacing: -.04em;
}
.cngrg-start-card h2 em {
  color: #ed7626;
  font-style: normal;
}
.cngrg-start-subtitle {
  margin: 0 auto 14px;
  max-width: 420px;
  font-size: clamp(18px, 2.1vw, 25px);
  line-height: 1.2;
  font-weight: 900;
  color: #5b3520;
}
.cngrg-start-text {
  margin: 18px auto 24px;
  max-width: 410px;
  font-size: 17px;
  line-height: 1.44;
  color: #76543f;
}
.cngrg-start-actions {
  display: grid;
  gap: 12px;
  max-width: 380px;
  margin: 0 auto 20px;
}
.cngrg-primary,
.cngrg-secondary,
.cngrg-roll,
.cngrg-top-actions button,
.cngrg-choice-list button {
  border: 0;
  cursor: pointer;
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}
.cngrg-primary,
.cngrg-roll {
  border-radius: 999px;
  padding: 15px 24px;
  background: linear-gradient(180deg, #ff983e, #df671d);
  color: #fff8ed;
  font-weight: 950;
  box-shadow: 0 12px 28px rgba(184, 84, 25, .28), inset 0 1px 0 rgba(255,255,255,.35);
}
.cngrg-secondary,
.cngrg-top-actions button {
  border-radius: 999px;
  padding: 13px 20px;
  background: rgba(255, 250, 240, .92);
  border: 1px solid rgba(132, 80, 37, .22);
  color: #6b3d21;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(78, 39, 16, .10);
}
.cngrg-primary:hover,
.cngrg-secondary:hover,
.cngrg-roll:hover,
.cngrg-top-actions button:hover,
.cngrg-choice-list button:hover { transform: translateY(-1px); filter: brightness(1.03); }
.cngrg-start-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
  margin: 0 auto 16px;
}
.cngrg-start-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(118, 78, 44, .14);
  font-weight: 900;
  color: #5c3822;
}
.cngrg-start-card small {
  color: #76543f;
  font-weight: 800;
}

.cngrg-game {
  border-radius: 34px;
  padding: 22px;
  background:
    radial-gradient(circle at 72% 18%, rgba(255, 220, 140, .32), transparent 26%),
    linear-gradient(135deg, #fff7e9, #f5d1a8 55%, #b96f36);
  box-shadow: 0 26px 90px rgba(48, 21, 8, .18);
}
.cngrg-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.cngrg-topbar h2 {
  margin: 8px 0 0;
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: .9;
  color: #3d2010;
}
.cngrg-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.cngrg-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: stretch;
}
.cngrg-board-wrap {
  position: relative;
  min-height: 620px;
  border-radius: 30px;
  overflow: hidden;
  background: linear-gradient(135deg, #e6b06f, #efc182 45%, #bb7041);
  border: 2px solid rgba(117, 66, 32, .20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 18px 48px rgba(69, 33, 12, .18);
}
.cngrg-home-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.cngrg-home-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(100,55,25,.22) 0 24%, transparent 24% 100%),
    radial-gradient(circle at 19% 79%, rgba(95,145,83,.35), transparent 14%),
    radial-gradient(circle at 82% 22%, rgba(255,239,158,.55), transparent 16%),
    linear-gradient(180deg, #f3c280, #d98d4e 70%, #9a4d26);
}
.cngrg-room {
  position: absolute;
  border-radius: 20px;
  padding: 10px 14px;
  background: rgba(255, 247, 228, .38);
  color: rgba(91, 48, 23, .72);
  font-weight: 950;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.cngrg-room-kitchen { left: 5%; top: 9%; }
.cngrg-room-hall { left: 42%; top: 8%; }
.cngrg-room-living { left: 24%; bottom: 10%; }
.cngrg-room-grandpa { right: 5%; top: 10%; background: rgba(255, 247, 228, .58); }
.cngrg-board { position: absolute; inset: 0; }
.cngrg-path { position: absolute; inset: 0; }
.cngrg-cell {
  position: absolute;
  width: 42px;
  height: 42px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 247, 226, .96), rgba(255, 225, 181, .90));
  border: 2px solid rgba(128, 76, 35, .20);
  box-shadow: 0 9px 18px rgba(82, 39, 14, .16), inset 0 1px 0 rgba(255,255,255,.70);
  color: rgba(94, 54, 25, .65);
  font-size: 12px;
  font-weight: 950;
  z-index: 2;
}
.cngrg-cell.is-passed { background: linear-gradient(180deg, #e8f7df, #cfeebf); border-color: rgba(96, 158, 83, .34); }
.cngrg-cell.is-current { box-shadow: 0 0 0 8px rgba(255,255,255,.38), 0 0 0 14px rgba(255, 146, 57, .18), 0 14px 28px rgba(82, 39, 14, .20); }
.cngrg-cell-item { background: linear-gradient(180deg, #fff2d3, #ffd094); border-color: rgba(231, 124, 43, .45); }
.cngrg-cell-choice { background: linear-gradient(180deg, #e8f7ff, #bfe6f6); border-color: rgba(77, 144, 173, .42); }
.cngrg-cell-family { background: linear-gradient(180deg, #f7eaff, #e1c5f8); border-color: rgba(151, 93, 184, .36); }
.cngrg-cell-calm { background: linear-gradient(180deg, #ecfae6, #c7e9ba); border-color: rgba(104, 158, 79, .40); }
.cngrg-cell-delay { background: linear-gradient(180deg, #fff1e4, #ffc9b6); border-color: rgba(201, 93, 60, .36); }
.cngrg-cell-finish, .cngrg-cell-finalcheck { background: linear-gradient(180deg, #fff6c9, #f2b85a); border-color: rgba(153, 90, 23, .45); }
.cngrg-token {
  position: absolute;
  width: 58px;
  height: 58px;
  transform: translate(-50%, -95%);
  z-index: 8;
  transition: left .34s ease, top .34s ease;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff8d7, #ffd05e 47%, #cf772d 100%);
  box-shadow: 0 13px 30px rgba(69, 32, 12, .30), 0 0 0 6px rgba(255,255,255,.28);
  font-size: 28px;
}
.cngrg-token.cngrg-no-transition { transition: none !important; }
.cngrg-token.is-stepping { animation: cngrgTokenStep .32s ease; }
@keyframes cngrgTokenStep { 0%,100%{ transform: translate(-50%, -95%) scale(1); } 50%{ transform: translate(-50%, -112%) scale(1.08); } }
.cngrg-grandpa {
  position: absolute;
  right: 5%;
  top: 3.5%;
  z-index: 4;
  width: 138px;
  min-height: 118px;
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 26px;
  background: rgba(255, 246, 225, .78);
  border: 2px solid rgba(115, 72, 35, .14);
  box-shadow: 0 16px 38px rgba(66, 31, 12, .16);
  text-align: center;
}
.cngrg-grandpa span { font-size: 48px; line-height: 1; }
.cngrg-grandpa strong { color: #5c3822; }

.cngrg-sidebar { display: grid; gap: 13px; align-content: start; }
.cngrg-goal-card,
.cngrg-inventory,
.cngrg-calm-card,
.cngrg-dice-card {
  padding: 16px;
  border-radius: 24px;
  background: rgba(255, 249, 236, .88);
  border: 1px solid rgba(126, 75, 33, .16);
  box-shadow: 0 15px 34px rgba(65, 31, 11, .12), inset 0 1px 0 rgba(255,255,255,.72);
}
.cngrg-sidebar span { display: block; color: #9a5d2c; font-weight: 950; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.cngrg-goal-card strong { display: block; font-size: 18px; line-height: 1.16; color: #432512; }
.cngrg-goal-card p { margin: 9px 0 0; color: #76543f; }
.cngrg-items { display: grid; gap: 8px; }
.cngrg-items div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 9px 11px;
  border-radius: 17px;
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(115, 74, 39, .12);
  opacity: .58;
  filter: grayscale(.2);
}
.cngrg-items div.is-found {
  opacity: 1;
  filter: none;
  background: linear-gradient(180deg, #edf9e8, #d6efc7);
  border-color: rgba(97, 157, 83, .30);
}
.cngrg-items i { font-style: normal; font-size: 24px; }
.cngrg-items b { color: #4e2c17; }
.cngrg-calm-bar {
  height: 13px;
  border-radius: 999px;
  background: rgba(121, 77, 42, .13);
  overflow: hidden;
  margin: 8px 0;
}
.cngrg-calm-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9dcd72, #f0c86e);
  transition: width .25s ease;
}
.cngrg-dice-card { text-align: center; }
.cngrg-dice {
  width: 86px;
  height: 86px;
  margin: 4px auto 13px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #fffdf8, #f3d8b7);
  border: 2px solid rgba(126, 75, 33, .16);
  box-shadow: 0 12px 28px rgba(75, 36, 14, .18), inset 0 1px 0 rgba(255,255,255,.85);
  color: #5a321b;
  font-size: 44px;
  font-weight: 950;
}
.cngrg-dice.is-rolling { animation: cngrgDiceRoll .16s linear infinite; }
@keyframes cngrgDiceRoll { 0%{ transform: rotate(0deg) scale(1); } 50%{ transform: rotate(12deg) scale(1.04); } 100%{ transform: rotate(-10deg) scale(1); } }
.cngrg-roll { width: 100%; }
.cngrg-roll:disabled { cursor: wait; opacity: .75; }
.cngrg-dice-card small { display: block; margin-top: 9px; color: #76543f; }

.cngrg-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(35, 17, 7, .55);
  backdrop-filter: blur(6px);
}
.cngrg-modal-card {
  width: min(560px, 96vw);
  padding: clamp(22px, 4vw, 34px);
  border-radius: 30px;
  background: linear-gradient(180deg, #fff9ed, #ffe7c7);
  border: 2px solid rgba(167, 93, 38, .20);
  box-shadow: 0 28px 90px rgba(38, 18, 7, .38), inset 0 1px 0 rgba(255,255,255,.8);
  color: #4e2d18;
}
.cngrg-modal-kicker {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(238, 126, 35, .12);
  color: #a75c22;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cngrg-modal-card h3 { margin: 14px 0 8px; font-size: clamp(26px, 4vw, 38px); line-height: 1.04; }
.cngrg-modal-card p { margin: 0 0 14px; color: #75543e; line-height: 1.48; font-size: 16px; }
.cngrg-choice-list { display: grid; gap: 9px; margin: 16px 0 4px; }
.cngrg-choice-list button {
  min-height: 48px;
  padding: 12px 15px;
  border-radius: 18px;
  text-align: left;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(126, 75, 33, .16);
  color: #4e2c17;
  font-weight: 900;
}
.cngrg-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.cngrg-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 100000;
  max-width: min(520px, calc(100vw - 28px));
  padding: 13px 18px;
  border-radius: 999px;
  background: rgba(61, 33, 16, .92);
  color: #fff7e8;
  font-weight: 900;
  box-shadow: 0 16px 45px rgba(0,0,0,.24);
}

@media (max-width: 1050px) {
  .cngrg-start { min-height: auto; }
  .cngrg-start-card { margin: 18px auto; min-height: auto; }
  .cngrg-layout { grid-template-columns: 1fr; }
  .cngrg-board-wrap { min-height: 560px; }
  .cngrg-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .cngrg-root { margin: 12px auto; }
  .cngrg-game { padding: 14px; border-radius: 24px; }
  .cngrg-topbar { align-items: flex-start; flex-direction: column; }
  .cngrg-top-actions { justify-content: flex-start; }
  .cngrg-board-wrap { min-height: 500px; }
  .cngrg-cell { width: 34px; height: 34px; font-size: 10px; }
  .cngrg-token { width: 48px; height: 48px; font-size: 23px; }
  .cngrg-grandpa { width: 110px; min-height: 100px; }
  .cngrg-grandpa span { font-size: 38px; }
  .cngrg-sidebar { grid-template-columns: 1fr; }
  .cngrg-start-card h2 { font-size: 54px; }
}

/* Stage 1 Fix 1 — Approved Visual Screen + Real Dice Rework */
.cngrg-root {
  max-width: 1672px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Use the approved concept art as the actual first screen. The HTML buttons remain clickable
   but are visually transparent so the approved design is not duplicated or changed. */
.cngrg-start {
  min-height: 0 !important;
  aspect-ratio: 1672 / 941;
  border-radius: 28px;
  background: #3b1d0d;
  box-shadow: 0 28px 90px rgba(48, 21, 8, .24);
}
.cngrg-start-bg {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  opacity: 1 !important;
  z-index: 0 !important;
}
.cngrg-start::after { display: none !important; }
.cngrg-start-card {
  position: absolute !important;
  inset: 0 !important;
  width: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  pointer-events: none;
}
.cngrg-start-card > :not(.cngrg-start-actions) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.cngrg-start-actions {
  position: absolute !important;
  left: 8.1% !important;
  top: 60.6% !important;
  width: 27.2% !important;
  height: 18.2% !important;
  max-width: none !important;
  margin: 0 !important;
  display: block !important;
  pointer-events: auto;
}
.cngrg-start-actions .cngrg-primary,
.cngrg-start-actions .cngrg-secondary {
  position: absolute !important;
  left: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  opacity: 0.01 !important;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  color: transparent !important;
  padding: 0 !important;
}
.cngrg-start-actions .cngrg-primary { top: 0 !important; height: 49% !important; }
.cngrg-start-actions .cngrg-secondary { bottom: 0 !important; height: 39% !important; }
.cngrg-start-actions .cngrg-primary:focus-visible,
.cngrg-start-actions .cngrg-secondary:focus-visible {
  opacity: .16 !important;
  outline: 5px solid rgba(255,255,255,.92) !important;
  outline-offset: 5px;
  border-radius: 999px !important;
  background: #ff9a3f !important;
}

/* Gameplay screen uses the same approved art direction instead of a dry/generated UI. */
.cngrg-game {
  border-radius: 30px;
  padding: 18px;
  background: linear-gradient(135deg, #2c1408, #8e4f25 54%, #f0bd7b);
}
.cngrg-topbar {
  padding: 6px 2px 12px;
}
.cngrg-topbar h2 {
  color: #fff5df !important;
  text-shadow: 0 4px 18px rgba(0,0,0,.28);
}
.cngrg-layout {
  grid-template-columns: minmax(0, 1fr) 330px;
}
.cngrg-board-wrap {
  min-height: 660px;
  background-image: var(--cngrg-board-image), linear-gradient(135deg, #e6b06f, #efc182 45%, #bb7041) !important;
  background-size: cover !important;
  background-position: center !important;
  border-radius: 30px;
  overflow: hidden;
}
.cngrg-board-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 42% 45%, transparent 0 48%, rgba(64,27,10,.12) 75%);
  pointer-events: none;
  z-index: 1;
}
.cngrg-home-bg { display: none !important; }
.cngrg-board { z-index: 2; }
.cngrg-path { z-index: 3; }
.cngrg-cell {
  width: 38px;
  height: 38px;
  font-size: 0;
  background: rgba(255, 247, 226, .22);
  border: 2px solid rgba(255, 255, 255, .52);
  box-shadow: 0 8px 20px rgba(67, 31, 11, .16), inset 0 1px 0 rgba(255,255,255,.65);
  backdrop-filter: blur(1px);
}
.cngrg-cell span { display: none; }
.cngrg-cell.is-current {
  background: radial-gradient(circle, #fff6dd 0 35%, #ffac4b 54%, rgba(255,142,43,.35) 72%);
  border-color: rgba(255,255,255,.82);
  box-shadow: 0 0 0 8px rgba(255,255,255,.26), 0 0 0 15px rgba(255,144,46,.18), 0 18px 34px rgba(64,27,10,.22);
}
.cngrg-cell.is-passed {
  background: radial-gradient(circle, #e8f7df 0 40%, rgba(113,178,87,.46) 70%);
  border-color: rgba(125,190,92,.42);
}
.cngrg-cell-item { background: radial-gradient(circle, #fff1d3 0 40%, rgba(255,157,68,.52) 70%); }
.cngrg-cell-choice { background: radial-gradient(circle, #e8f7ff 0 40%, rgba(89,170,207,.46) 70%); }
.cngrg-cell-family { background: radial-gradient(circle, #f8edff 0 40%, rgba(165,101,205,.42) 70%); }
.cngrg-cell-calm { background: radial-gradient(circle, #ecfae6 0 40%, rgba(115,181,89,.42) 70%); }
.cngrg-cell-delay { background: radial-gradient(circle, #fff1e4 0 40%, rgba(224,112,78,.40) 70%); }

.cngrg-token {
  width: 62px;
  height: 62px;
  background: radial-gradient(circle at 35% 28%, #fff2c1, #ffb64b 47%, #d56b25 100%);
  border: 4px solid rgba(255,255,255,.72);
  box-shadow: 0 18px 36px rgba(64,27,10,.28), 0 0 0 8px rgba(255,255,255,.26);
  font-size: 30px;
}
.cngrg-grandpa {
  background: rgba(255, 246, 225, .82);
  backdrop-filter: blur(10px);
}

/* Real 3D dice */
.cngrg-dice-scene {
  width: 104px;
  height: 104px;
  margin: 6px auto 14px;
  perspective: 680px;
  display: grid;
  place-items: center;
}
.cngrg-dice {
  position: relative;
  width: 84px;
  height: 84px;
  transform-style: preserve-3d;
  transform: rotateX(-16deg) rotateY(18deg) rotateZ(0deg);
  transition: transform .45s cubic-bezier(.18,.72,.2,1.15);
}
.cngrg-dice-face {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,.98), rgba(255,255,255,0) 32%),
    linear-gradient(145deg, #fffdfa, #f1dcc5 74%, #d7b38c);
  border: 2px solid rgba(84, 48, 26, .16);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.9), inset 0 -10px 18px rgba(97, 58, 28, .10), 0 6px 14px rgba(67, 31, 11, .10);
  backface-visibility: hidden;
}
.cngrg-dice-front { transform: rotateY(0deg) translateZ(42px); }
.cngrg-dice-back { transform: rotateY(180deg) translateZ(42px); }
.cngrg-dice-right { transform: rotateY(90deg) translateZ(42px); }
.cngrg-dice-left { transform: rotateY(-90deg) translateZ(42px); }
.cngrg-dice-top { transform: rotateX(90deg) translateZ(42px); }
.cngrg-dice-bottom { transform: rotateX(-90deg) translateZ(42px); }
.cngrg-dice .pip {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #80513c, #2f1a12 72%);
  box-shadow: inset 0 1px 2px rgba(255,255,255,.12), 0 1px 1px rgba(255,255,255,.3);
}
.cngrg-dice .tl { left: 18px; top: 18px; }
.cngrg-dice .tr { right: 18px; top: 18px; }
.cngrg-dice .ml { left: 18px; top: 50%; transform: translateY(-50%); }
.cngrg-dice .mr { right: 18px; top: 50%; transform: translateY(-50%); }
.cngrg-dice .bl { left: 18px; bottom: 18px; }
.cngrg-dice .br { right: 18px; bottom: 18px; }
.cngrg-dice .center { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.cngrg-dice-face-1 { transform: rotateX(-16deg) rotateY(18deg) rotateZ(0deg); }
.cngrg-dice-face-2 { transform: rotateX(82deg) rotateY(12deg) rotateZ(-10deg); }
.cngrg-dice-face-3 { transform: rotateX(-12deg) rotateY(-72deg) rotateZ(5deg); }
.cngrg-dice-face-4 { transform: rotateX(-12deg) rotateY(108deg) rotateZ(-5deg); }
.cngrg-dice-face-5 { transform: rotateX(-102deg) rotateY(8deg) rotateZ(10deg); }
.cngrg-dice-face-6 { transform: rotateX(-12deg) rotateY(198deg) rotateZ(0deg); }
.cngrg-dice.is-rolling {
  animation: cngrgRealDiceRoll 1.05s cubic-bezier(.19,.66,.26,1.05) infinite;
}
@keyframes cngrgRealDiceRoll {
  0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) translateY(0) scale(1); }
  18% { transform: rotateX(176deg) rotateY(94deg) rotateZ(28deg) translateY(-12px) scale(1.05); }
  38% { transform: rotateX(322deg) rotateY(210deg) rotateZ(-20deg) translateY(3px) scale(.98); }
  62% { transform: rotateX(512deg) rotateY(326deg) rotateZ(34deg) translateY(-9px) scale(1.04); }
  82% { transform: rotateX(690deg) rotateY(448deg) rotateZ(-18deg) translateY(2px) scale(1); }
  100% { transform: rotateX(720deg) rotateY(540deg) rotateZ(0deg) translateY(0) scale(1); }
}

.cngrg-dice-card {
  background: linear-gradient(180deg, rgba(255,249,236,.94), rgba(255,232,198,.88));
}

@media (max-width: 1050px) {
  .cngrg-start { aspect-ratio: 1672 / 941; }
  .cngrg-layout { grid-template-columns: 1fr; }
  .cngrg-board-wrap { min-height: 560px; }
}
@media (max-width: 720px) {
  .cngrg-root { margin: 10px auto; }
  .cngrg-start { border-radius: 18px; }
  .cngrg-game { border-radius: 22px; padding: 12px; }
  .cngrg-board-wrap { min-height: 500px; }
  .cngrg-start-actions { top: 60.5% !important; }
}


/* Stage 1 Fix 2 — Board Layout + Path Fix.
   This block corrects the geometry of the approved board screen:
   - removes the extra grandpa marker card;
   - uses the approved board image without cropping;
   - makes the game wider, so the boy and grandfather remain visible;
   - aligns all 30 cells with the snake path coordinates from game-data.js. */
.cngrg-root {
  width: min(1680px, calc(100vw - 24px)) !important;
  max-width: none !important;
  margin: 24px auto !important;
}
.cngrg-grandpa { display: none !important; }
.cngrg-game {
  padding: 18px !important;
  border-radius: 30px !important;
  background: linear-gradient(135deg, #2c1408, #8e4f25 54%, #f0bd7b) !important;
}
.cngrg-layout {
  display: grid !important;
  grid-template-columns: minmax(760px, 1152px) minmax(286px, 318px) !important;
  gap: 16px !important;
  align-items: start !important;
  justify-content: center !important;
}
.cngrg-board-wrap {
  width: 100% !important;
  min-height: 0 !important;
  aspect-ratio: 1152 / 835 !important;
  background-image: var(--cngrg-board-image), linear-gradient(135deg, #e6b06f, #efc182 45%, #bb7041) !important;
  background-size: 100% 100% !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  border-radius: 30px !important;
  overflow: hidden !important;
}
.cngrg-board-wrap::after {
  background: radial-gradient(circle at 44% 50%, transparent 0 58%, rgba(64,27,10,.08) 88%) !important;
}
.cngrg-cell {
  width: clamp(22px, 3.4vw, 36px) !important;
  height: clamp(22px, 3.4vw, 36px) !important;
  background: rgba(255, 247, 226, .18) !important;
  border: 2px solid rgba(255, 255, 255, .58) !important;
  box-shadow: 0 6px 14px rgba(67, 31, 11, .11), inset 0 1px 0 rgba(255,255,255,.62) !important;
  backdrop-filter: blur(.6px) !important;
}
.cngrg-cell-item { background: radial-gradient(circle, rgba(255,247,226,.95) 0 34%, rgba(255,157,68,.54) 72%) !important; }
.cngrg-cell-choice { background: radial-gradient(circle, rgba(255,247,226,.95) 0 34%, rgba(89,170,207,.50) 72%) !important; }
.cngrg-cell-family { background: radial-gradient(circle, rgba(255,247,226,.95) 0 34%, rgba(165,101,205,.46) 72%) !important; }
.cngrg-cell-calm { background: radial-gradient(circle, rgba(255,247,226,.95) 0 34%, rgba(115,181,89,.48) 72%) !important; }
.cngrg-cell-delay { background: radial-gradient(circle, rgba(255,247,226,.95) 0 34%, rgba(224,112,78,.48) 72%) !important; }
.cngrg-cell.is-current {
  background: radial-gradient(circle, #fff6dd 0 33%, #ffac4b 55%, rgba(255,142,43,.36) 72%) !important;
  border-color: rgba(255,255,255,.88) !important;
  box-shadow: 0 0 0 7px rgba(255,255,255,.25), 0 0 0 13px rgba(255,144,46,.17), 0 15px 26px rgba(64,27,10,.20) !important;
}
.cngrg-cell.is-passed {
  background: radial-gradient(circle, rgba(232,247,223,.94) 0 38%, rgba(113,178,87,.48) 74%) !important;
}
.cngrg-token {
  width: clamp(42px, 4.6vw, 58px) !important;
  height: clamp(42px, 4.6vw, 58px) !important;
  font-size: clamp(20px, 2.4vw, 28px) !important;
}
.cngrg-sidebar {
  gap: 10px !important;
}
.cngrg-goal-card,
.cngrg-inventory,
.cngrg-calm-card,
.cngrg-dice-card {
  padding: 13px !important;
  border-radius: 22px !important;
}
.cngrg-items div {
  min-height: 42px !important;
  padding: 7px 9px !important;
}

@media (max-width: 1280px) {
  .cngrg-layout {
    grid-template-columns: minmax(700px, 1fr) 292px !important;
    gap: 14px !important;
  }
  .cngrg-top-actions button { padding: 10px 13px !important; }
}
@media (max-width: 1050px) {
  .cngrg-root {
    width: min(100%, calc(100vw - 18px)) !important;
    margin: 12px auto !important;
  }
  .cngrg-layout {
    grid-template-columns: 1fr !important;
  }
  .cngrg-board-wrap {
    aspect-ratio: 1152 / 835 !important;
  }
  .cngrg-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 720px) {
  .cngrg-board-wrap { aspect-ratio: 1152 / 835 !important; }
  .cngrg-sidebar { grid-template-columns: 1fr !important; }
  .cngrg-cell {
    width: 24px !important;
    height: 24px !important;
  }
}


/* Stage 1 Fix 3 — Viewport Fit + Board Crop Fix.
   Fixes the game area being too large at 100% browser zoom and removes the leftover
   first-screen card from the play board by using a cropped board image (1034x835). */
.cngrg-root {
  width: min(1100px, calc(100vw - 32px)) !important;
  max-width: 1100px !important;
  margin: 14px auto !important;
}
.cngrg-game {
  padding: 14px !important;
  border-radius: 26px !important;
}
.cngrg-topbar {
  margin-bottom: 10px !important;
  padding: 2px 0 8px !important;
}
.cngrg-topbar h2 {
  margin-top: 6px !important;
  font-size: clamp(34px, 4vw, 46px) !important;
}
.cngrg-kicker {
  padding: 7px 13px !important;
  font-size: 13px !important;
}
.cngrg-top-actions button {
  padding: 10px 13px !important;
  font-size: 13px !important;
}
.cngrg-layout {
  grid-template-columns: minmax(0, 1fr) 264px !important;
  gap: 12px !important;
  justify-content: stretch !important;
}
.cngrg-board-wrap {
  aspect-ratio: 1034 / 835 !important;
  background-size: 100% 100% !important;
  background-position: center !important;
  border-radius: 24px !important;
}
.cngrg-board-wrap::after {
  background: radial-gradient(circle at 50% 50%, transparent 0 62%, rgba(64,27,10,.06) 90%) !important;
}
.cngrg-sidebar {
  gap: 8px !important;
}
.cngrg-goal-card,
.cngrg-inventory,
.cngrg-calm-card,
.cngrg-dice-card {
  padding: 11px !important;
  border-radius: 18px !important;
}
.cngrg-goal-card strong {
  font-size: 15px !important;
  line-height: 1.12 !important;
}
.cngrg-goal-card p {
  margin-top: 6px !important;
}
.cngrg-sidebar span {
  font-size: 10.5px !important;
  margin-bottom: 5px !important;
}
.cngrg-items {
  gap: 6px !important;
}
.cngrg-items div {
  min-height: 38px !important;
  padding: 6px 8px !important;
  border-radius: 14px !important;
}
.cngrg-items i { font-size: 20px !important; }
.cngrg-items b { font-size: 13px !important; }
.cngrg-calm-bar { height: 10px !important; }
.cngrg-dice-scene {
  width: 86px !important;
  height: 86px !important;
  margin: 4px auto 10px !important;
}
.cngrg-dice {
  width: 66px !important;
  height: 66px !important;
}
.cngrg-dice-front { transform: rotateY(0deg) translateZ(33px) !important; }
.cngrg-dice-back { transform: rotateY(180deg) translateZ(33px) !important; }
.cngrg-dice-right { transform: rotateY(90deg) translateZ(33px) !important; }
.cngrg-dice-left { transform: rotateY(-90deg) translateZ(33px) !important; }
.cngrg-dice-top { transform: rotateX(90deg) translateZ(33px) !important; }
.cngrg-dice-bottom { transform: rotateX(-90deg) translateZ(33px) !important; }
.cngrg-dice-face { border-radius: 14px !important; }
.cngrg-dice .pip { width: 10px !important; height: 10px !important; }
.cngrg-dice .tl { left: 14px !important; top: 14px !important; }
.cngrg-dice .tr { right: 14px !important; top: 14px !important; }
.cngrg-dice .ml { left: 14px !important; }
.cngrg-dice .mr { right: 14px !important; }
.cngrg-dice .bl { left: 14px !important; bottom: 14px !important; }
.cngrg-dice .br { right: 14px !important; bottom: 14px !important; }
.cngrg-roll {
  padding: 12px 16px !important;
  font-size: 13px !important;
}
.cngrg-dice-card small { font-size: 11px !important; }
.cngrg-cell {
  width: clamp(20px, 2.2vw, 29px) !important;
  height: clamp(20px, 2.2vw, 29px) !important;
}
.cngrg-token {
  width: clamp(38px, 4vw, 50px) !important;
  height: clamp(38px, 4vw, 50px) !important;
  font-size: clamp(18px, 2.1vw, 24px) !important;
}

@media (max-width: 1050px) {
  .cngrg-root { width: min(100%, calc(100vw - 18px)) !important; margin: 10px auto !important; }
  .cngrg-layout { grid-template-columns: 1fr !important; }
  .cngrg-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 720px) {
  .cngrg-game { padding: 10px !important; }
  .cngrg-sidebar { grid-template-columns: 1fr !important; }
}

/* Stage 1 Fix 4 — Board Clean + Path Geometry Fix.
   Clean board-only background, stable 16:9-ish board artboard and hand-tuned route points. */
.cngrg-root {
  width: min(1100px, calc(100vw - 32px)) !important;
  max-width: 1100px !important;
  margin: 14px auto !important;
}
.cngrg-layout {
  grid-template-columns: minmax(0, 1fr) 264px !important;
  gap: 12px !important;
  justify-content: stretch !important;
}
.cngrg-board-wrap {
  aspect-ratio: 1148 / 676 !important;
  min-height: 0 !important;
  background-image: var(--cngrg-board-image), linear-gradient(135deg, #e6b06f, #efc182 45%, #bb7041) !important;
  background-size: 100% 100% !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  border-radius: 24px !important;
  overflow: hidden !important;
}
.cngrg-board-wrap::after {
  background: radial-gradient(circle at 50% 50%, transparent 0 66%, rgba(64,27,10,.045) 92%) !important;
}
.cngrg-cell {
  width: clamp(22px, 3.2vw, 34px) !important;
  height: clamp(22px, 3.2vw, 34px) !important;
  background: rgba(255, 247, 226, .10) !important;
  border: 2px solid rgba(255, 255, 255, .42) !important;
  box-shadow: 0 5px 12px rgba(67, 31, 11, .09), inset 0 1px 0 rgba(255,255,255,.48) !important;
  backdrop-filter: blur(.4px) !important;
}
.cngrg-cell-item { background: radial-gradient(circle, rgba(255,247,226,.82) 0 34%, rgba(255,157,68,.46) 72%) !important; }
.cngrg-cell-choice { background: radial-gradient(circle, rgba(255,247,226,.78) 0 34%, rgba(89,170,207,.42) 72%) !important; }
.cngrg-cell-family { background: radial-gradient(circle, rgba(255,247,226,.78) 0 34%, rgba(165,101,205,.40) 72%) !important; }
.cngrg-cell-calm { background: radial-gradient(circle, rgba(255,247,226,.78) 0 34%, rgba(115,181,89,.42) 72%) !important; }
.cngrg-cell-delay { background: radial-gradient(circle, rgba(255,247,226,.78) 0 34%, rgba(224,112,78,.42) 72%) !important; }
.cngrg-cell.is-current {
  background: radial-gradient(circle, #fff6dd 0 33%, #ffac4b 55%, rgba(255,142,43,.36) 72%) !important;
  border-color: rgba(255,255,255,.90) !important;
  box-shadow: 0 0 0 7px rgba(255,255,255,.25), 0 0 0 13px rgba(255,144,46,.17), 0 15px 26px rgba(64,27,10,.20) !important;
}
.cngrg-cell.is-passed {
  background: radial-gradient(circle, rgba(232,247,223,.76) 0 38%, rgba(113,178,87,.38) 74%) !important;
}
.cngrg-token {
  width: clamp(38px, 4.3vw, 54px) !important;
  height: clamp(38px, 4.3vw, 54px) !important;
  font-size: clamp(18px, 2.2vw, 26px) !important;
}
@media (max-width: 1050px) {
  .cngrg-layout { grid-template-columns: 1fr !important; }
  .cngrg-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 720px) {
  .cngrg-board-wrap { aspect-ratio: 1148 / 676 !important; }
  .cngrg-sidebar { grid-template-columns: 1fr !important; }
  .cngrg-cell { width: 22px !important; height: 22px !important; }
}


/* Stage 1 v1.0.4.1 — real clean-board cache-bust correction.
   The previous archive kept the same board filename, so browser/server cache could keep
   showing the old cropped first-screen image. This version uses a renamed clean image.
   Also reduces the duplicated overlay grid: the drawn board already contains the path circles. */
.cngrg-board-wrap {
  background-size: 100% 100% !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}
.cngrg-cell {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  opacity: 0 !important;
}
.cngrg-cell.is-passed,
.cngrg-cell.is-current,
.cngrg-cell-item.is-current,
.cngrg-cell-choice.is-current,
.cngrg-cell-family.is-current,
.cngrg-cell-calm.is-current,
.cngrg-cell-delay.is-current {
  opacity: 1 !important;
}
.cngrg-cell.is-passed {
  background: radial-gradient(circle, rgba(232,247,223,.82) 0 38%, rgba(113,178,87,.48) 74%) !important;
  border: 2px solid rgba(255,255,255,.38) !important;
  box-shadow: 0 5px 12px rgba(67, 31, 11, .09), inset 0 1px 0 rgba(255,255,255,.48) !important;
}
.cngrg-cell.is-current {
  background: radial-gradient(circle, #fff6dd 0 33%, #ffac4b 55%, rgba(255,142,43,.42) 72%) !important;
  border: 2px solid rgba(255,255,255,.92) !important;
  box-shadow: 0 0 0 7px rgba(255,255,255,.25), 0 0 0 13px rgba(255,144,46,.17), 0 15px 26px rgba(64,27,10,.20) !important;
}


/* Stage 1 v1.0.4.2 — path coordinates microtune.
   Only route marker geometry is changed: cells are smaller and the hand-tuned
   coordinates sit closer to the centers of the drawn snake-path circles. */
.cngrg-cell {
  width: clamp(16px, 1.85vw, 24px) !important;
  height: clamp(16px, 1.85vw, 24px) !important;
}
.cngrg-cell.is-passed {
  opacity: .58 !important;
  background: radial-gradient(circle, rgba(232,247,223,.72) 0 36%, rgba(113,178,87,.34) 76%) !important;
  border: 1.5px solid rgba(255,255,255,.44) !important;
  box-shadow: 0 3px 8px rgba(67, 31, 11, .08), inset 0 1px 0 rgba(255,255,255,.42) !important;
}
.cngrg-cell.is-current {
  opacity: 1 !important;
  background: radial-gradient(circle, #fff6dd 0 33%, #ffac4b 55%, rgba(255,142,43,.42) 72%) !important;
  border: 2px solid rgba(255,255,255,.94) !important;
  box-shadow: 0 0 0 5px rgba(255,255,255,.22), 0 0 0 10px rgba(255,144,46,.15), 0 11px 20px rgba(64,27,10,.18) !important;
}
@media (max-width: 720px) {
  .cngrg-cell { width: 17px !important; height: 17px !important; }
}

/* Stage 1 v1.0.4.3 — Path Final Reward Polish */
.cngrg-layout {
  align-items: start !important;
}
.cngrg-cell {
  width: clamp(20px, 3.0vw, 32px) !important;
  height: clamp(20px, 3.0vw, 32px) !important;
  border-width: 2px !important;
  box-shadow: 0 4px 10px rgba(67, 31, 11, .10), inset 0 1px 0 rgba(255,255,255,.62) !important;
}
.cngrg-cell.is-current {
  box-shadow: 0 0 0 6px rgba(255,255,255,.24), 0 0 0 11px rgba(255,144,46,.16), 0 12px 22px rgba(64,27,10,.18) !important;
}
.cngrg-token {
  width: clamp(40px, 4.3vw, 54px) !important;
  height: clamp(40px, 4.3vw, 54px) !important;
  font-size: clamp(18px, 2.1vw, 25px) !important;
}
.cngrg-finish-preview {
  margin-top: 16px;
}
.cngrg-finish-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255,248,236,.96), rgba(255,234,206,.92));
  border: 1px solid rgba(126, 75, 33, .16);
  box-shadow: 0 15px 34px rgba(65, 31, 11, .12), inset 0 1px 0 rgba(255,255,255,.72);
}
.cngrg-finish-medal {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: radial-gradient(circle at 35% 28%, #fff6df, #ffbe63 50%, #df7b2a 100%);
  color: #fff8ed;
  font-size: 34px;
  box-shadow: 0 12px 24px rgba(184, 84, 25, .20);
}
.cngrg-finish-copy span {
  display: block;
  margin-bottom: 6px;
  color: #a0602d;
  font-weight: 950;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cngrg-finish-copy strong {
  display: block;
  color: #432512;
  font-size: 24px;
  line-height: 1.08;
  margin-bottom: 8px;
}
.cngrg-finish-copy p {
  margin: 0;
  color: #76543f;
  line-height: 1.45;
  max-width: 640px;
}
.cngrg-finish-badges {
  display: grid;
  gap: 8px;
}
.cngrg-finish-badges i {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(118, 78, 44, .14);
  color: #5c3822;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}
.cngrg-finish-actions {
  display: flex;
  align-items: center;
}
.cngrg-finish-card.is-complete {
  background: linear-gradient(180deg, rgba(239,249,233,.98), rgba(222,242,206,.94));
  border-color: rgba(97, 157, 83, .26);
}
.cngrg-finish-card.is-complete .cngrg-finish-medal {
  background: radial-gradient(circle at 35% 28%, #fff6df, #86c76c 46%, #4f9c4e 100%);
}
@media (max-width: 1280px) {
  .cngrg-finish-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .cngrg-finish-badges,
  .cngrg-finish-actions {
    grid-column: 1 / -1;
  }
}
@media (max-width: 720px) {
  .cngrg-finish-card {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .cngrg-finish-medal {
    width: 60px;
    height: 60px;
    font-size: 28px;
  }
  .cngrg-finish-copy strong {
    font-size: 20px;
  }
}

/* Stage 1 v1.0.4.4 — finish item stop + reward block placement fix */
.cngrg-play-column {
  min-width: 0;
  display: grid;
  gap: 16px;
  align-content: start;
}
.cngrg-finish-preview {
  margin-top: 0 !important;
}
.cngrg-play-column .cngrg-finish-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 24px;
}
.cngrg-play-column .cngrg-finish-medal {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  font-size: 30px;
}
.cngrg-play-column .cngrg-finish-copy strong {
  font-size: 22px;
}
.cngrg-play-column .cngrg-finish-copy p {
  max-width: 560px;
  font-size: 14px;
}
.cngrg-play-column .cngrg-finish-badges {
  grid-column: 2 / 4;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cngrg-play-column .cngrg-finish-badges i {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}
.cngrg-play-column .cngrg-finish-actions {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}
@media (max-width: 1280px) {
  .cngrg-play-column .cngrg-finish-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }
  .cngrg-play-column .cngrg-finish-actions,
  .cngrg-play-column .cngrg-finish-badges {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-self: stretch;
  }
}
