* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --option-height: 752px;
  --option-width: 200px;
  --radius: 1.875rem;
  --gutter: 10px;
  --bg: #f5f5f5;
}

body {
  background-color: var(--bg);
  min-width: 320px;
  font-family: Arial, sans-serif;
}

.wrapper {
  display: flex;
  height: 100vh;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.options {
  display: flex;
  flex-direction: row;
  /*min-width: 480px;*/
  min-width: 100%;
  max-width: calc(var(--total-options) * 130px);
  height: var(--option-height);
  width: 100%;
  gap: var(--gutter);
}

.option {
  display: block;
  text-decoration: none;
  position: relative;
  background-color: color-mix(in srgb, var(--bg), CanvasText 10%);
  background-image: var(--bg-image);
  flex-grow: 1;
  border-radius: var(--radius);
  flex: 0 0 var(--option-width);
  /*transition: filter, opacity, transform;*/
  transition: all;
  transition-duration: 1.5s;
  transition-timing-function: cubic-bezier(.17, .84, .44, 1);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  overflow: hidden;
  border: none;
  outline: none;
}

.option::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 60%,
    rgba(0, 0, 0, 0.4) 100%
  );
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.option.active::before {
  opacity: 1;
}

.option-text {
  position: absolute;
  bottom: 20px;
  left: 20px;
  color: white;
  font-family: inherit;
  font-size: 18px;
  font-weight: bold;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
  opacity: 1;
  /*transform: translateY(10px);*/
  transition: all 0.4s ease 0.5s;
  z-index: 2;
  text-transform: uppercase;
}

.option.active .option-text {
  opacity: 1;
  transform: translateY(0);
}

.option:not(.active) {
  cursor: pointer;
  filter: saturate(0.25);
}

.option:not(.active):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.option:focus-visible {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

.option.active {
  flex-grow: var(--total-options);
  transform: none;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

/* Анимация для плавного появления */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.options {
  animation: fadeInScale 0.6s ease-out;
}

/* Адаптивность для планшетов */
@media (max-width: 1024px) {
  :root {
    --option-height: 350px;
    --option-width: 50px;
  }
  
  .option-text {
    font-size: 16px;
    bottom: 15px;
    left: 15px;
  }
}

/* Мобильные устройства (max-width: 767.98px) */
@media (max-width: 767.98px) {
  .wrapper {
    padding: 10px;
    align-items: flex-start;
  }
  
  .options {
    flex-direction: column;
    min-height: 100vh;
    min-width: auto;
    max-width: none;
    height: auto;
    gap: 8px;
  }
  
  .option {
    flex: 0 0 60px;
    width: 100%;
    transition: all 0.8s cubic-bezier(.17, .84, .44, 1);
  }
  
  .option.active {
    flex-grow: var(--total-options);
    min-height: 400px;
  }
  
  .option-text {
    font-size: 16px;
    bottom: 15px;
    left: 15px;
  }
  
  .option:not(.active):hover {
    transform: none;
    box-shadow: none;
  }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
  :root {
    --gutter: 5px;
    --radius: 1.25rem;
  }
  
  .option-text {
    font-size: 14px;
    bottom: 12px;
    left: 12px;
  }
  
  .option.active {
    min-height: 300px;
  }
}

/* Поддержка reduced-motion для доступности */
@media (prefers-reduced-motion: reduce) {
  .option,
  .option-text,
  .options {
    transition-duration: 0.1s;
    animation: none;
  }
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a;
  }
  
  body {
    background-color: var(--bg);
  }
  
  .option {
    background-color: color-mix(in srgb, var(--bg), white 5%);
  }
}

/* Поддержка старых браузеров */
@supports not (background-color: color-mix(in srgb, var(--bg), CanvasText 10%)) {
  .option {
    background-color: rgba(0, 0, 0, 0.1);
  }
}