@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=DM+Sans:wght@300;400;500&display=swap');
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --main-text-color: #fff;
}
.pace-app { background: #0d0d0f; min-height: 100vh; padding: 2rem 0.5rem 2.5rem; font-family: 'DM Sans', sans-serif; color: #e8e6e1; }
.header { text-align: center; margin-bottom: 2.5rem; }
.header h1 { font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: 0.25em; text-transform: uppercase; color: #888; margin-bottom: 0.4rem; }
.header p { font-size: 24px; font-weight: 300; color: #c8c4bc; letter-spacing: -0.02em; }
.header p span { color: #c8ff3e; font-weight: 500; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card { background: #161618; border: 0.5px solid #2a2a2e; border-radius: 10px; padding: 1.1rem 1.25rem; }
.card label { display: block; font-family: 'Space Mono', monospace; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--main-text-color); margin-bottom: 0.6rem; }
.input-row { display: flex; align-items: center; gap: 8px; }
.time-parts { display: flex; align-items: center; gap: 4px; }
.tseg { font-family: 'Space Mono', monospace; font-size: 28px; font-weight: 700; color: #e8e6e1; width: 50px; text-align: center; cursor: text; outline: none; -webkit-user-select: text; user-select: text; caret-color: transparent; touch-action: manipulation; }
.tseg:empty:before { content: '00'; color: #666; }
.tseg.empty { color: #666; }
.tseg:focus {
  color: #fff;
  background: linear-gradient(90deg, #c8ff3e 0%, #6ee7ff 100%);
  border-radius: 6px;
  outline: 2px solid #c8ff3e;
  box-shadow: 0 0 0 2px #6ee7ff44;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.tseg:hover {
  background: linear-gradient(90deg, #c8ff3e33 0%, #6ee7ff33 100%);
  border-radius: 6px;
  box-shadow: 0 0 0 2px #6ee7ff22;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.sep { font-family: 'Space Mono', monospace; font-size: 26px; color: #666; line-height: 1; }
.speed-wrap { display: flex; align-items: center; gap: 8px; }
.speed-seg { font-family: 'Space Mono', monospace; font-size: 28px; font-weight: 700; color: #e8e6e1; min-width: 55px; cursor: text; outline: none; -webkit-user-select: text; user-select: text; caret-color: transparent; touch-action: manipulation; }
.speed-seg.empty { color: #666; }
.speed-seg:focus {
  color: #fff;
  background: linear-gradient(90deg, #c8ff3e 0%, #6ee7ff 100%);
  border-radius: 6px;
  outline: 2px solid #c8ff3e;
  box-shadow: 0 0 0 2px #6ee7ff44;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.speed-seg:hover {
  background: linear-gradient(90deg, #c8ff3e33 0%, #6ee7ff33 100%);
  border-radius: 6px;
  box-shadow: 0 0 0 2px #6ee7ff22;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.unit { font-size: 13px; color: #666; font-weight: 300; letter-spacing: 0.02em; align-self: flex-end; margin-bottom: 3px; }
.section-label { font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--main-text-color); margin: 1.75rem 0 0.9rem; text-align: center; }
.race-grid { display: grid; grid-template-columns: 0.7fr 1.1fr 1.1fr 1.1fr; gap: 10px; }
.race-card { background: #111113; border: 0.5px solid #222226; border-radius: 10px; padding: 0.9rem 0.75rem; text-align: center; }
.race-name { font-family: 'Space Mono', monospace; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--main-text-color); margin-bottom: 0.35rem; }
.race-dist { font-size: 10px; color: var(--main-text-color); margin-bottom: 0.6rem; font-family: 'Space Mono', monospace; }
.race-time-row { display: flex; align-items: center; justify-content: center; gap: 2px; }
.rseg { font-family: 'Space Mono', monospace; font-size: 20px; font-weight: 700; color: #c8ff3e; text-align: center; cursor: text; outline: none; width: 28px; -webkit-user-select: text; user-select: text; caret-color: transparent; touch-action: manipulation; }
.rseg.wide { min-width: 14px; width: auto; }
.rseg.empty { color: #666; }
.rseg:focus {
  color: #fff;
  background: linear-gradient(90deg, #c8ff3e 0%, #6ee7ff 100%);
  border-radius: 6px;
  outline: 2px solid #c8ff3e;
  box-shadow: 0 0 0 2px #6ee7ff44;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.rseg:hover {
  background: linear-gradient(90deg, #c8ff3e33 0%, #6ee7ff33 100%);
  border-radius: 6px;
  box-shadow: 0 0 0 2px #6ee7ff22;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.rsep { font-family: 'Space Mono', monospace; font-size: 18px; color: #3a5a1a; }
.reset-row { text-align: center; margin-top: 1.5rem; }
.reset-btn { background: transparent; border: 0.5px solid #2a2a2e; border-radius: 6px; color: var(--main-text-color); font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; padding: 8px 20px; cursor: pointer; transition: border-color 0.2s, color 0.2s; }
.reset-btn:hover {
  background: linear-gradient(90deg, #c8ff3e33 0%, #6ee7ff33 100%);
  border-radius: 6px;
  box-shadow: 0 0 0 2px #6ee7ff22;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;  
}
.name-full { display: inline; }
.name-short { display: none; }
@media (max-width: 800px) {
  .name-full { display: none; }
  .name-short { display: inline; }
  .tseg { font-size: 22px; width: 40px; }
  .sep { font-size: 20px; }
  .speed-seg { font-size: 22px; }
  .rseg { font-size: 16px; width: 22px; }
  .rseg.wide { min-width: 12px; width: auto; }
  .rsep { font-size: 14px; }
  .race-card { padding: 0.75rem 0.4rem; }
  .card { padding: 0.9rem 1rem; }
}
