*{
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

html,
body {
    min-height: 100%;
}

.main{
    background-color: #020b32;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: auto;
    padding: clamp(16px, 3vw, 40px);
}

.main::before {
    background-image: url("../assets/background-blue.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    content: "";
    aspect-ratio: 9 / 16;
    height: max(100vw, 177.78vh);
    height: max(100vw, 177.78dvh);
    left: 50%;
    pointer-events: none;
    position: fixed;
    top: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center;
    z-index: 0;
}

.main > * {
    position: relative;
    z-index: 1;
}

.sound-gate {
    align-items: center;
    background: rgba(2, 8, 35, 0.76);
    display: flex;
    inset: 0;
    justify-content: center;
    position: fixed;
    z-index: 10000;
}

.sound-gate-hidden {
    display: none;
}

.sound-gate-button {
    background-color: #2f7df6;
    border: 5px #9ec5ff solid;
    border-radius: 16px;
    color: aliceblue;
    cursor: pointer;
    font-size: clamp(2rem, 5vw, 4.5rem);
    font-weight: bold;
    padding: 28px 46px;
    max-width: min(92vw, 680px);
    text-transform: uppercase;
}

.question-grid {
    animation: board-enter 520ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
    display: grid;
    gap: 28px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(1250px, 92vw);
}

.quest{
    background: rgba(10, 42, 130, 0.28);
    color: #f8fbff;
    border-radius: 20px;
    font-weight: bold;
    font-size: clamp(5rem, 13vw, 15rem);
    min-height: clamp(180px, 26vh, 300px);
    align-items: center;
    align-content: center;
    justify-content: center;
    display: flex;
    isolation: isolate;
    overflow: hidden;
    position: relative;
    text-align: center;
    text-shadow: 0 8px 28px rgba(0, 0, 0, 0.42);
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;

    border: 2px solid rgba(210, 230, 255, 0.68);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        inset 0 -28px 52px rgba(23, 73, 190, 0.2);
}

.quest::before {
    -webkit-backdrop-filter: blur(22px) saturate(1.25);
    backdrop-filter: blur(22px) saturate(1.25);
    background: linear-gradient(145deg, rgba(75, 137, 255, 0.42), rgba(3, 18, 73, 0.52));
    border-radius: inherit;
    content: "";
    inset: 0;
    position: absolute;
    z-index: -1;
}

.quest::after {
    background: radial-gradient(circle at 30% 15%, rgba(255, 255, 255, 0.34), transparent 34%);
    content: "";
    inset: 0;
    opacity: 0.7;
    position: absolute;
    z-index: -1;
}

.quest-respondida{
    background: linear-gradient(145deg, rgba(3, 11, 38, 0.68), rgba(8, 24, 72, 0.72));
    border-color: rgba(105, 144, 220, 0.34);
    color: rgba(170, 195, 245, 0.38);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);

}
.quest:hover{
  transform: scale(1.08);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(89, 155, 255, 0.28));
  border-color: rgba(245, 250, 255, 0.9);
  box-shadow:
      0 28px 70px rgba(0, 0, 0, 0.4),
      0 0 0 6px rgba(125, 211, 252, 0.14),
      inset 0 1px 0 rgba(255, 255, 255, 0.68),
      inset 0 -28px 52px rgba(23, 73, 190, 0.24);
  cursor: pointer;
}

.quest:active {
  transform: scale(0.98);
}

.modal-header{
    background-color: #04134a;
    border-bottom: 1px solid #2c66d3;
    color: #f8fbff;

}

.modal-xl {
    max-width: 95vw;
}

.modal-content {
    max-height: 95vh;
    max-height: 95dvh;
    min-height: 95vh;
    min-height: 95dvh;
    overflow: hidden;
}

.modal-header .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
    opacity: 1;
}

.modal-header .btn-close:focus {
    box-shadow: 0 0 0 0.25rem rgba(158, 197, 255, 0.45);
}

.modal-body{
    background-color: #020b32;
    color: #f8fbff;
    font-weight: bold;
    font-size: clamp(2rem, 5vw, 4rem);
    padding: clamp(20px, 4vw, 50px);

    align-items: center;
    align-content: center;
    justify-content: center;
    display: flex;
    min-height: calc(95vh - 64px);
    overflow: auto;
}

.question-content {
    display: grid;
    gap: 28px;
    justify-items: center;
    text-align: center;
    width: 100%;
}

.question-content p {
    margin: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.question-content img {
    border-radius: 12px;
    max-height: 70vh;
    max-width: 100%;
    object-fit: contain;
}

.question-content audio {
    max-width: 720px;
    width: 100%;
}

@media (max-width: 900px) {
    .question-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: min(680px, 92vw);
        gap: 18px;
    }

    .quest {
        min-height: 180px;
    }

    .modal-body {
        font-size: 36px;
    }
}

@media (max-width: 560px) {
    .main {
        align-items: flex-start;
        padding-top: 24px;
    }

    .question-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        width: min(360px, 92vw);
    }

    .quest {
        border-width: 1px;
        border-radius: 14px;
        min-height: 120px;
    }

    .modal-xl {
        max-width: 100vw;
    }

    .modal-dialog {
        margin: 0;
    }

    .modal-content {
        border-radius: 0;
        min-height: 100vh;
        min-height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
    }

    .modal-body {
        min-height: calc(100vh - 64px);
        min-height: calc(100dvh - 64px);
    }

    .question-content img {
        max-height: 56vh;
    }
}

@keyframes board-enter {
    from {
        opacity: 0;
        transform: translateY(28px) scale(0.94);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .quest {
        animation: none;
        transition: none;
    }

    .quest:hover,
    .quest:active {
        transform: none;
    }

}
