body.agp-body {
  background: #efe8df !important;
  background-color: #efe8df !important;
  color: #2a241f !important;
}

.agp-body .shell-footer {
  position: static !important;
  background: #efe8df !important;
  border-top: 1px solid #ddd4c8 !important;
}

.agp-body .shell-footer-inner {
  color: #6d6258 !important;
}

main.shell-main.agp-main {
  box-sizing: border-box;
  width: min(760px, 100%);
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: 48px;
  color: #2a241f !important;
}

.agp-sheet {
  width: min(720px, 100%);
  margin: 18px auto 0;
}

.agp-title,
.agp-type {
  margin: 0 0 12px;
  color: #2a241f;
  font-size: clamp(1.85rem, 5vw, 2.7rem);
  line-height: 1.18;
  font-weight: 760;
}

.agp-lead,
.agp-skip,
.agp-read,
.agp-dim,
.agp-hard,
.agp-clip,
.agp-note,
.agp-count,
.agp-miss,
.agp-safe,
.agp-pivot,
.agp-tri {
  color: #2a241f;
}

.agp-lead,
.agp-skip {
  margin: 0 0 10px;
  font-size: 1.06rem;
  line-height: 1.55;
}

.agp-skip,
.agp-safe,
.agp-hard {
  color: #6d6258;
}

.agp-gates {
  display: grid;
  gap: 8px;
  margin: 22px 0 18px;
}

.agp-gate-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 48px;
  padding: 8px 2px;
  color: #2a241f;
  font-size: 1.05rem;
  line-height: 1.45;
}

.agp-start,
.agp-actions button,
.agp-tick,
.agp-card {
  font: inherit;
  cursor: pointer;
}

.agp-start {
  min-height: 52px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: #e0892f;
  color: #2a241f;
  font-size: 1.1rem;
  font-weight: 740;
}

.agp-start:disabled {
  background: #ddd4c8;
  color: #8a7d72;
  cursor: default;
}

.agp-count {
  margin: 0 0 8px;
  font-weight: 700;
}

.agp-pips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 16px;
}

.agp-pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ddd4c8;
}

.agp-pip.is-in {
  background: #e0892f;
}

#agp-prompt {
  margin: 0 0 18px;
  color: #2a241f;
  font-size: clamp(1.35rem, 3.4vw, 1.85rem);
  line-height: 1.35;
  font-weight: 720;
}

.agp-ruler {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agp-tick {
  flex: 1 1 18%;
  min-height: 56px;
  padding: 10px 8px;
  border: 1px solid #d5cbbf;
  border-radius: 14px;
  background: #f7f3ee;
  color: #2a241f;
  font-size: 0.98rem;
}

.agp-tick.is-on[data-value="1"] { background: #f3e2cf; border-color: #e7c49a; }
.agp-tick.is-on[data-value="2"] { background: #f0d2ae; border-color: #e0a86a; }
.agp-tick.is-on[data-value="3"] { background: #e8b87a; border-color: #d4923e; }
.agp-tick.is-on[data-value="4"] { background: #e0892f; border-color: #c56e12; color: #fffaf4; }
.agp-tick.is-on[data-value="5"] { background: #b56812; border-color: #8d4e0c; color: #fffaf4; }

.agp-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agp-card {
  width: 100%;
  min-height: 76px;
  padding: 16px 18px;
  border: 1px solid #d5cbbf;
  border-radius: 16px;
  background: #f7f3ee;
  color: #2a241f;
  text-align: left;
  font-size: 1.08rem;
  line-height: 1.45;
}

.agp-card.is-on.is-up { background: #e0892f; border-color: #b56812; color: #fffaf4; }
.agp-card.is-on.is-down { background: #3eae8c; border-color: #1f7a62; color: #f4fffb; }
.agp-card.is-on.is-lead,
.agp-card.is-on.is-led { background: #5c4638; border-color: #3d2e24; color: #fffaf4; }

.agp-stage {
  position: relative;
  height: 292px;
  margin: 8px 0 8px;
}

.agp-rotor {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 54px;
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transform-origin: 50% 50%;
  transition: transform 420ms ease;
}

.agp-beam {
  position: absolute;
  left: 52px;
  right: 52px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e0892f 0%, #e7d7c4 50%, #3eae8c 100%);
  box-shadow: 0 8px 0 rgba(42, 36, 31, 0.06);
}

.agp-stage.is-flat .agp-beam {
  background: #c8c0b6;
}

.agp-end {
  position: relative;
  z-index: 1;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fffaf4;
  color: #2a241f;
}

.agp-end b {
  font-size: 1.7rem;
  line-height: 1;
}

.agp-end small {
  margin-top: 4px;
  font-size: 0.82rem;
}

.agp-end.is-up { box-shadow: inset 0 0 0 5px #e0892f; }
.agp-end.is-down { box-shadow: inset 0 0 0 5px #3eae8c; }

.agp-stage.is-up .agp-end.is-down,
.agp-stage.is-down .agp-end.is-up {
  opacity: 0.42;
  filter: grayscale(0.55);
}

.agp-stage.is-flat .agp-end {
  opacity: 0.62;
  filter: grayscale(0.85);
  box-shadow: inset 0 0 0 5px #c8c0b6;
}

.agp-fulcrum {
  position: absolute;
  left: 50%;
  top: 168px;
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-bottom: 30px solid #2a241f;
  transform: translateX(-50%);
}

.agp-pivot,
.agp-tri,
.agp-note {
  margin: 0;
  text-align: center;
}

.agp-pivot {
  position: absolute;
  left: 0;
  right: 0;
  top: 206px;
  font-weight: 720;
}

.agp-tri {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-weight: 700;
}

.agp-tri.is-hollow {
  color: #6d6258;
  font-weight: 600;
}

.agp-tri.is-hollow::before {
  content: '△ ';
}

.agp-tri.is-solid::before {
  content: '▲ ';
  color: #e0892f;
}

.agp-stage.is-down .agp-tri.is-solid::before {
  color: #1f7a62;
}

.agp-note {
  min-height: 1.4em;
  margin: 4px 0 16px;
  font-weight: 680;
}

.agp-kicker {
  margin: 18px 0 6px;
  color: #8a4e12;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

.agp-read,
.agp-dim,
.agp-hard,
.agp-clip,
.agp-safe {
  margin: 0;
  line-height: 1.65;
  font-size: 1.02rem;
}

.agp-open {
  margin: 0;
  padding-left: 1.2em;
  color: #2a241f;
  line-height: 1.6;
}

.agp-clip {
  margin-top: 14px;
  font-weight: 720;
}

.agp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.agp-actions button,
#agp-download {
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 0;
  background: #2a241f;
  color: #fffaf4;
  text-decoration: none;
}

.agp-ghost {
  background: transparent !important;
  color: #2a241f !important;
  box-shadow: inset 0 0 0 1.5px #2a241f;
}

.agp-miss[hidden],
#agp-ask[hidden],
#agp-result[hidden],
#agp-download[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .agp-tick { flex-basis: 46%; }
  .agp-end { width: 78px; height: 78px; }
  .agp-beam { left: 40px; right: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .agp-rotor { transition: none; }
}
