/* ---------- RESET ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---------- BASE ---------- */
body {
  font-family: "Computer Modern Serif", "CMU Serif", Georgia, serif;
  background: #fdfdfd;
  color: #1a1a1a;
  line-height: 1.65;
  max-width: 680px;
  margin: 64px auto;
  padding: 0 24px 80px;
}

button,
input {
  font-family: inherit;
}

@media (max-width: 640px) {
  body {
    margin: 36px auto;
    padding: 0 18px 60px;
  }
}

/* ---------- TYPOGRAPHY ---------- */
h1 {
  font-size: 2.1rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  margin-bottom: 18px;
  color: #111;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

section {
  margin-bottom: 26px;
}

section p {
  font-size: 0.85rem;
  font-style: italic;
  color: #888;
  margin-bottom: 8px;
}

ul {
  padding-left: 22px;
  line-height: 2;
  font-size: 0.9rem;
  color: #333;
}

/* ---------- NAV ---------- */
nav {
  font-size: 0.88rem;
  font-style: italic;
  margin-bottom: 28px;
  line-height: 2.2;
  text-align: center;
  color: #444;
  text-transform: none;
  letter-spacing: normal;
}

nav a {
  color: #111;
  text-decoration: none;
  font-style: normal;
  border-bottom: 1px solid #bbb;
}

/* ---------- DIVIDERS ---------- */
hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 0 0 28px;
}

/* ---------- GAME CARD ---------- */
.game-shell {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 20px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.07);
  padding: 24px 22px;
  margin-top: 20px;
}

/* ---------- HUD ---------- */
.hud {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.hud > div {
  flex: 1;
  border: 1px solid #e8e8e8;
  border-radius: 2px;
  padding: 8px 12px;
  text-align: center;
  background: #fafafa;
}

.label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #aaa;
  margin-bottom: 3px;
}

.hud strong,
.hud span:last-child {
  font-size: 1.3rem;
  font-weight: 600;
}

/* ---------- PROBLEM ---------- */
.problem {
  font-size: 2.2rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 18px;
  letter-spacing: -0.02em;
  color: #111;
}

/* ---------- INPUT ---------- */
input[type="number"],
input[type="text"] {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 2px;
  font-size: 1rem;
  text-align: center;
  background: #fff;
  margin-bottom: 12px;
  outline: none;
}

/* ---------- BUTTONS ---------- */
.button-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

button {
  font-size: 0.82rem;
  padding: 7px 16px;
  border-radius: 2px;
  border: 1px solid #bbb;
  background: #fff;
  color: #333;
  cursor: pointer;
}

button.primary,
button.start,
.button-row button:first-child {
  background: #111;
  color: #fff;
  border-color: #111;
}

button[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- STATUS ---------- */
.status-msg {
  text-align: center;
  font-size: 0.85rem;
  font-style: italic;
  color: #444;
  margin-top: 12px;
}

/* ---------- LEADERBOARD ---------- */
.leaderboard-wrap {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #eee;
}

.leaderboard-wrap .label {
  font-size: 0.72rem;
  letter-spacing: 1.2px;
  color: #999;
  margin-bottom: 12px;
}

.leaderboard-list {
  list-style: none;
  padding: 0;
}

.leaderboard-list li {
  margin-bottom: 9px;
}

/* ---------- FOCUS ---------- */
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #2a7fff;
  outline-offset: 2px;
}

#days-header {
  position: relative;
  cursor: help;
}
/* ---------- TIME HOVER ---------- */

#days-header::after {
  content: attr(data-detail);
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 8px;
  padding: 6px 10px;
  font-size: 0.9rem;
  font-weight: normal;
  white-space: nowrap;
  background: white;
  border: 1px solid black;
  opacity: 0;
  pointer-events: none;
}

#days-header:hover::after {
  opacity: 1;
}
