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

/* ── Variables ── */
:root {
  --blue:       #1B3A5C;
  --blue-dark:  #142B45;
  --blue-light: #2D5A8E;
  --dark:       #1A1A1A;
  --grey:      #4A4A4A;
  --grey-mid:  #7A7A7A;
  --grey-light:#B0B0B0;
  --border:    #D8D8D8;
  --bg:        #F5F5F5;
  --white:     #FFFFFF;
  --gold:      #B8860B;
  --silver:    #808080;
  --bronze:    #8B4513;
  --font:      'Helvetica Neue', Helvetica, Arial, sans-serif;
  --radius:    2px;
  --shadow:    0 1px 4px rgba(0,0,0,0.10);
  --shadow-md: 0 2px 12px rgba(0,0,0,0.12);
}

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--dark);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ── */
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1rem;    font-weight: 600; }

/* ── Layout ── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Header bar ── */
.site-header {
  background: var(--blue);
  color: var(--white);
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.brand-icon { flex-shrink: 0; display: block; }

.site-header h1 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.4rem;
  min-height: 44px; /* WCAG 2.1 touch target */
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--blue);
  color: var(--white);
}
.btn-primary:hover { background: var(--blue-dark); }

.btn-secondary {
  background: var(--dark);
  color: var(--white);
}
.btn-secondary:hover { background: #333; }

.btn-ghost {
  background: transparent;
  color: var(--dark);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--grey-mid); }

/* ── Input ── */
.input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-family: var(--font);
  font-size: 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--dark);
  transition: border-color 0.15s;
  outline: none;
}
.input:focus { border-color: var(--blue); }
.input::placeholder { color: var(--grey-light); }

/* ── Card ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

/* ── Leaderboard ── */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.75rem;
  margin: 2rem 0;
}

.podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  max-width: 180px;
}

.podium-name {
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  color: var(--dark);
  word-break: break-word;
}

.podium-score {
  font-size: 0.75rem;
  color: var(--grey-mid);
  font-weight: 500;
}

.podium-block {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
}

.podium-item:nth-child(1) .podium-block { background: var(--silver); height: 70px; }
.podium-item:nth-child(2) .podium-block { background: var(--gold);   height: 90px; }
.podium-item:nth-child(3) .podium-block { background: var(--bronze); height: 55px; }

.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.score-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-mid);
  border-bottom: 1.5px solid var(--border);
}

.score-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--dark);
}

.score-table tr:last-child td { border-bottom: none; }

.score-table tr:hover td { background: var(--bg); }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
}

.rank-1 { background: var(--gold);   color: var(--white); }
.rank-2 { background: var(--silver); color: var(--white); }
.rank-3 { background: var(--bronze); color: var(--white); }

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

/* ── Tag / pill ── */
.tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius);
}
.tag-blue  { background: var(--blue);  color: var(--white); }
.tag-dark  { background: var(--dark);  color: var(--white); }
.tag-light { background: var(--bg);    color: var(--grey);  border: 1px solid var(--border); }

/* ── Fade-in animation ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.35s ease forwards; }

/* ── Pulse animation for timer warning ── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}
.pulse { animation: pulse 0.6s ease infinite; }

/* ── Responsive ── */
@media (max-width: 640px) {
  h1 { font-size: 1.35rem; }
  .podium { gap: 0.4rem; }
  .podium-item { max-width: 110px; }
  .podium-item:nth-child(1) .podium-block { height: 55px; }
  .podium-item:nth-child(2) .podium-block { height: 70px; }
  .podium-item:nth-child(3) .podium-block { height: 44px; }
}
