*, *::before, *::after {
    box-sizing: border-box;
    font-family: Gotham Rounded, sans-serif;
    font-weight: normal;
}
.bgBlack {
    padding: 0;
    margin: 0;
    background-color: #000;
}
.calculator-grid {
    display: grid;
    justify-content: center;
    align-content: center;
    min-height: 100vh;
    grid-template-columns: repeat(4, 80px);
    grid-template-rows: minmax(280px, auto) repeat(6, 70px);
    position: relative;
    z-index: 1111;
}
.calculator-grid::before {
    content: "";
    background-image: url('./img/phoneBG.png');
    width: 700px;
    height: 820px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-350px, -410px);   
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
}
.calculator-grid > button {
    cursor: pointer;
    font-size: 2rem;
    border-radius: 50px;
    margin: 5px;    
    border: none;
    outline: none;
    color: #fff;
    transition-duration: .2s;
    transition-delay: .1s;
    z-index: 1111;
}
.span-two {
    grid-column: span 2;
}
.output {
    grid-column: 1 / -1;
    background-color: transparent;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    flex-direction: column;
    padding: 10px;
    word-wrap: break-word;
    word-break: break-all;
    z-index: 1111;
}
.output .previous-operand {
    color: rgba(255, 255, 255, .75);
    font-size: 1.5rem;
}
.output .current-operand {
    color: white;
    font-size: 3.5rem;
}
.calculator-grid .color-number {
    background-color: #303030;
}
.calculator-grid .color-number:hover {
    background-color: rgba(168,168,168, .75);
}
.calculator-grid .color-operation {
    background-color: #ff9701;
}
.calculator-grid .color-operation:hover {
    background-color: rgba(255, 216, 162, 0.877);
}
.calculator-grid .color-clear {
    background-color: #a8a8a8;
    color: #000;
}
.calculator-grid .color-clear:hover {
    background-color: rgba(255, 255, 255, .9);
}
.column-span {
    grid-column: span 2;
}
.row-span {
    grid-row: span 2;
}
.active {
    background-color: #fff;
}
.output--active {
    background-color: transparent;
}
.calculator-grid .clr-oper-active {
    background-color: #f5210b;
    color: #000;
}
.calculator-grid .clr-oper-active:hover {
    background-color: rgba(255, 104, 87, 0.877);
}
.calculator-grid .clr-clear-active:hover {
    background-color: rgba(165, 165, 165, 0.7);
}
.calculator-grid .clr-number-active:hover {
    background-color: rgba(51,51,51, .73);
    background-color: rgba(165, 165, 165, 0.7);
}
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(41, 41, 41, 0.6);
}
.modal__wrap {
    background-color: rgba(41, 41, 41, 0);
    max-width: 852px;
    width: 90%;
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.modal__content {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    bottom: 0;
    max-width: 800px;
    width: 100%;
    background-color: #fefefe;
    border: 1px solid #888;
    animation: scale-in-center 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    padding: 15px;
    overflow: hidden;
    border-radius: 9px;
    transition-duration: .5s;
}
.modal__content:hover {
    box-shadow: 0px 2px 35px 14px rgba(13, 13, 13, 0.04);
}
.modal__title {
    font-size: 35px;
    letter-spacing: 1px;
    margin-top: 0;
    margin-bottom: 0;
    color: #f5210b;
}
.modal__text {
    font-size: 20px;
    letter-spacing: 1px;
    line-height: 26px;
    margin-top: 0;
    margin-bottom: 0;
    color: #303030;
}
.modal__close {
    width: 52px;
    height: 52px;
    color: #fff;
    font-size: 36px;
    padding: 1px 16px;
    right: 0;
    top: 50%;
    transform: translateY(-150px);
    position: absolute;
    border: 2px solid #ff9701;
    border-radius: 50%;
    cursor: pointer;
    transition-duration: .5s;
}
.modal__close:hover {
    background-color: #ff9701;
}
.modal__close:hover,
.modal__close:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

@media (max-width: 781px) {
    .modal__close {
        right: -35px;
        transform: translateY(-190px);
    }
}
@media (max-width: 698px) {
    .calculator-grid::before {
        width: 90%;
        transform: translate(-50%, -410px);
    }
}
@media (max-width: 665px) {
    .modal__close {
        right: -30px;
        transform: translateY(-220px);
    }
}
@media (max-width: 605px) {
    .modal__close {
        right: -25px;
        transform: translateY(-220px);
    }
}
@media (max-width: 455px) {
    .calculator-grid {
        grid-template-columns: repeat(4, 19%);
        grid-template-rows: minmax(35%, auto) repeat(6, 7%);
    }
}
@media (max-width: 415px) {
    .modal__close {
        right: -15px;
        transform: translateY(-260px);
    }
}
@media (max-width: 385px) {
    .calculator-grid {
        grid-template-rows: minmax(35%, auto) repeat(2, 7%);
    }
}
@media (max-width: 355px) {
    .calculator-grid {
        grid-template-rows: minmax(25%, auto) repeat(6, 7%);
    }
}