:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fb;
  color: #172033;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(202, 138, 4, 0.12), transparent 38%),
    #f5f7fb;
}

.timer-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.timer-panel {
  width: min(100%, 620px);
  border: 1px solid #d7deea;
  border-radius: 8px;
  padding: 32px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(23, 32, 51, 0.12);
  transform-origin: center center;
  transition: transform 180ms ease, filter 180ms ease;
}

.timer-meta {
  display: grid;
  gap: 8px;
}

.game-logo {
  width: min(100%, 360px);
  height: auto;
  margin-bottom: 6px;
}

.label {
  margin: 0;
  color: #0f766e;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.description {
  max-width: 34rem;
  margin: 4px 0 0;
  color: #475569;
  font-size: 1rem;
  line-height: 1.5;
}

.alert-banner {
  margin-top: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.95rem;
  font-weight: 900;
  text-align: center;
}

.alert-banner.is-alert {
  border-color: #dc2626;
  background: #991b1b;
  color: #ffffff;
  animation: alert-pulse 800ms linear infinite alternate;
}

@keyframes alert-pulse {
  from {
    box-shadow: 0 0 0 rgba(220, 38, 38, 0);
  }

  to {
    box-shadow: 0 0 24px rgba(220, 38, 38, 0.45);
  }
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 8vw, 4rem);
  line-height: 1;
}

.timer-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin: 42px 0 22px;
  color: #0f172a;
}

.remaining {
  min-width: 1.1em;
  font-size: clamp(6rem, 28vw, 11rem);
  font-weight: 900;
  line-height: 0.85;
  text-align: center;
  transition: opacity 160ms ease, transform 160ms ease;
}

.unit {
  color: #64748b;
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 800;
}

.progress-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
  transition: opacity 160ms ease;
}

.progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #84cc16, #ca8a04);
  transform-origin: left center;
  transform: scaleX(1);
  will-change: transform;
}

.progress-bar.is-running {
  transition: transform 80ms linear;
}

.effect-hide-timer .timer-display {
  visibility: hidden;
}

.effect-hide-bar .progress-track {
  visibility: hidden;
}

.effect-mirror-digits .remaining {
  transform: scaleX(-1);
}

.effect-page-flip .timer-panel {
  transform: rotate(180deg);
}

.effect-page-tilt .timer-panel {
  transform: rotate(-7deg);
}

.effect-page-tilt .remaining {
  transform: skewX(-10deg);
}

.game-actions {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.hit-button {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  background: #0f766e;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 900;
}

.hit-button:hover:not(:disabled),
.hit-button:focus-visible:not(:disabled) {
  background: #115e59;
}

.hit-button:disabled {
  cursor: not-allowed;
  background: #94a3b8;
}

.score-text {
  min-height: 1.5em;
  margin: 0;
  color: #334155;
  font-weight: 700;
  text-align: center;
}

.score-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.score-overlay.is-visible {
  opacity: 1;
}

.score-modal {
  width: min(100%, 360px);
  border: 1px solid #d7deea;
  border-radius: 8px;
  padding: 24px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.26);
  text-align: center;
}

.score-modal-label,
.score-modal-meta {
  margin: 0;
  color: #475569;
  font-weight: 800;
}

.score-modal-value {
  margin: 10px 0;
  color: #0f766e;
  font-size: clamp(2.4rem, 14vw, 4rem);
  font-weight: 900;
  line-height: 1;
}

.podium-section {
  margin-top: 30px;
}

.podium-section h2 {
  font-size: 1rem;
  font-weight: 800;
}

.podium {
  display: grid;
  margin: 12px 0 0;
  padding: 0;
  gap: 8px;
  list-style: none;
}

.podium li {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: #334155;
}

.podium-rank {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: #172033;
  color: #ffffff;
  font-weight: 900;
}

.podium-score {
  color: #0f766e;
  font-weight: 900;
}

.empty-score {
  display: block;
  grid-template-columns: none;
  color: #64748b;
}

.iteration-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
}

.iteration-header h2 {
  font-size: 1rem;
  font-weight: 800;
}

.iteration-count {
  display: inline-grid;
  min-width: 44px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: #172033;
  color: #ffffff;
  font-weight: 800;
}

.marks {
  display: grid;
  max-height: 240px;
  margin: 16px 0 0;
  padding: 0;
  gap: 8px;
  overflow: auto;
  list-style: none;
}

.marks li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: #334155;
  font-size: 0.95rem;
}

.marks li:first-child {
  border-color: #0f766e;
}

.mark-number {
  color: #172033;
  font-weight: 800;
}

.mark-level {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 800;
}

.mark-result {
  color: #0f766e;
  font-weight: 900;
}

@media (max-width: 520px) {
  .timer-shell {
    padding: 14px;
  }

  .timer-panel {
    padding: 24px;
  }

  .podium li,
  .marks li {
    grid-template-columns: 1fr;
  }

  .podium-rank {
    width: 28px;
    height: 28px;
  }

  .mark-result,
  .podium-score {
    justify-self: start;
  }
}
