.rot-game {
  display: grid;
  gap: 14px;
}

.rot-lede {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.rot-mini-clock {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 48%, #ffffff 48% 53%, transparent 53%),
    linear-gradient(0deg, transparent 48%, #ffffff 48% 53%, transparent 53%),
    radial-gradient(circle at 50% 50%, #f97316 0 9px, transparent 10px),
    #0f766e;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.28), 0 9px 18px rgba(15, 118, 110, 0.16);
}

.rot-lede-title {
  color: #17202a;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.25;
}

.rot-lede-text {
  margin-top: 3px;
  color: #475467;
  font-size: 14px;
  line-height: 1.45;
}

.rot-dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.rot-meter,
.rot-stat {
  min-width: 0;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #ffffff;
  padding: 9px 10px;
  display: grid;
  gap: 2px;
}

.rot-meter span,
.rot-stat span {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.rot-meter strong,
.rot-stat strong {
  color: #17202a;
  font-size: 21px;
  font-weight: 950;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.rot-status {
  min-height: 52px;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #ffffff;
  color: #344054;
  padding: 11px 12px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.rot-status-good {
  border-color: #147d4f;
  background: #e7f6ef;
  color: #0b5f3d;
}

.rot-status-warn {
  border-color: #b45309;
  background: #fff7ed;
  color: #7c2d12;
}

.rot-boards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rot-board {
  min-width: 0;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96)),
    repeating-linear-gradient(90deg, rgba(120, 113, 108, 0.08) 0, rgba(120, 113, 108, 0.08) 1px, transparent 1px, transparent 18px);
  padding: 12px;
  display: grid;
  gap: 11px;
  overflow: hidden;
  box-shadow: 0 9px 22px rgba(20, 31, 50, 0.06);
}

.rot-board-success {
  border-color: #147d4f;
}

.rot-board-fail {
  border-color: #b42318;
}

.rot-board-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.rot-board-title {
  color: #17202a;
  font-size: 18px;
  font-weight: 950;
  line-height: 1.15;
}

.rot-board-sub {
  margin-top: 3px;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.rot-board-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  background: #eef2f6;
  color: #344054;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.rot-board-success .rot-board-badge {
  background: #e7f6ef;
  color: #0b5f3d;
}

.rot-board-fail .rot-board-badge {
  background: #fff1f0;
  color: #912018;
}

.rot-board-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.rot-crate {
  display: grid;
  grid-template-columns: repeat(4, minmax(44px, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 330px;
  margin: 0 auto;
  border: 1px solid #c7d2dd;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(120, 113, 108, 0.14), transparent 12%, transparent 88%, rgba(120, 113, 108, 0.14)),
    #f8fafc;
  padding: 8px;
}

.rot-cell {
  position: relative;
  min-width: 44px;
  min-height: 58px;
  aspect-ratio: 1;
  border: 2px solid #d0d5dd;
  border-radius: 8px;
  background: #ffffff;
  color: #17202a;
  display: grid;
  place-items: center;
  padding: 5px;
  cursor: pointer;
  touch-action: manipulation;
  overflow: hidden;
  transition: transform 140ms ease, border-color 180ms ease, background 180ms ease;
}

.rot-cell:active {
  transform: scale(0.96);
}

.rot-cell:focus-visible,
.rot-btn:focus-visible,
.rot-clock:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.24);
  outline-offset: 2px;
}

.rot-orange {
  position: relative;
  width: min(42px, 72%);
  height: min(42px, 72%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.72) 0 5px, transparent 6px),
    radial-gradient(circle at 58% 62%, rgba(194, 65, 12, 0.22) 0 12px, transparent 13px),
    #f97316;
  box-shadow: inset -5px -7px 0 rgba(194, 65, 12, 0.16), 0 5px 10px rgba(154, 52, 18, 0.14);
}

.rot-orange::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 8px;
  left: 50%;
  top: -5px;
  border-radius: 90% 10% 90% 10%;
  background: #15803d;
  transform: translateX(-15%) rotate(-24deg);
}

.rot-rotten .rot-orange {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.42) 0 4px, transparent 5px),
    radial-gradient(circle at 61% 58%, #14532d 0 10px, transparent 11px),
    radial-gradient(circle at 36% 66%, #365314 0 7px, transparent 8px),
    #c2410c;
}

.rot-empty {
  background:
    linear-gradient(135deg, #f8fafc, #e5e7eb);
  border-style: dashed;
  color: #667085;
}

.rot-hole {
  width: 58%;
  height: 58%;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(100, 116, 139, 0.18), transparent),
    #ffffff;
  box-shadow: inset 0 2px 7px rgba(31, 41, 55, 0.16);
}

.rot-fresh {
  border-color: #fdba74;
  background: #fff7ed;
}

.rot-rotten {
  border-color: #166534;
  background: #ecfdf3;
}

.rot-source {
  box-shadow: inset 0 0 0 1px rgba(22, 101, 52, 0.18);
}

.rot-queued,
.rot-frontier {
  border-color: #0f766e;
  background: #d7f4ef;
}

.rot-frontier {
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.rot-new .rot-ripple {
  position: absolute;
  inset: 6px;
  border: 2px solid rgba(15, 118, 110, 0.45);
  border-radius: 50%;
  animation: rot-ripple 520ms ease;
}

.rot-stranded {
  border-color: #b42318;
  background: #fff1f0;
}

.rot-stranded .rot-orange {
  filter: saturate(0.75);
}

.rot-cell-label {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-width: 24px;
  min-height: 20px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.9);
  color: #344054;
  padding: 2px 4px;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(20, 31, 50, 0.08);
}

.rot-rotten .rot-cell-label,
.rot-queued .rot-cell-label,
.rot-frontier .rot-cell-label {
  background: #0f766e;
  color: #ffffff;
}

.rot-stranded .rot-cell-label {
  background: #b42318;
  color: #ffffff;
}

.rot-queue {
  min-height: 42px;
  border: 1px dashed #98a2b3;
  border-radius: 8px;
  background: #ffffff;
  padding: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rot-chip,
.rot-queue-empty {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eef2f6;
  color: #344054;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.rot-chip {
  background: #d7f4ef;
  color: #0f514b;
}

.rot-board-note {
  min-height: 48px;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #ffffff;
  color: #344054;
  padding: 10px 11px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.42;
}

.rot-actions {
  display: grid;
  grid-template-columns: minmax(82px, 0.42fr) minmax(160px, 1fr) minmax(82px, 0.42fr);
  gap: 10px;
  align-items: stretch;
}

.rot-btn,
.rot-clock {
  min-height: 52px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #ffffff;
  color: #17202a;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
}

.rot-clock {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  text-align: left;
  border-color: #aab7c7;
  background: linear-gradient(180deg, #ffffff, #eef2f6);
}

.rot-clock-ready {
  border-color: #0f766e;
  background: linear-gradient(180deg, #f0fdfa, #c7f2eb);
}

.rot-clock:disabled {
  opacity: 0.72;
  cursor: default;
}

.rot-clock-face {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, transparent 48%, rgba(255, 255, 255, 0.9) 48% 53%, transparent 53%),
    linear-gradient(0deg, transparent 48%, rgba(255, 255, 255, 0.9) 48% 53%, transparent 53%),
    #0f766e;
  color: #ffffff;
  font-size: 18px;
  font-weight: 950;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.24);
}

.rot-clock-text {
  min-width: 0;
  color: #17202a;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.rot-wrong {
  animation: rot-shake 340ms ease;
  border-color: #b42318 !important;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.16) !important;
}

@keyframes rot-ripple {
  0% { transform: scale(0.46); opacity: 0.95; }
  100% { transform: scale(1.35); opacity: 0; }
}

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

@media (max-width: 820px) {
  .rot-boards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .rot-lede {
    grid-template-columns: 46px minmax(0, 1fr);
    padding: 10px;
  }

  .rot-mini-clock {
    width: 46px;
    height: 46px;
  }

  .rot-dashboard {
    grid-template-columns: 1fr;
  }

  .rot-board {
    padding: 10px;
  }

  .rot-board-title {
    font-size: 17px;
  }

  .rot-crate {
    gap: 6px;
    padding: 6px;
  }

  .rot-cell {
    min-height: 54px;
    padding: 4px;
  }

  .rot-orange {
    width: min(38px, 70%);
    height: min(38px, 70%);
  }

  .rot-actions {
    grid-template-columns: 1fr;
  }

  .rot-btn,
  .rot-clock {
    min-height: 54px;
  }
}
