:root {
  color-scheme: dark;
  --bg: #080b10;
  --panel: rgba(8, 11, 16, 0.72);
  --panel-strong: rgba(12, 16, 23, 0.88);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f4f7fb;
  --muted: #aeb8c5;
  --quiet: #798595;
  --accent: #ff3f3f;
  --accent-soft: rgba(255, 63, 63, 0.16);
  --glow: rgba(255, 63, 63, 0.32);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(8, 11, 16, 0.92), rgba(8, 11, 16, 0.54) 44%, rgba(8, 11, 16, 0.88)),
    image-set(
      url("/assets/bg-768.webp") 1x,
      url("/assets/bg-1280.webp") 1.5x,
      url("/assets/bg-1920.webp") 2x
    );
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 72%);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 18px;
}

.shell:not(.op-shell) {
  padding-top: 58px;
  padding-bottom: 8px;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: clamp(42px, 7vh, 68px);
}

.masthead,
.clock-layout,
.tools,
.site-footer {
  width: 100%;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 800;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 24px var(--glow);
  background:
    linear-gradient(var(--accent), var(--accent)) center / 2px 12px no-repeat,
    linear-gradient(90deg, var(--accent), var(--accent)) center / 12px 2px no-repeat;
}

.status-pill {
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.88rem;
}

.clock-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  align-items: end;
  gap: 28px;
}

.clock-primary {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.78rem;
  font-weight: 800;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 920px;
  margin: 0 0 8px;
  font-size: clamp(2.1rem, 5.6vw, 5.4rem);
  line-height: 0.95;
}

h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.2;
}

.time-display {
  display: block;
  color: var(--accent);
  font-size: clamp(3.4rem, 11vw, 8.8rem);
  line-height: 0.95;
  font-weight: 900;
  text-shadow: 0 0 34px rgba(255, 37, 37, 0.34);
  font-variant-numeric: tabular-nums;
  overflow-wrap: normal;
  white-space: nowrap;
}

.date-line {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.28rem);
}

.quick-panel,
.tool-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: var(--panel);
  backdrop-filter: blur(18px);
}

.quick-panel {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.panel-label {
  margin: 0 0 8px;
  color: var(--quiet);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.74rem;
  font-weight: 800;
}

.panel-time,
.shared-main {
  display: block;
  color: var(--text);
  font-size: 1.7rem;
  line-height: 1.1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.panel-time-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  justify-content: center;
  max-width: 100%;
}

.panel-clock {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0 16px;
}

.panel-clock + .panel-clock {
  border-left: 1px solid var(--line);
}

.panel-clock-mode {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.panel-clock .panel-time {
  font-size: clamp(1.35rem, 1.7vw, 1.7rem);
  white-space: nowrap;
}

.panel-note {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

#local-zone {
  text-align: center;
}

.quick-panel > div:first-child .panel-label {
  text-align: center;
}

.shared-time {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.hello-board {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.hello-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.hello-form .hello-button {
  grid-column: 1 / -1;
}

.hello-count {
  margin: 9px 0 0;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.hello-recent {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hello-button[disabled] {
  cursor: wait;
  opacity: 0.72;
}

.shared-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.shared-head .panel-label {
  margin: 0;
}

.tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 580px);
  gap: 14px;
  margin-top: 18px;
}

.tool-section {
  padding: 18px;
  background: var(--panel-strong);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.section-heading .eyebrow {
  margin-bottom: 5px;
}

.op-form {
  display: grid;
  gap: 10px;
}

.op-form label {
  color: var(--muted);
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.tools .op-form .form-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

.ghost-button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.78rem;
}

.op-clear-button {
  min-height: 42px;
}

button:hover,
button:focus-visible {
  background: #ff5b5b;
}

.ghost-button:hover,
.ghost-button:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
}

input:focus-visible,
button:focus-visible,
.brand:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.72);
  outline-offset: 3px;
}

.result-line {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.result-line a {
  color: var(--text);
  font-weight: 700;
}

.private-result {
  display: grid;
  gap: 5px;
  padding-top: 4px;
}

.private-result strong {
  color: var(--text);
}

.private-result span {
  color: var(--muted);
}

.milestones {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 28px;
}

.milestones div {
  min-height: 62px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
}

.milestones span {
  color: var(--quiet);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.milestones strong {
  font-size: clamp(0.92rem, 1vw, 1.05rem);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: normal;
  white-space: nowrap;
}

.site-footer {
  width: min(1280px, calc(100% - 32px));
  margin: 4px auto 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 18px;
  color: var(--quiet);
  font-size: 0.78rem;
  line-height: 1.35;
  pointer-events: none;
  text-align: center;
}

.site-footer span {
  flex: 1 1 100%;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  pointer-events: auto;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--text);
  text-decoration: underline;
}

.op-shell {
  min-height: 100vh;
  padding-bottom: 72px;
}

.op-card {
  width: min(780px, 100%);
  margin: clamp(48px, 12vh, 110px) auto 0;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.op-card-wide {
  width: min(980px, 100%);
}

.op-card h1 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 5vw, 4.2rem);
}

.op-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 22px;
  align-items: start;
}

.op-live-time {
  display: block;
  color: var(--accent);
  font-size: clamp(1.85rem, 3.2vw, 3.25rem);
  line-height: 0.95;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  overflow-wrap: normal;
  white-space: nowrap;
}

.op-share-box,
.op-admin-form {
  display: grid;
  gap: 10px;
}

.op-share-box label,
.op-admin-form label {
  color: var(--muted);
  font-weight: 700;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

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

.op-notice {
  margin: -4px 0 16px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 63, 63, 0.34);
  border-radius: 6px;
  color: var(--text);
  background: var(--accent-soft);
}

.danger-button {
  color: #ffd6d6;
  border-color: rgba(255, 63, 63, 0.46);
}

.op-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding: 0 16px;
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  font-weight: 800;
}

.form-error {
  color: #ffd6d6;
}

@media (max-width: 860px) {
  .shell:not(.op-shell) {
    padding-top: 36px;
    padding-bottom: 8px;
  }

  .hero {
    gap: 34px;
  }

  .clock-layout,
  .tools,
  .op-grid {
    grid-template-columns: 1fr;
  }

  .milestones {
    margin-top: 0;
  }

  .time-display {
    font-size: clamp(3.2rem, 18vw, 7rem);
  }

}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 22px, 1280px);
    padding-top: 16px;
  }

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

  .form-row,
  .milestones {
    grid-template-columns: 1fr;
  }

  .tools .op-form .form-row {
    grid-template-columns: 1fr;
  }

  .hello-form {
    grid-template-columns: 1fr;
  }

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

  .site-footer {
    flex-direction: column;
    gap: 2px;
    text-align: center;
  }
}
