:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #16202a;
  --muted: #657180;
  --line: #d7dde4;
  --primary: #176b87;
  --primary-dark: #0f5268;
  --accent: #2d7d46;
  --warn: #a44722;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

main {
  min-height: 100vh;
}

.timer-shell {
  width: min(1040px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 32px 0;
}

.join-panel,
.timer-panel {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(22, 32, 42, 0.08);
}

.join-panel {
  max-width: 420px;
  padding: 28px;
}

.timer-panel {
  overflow: hidden;
}

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

h1 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
}

.join-form {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.join-form label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.form-control {
  min-height: 44px;
  border-color: var(--line);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.18rem rgba(23, 107, 135, 0.18);
}

.btn {
  min-height: 42px;
  border-radius: 6px;
  font-weight: 700;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.join-error {
  min-height: 22px;
  margin: 2px 0 0;
  color: var(--warn);
  font-size: 0.9rem;
}

.timer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.diagnostics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.diagnostics div {
  min-width: 0;
  padding: 12px 14px;
  background: #fbfcfd;
}

.diagnostics dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.diagnostics dd {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timer-display {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 56px 24px 48px;
  text-align: center;
}

.timer-label {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
}

#countValue {
  color: var(--accent);
  font-size: clamp(5rem, 18vw, 12rem);
  font-variant-numeric: tabular-nums;
  line-height: 0.92;
}

.timer-subtext {
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 700;
}

.events {
  min-height: 126px;
  margin: 0;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
  color: var(--muted);
  font-size: 0.92rem;
  list-style: none;
}

.events li + li {
  margin-top: 6px;
}

@media (max-width: 760px) {
  .timer-shell {
    width: 100%;
    padding: 0;
  }

  .join-panel,
  .timer-panel {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .join-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: none;
    padding: 24px;
  }

  .diagnostics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timer-display {
    padding: 48px 20px 42px;
  }
}
