* {
  box-sizing: border-box;
}

html {
  min-height: 100vh;
}

body {
  min-height: 100vh;
  padding: 0;
  margin: 0;
  background: #f5f5f5;
  font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(100%);
  height: 1px;
  width: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
}

.layout {
  width: 100%;
  height: 100%;
  display: flex;
}

.game {
  background: #444857;
  box-shadow: 2px 6px 20px 0 #616161;
  display: flex;
  justify-content: space-between;
  overflow: hidden;
  padding: 0 4px;
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: min-content;
  margin: 0 auto;
  flex-wrap: wrap;
}
.game__controls {
  display: flex;
  flex-direction: column-reverse;
  min-width: 280px;
  padding: 16px 12px;
  gap: 12px;
}
.game__screen {
  min-width: 320px;
  display: flex;
  gap: 8px;
  flex-direction: column;
  flex-shrink: 0;
  justify-content: center;
  padding: 16px 12px;
  flex-grow: 1;
}

.game-section {
  display: block;
  overflow: hidden;
  background: #3f3b3c;
  background: linear-gradient(
    156deg,
    rgba(63, 59, 60, 1) 17%,
    rgba(66, 66, 75, 1) 94%,
    rgba(68, 72, 87, 1) 100%
  );
  border-radius: 8px;
  border: 2px solid black;
  padding: 16px 20px;
}

.game-generation {
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
}

.game-title {
  font-size: 24px;
  margin: 0;
  color: rgb(238, 174, 202);
  background: linear-gradient(36deg, #f4aeb8 10%, #fe938b 70%, #f4aeb8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.game-screen {
  position: relative;
  display: flex;
  justify-content: center;
  flex: 1;
  border-radius: 8px;
  aspect-ratio: 1 / 1;
}
.game-background,
.game-layer {
  position: absolute;
  border-radius: 8px;
  border: 2px solid black;
}

.game-background {
  z-index: 1;
}
.game-layer {
  z-index: 2;
}

.game-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.game-control__title {
  font-size: 18px;
  margin: 0;
  color: rgb(238, 174, 202);
  background: linear-gradient(72deg, #f4aeb8 5%, #fe938b 30%, #f4aeb8 95%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.game-control__input {
  width: 100px;
  height: 32px;
}

.game-generation__description {
  line-height: 1.25;
  padding: 0;
  margin-top: 0;
  color: rgb(238, 174, 202);
  background: linear-gradient(72deg, #f4aeb8 5%, #fe938b 30%, #f4aeb8 95%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.game-generation__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.game-control-input {
  padding: 6px;
  font-size: 16px;
  border-radius: 6px;
  background: rgba(68, 72, 87, 0.6);
  color: rgb(238, 174, 202);
}

.game-stats {
  color: rgb(238, 174, 202);
  background: linear-gradient(72deg, #f4aeb8 5%, #fe938b 30%, #f4aeb8 95%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  justify-content: space-between;
}
.game-stats:first-of-type {
  margin-top: 0;
}
.game-stats:last-of-type {
  margin-bottom: 0;
}

.game-stats__value {
  color: #19c0e6;
  font-weight: 400;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: initial;
}
.ctrl-btn {
  border-radius: 6px;
  text-transform: uppercase;
  padding: 8px 20px;
  font-weight: 700;
  color: #fff;
  background: #82738c;
  border: 0;
  font-size: 16px;
  letter-spacing: 1.3px;
}
.ctrl-btn--full-width {
  width: 100%;
}
.ctrl-btn--start {
  font-size: 24px;
  border-radius: 8px;
  padding: 12px 24px;
  background: #5998a6;
  color: #fff;
  letter-spacing: 1.5px;
}
.ctrl-btn--stop {
  font-size: 24px;
  padding: 12px 24px;
  border-radius: 8px;
  background: #996666;
  color: #fff;
  letter-spacing: 1.5px;
}
.ctrl-btn--reset {
}

@media screen and (min-width: 768px) {
  .layout {
    padding: 10px;
  }
  .game {
    border-radius: 16px;
    flex-grow: 0;
    flex-wrap: nowrap;
    flex-shrink: 0;
    flex-basis: fit-content;
  }
  .game__screen {
    aspect-ratio: 1 / 1;
  }
  .game-screen {
    aspect-ratio: auto;
  }
  .game__controls {
    flex-direction: column;
    flex-basis: min-content;
  }
  .game-generation {
    display: block;
  }
}
