/* Clip Screen */
.screen-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.screen {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 380px;
    min-height: 640px;
    border-radius: 8px;
    background-color: #282828;
    overflow: hidden;
}

#video {
    display: none;
    width: 380px;
    min-height: 640px;
}

#canvas {
    width: 380px;
    min-height: 640px;
}

/* Media Query for Phones */
@media screen and (max-width: 767px) and (orientation: portrait) {
    .screen,
    #canvas {
        width: 100%;
        height: 100vh;
    }
}

.overlay,
.bottommenu {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    width: 100%;
}

.overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.9rem;
    color: #fff;
}

.overlay.is-active {
    background-color: rgb(0,0,0, 0.3);
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.5));
}

.close-screen,
.bottommenu-open {
    position: absolute; 
    top: 12px;
    left: 12px;
    border: none;
    font-size: 2rem;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.4));
}

.bottommenu-open {
    left: auto;
    right: 16px;
}

/* Countdown */
.countdown-circle {
    display: none;
    position: absolute;
    top: 12px;
    left: 50%;
    width: 52px;
    height: 52px;
    margin-left: -26px;
}

.countdown-circle.is-active {
    display: block;
}

.countdown-circle span {
    display: block;
    position: absolute;
    width: 24px;
    top: 50%;
    left: 50%;
    margin-top: -12px;
    margin-left: -12px;
    text-align: center;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.4));
}

.countdown-circle svg {
  transform: rotate(-90deg); 
}

.countdown-background,
.countdown-progress {
    fill: none;
    stroke-width: 10;
}

.countdown-background {
    stroke: #eee;
}

.countdown-progress {
    stroke: #4caf50;
    stroke-dasharray: 282.6;
    stroke-dashoffset: 282.6;
    transition: stroke-dashoffset 0.3s ease;
}

/* Recrod Button */
.record-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    bottom: 0;
    height: 80px;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.4);
}

.record {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: #ff4840;
    border: none;
}

.record>div {
    color: #fff;
    font-size: 1.3rem;
    transform: translateY(1px);
}

/* Backgrounds */
.bottommenu {
    visibility: hidden;
}

.bottommenu.is-active {
    visibility: visible;
}

.bottom-overlay {
    height: 100%;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.4);
}

.bottom-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    position: absolute;
    padding: 8px 16px;
    bottom: 0;
    height: 244px;
    border-radius: 8px;
    background-color: #222;
    overflow-y: auto;
    transform: translateY(4px);
    transition: transform 0.3s;
}

.bottommenu.is-active .bottom-content {
    transform: translateY(0);
}

.backgrounds {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
    width: 100%;
}

.background {
    flex-shrink: 0;
    border: none;
    height: 72px;
    width: 72px;
}

.background img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}