/* Checkpoint Guard: the inspection ticket + gate control and the gatehouse scene inside the practice shell's stage. */
.cg { position: absolute; inset: 0; display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 12px; padding: 8px 12px; }
.cg-panel { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding: 2px; }
.cg-ticket { padding: 8px 14px 10px; border-radius: var(--tlg-radius-lg, 14px); border: 2px solid #1d5f7a; background: #f3f8fa; color: #12232c;
  box-shadow: inset 0 0 0 3px #ffffff, 0 2px 6px rgba(0, 0, 0, .08); }
.cg-ticket-k { margin: 0 0 4px; font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #1d5f7a; }
.cg-given { margin: 0; display: grid; gap: 4px; }
.cg-given div { display: flex; gap: 10px; justify-content: space-between; align-items: baseline; font-size: 17px; line-height: 1.3; border-top: 1px dashed #b7cbd4; padding-top: 4px; }
.cg-given div:first-child { border-top: 0; padding-top: 0; }
.cg-given dt { font-weight: 600; color: #3d5562; }
.cg-given dd { margin: 0; text-align: right; font-weight: 800; }
html[data-theme="dark"] .cg-ticket { background: #172630; color: #e6f1f6; border-color: #5aa9c6; box-shadow: inset 0 0 0 3px #101c24; }
html[data-theme="dark"] .cg-ticket-k { color: #8fd0e6; }
html[data-theme="dark"] .cg-given dt { color: #b5cad4; }
html[data-theme="dark"] .cg-given div { border-color: #33505e; }

.cg-field { display: flex; flex-direction: column; gap: 6px; }
.cg-field-k { margin: 0; font-size: 16px; font-weight: 800; }
.cg-choices { display: grid; grid-template-columns: 1fr; gap: 8px; }
.cg-choices--gate { grid-template-columns: 1fr 1fr; }
.cg-choice { font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 8px 10px;
  border-radius: 12px; border: 2px solid var(--tlg-border, #8aa0ab); background: var(--tlg-surface, #ffffff); color: var(--tlg-text, #12232c);
  font-size: 17px; line-height: 1.2; text-align: center; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.cg-choice:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0, 0, 0, .12); }
.cg-choice:focus-visible { outline: 3px solid #b16a08; outline-offset: 2px; }
.cg-choice-t { font-weight: 700; }
.cg-choice-s { font-size: 16px; opacity: .85; }
.cg-choice-i { font-size: 26px; line-height: 1; }
.cg-choices--gate .cg-choice { min-height: 104px; }
.cg-choices--three .cg-choice { min-height: 84px; }
.cg-choices--three .cg-choice--apoptosis { grid-column: 1 / -1; min-height: 52px; flex-direction: row; gap: 10px; }
.cg-choice--apoptosis .cg-choice-i { color: #7a3fa0; }
html[data-theme="dark"] .cg-choice--apoptosis .cg-choice-i { color: #d6b0f0; }
.cg-choice--pass .cg-choice-i { color: #2f8a63; }
.cg-choice--wait .cg-choice-i { color: #c8372d; }
.cg-choice[aria-pressed="true"] { border-color: #1d5f7a; background: #dcEEF5; box-shadow: inset 0 0 0 2px #1d5f7a; }
.cg-choice[aria-pressed="true"] .cg-choice-t::before { content: '● '; }
.cg-choice:disabled { cursor: default; }
html[data-theme="dark"] .cg-choice[aria-pressed="true"] { background: #1c3b48; border-color: #8fd0e6; box-shadow: inset 0 0 0 2px #8fd0e6; }
html[data-theme="dark"] .cg-choice--pass .cg-choice-i { color: #7ee2a8; }
html[data-theme="dark"] .cg-choice--wait .cg-choice-i { color: #ff9a8c; }
.cg-msg { margin: 0; min-height: 1.2em; font-size: 16px; font-weight: 700; color: var(--tlg-danger, #b42318); }
html[data-theme="dark"] .cg-msg { color: #ffb4a8; }
.cg-about { font-size: 16px; line-height: 1.4; color: var(--tlg-text-muted, #44535c); }
.cg-about summary { cursor: pointer; font-weight: 700; }
.cg-about p { margin: 6px 0 0; }

.cg-view { position: relative; min-width: 0; min-height: 0; display: flex; align-items: flex-start; justify-content: center; }
.cg-scene { position: relative; width: 100%; aspect-ratio: 720 / 640; border-radius: var(--tlg-radius-lg, 14px); overflow: hidden; border: 2px solid var(--tlg-border, #9fb3bd); user-select: none; -webkit-user-select: none; }
.cg-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; font-family: inherit; }
.cg-wall { fill: url(#cg-wall); }
.cg-wall-p { fill: url(#cg-panels); }
.cg-floor { fill: #c6d0d5; }
.cg-ink { fill: #14222c; }
html[data-theme="dark"] .cg-wall { fill: url(#cg-wall-d); }
html[data-theme="dark"] .cg-wall-p { fill: url(#cg-panels-d); }
html[data-theme="dark"] .cg-floor { fill: #26323a; }
.cg-pulse { transform-box: fill-box; transform-origin: center; animation: cg-pulse 1.8s ease-in-out infinite; }
@keyframes cg-pulse { 0%, 100% { opacity: .55; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }

.cg-badge { position: absolute; left: 2%; right: 2%; bottom: 1.6%; padding: 7px 14px; border-radius: 12px; font-size: 16px; font-weight: 700; line-height: 1.3;
  background: rgba(255, 255, 255, .96); color: #12232c; border: 3px solid #1d5f7a; box-shadow: 0 3px 10px rgba(0, 0, 0, .25); animation: cg-pop .3s ease-out; pointer-events: none; }
.cg-badge--ok { border-color: #2f8a63; }
.cg-badge--bad { border-color: #c8372d; }
html[data-theme="dark"] .cg-badge { background: rgba(16, 28, 36, .96); color: #e6f1f6; }
@keyframes cg-pop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.cg-example-svg { display: block; width: 100%; height: auto; max-height: 460px; }
@media (prefers-reduced-motion: reduce) { .cg-pulse, .cg-badge { animation: none; } .cg-choice { transition: none; } }

@media (max-width: 1100px) { .cg { grid-template-columns: 290px minmax(0, 1fr); } }
@media (max-width: 900px) {
  .cg { position: static; grid-template-columns: 1fr; }
  .cg-view { display: block; }
  .cg-scene { width: 100% !important; height: auto !important; }
}
