*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --text: #f0f0f0;
  --muted: #666;
  --accent: #dc2626;
  --accent-soft: rgba(220,38,38,0.15);
  --green: #22c55e;
  --border: rgba(255,255,255,0.08);
  --font-mono: 'JetBrains Mono', monospace;
  --font-ui: 'Inter', system-ui, sans-serif;
}

html, body { height: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

.app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Header */
.timer-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover { color: var(--text); }

.tournament-name {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--muted);
}

/* Main */
.timer-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 32px;
}

/* Blinds */
.blinds-row {
  position: relative;
  display: flex;
  gap: 48px;
  width: 100%;
  max-width: 600px;
  justify-content: center;
  overflow: hidden;
}

.blind-group {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}

.blind-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.blind-value {
  font-family: var(--font-mono);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 700;
}

.blind-group.current .blind-value { color: var(--text); }
.blind-group.next .blind-value { color: var(--muted); }

/* Break state */
.blind-group.current.is-break .blind-value { color: var(--green); }

/* Clock */
.clock-container {
  position: relative;
}

.clock {
  font-family: var(--font-mono);
  font-size: clamp(5rem, 18vw, 10rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
  color: var(--text);
  user-select: none;
  transition: color 0.3s;
}

.clock.warning { color: #f59e0b; }
.clock.danger { color: var(--accent); }
.clock.paused { opacity: 0.5; }
.clock.is-break { color: var(--green); }

/* Progress bar — 48 ticks like the original */
.progress-bar {
  display: flex;
  gap: 3px;
  width: 100%;
  max-width: 600px;
}

.tick {
  flex: 1;
  height: 6px;
  background: var(--surface);
  border-radius: 1px;
  transition: background 0.15s;
  cursor: pointer;
}

.tick.filled { background: var(--accent); }
.tick.break-tick.filled { background: var(--green); }
.tick:hover { background: rgba(255,255,255,0.15); }
.tick.filled:hover { opacity: 0.8; }

/* Controls */
.controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.ctrl-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.ctrl-btn:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.2);
}

.play-btn {
  width: 64px;
  height: 64px;
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.play-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: white;
  transform: scale(1.05);
}

/* Footer */
.timer-footer {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.footer-stat { text-align: center; }

.stat-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

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

/* Author link */
.author-link {
  position: fixed;
  bottom: 12px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s, color 0.2s;
  z-index: 50;
}

.author-link:hover {
  opacity: 1;
  color: #29a9eb;
}

/* Pro Badge */
.pro-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fbbf24;
  background: rgba(251,191,36,0.1);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
  z-index: 100;
  flex-shrink: 0;
}

.pro-badge:hover {
  background: rgba(251,191,36,0.18);
  border-color: rgba(251,191,36,0.45);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(251,191,36,0.15);
}

/* Pro Modal */
.pro-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.pro-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.pro-modal {
  position: relative;
  width: 90%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background: #141414;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 32px 28px;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.3s;
}

.pro-modal-overlay.open .pro-modal {
  transform: translateY(0) scale(1);
}

.pro-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.pro-modal-close:hover { color: var(--text); }

.pro-modal-header {
  text-align: center;
  margin-bottom: 28px;
}

.pro-star {
  color: #fbbf24;
  margin-bottom: 12px;
}

.pro-modal-header h2 {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.pro-subtitle {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Features List */
.pro-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.pro-feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.pro-feature-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
}

.pro-feature strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.pro-feature span {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Contact Section */
.pro-contact {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  text-align: center;
}

.pro-contact-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.pro-contact-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.pro-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
  text-decoration: none;
  padding: 8px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
  width: 100%;
  max-width: 280px;
  justify-content: center;
}

.pro-contact-link:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
}

.pro-contact-link:last-child:hover {
  color: #29a9eb;
  border-color: rgba(41,169,235,0.3);
}

.pro-contact-link:first-child:hover {
  color: #fbbf24;
  border-color: rgba(251,191,36,0.3);
}

@media (max-width: 600px) {
  .tournament-name { display: none; }
  .blinds-row { gap: 24px; }
  .timer-footer { gap: 24px; }
  .timer-footer .footer-stat:last-child { display: none; }
  .pro-modal { padding: 24px 20px; }
}
