@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400..700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --felt-dark: #12352A;
  --felt-mid: #1C4B39;
  --felt-line: rgba(243, 236, 218, 0.14);
  --brass: #C6A15B;
  --brass-light: #E4C784;
  --cream: #F3ECDA;
  --ink: #152018;
  --alert: #C1502E;
  --slate: #93A69B;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(120% 100% at 50% 0%, var(--felt-mid) 0%, var(--felt-dark) 60%);
  color: var(--cream);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

.num { font-variant-numeric: tabular-nums; }

.serif {
  font-family: 'Fraunces', serif;
  font-weight: 600;
}

button {
  font-family: 'Inter', sans-serif;
}

/* ---------- Landing page ---------- */

.landing-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}

.landing-card {
  width: 100%;
  max-width: 460px;
  background: rgba(243, 236, 218, 0.04);
  border: 1px solid var(--felt-line);
  border-radius: 8px;
  padding: 36px 32px;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--brass-light);
  text-transform: uppercase;
  margin-bottom: 8px;
  text-align: center;
}

.landing-card h1 {
  font-size: 28px;
  margin: 0 0 6px;
  text-align: center;
  color: var(--brass-light);
}

.landing-card p.sub {
  color: var(--slate);
  font-size: 13.5px;
  margin: 0 0 26px;
  line-height: 1.5;
  text-align: center;
}

.field { display: block; margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  background: rgba(243, 236, 218, 0.06);
  border: 1px solid rgba(243, 236, 218, 0.18);
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--cream);
  font-size: 15px;
  outline: none;
  transition: border-color 150ms ease, background 150ms ease;
}

.field input:focus {
  border-color: var(--brass);
  background: rgba(243, 236, 218, 0.1);
}

.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.rounds-hint { font-size: 12.5px; color: var(--slate); margin: -6px 0 16px; }

.link-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(198, 161, 91, 0.08);
  border: 1px dashed var(--felt-line);
  border-radius: 4px;
  padding: 9px 12px;
  margin-bottom: 20px;
}

.link-preview span {
  font-size: 13px;
  color: var(--brass-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-preview button {
  border: none;
  background: transparent;
  color: var(--cream);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  flex-shrink: 0;
}

.link-preview button.copied { color: var(--brass-light); }

.btn-primary {
  width: 100%;
  border: none;
  border-radius: 4px;
  padding: 13px 20px;
  background: var(--brass);
  color: var(--ink);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 120ms ease;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(0.98); }

.powered-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
  opacity: 0.55;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--slate);
}
.powered-by img {
  width: 16px;
  height: 16px;
  display: block;
}
.powered-by .brand-name {
  color: var(--brass-light);
  font-weight: 600;
}

.landing-error {
  font-size: 12.5px;
  color: var(--alert);
  margin: -8px 0 14px;
  display: none;
}
.landing-error.visible { display: block; }

/* ---------- Session / timer page ---------- */

.timer-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 56px;
}

.header { text-align: center; margin-bottom: 28px; max-width: 640px; }

.tournament-name {
  background: transparent;
  border: none;
  outline: none;
  text-align: center;
  color: var(--cream);
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(24px, 4vw, 36px);
  width: 100%;
  letter-spacing: 0.01em;
}

.header hr {
  height: 1px;
  width: 64px;
  background: var(--brass);
  border: none;
  margin: 14px auto 0;
  opacity: 0.6;
}

.stat-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 30px;
}

.stat-card {
  background: rgba(243, 236, 218, 0.05);
  border: 1px solid var(--felt-line);
  border-radius: 4px;
  padding: 10px 18px;
  min-width: 92px;
  text-align: center;
}

.stat-card .label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 4px;
}

.stat-card .value {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 22px;
  color: var(--cream);
}

.dial-holder { position: relative; width: 340px; height: 340px; max-width: 90vw; max-height: 90vw; }

.dial-holder svg { width: 100%; height: 100%; }

.dial-arc { transition: stroke-dashoffset 900ms linear, stroke 400ms ease; }

.dial-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.dial-time {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 56px;
  line-height: 1;
  color: var(--cream);
}
.dial-time.overtime { color: var(--alert); }

.dial-status {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass-light);
}
.dial-status.running { color: var(--slate); }

/* Banner above the dial (outside the clock). Space is reserved so the dial doesn't jump. */
.warn-slot {
  display: flex;
  justify-content: center;
  min-height: 40px;
  margin: 4px 0 10px;
}
.warn-badge {
  background: var(--alert);
  color: var(--cream);
  font-size: 15px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
  visibility: hidden;
}
.warn-badge.visible { visibility: visible; }

.controls {
  margin-top: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--felt-line);
  background: rgba(243, 236, 218, 0.05);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 120ms ease, background 150ms ease, border-color 150ms ease;
  font-size: 16px;
  line-height: 1;
}
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0) scale(0.97); }

.icon-btn.primary {
  width: 52px;
  height: 52px;
  border-color: var(--brass);
  background: var(--brass);
  color: var(--ink);
  font-size: 19px;
}

.footer-note {
  margin-top: 10px;
  font-size: 11px;
  color: var(--slate);
  letter-spacing: 0.05em;
  text-align: center;
}

.footer-note a {
  color: var(--brass-light);
  text-decoration: underline;
  cursor: pointer;
}

.presence-note { margin-top: 4px; font-size: 10.5px; color: var(--slate); opacity: 0.8; }

.connection-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--alert);
  color: var(--cream);
  text-align: center;
  font-size: 12.5px;
  padding: 8px;
  letter-spacing: 0.03em;
  display: none;
  z-index: 10;
}
.connection-banner.visible { display: block; }
