@font-face {
  font-family: '7segment';
  src: url(../fonts/DSEG7Classic-BoldItalic.woff2) format('woff2');
  font-display: swap;
}

/* Accessibility improvements */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #000;
  color: #fff;
  padding: 8px;
  text-decoration: none;
  z-index: 1000;
  border-radius: 0 0 4px 4px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.skip-link:focus {
  top: 0;
}

.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Enhanced focus indicators */
button:focus-visible,
.button:focus-visible {
  outline: 2px solid #4A90E2;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.3);
}

/* High contrast support */
@media (prefers-contrast: high) {
  body {
    background: #000;
    color: #fff;
  }
  
  .button {
    border: 2px solid #fff;
    background: #000;
    color: #fff;
  }
  
  .counter-digit {
    background: #000;
    color: #fff;
    border: 1px solid #fff;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .digit-move-in-down,
  .digit-move-out-up {
    animation: none !important;
  }
  
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
  font-family: '7segment', 'Courier New', 'Monaco', 'Consolas', 'Liberation Mono', monospace;
}

html {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 100dvh;
  max-width: 100dvw;
  justify-content: center;
  align-items: center;
  overscroll-behavior: none;
  overflow-y: auto;
  background-image: url(../img/background.jpg);
  background-size: cover;
  background-position: top;
}

/* Container base styles - shared properties */
.first-container,
.second-container {
  display: flex;
  width: min(670px, calc(100dvw - 20px));
  max-width: calc(100dvw - 20px);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  align-content: center;
  position: relative;
  border: 2px solid black;
  border-radius: 5px;
  margin: 0 10px;
}

.first-container {
  height: 250px;
  background-color: rgba(107, 105, 105, 1);
  box-shadow: 4px 6px 6px #0d0d0d;
}

.second-container {
  height: 130px;
  background-color: rgba(217, 203, 198, 1);
  border-top: none;
  box-shadow: 4px 4px 6px #0d0d0d;
}

.button-container {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  justify-content: space-around;
  align-items: center;
  width: min(540px, 90%);
  max-width: 90%;
  padding: 0 5%;
  box-sizing: border-box;
}

.button-container .btn:nth-child(2) {
  margin-right: 60px;
}

.number {
  display: flex;
  color: rgb(255, 0, 0);
  text-shadow: 0 0 10px #FF0000, 0 0 20px rgba(255, 0, 0, 0.5);
  flex: 1;
  justify-content: center;
  align-items: center;
  font-size: 90px;
  max-width: 15dvw;
  padding: 0.3rem;
}

.output {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  background-color: rgb(0, 0, 0);
  padding: 0rem 0.5rem;
  border-radius: 15px;
  margin-top: 2rem;
}

.title {
  text-align: center;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: whitesmoke;
  font-weight: bolder;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  position: absolute;
  top: 17px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 90vw;
  max-width: 35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 10px;
  box-sizing: border-box;
}

.model {
  text-align: end;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: rgb(42, 42, 42);
  font-weight: bolder;
  font-size: 1.2rem;
  position: absolute;
  bottom: 10px;
  margin: 0;
  z-index: 10;
}

.bi {
  font-size: 1.5rem;
  line-height: 1;
  vertical-align: middle;
}

.btn {
  border: 2px solid black;
  padding: 0.7rem;
  margin-bottom: 2rem;
  box-shadow: 1px 1px 4px #0d0d0d;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
}

.alert,
strong {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
