:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f7f8fa;
  background: #172033;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 0, #293952 0, transparent 36rem),
    radial-gradient(circle at 96% 4%, #334253 0, transparent 32rem),
    #172033;
}

main { max-width: 1160px; margin: auto; padding: 32px 42px; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #607d99;
  padding: 0 0 26px;
  margin-bottom: 42px;
}

.brand { color: #e6b86c; font-size: 15px; font-weight: 900; letter-spacing: .15em; }
.eyebrow { font-size: 12px; font-weight: 850; letter-spacing: .14em; color: #b4c9d9; margin: 10px 0; }

.clock {
  background: #344256;
  color: #fff;
  border: 1px solid #708aa2;
  border-radius: 18px;
  padding: 11px 18px;
  text-align: right;
  box-shadow: 0 5px 0 #111925;
}

.clock strong { display: block; font-size: 32px; font-variant-numeric: tabular-nums; }
.clock span { font-size: 14px; color: #d5e0e9; }
h1 { font-family: Georgia, serif; font-size: 52px; letter-spacing: -.04em; font-weight: 500; margin: 6px 0 12px; color: #fff; }
.intro { font-size: 18px; color: #ccd8e3; margin: 0 0 28px; }

.workers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 22px 0 42px; }
button { font: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 4px solid #fff; outline-offset: 5px; }

.worker {
  position: relative;
  background: #dfb36f;
  color: #1e2935;
  border: 0;
  border-radius: 18px;
  min-height: 114px;
  font-size: 28px;
  font-weight: 850;
  box-shadow: 0 6px 0 #b17f3e;
  overflow-wrap: anywhere;
  padding: 20px;
  transition: transform .12s ease, box-shadow .12s ease;
}

.worker:nth-child(3n+2) { background: #82ada8; box-shadow: 0 6px 0 #527d79; }
.worker:nth-child(3n) { background: #bd8580; box-shadow: 0 6px 0 #8c5752; }
.worker.active { background: #83a984; border: 3px solid #f8fbf8; box-shadow: 0 6px 0 #527753; color: #183424; }

.worker.active:after {
  content: "EN COURS";
  position: absolute;
  right: 12px;
  top: 12px;
  background: #254633;
  color: #fff;
  border-radius: 30px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  padding: 5px 8px;
}

.worker:active { transform: translateY(5px); box-shadow: 0 1px 0 currentColor; }
button:disabled { opacity: .5; cursor: wait; }

.ongoing { background: #263247; border: 1px solid #5d7892; border-radius: 22px; padding: 25px 28px; color: #fff; box-shadow: 0 8px 0 #111925; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h2 { font-size: 23px; margin: 0; }
.badge { font-size: 13px; background: #d7aa68; padding: 7px 12px; border-radius: 30px; color: #292115; font-weight: 900; }
.line { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; border-top: 1px solid #536982; }
.line:first-child { margin-top: 20px; }
.line strong { font-size: 20px; }
.line span { font-size: 17px; color: #d4e0eb; font-variant-numeric: tabular-nums; }
.empty { color: #d4e0eb; margin-bottom: 0; }
footer { display: flex; justify-content: space-between; gap: 20px; color: #b8c9d8; font-size: 12px; padding: 26px 0; }

#notice:empty { display: none; }
#notice { background: #84aa87; color: #183424; border: 1px solid #e8f1e9; padding: 14px 18px; border-radius: 12px; margin: 16px 0; font-weight: 750; }
#notice.error { background: #b96964; color: #fff; border-color: #efc77b; }

dialog { border: 1px solid #6d879d; border-radius: 26px; padding: 38px; max-width: 480px; width: calc(100% - 32px); color: #1e2935; background: #f8f8f6; box-shadow: 0 20px 100px #07101d99; }
dialog::backdrop { background: #0d1523dd; backdrop-filter: blur(3px); }
dialog h2 { font-size: 38px; color: #a75651; overflow-wrap: anywhere; }
dialog p#status { font-size: 19px; min-height: 52px; line-height: 1.6; }
.close { position: absolute; right: 16px; top: 10px; background: none; border: 0; font-size: 36px; color: #a75651; width: 48px; height: 48px; }
.primary, .secondary { width: 100%; min-height: 64px; border: 0; border-radius: 14px; font-size: 20px; font-weight: 850; }
.primary { background: #4f817e; color: #fff; box-shadow: 0 4px 0 #315e5c; }
.primary.stop { background: #ae625d; box-shadow: 0 4px 0 #803e3a; }
.secondary { margin-top: 12px; background: #dfb36f; color: #322817; }

@media (max-width: 700px) {
  main { padding: 24px; }
  .workers { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: 40px; }
  header { margin-bottom: 28px; }
  .clock strong { font-size: 27px; }
  .brand { font-size: 12px; }
  .worker { font-size: 24px; }
  .line { align-items: flex-start; flex-direction: column; gap: 6px; }
  footer { flex-direction: column; gap: 8px; }
  .ongoing { padding: 22px; }
}

@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: appear .15s ease-out; }
  @keyframes appear { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
}
