/* Jacob Watch visual system */
:root {
  color-scheme: dark;
  --bg: #050906;
  --surface: #0d140f;
  --surface-2: #121c14;
  --surface-3: #18241a;
  --border: #27372a;
  --border-bright: #3f5944;
  --text: #f3f7f3;
  --muted: #9aa99d;
  --muted-2: #6e7f71;
  --green: #77ed71;
  --green-strong: #45d65b;
  --gold: #ffc84a;
  --platinum: #a8d7e4;
  --diamond: #68e4d4;
  --danger: #ff746c;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --mono: "Fira Code", ui-monospace, monospace;
  --sans: "Fira Sans", Inter, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 78% -10%, rgba(69, 214, 91, 0.13), transparent 30rem),
    linear-gradient(rgba(119, 237, 113, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(119, 237, 113, 0.018) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 40px 40px, 40px 40px, auto;
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: var(--green);
}

svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: fixed;
  z-index: 50;
  top: 0.75rem;
  left: 0.75rem;
  transform: translateY(-180%);
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  background: var(--green);
  color: #071008;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
main,
footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #376d3c;
  border-radius: 10px;
  background: linear-gradient(145deg, #17301b, #0a160c);
  color: var(--green);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--mono);
  font-size: 0.95rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.73rem;
}

.live-status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px currentColor;
}

.live-status.is-live .status-dot {
  color: var(--green);
  background: var(--green);
}

.live-status.is-error .status-dot {
  color: var(--danger);
  background: var(--danger);
}

main {
  padding: 72px 0 40px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.7fr);
  gap: 64px;
  align-items: center;
  padding-bottom: 80px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: clamp(2.8rem, 6.2vw, 5.5rem);
  line-height: 0.99;
  letter-spacing: -0.065em;
}

h1 span {
  color: var(--muted-2);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.hero-description {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.setup-panel {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(24, 36, 26, 0.92), rgba(10, 16, 12, 0.95));
  box-shadow: var(--shadow);
}

.panel-heading,
.section-heading,
.setup-panel label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-heading {
  margin-bottom: 26px;
}

.panel-heading h2 {
  font-size: 1.35rem;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.icon-button:hover {
  border-color: var(--border-bright);
  background: var(--surface-3);
  color: var(--green);
}

.setup-panel label {
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
}

.setup-panel output {
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.78rem;
}

input[type="range"] {
  width: 100%;
  height: 5px;
  margin: 14px 0 26px;
  border-radius: 999px;
  accent-color: var(--green-strong);
  cursor: pointer;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.input-row label {
  display: block;
}

.input-row label > span:first-child {
  display: block;
  margin-bottom: 8px;
}

.input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #080d09;
  overflow: hidden;
}

.input-wrap input {
  width: 100%;
  min-width: 0;
  padding: 9px 4px 9px 11px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
}

.input-wrap > span {
  padding-right: 10px;
  color: var(--muted);
  font-family: var(--mono);
}

.input-wrap:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(119, 237, 113, 0.1);
}

.setup-note {
  margin: 14px 0 0;
  color: var(--muted-2);
  font-size: 0.75rem;
}

.next-section,
.schedule-section {
  padding: 56px 0;
  border-top: 1px solid var(--border);
}

.section-heading {
  gap: 24px;
  margin-bottom: 28px;
}

.timezone-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.timezone-note svg {
  width: 1rem;
  height: 1rem;
}

.next-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(0, 1.8fr);
  min-height: 260px;
  border: 1px solid var(--border-bright);
  border-radius: 18px;
  background:
    linear-gradient(110deg, rgba(119, 237, 113, 0.07), transparent 36%),
    var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.next-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--green);
  content: "";
}

.contest-time {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px;
  border-right: 1px solid var(--border);
}

