/* Raceway Rotation puzzle: status strip, three raceway cards, and action row. */

/* Shadow clock: a soft shadow band slides across the hatch house as the day turns. */
.hatch-light {
  position: relative;
  overflow: hidden;
}

.hatch-light__shadow {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 35%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(10, 15, 29, 0.42), transparent);
  transition: left 1.2s ease;
}

.hatch-light[data-light-phase="morning"] .hatch-light__shadow { left: -10%; }
.hatch-light[data-light-phase="midday"] .hatch-light__shadow { left: 32%; }
.hatch-light[data-light-phase="evening"] .hatch-light__shadow { left: 72%; }

.hatch-light__caption {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 0.35rem;
  background: rgba(10, 15, 29, 0.7);
  color: #e6fbff;
  font-size: 0.85rem;
}

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

.raceway-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.raceway-status > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(77, 242, 255, 0.25);
  border-radius: 0.5rem;
  background: rgba(13, 43, 54, 0.45);
}

.raceway-status span {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.raceway-status strong {
  font-size: 1.15rem;
}

.raceway-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.9rem;
}

.raceway {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border: 2px solid rgba(77, 242, 255, 0.2);
  border-radius: 0.6rem;
  background: rgba(10, 15, 29, 0.55);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.raceway:hover,
.raceway:focus-visible {
  border-color: rgba(77, 242, 255, 0.7);
  transform: translateY(-2px);
}

.raceway[aria-pressed="true"] {
  border-color: #4df2ff;
  box-shadow: 0 0 18px rgba(77, 242, 255, 0.35);
}

.raceway[data-state="fish"] .raceway__status {
  color: #7ff0c8;
}

.raceway[data-state="murky"] {
  border-color: rgba(245, 158, 11, 0.45);
}

.raceway[data-state="murky"] .raceway__status {
  color: #f5b041;
}

.raceway[data-state="ready"] {
  border-color: rgba(253, 230, 138, 0.7);
}

.raceway[data-state="ready"] .raceway__status {
  color: #fde68a;
}

.raceway__name {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.raceway__status,
.raceway__murk-label {
  font-size: 0.9rem;
}

.raceway__meter {
  display: block;
  height: 0.6rem;
  margin-top: 0.3rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
}

.raceway__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #1fa8b5, #f59e0b);
  transition: width 0.4s ease;
}

.raceway-actions {
  margin: 1.25rem 0;
}

.raceway-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.75rem 0;
}

.raceway-buttons .button {
  transition: transform 0.2s ease;
}

.raceway-buttons .button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.raceway-buttons .button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.raceway-note {
  min-height: 1.5em;
  font-weight: 600;
}

.raceway-end {
  min-height: 1.5em;
  font-size: 1.1rem;
  font-weight: 700;
}

.egg-station {
  margin: 1.25rem 0;
}

.egg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.9rem;
}

.egg-panel {
  padding: 0.9rem 1rem;
  border: 1px solid rgba(77, 242, 255, 0.25);
  border-radius: 0.6rem;
  background: rgba(13, 43, 54, 0.45);
}

.egg-panel h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.incubator {
  position: relative;
  overflow: hidden;
}

.incubator__bubbles {
  position: absolute;
  right: 1rem;
  bottom: 0;
  width: 0.5rem;
  height: 0;
  border-radius: 999px;
  opacity: 0;
  background: rgba(77, 242, 255, 0.6);
}

.incubator[data-flowing="true"] .incubator__bubbles {
  animation: bubble-rise 2.4s linear infinite;
}

@keyframes bubble-rise {
  0% { height: 0; bottom: 0; opacity: 0.8; }
  100% { height: 4rem; bottom: 6rem; opacity: 0; }
}

.egg-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  min-height: 5rem;
}

.egg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5.5rem;
  min-height: 4.5rem;
  padding: 0.4rem;
  border-radius: 50% / 60%;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.2;
  text-align: center;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.egg--submerged {
  border: 2px solid #8a5a2b;
  background: #c98f4e;
}

.egg--floating {
  border: 2px dashed #6b7280;
  background: #f5f1e6;
  transform: translateY(-0.8rem);
}

.egg:focus-visible {
  outline: 3px solid #4df2ff;
  outline-offset: 2px;
}

.raceway-badges .badge-list {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.badge {
  display: grid;
  gap: 0.25rem;
  border: 2px dashed rgba(255, 255, 255, 0.35);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  opacity: 0.7;
}

.badge[data-earned="true"] {
  border-style: solid;
  border-color: #ffd166;
  opacity: 1;
}

.badge em {
  font-style: normal;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .raceway,
  .raceway-buttons .button,
  .egg { transition: none; }
  .incubator[data-flowing="true"] .incubator__bubbles { animation: none; }
}
