:root {
  color-scheme: dark;
  --bg: #0b1018;
  --surface: #111a25;
  --surface-2: #162232;
  --surface-3: #0f1722;
  --line: #293746;
  --text: #edf5ff;
  --muted: #96a6b8;
  --blue: #76d7ff;
  --green: #8af0b1;
  --amber: #e9c46a;
  --red: #ff8c7a;
  --shadow: rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  background:
    linear-gradient(180deg, rgba(118, 215, 255, 0.08), transparent 340px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.shell {
  margin: 0 auto;
  padding: 34px 0 24px;
  width: min(1120px, calc(100% - 32px));
}

.hero {
  align-items: end;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) 180px;
  margin-bottom: 22px;
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(42px, 8vw, 92px);
  letter-spacing: 0;
  line-height: 0.92;
  margin-bottom: 12px;
}

.hero p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
  margin-bottom: 0;
  max-width: 660px;
}

.event-card,
.timer-card,
.panel,
.guide {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 48px var(--shadow);
}

.event-card {
  padding: 16px;
}

.event-card span,
.event-card small,
.timer-meta span,
label,
.history-list span,
.history-list time,
.form-note,
.guide p,
footer {
  color: var(--muted);
}

.event-card strong {
  display: block;
  font-size: 40px;
  line-height: 1;
  margin: 8px 0;
}

.timer-card {
  margin-bottom: 18px;
  padding: clamp(18px, 3vw, 30px);
}

.timer-heading,
.countdown-wrap,
.current-item-card,
.ingredient-list div,
.history-list li,
.guide {
  display: flex;
}

.timer-heading {
  align-items: flex-start;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.timer-heading h2 {
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1;
  margin-bottom: 0;
}

.sync-pill {
  background: rgba(138, 240, 177, 0.1);
  border: 1px solid rgba(138, 240, 177, 0.3);
  border-radius: 999px;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  padding: 8px 12px;
  white-space: nowrap;
}

.sync-pill[data-mode="local"] {
  background: rgba(233, 196, 106, 0.12);
  border-color: rgba(233, 196, 106, 0.34);
  color: var(--amber);
}

.countdown-wrap {
  align-items: center;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  gap: 18px;
  padding: 18px;
}

.current-item-card {
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.current-item-card span:not(.sprite-frame) {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

.current-item-card strong {
  display: block;
  font-size: 20px;
}

.sprite-frame {
  align-items: center;
  background: #0a111b;
  border: 1px solid #31475b;
  border-radius: 8px;
  display: inline-flex;
  flex: 0 0 auto;
  height: 46px;
  justify-content: center;
  width: 46px;
}

.sprite-frame.large {
  height: 70px;
  width: 70px;
}

.sprite-frame img {
  height: 32px;
  image-rendering: pixelated;
  object-fit: contain;
  width: 32px;
}

.sprite-frame.large img {
  height: 46px;
  width: 46px;
}

.countdown {
  flex: 1 1 auto;
  font-size: clamp(54px, 12vw, 128px);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.9;
  margin: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.timer-meta {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 14px 0 18px;
}

.timer-meta article {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 12px;
}

.timer-meta span {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
}

.timer-meta strong {
  display: block;
  overflow-wrap: anywhere;
}

.done-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(190px, 260px) minmax(220px, 1fr) max-content;
}

label {
  display: grid;
  font-size: 13px;
  gap: 7px;
}

select,
input {
  background: #0a111b;
  border: 1px solid #35475a;
  border-radius: 8px;
  color: var(--text);
  min-height: 46px;
  padding: 0 12px;
  width: 100%;
}

select:focus,
input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(118, 215, 255, 0.14);
}

button {
  background: var(--blue);
  border: 0;
  border-radius: 8px;
  color: #04131b;
  cursor: pointer;
  font-weight: 950;
  min-height: 46px;
  padding: 0 18px;
  white-space: nowrap;
}

.form-note {
  font-size: 13px;
  margin: 10px 0 0;
}

.content-grid {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.panel,
.guide {
  padding: 18px;
}

.section-title {
  margin-bottom: 14px;
}

.section-title h2,
.guide h2 {
  font-size: 22px;
  line-height: 1.1;
  margin-bottom: 0;
}

.ingredient-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ingredient-list div,
.history-list li {
  align-items: center;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  gap: 10px;
  min-width: 0;
  padding: 10px;
}

.ingredient-list strong {
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}

.ingredient-list span:last-child {
  background: rgba(118, 215, 255, 0.1);
  border: 1px solid rgba(118, 215, 255, 0.24);
  border-radius: 999px;
  color: var(--blue);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 8px;
}

.history-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.history-list li {
  align-items: flex-start;
  flex-direction: column;
}

.history-list strong {
  font-size: 16px;
}

.history-list time {
  font-size: 12px;
}

.guide {
  margin-top: 18px;
}

.guide p {
  line-height: 1.55;
  margin-bottom: 0;
}

.admin-shell {
  max-width: 760px;
}

.compact-hero {
  grid-template-columns: 1fr;
  margin-bottom: 20px;
}

.compact-hero h1 {
  font-size: clamp(44px, 10vw, 82px);
}

.admin-form {
  display: grid;
  gap: 14px;
}

footer {
  font-size: 13px;
  padding-top: 20px;
  text-align: center;
}

@media (max-width: 900px) {
  .hero,
  .done-form,
  .content-grid,
  .timer-meta {
    grid-template-columns: 1fr;
  }

  .countdown-wrap {
    align-items: stretch;
    flex-direction: column;
  }

  .countdown {
    text-align: left;
  }

  button {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 24px, 1120px);
    padding-top: 20px;
  }

  .timer-card,
  .panel,
  .guide {
    padding: 15px;
  }

  h1 {
    font-size: clamp(40px, 13vw, 58px);
  }

  .timer-heading,
  .ingredient-list div {
    align-items: flex-start;
    flex-direction: column;
  }

  .ingredient-list {
    grid-template-columns: 1fr;
  }

  .current-item-card {
    min-width: 0;
  }

  .countdown {
    font-size: clamp(46px, 17vw, 70px);
  }
}