.skyblock-date {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.countdown {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(2.1rem, 4.5vw, 4.3rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.07em;
}

.countdown-label {
  margin: 10px 0 0;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.local-time {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.next-crops {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.crop-panel {
  min-width: 0;
  padding: 28px 24px;
  border-right: 1px solid var(--border);
}

.crop-panel:last-child {
  border-right: 0;
}

.crop-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 23px;
}

.crop-title h3 {
  margin: 0;
  font-size: 1rem;
}

.crop-icon {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--crop) 50%, #27372a);
  border-radius: 9px;
  background: color-mix(in srgb, var(--crop) 13%, #0d140f);
  color: var(--crop);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
}

.tier-row {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid rgba(39, 55, 42, 0.72);
}

.tier-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 9px color-mix(in srgb, currentColor 55%, transparent);
}

.tier-name {
  color: var(--muted);
  font-size: 0.76rem;
}

.tier-value {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 600;
}

.tier-gold {
  color: var(--gold);
}

.tier-platinum {
  color: var(--platinum);
}

.tier-diamond {
  color: var(--diamond);
}

.fortune-label {
  margin: 12px 0 0;
  color: var(--muted-2);
  font-size: 0.66rem;
}

.schedule-actions {
  display: flex;
  gap: 10px;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 220px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
}

.search-wrap:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(119, 237, 113, 0.1);
}

.search-wrap svg {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  padding: 9px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-wrap input::placeholder {
  color: var(--muted-2);
}

.secondary-button,
.load-more,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.secondary-button:hover,
.load-more:hover {
  border-color: var(--border-bright);
  background: var(--surface-3);
  color: var(--green);
}

.secondary-button svg {
  width: 1rem;
  height: 1rem;
}

.contest-list {
  border-top: 1px solid var(--border);
}

.contest-entry {
  border-bottom: 1px solid var(--border);
}

.contest-entry > summary {
  list-style: none;
}

.contest-entry > summary::-webkit-details-marker {
  display: none;
}

.contest-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 120px;
  gap: 24px;
  align-items: center;
  padding: 21px 12px;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.contest-row:hover,
.contest-entry[open] > .contest-row {
  background: rgba(119, 237, 113, 0.025);
}

.contest-row:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

.row-time strong,
.row-time span {
  display: block;
}

.row-time strong {
  font-family: var(--mono);
  font-size: 0.84rem;
}

.row-time span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
}

.row-crops {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.crop-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 7px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  font-size: 0.78rem;
}

.crop-chip .crop-icon {
  width: 25px;
  height: 25px;
  border-radius: 6px;
  font-size: 0.58rem;
}

.row-countdown {
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.8rem;
  text-align: right;
}

.row-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.dropdown-chevron {
  width: 1rem;
  height: 1rem;
  color: var(--muted);
  transition: transform 180ms ease, color 180ms ease;
}

.contest-entry[open] .dropdown-chevron {
  transform: rotate(180deg);
  color: var(--green);
}

.contest-estimates {
  padding: 8px 24px 28px;
  animation: reveal-estimates 180ms ease-out;
}

@keyframes reveal-estimates {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
}

.estimate-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0 16px;
  border-top: 1px solid var(--border);
}

.estimate-heading h3,
.estimate-heading p {
  margin: 0;
}

.estimate-heading h3 {
  font-size: 1rem;
}

.estimate-heading > p {
  color: var(--muted-2);
  font-size: 0.7rem;
}

.estimate-heading .eyebrow {
  margin-bottom: 5px;
  font-size: 0.62rem;
}

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

.estimate-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.estimate-crop {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
}

.estimate-crop .crop-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 0.6rem;
}

.estimate-crop h3 {
  margin: 0;
  font-size: 0.85rem;
}

.estimate-table-head,
.estimate-table-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.8fr) 1fr 0.75fr;
  gap: 8px;
  align-items: center;
}

.estimate-table-head {
  padding: 0 0 7px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 0.58rem;
  text-transform: uppercase;
}

.estimate-table-row {
  padding: 7px 0;
  border-top: 1px solid rgba(39, 55, 42, 0.7);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.estimate-table-head span:not(:first-child),
.estimate-table-row > span:not(:first-child),
.estimate-table-row strong {
  text-align: right;
}

.estimate-table-row > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--sans);
}

.estimate-table-row .tier-dot {
  display: inline-block;
  flex: 0 0 auto;
}

.list-placeholder {
  height: 86px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.025), transparent);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}

.skeleton {
  background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface));
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

.empty-state {
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.load-more {
  width: 100%;
  margin-top: 18px;
}

.method-section {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 80px;
  align-items: start;
  margin-top: 30px;
  padding: 48px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.method-copy p {
  max-width: 620px;
  margin-bottom: 18px;
  color: var(--muted);
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  font-weight: 600;
}

.text-button svg {
  width: 1rem;
  transition: transform 180ms ease;
}

.text-button:hover svg {
  transform: translateX(3px);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 36px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 0.72rem;
}

footer p {
  margin: 0;
}

dialog {
  width: min(560px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--border-bright);
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--text);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

dialog form {
  position: relative;
  padding: 32px;
}

.dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

dialog h2 {
  padding-right: 40px;
}

dialog code {
  display: block;
  margin: 24px 0;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #080d09;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.7;
}

dialog p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.9rem;
}

.primary-button {
  width: 100%;
  margin-top: 10px;
  border-color: var(--green);
  background: var(--green);
  color: #071008;
}

.primary-button:hover {
  background: #91f38c;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

@media (max-width: 940px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .setup-panel {
    max-width: 600px;
  }

  .next-card {
    grid-template-columns: 1fr;
  }

  .contest-time {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .local-time {
    margin: 0;
  }
}

@media (max-width: 720px) {
  .site-header,
  main,
  footer {
    width: min(100% - 28px, 1180px);
  }

  main {
    padding-top: 48px;
  }

  .hero {
    padding-bottom: 56px;
  }

  .live-status {
    font-size: 0;
  }

  .live-status .status-dot {
    width: 9px;
    height: 9px;
  }

  .next-crops {
    grid-template-columns: 1fr;
  }

  .crop-panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .crop-panel:last-child {
    border-bottom: 0;
  }

  .schedule-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .schedule-actions {
    width: 100%;
  }

  .search-wrap {
    flex: 1;
    width: auto;
  }

  .contest-row {
    grid-template-columns: 1fr auto;
    gap: 15px;
  }

  .row-crops {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .row-meta {
    grid-column: 2;
    grid-row: 1;
  }

  .estimate-grid {
    grid-template-columns: 1fr;
  }

  .estimate-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .method-section {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 30px;
  }

  footer {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .brand small {
    display: none;
  }

  h1 {
    font-size: 2.65rem;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .contest-time {
    display: block;
    padding: 24px;
  }

  .local-time {
    margin-top: 22px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .timezone-note {
    max-width: 90px;
    text-align: right;
  }

  .schedule-actions {
    flex-direction: column;
  }

  .secondary-button {
    width: 100%;
  }

  .crop-panel {
    padding: 24px;
  }

  .contest-estimates {
    padding-inline: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
