:root {
  --navy-900: #0a1f3a;
  --navy-700: #1e3a5f;
  --brand-bg: #f4f9ff;
  --accent: #f5c242;
  --accent-dark: #d1a21a;
}

* {
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: var(--brand-bg);
  margin: 0;
  color: #1a1a1a;
}

.main-content {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 160px); /* leaves room for navbar + footer */
  padding: 20px;
}

.container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 20px;
  width: 320px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  transition: width 0.3s, padding 0.3s;
}

@media (min-width: 768px) {
  .container {
    width: 500px;
    padding: 40px;
  }
}

/* Flash when timer ends */
@keyframes flash {
  0%,
  100% {
    background: #fff;
  }
  50% {
    background: #ffe9e9;
  }
}
.flash {
  animation: flash 1s ease-in-out 3;
}

/* Timer */
.timer-area {
  display: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 50px;
  gap: 8px;
}
.timer-display {
  font-size: 1.6rem;
  font-weight: 700;
  justify-self: center;
  letter-spacing: 0.5px;
  color: var(--navy-900);
}
.timer-controls {
  background: var(--navy-900);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  transition: transform 0.06s ease, background 0.2s ease;
}
.timer-controls:hover {
  background: var(--navy-700);
}
.timer-controls:active {
  transform: translateY(1px);
}
.timer-controls.minus {
  justify-self: start;
}
.timer-controls.plus {
  justify-self: end;
}

/* Buttons */
.top-button,
.solve-btn {
  background: var(--navy-900);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s ease, transform 0.06s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 6px rgba(10, 31, 58, 0.2);
}
.top-button {
  margin-bottom: 20px;
}
.top-button:hover,
.solve-btn:hover {
  background: var(--navy-700);
}
.top-button:active,
.solve-btn:active {
  transform: translateY(1px);
}

.solve-btn {
  width: auto;
  min-width: 160px;
  margin: 0 auto 20px;
}

/* Numbers */
.numbers-area {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
}
.card {
  background: var(--navy-900);
  color: #fff;
  border-radius: 10px;
  padding: 12px;
  font-size: 1.4rem;
  width: 56px;
  height: 56px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(10, 31, 58, 0.2);
}
@media (min-width: 768px) {
  .card {
    font-size: 2rem;
    width: 74px;
    height: 74px;
  }
}

/* Target */
.target-area {
  text-align: center;
  margin-bottom: 20px;
}
.target-area .label {
  font-size: 1rem;
  margin-bottom: 4px;
  display: block;
  color: var(--navy-700);
}
.target-area .value {
  font-size: 4rem;
  font-weight: 900;
  color: var(--navy-900);
}
@media (min-width: 768px) {
  .target-area .label {
    font-size: 1.2rem;
  }
  .target-area .value {
    font-size: 5rem;
  }
}

/* Solution */
#solution {
  margin-top: 16px;
  text-align: center;
  font-style: italic;
  color: #111;
}

/* Footer */
.site-footer {
  margin-top: 20px;
  background: var(--navy-900);
  color: #fff;
  text-align: center;
  padding: 14px 16px;
  font-size: 0.95rem;
  box-shadow: 0 -2px 6px rgba(10, 31, 58, 0.12);
}

/* Keep footer always visible at the bottom */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
}

/* Ensure content isn't hidden behind the fixed footer */
.main-content {
  padding-bottom: 72px; /* matches footer height + padding */
}

/* Grow the main card container on larger screens */
@media (min-width: 1024px) {
  .container {
    width: 720px;
  }
}
@media (min-width: 1440px) {
  .container {
    width: 860px;
  }
}

/* Scale internal UI accordingly on large screens */
@media (min-width: 1024px) {
  .card {
    width: 84px;
    height: 84px;
    font-size: 2.2rem;
  }
  .timer-display {
    font-size: 2rem;
  }
  .target-area .value {
    font-size: 5.5rem;
  }
}
@media (min-width: 1440px) {
  .card {
    width: 96px;
    height: 96px;
    font-size: 2.4rem;
  }
  .target-area .value {
    font-size: 6rem;
  }
}
