/* CSS file for app.html styling */
/* General styles */
body {
    margin: 0;
    font-family: 'Helvetica', sans-serif;
    color: #333;
    padding-top: 120px;
    /* Found here: https://doka-guide.vercel.app/css/linear-gradient/ */
    background: linear-gradient(270deg, #9494cf, #a0d2e8, #dad98e);
    background-size: 600% 600%;
    animation: gradientBG 15s ease infinite;
}
/* I use this as a reference: https://code.mu/ru/markup/article/infinite-gradient-animation/#
and this: https://codeconvey.com/css-background-linear-gradient-animation/ */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@media screen and (max-width: 600px) {
    body {
        padding-top: 100px;
    }
}

.hidden {
    display: none !important;
}

section {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(42, 22, 154, 0.08);
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 28px;
    box-sizing: border-box;
}

/* Header styles */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    padding: 0 20px;
    background: linear-gradient(270deg, #2A169A, #4786fc, #2A169A);
    background-size: 600% 600%;
    animation: gradientShift 12s ease infinite;
    /* All box-shadows was generated with this website: https://active-vision.ru/icon/box-shadow/ */
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    z-index: 1000;
    overflow: hidden;
}

.app-header-content {
    width: 55%;
    margin-left: auto;
    align-content: center;

}
/* Found here: https://1stwebdesigner.com/how-to-animate-gradient-text-using-css/ */
@keyframes gradientShift {
    0% {background-position: 0% 50%;}
    50% {background-position: 100% 50%;}
    100% {background-position: 0% 50%;}
}

.app-header img {
    max-width: 400px;
    height: auto;
}

/* Player & Score Card  */
.session-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 900px;
    margin: 30px auto -50px auto;
    padding: 16px 28px;
    box-sizing: border-box;
    font-weight: 700;
    font-size: 18px;
    color: #1B1B1B;
    text-align: center;
    background: linear-gradient(135deg, #A7FC47, #7FD62E);
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    opacity: 0;
    transform: translateY(-10px);
    animation: fadeInSlide 0.8s forwards;
    z-index: 100;
    position: relative;
}

.session-info-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.session-info.show {
    animation: fadeDown 0.4s ease;
}
/* Use as a reference - https://stackoverflow.com/questions/57392817/how-to-add-animations-that-include-a-scroll-in-the-middle-of-the-page-after-2-se */
@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.player-name, .current-score {
    font-size: 20px;
    /* All rgba were created here: https://www.w3schools.com/colors/colors_rgb.asp */
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    padding: 8px 16px;
    border-radius: 12px;
    transition: transform 0.3s ease, background 0.3s ease;
    cursor: default;
}

.player-name:hover, .current-score:hover {
    transform: scale(1.05);
    background: rgba(255,255,255,0.15);
}

.player-name {
    background: rgba(255,255,255,0.2);
    color: #1B1B1B;
}

.current-score {
    background: rgba(255,255,255,0.25);
    color: #0F3D00;
}

@keyframes fadeInSlide {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media screen and (max-width: 600px) {
    .session-info {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 12px 16px;
        width: 100%;
        /* https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/calc */
        max-width: calc(100% - 32px);
        margin: 16px auto 0 auto;
    }

    .player-name, .current-score {
        width: auto;
        font-size: 14px;
        padding: 4px 8px;
    }
}

/* Main App Layout */
.app-main {
    padding: 10px 28px;
    max-width: 1000px;
    margin: 50px auto 48px auto;
}

/* App Sections */
.app-section {
    align-items: center;
    display: none;
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(42, 22, 154, 0.15), 0 4px 15px rgba(0,0,0,0.1);
    opacity: 0;
    transform: translateY(10px);
    animation: fadeUpSection 0.6s forwards;
    width: 100%;
    margin: 20px 0;
    padding: 30px;
}

.app-section.active {
    display: block;
}
/* https://purpleschool.ru/knowledge-base/css/directives/keyframes */
@keyframes fadeUpSection {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section headers */
.app-section h2,
.app-section h3 {
    color: #2A169A;
    font-weight: 700;
    margin-bottom: 12px;
}
.welcome-title {
    color: #2A169A;
    font-size: 28px;
    margin-bottom: 30px;
    position: relative;
    padding-left: 14px;
}

.welcome-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: -4px;
    width: 4px;
    height: calc(100% + 8px);
    background-color: #A7FC47;
    border-radius: 2px;
}

/* Paragraphs */
.app-section p {
    font-size: 22px;
    line-height: 1.5;
    margin-bottom: 20px;
    margin-top: 40px;
}

/* Input fields */
.app-input {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    margin-bottom: 12px;
    font-size: 16px;
    border: 2px solid #2A169A;
    border-radius: 8px;
    box-sizing: border-box;
}
.input-group,
.hunt-list {
    margin-bottom: 24px;
}
.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #2A169A;
    font-size: 20px;
    font-weight: 700;
}

/* Buttons */
.app-btn {
    cursor: pointer;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 16px;
    transition: transform 0.15s ease, background 0.25s ease;
}

.app-btn:active {
    transform: scale(0.97);
}

.app-btn-primary {
    background-color: #A7FC47;
    color: #2A169A;
    box-shadow: 0 4px 0 #7FD62E;
}

.app-btn-primary:active {
    box-shadow: 0 2px 0 #7FD62E;
}

.app-btn-secondary {
    background-color: #2A169A;
    color: #A7FC47;
    box-shadow: 0 4px 0 #1e0f7a;
}

.app-btn-secondary:active {
    box-shadow: 0 2px 0 #1e0f7a;
}

.app-btn:disabled {
    background-color: #c8c8c8;
    color: #7a7a7a;
    box-shadow: 0 4px 0 #0a0a0a;
    cursor: not-allowed;
    opacity: 0.7;
}

.app-btn:disabled:active {
    transform: none;
    box-shadow: 0 4px 0 #0a0a0a;
}

#skipQuestionBtn:disabled {
    background-color: #1a0e6a;
    color: rgba(167, 252, 71, 0.4);
    box-shadow: 0 4px 0 #0f0840;
    cursor: not-allowed;
    opacity: 0.7;
}

.app-btn-home {
    background: rgba(255, 255, 255, 0.08);
    color: #A7FC47;
    border: 1px solid rgba(167, 252, 71, 0.35);
    margin-right: 3%;
}

/* Input groups */
.input-group {
    display: flex;
    flex-direction: column;
}

/* Hunt list */
.hunt-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 16px;
}
.hunt-card {
    background: #F6F4FB;
    border-radius: 18px;
    padding: 18px;
    border: 2px solid #D0D0D0;
    box-shadow: 0 6px 14px rgba(42, 22, 154, 0.10);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition:
            transform 0.25s ease,
            box-shadow 0.25s ease,
            border-color 0.25s ease;
    position: relative;
    overflow: hidden;

}
.hunt-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 6px;
    width: 100%;
    background: linear-gradient(90deg, #A7FC47, #7FD62E);
    box-shadow: 0 2px 6px rgba(167, 252, 71, 0.6);
}

.hunt-card::after {
    content: "TREASURE HUNT";
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #2A169A;
    background: rgba(42, 22, 154, 0.08);
    padding: 4px 8px;
    border-radius: 8px;
}
.hunt-card-content {
    margin-bottom: 16px;
}
.hunt-title {
    font-size: 20px;
    font-weight: 900;
    color: #2A169A;
    margin-bottom: 8px;
    line-height: 1.2;
}
/* !important rule - https://medium.com/@visualmodo/understanding-important-css-rules-f5fcd2adbbfd */
.hunt-description {
    font-size: 16px !important;
    line-height: 1.2;
    font-weight: 400;
    color: #888;
}
.hunt-btn {
    align-self: stretch;
    margin-top: auto;
}
@media screen and (max-width: 600px) {
    .hunt-title {
        font-size: 18px;
    }

    .hunt-description {
        font-size: 12px;
    }
    .app-section p{
        font-size: 18px;
    }
}

.loading-text {
    font-style: italic;
    color: #555;
}
@media screen and (max-width: 400px) {
    .hunt-list {
        grid-template-columns: 1fr;
    }
}

/* Question section */

.question-points {
    font-weight: 700;
    color: #A7FC47;
}

/* Answer area */
.answer-area {
    margin-bottom: 12px;
}

/* Button group */
.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Results section */
.leaderboard-section {
    background: #f0f0f0;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    text-align: center;
}
.leaderboard-modal .modal-content {
    overflow-y: auto;
    overflow-x: hidden;
}

.leaderboard-display p {
    margin: 6px 0;
}
.leaderboard-display {
    overflow-y: auto;
    overflow-x: hidden;
}


/* Error section */
.error-text {
    color: #d8000c;
}
#leaderboardBtn {
    padding: 8px 14px;
    width: auto !important;
    height: auto;
    border-radius: 10px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}
/* Mobile-friendly */
@media screen and (max-width: 600px) {
    .app-main {
        padding: 0 12px;
        margin-top: 20px;

    }

    .app-btn {
        width: 100%;
    }

    .button-group {
        flex-direction: column;
    }

    .input-group input {
        font-size: 14px;
    }

    .final-score-number {
        font-size: 28px;
    }
}

@media screen and (max-width: 600px) {
    .app-header {
        position: fixed;
        height: 100px;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .app-header-content {
        width: 100%;
        margin: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .app-header img {
        max-width: 230px;
        display: block;
    }

    #leaderboardBtn {
        padding: 8px 12px;
        font-size: 14px;
    }

    .app-section {
        margin: 16px auto 16px auto;
        padding: 10px;
        border-radius: 14px;
        box-sizing: border-box;
        max-width: calc(100% - 8px);
    }

    .app-container {
        padding: 0 16px 0 16px;
    }
}

@media screen and (max-width: 600px) {
    .app-btn {
        width: 100%;
        padding: 10px 14px;
    }
    .app-btn-home{
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        width: auto;

        padding: 8px 12px;
        font-size: 14px;
        margin: 0;
    }
    .input-group input {
        font-size: 14px;

    }
    .app-input {
        padding: 8px;
    }
}

/* animation */
.fly-in {
    opacity: 0;
    transform: translateX(-60px);
}

.fly-in.show {
    animation: flyInLeft 0.6s ease-out forwards;
}

@keyframes flyInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

input[type="text"]{
    padding: 10px;
    margin: 5px;
    font-size: 16px;
    border: 2px solid black;
}

/* Loading overlay */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
}

#loadingOverlay.hidden {
    display: none;
}

.loading-spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #2A169A;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}
/*keyframes spin was found here: https://frontendhack.com/css/css-spin-animation/ */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loadingOverlay p {
    font-size: 18px;
    color: #2A169A;
    font-weight: bold;
}

/* Question Card */
#questionContainer {
    background: white;
    border-radius: 16px;
    padding: 16px 16px;
    box-shadow: 0 6px 18px rgba(42, 22, 154, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 1000px;
    margin: 20px auto 0 auto;
    box-sizing: border-box;
    border: 2px solid #D0D0D0;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUpMobile 0.4s forwards;
}
#question-section {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

/* Question Header */
.question-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    width: 100%;
}

.question-progress {
    font-size: 12px;
    color: #525252;
    text-align: left;
    white-space: normal;
    margin-top: 5px;
    min-width: 0;
    word-break: break-word;
}

.question-type-badge {
    background: #A7FC47;
    color: #2A169A;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 10px;
    white-space: nowrap;
    text-align: right;
}
#questionTitle {
    font-size: 20px;
    font-weight: 700;
    color: #2A169A;
    text-align: center;
    margin-top: 8px;
    margin-bottom: 10px;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(-10px);
    animation: fadeInDown 0.5s forwards;
}
@keyframes fadeInDown {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Question text */
#questionText {
    font-size: 18px;
    color: #1B1B1B;
    margin-bottom: 8px;
    line-height: 1.5;
    position: relative;
    padding-left: 12px;
}
#questionText::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background-color: #A7FC47;
    border-radius: 2px;
}

/* Skip & Location Info */
.skip-info,
.location-info {
    font-size: 14px;
    color: #888;
    margin-top: 8px;
    margin-bottom: 10px;
}

/*location notice*/
.location-notice {
    font-size: 13px;
    color: #2A169A;
    background: rgba(167, 252, 71, 0.15);
    border-left: 3px solid #A7FC47;
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 4px;
    margin-bottom: 10px;
}

/* Feedback message */
.feedback-message {
    font-weight: 700;
    padding: 8px;
    border-radius: 12px;
    margin-bottom: 10px;
    text-align: center;
    color: #d8000c;
}

.feedback-message.success {
    background: rgba(167, 252, 71, 0.2);
    color: #2A5500;
}

.feedback-message.error {
    background: rgba(255, 0, 0, 0.08);
    color: #d8000c;
}

/* Answer input field */
#answerInput {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px;
    border-radius: 12px;
    border: 2px solid #2A169A;
    outline: none;
    box-shadow: 0 3px 6px rgba(42, 22, 154, 0.08);
    transition: all 0.25s ease;
    margin-bottom: 12px;
}

#answerInput:focus {
    border-color: #A7FC47;
    box-shadow: 0 4px 10px rgba(167, 252, 71, 0.3);
}

/* Dropdowns for MCQ and BOOLEAN */
#answerInput.app-input {
    appearance: none;
    background: white url('data:image/svg+xml;charset=US-ASCII,<svg fill="%232A169A" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat right 10px center;
    background-size: 16px;
    padding-right: 36px;
}

/* https://www.w3schools.com/cssref/atrule_keyframes.php */
@keyframes fadeInUpMobile {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.button-group button {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    border-radius: 10px;
    padding: 12px 20px;
    transition: transform 0.15s ease, box-shadow 0.25s ease;
}

.button-group button:active {
    transform: scale(0.97);
}

/* Submit / Skip buttons */
#submitAnswerBtn {
    background-color: #A7FC47;
    color: #2A169A;
    box-shadow: 0 4px 0 #7FD62E;
}

#submitAnswerBtn:active {
    box-shadow: 0 2px 0 #7FD62E;
}

#skipQuestionBtn {
    background-color: #2A169A;
    color: #A7FC47;
    box-shadow: 0 4px 0 #1e0f7a;
}

#skipQuestionBtn:active {
    box-shadow: 0 2px 0 #1e0f7a;
}

@media screen and (max-width: 600px) {
    .question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        margin-bottom: 8px;
        justify-content: space-between;
    }
    .question-progress {
        font-size: 11px;
    }

    .question-type-badge {
        align-self: flex-end;
    }

    #questionTitle {
        font-size: 24px;
        margin-top: 10px;
        margin-bottom: 14px;
    }

    #questionText {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .skip-info,
    .location-info {
        font-size: 13px;
        margin-top: 6px;
        margin-bottom: 8px;
    }
}
/* Location */

.location-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #F6F4FB, #FFFFFF);
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: 0 6px 16px rgba(42, 22, 154, 0.12);
    border: 1px solid #E0E0E0;
    font-size: 14px;
    font-weight: 600;
    color: #2A169A;
    transition: all 0.3s ease;
}

#locationIcon {
    font-size: 18px;
}

#locationText {
    flex: 1;
}
.location-wrapper {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding-left: 28px;
    padding-right: 28px;
    padding-bottom: 36px;
    box-sizing: border-box;
}

.location-status.show {
    animation: slideFadeIn 0.4s ease forwards;
}

@keyframes slideFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.location-update {
    position: absolute;
    top: 60px;
    right: 28px;
    background: #2A169A;
    color: #A7FC47;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(42, 22, 154, 0.3);
    z-index: 10;
    opacity: 1;
    transition: opacity 0.4s ease;
    white-space: nowrap;
}

.location-update.fading {
    opacity: 0;
}


/* Leaderboard Modal */
.leaderboard-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.leaderboard-modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    box-shadow: 0 8px 20px rgba(42, 22, 154, 0.3);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: #2A169A;
    margin: 0;
    font-size: 24px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #2A169A;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.close-btn:hover {
    background: rgba(42, 22, 154, 0.1);
}

/* Leaderboard Display */
.leaderboard-display {
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: #F6F4FB;
    border-radius: 12px;
    border: 1px solid #D0D0D0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.leaderboard-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 22, 154, 0.1);
}

.leaderboard-rank {
    font-weight: bold;
    color: #2A169A;
    font-size: 18px;
    min-width: 40px;
}

.leaderboard-name {
    flex: 1;
    text-align: center;
    font-weight: 600;
    color: #333;
}

.leaderboard-score {
    font-weight: bold;
    color: #088948;
    flex-shrink: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.loading-text {
    text-align: center;
    color: #888;
    font-style: italic;
}
/* Final Leaderboard */
#results-section .app-container {
    max-width: 100%;
    padding: 0 10px;
}
.leaderboard-section {
    background: transparent;
    padding: 0;
    margin-top: 20px;
}
#resultsLeaderboard .leaderboard-row {
    width: 100%;
    max-width: 700px;
    margin: 0 auto 10px auto;
    gap: 12px;
    justify-content: flex-start;
    padding: 16px 18px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, #F6F4FB, #FFFFFF);
    box-shadow: 0 6px 16px rgba(42, 22, 154, 0.12);
    font-size: 18px;
}
.hunt-complete-banner {
    text-align: center;
    font-size: 26px;
    font-weight: 900;
    color: white;

    background: linear-gradient(135deg, #2A169A, #4786fc);
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 20px;
    box-shadow: 0 6px 16px rgba(42, 22, 154, 0.25);
}
@media screen and (max-width: 600px) {
    #resultsLeaderboard .leaderboard-row {
        font-size: 16px;
        padding: 8px;
    }

    .leaderboard-name {
        font-size: 15px;
    }
    .hunt-complete-banner {
        font-size: 16px;
        font-weight: 700;
    }
}

/* option buttons */
.answer-options {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.option-btn {
    flex: 1;
    min-width: 90px;
    padding: 16px;
    font-size: 18px;
    font-weight: 800;
    margin-top: 20px;
    border-radius: 16px;
    border: none;
    color: white;

    background: linear-gradient(135deg, #2A169A, #4786fc);
    box-shadow: 0 6px 16px rgba(42, 22, 154, 0.25);
    cursor: pointer;
    transition: all 0.25s ease;
}

.option-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 22px rgba(42, 22, 154, 0.35);
}

.option-btn:active {
    transform: scale(0.95);
}

.option-btn.selected {
    background: linear-gradient(135deg, #A7FC47, #7FD62E);
    color: #2A169A;
    box-shadow: 0 6px 18px rgba(167, 252, 71, 0.5);
    transform: scale(1.05);
}

/* MCQ */
.mcq-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
/* QR code */
/* filter generator: https://color-to-filter.vercel.app/ */
#qr-icon img{
    filter: invert(1);
}
#qr-icon {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: 20px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #A7FC47, #7FD62E);
    box-shadow: 0 6px 18px rgba(167, 252, 71, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 1100;
}
#qr-icon:active {
    transform: scale(0.9);
}

#qr-icon:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 25px rgba(167, 252, 71, 0.9);
}

#qr-icon::after {
    content: "Scan";
    position: absolute;
    bottom: 75px;
    background: #2A169A;
    color: white;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    opacity: 0;
    transition: 0.2s;
}

#qr-icon:hover::after {
    opacity: 1;
}
/* QR camera */
.qr-frame {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 3px solid #A7FC47;
    box-shadow: 0 0 20px rgba(167, 252, 71, 0.4);
    width: 100%;
    aspect-ratio: 4 / 3;
}

.qr-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.qr-modal-header h3{
    text-align: center;
    font-size: 18px;
    color: #ffffff;
    margin-bottom: 10px;
}
.qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.qr-modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.qr-modal-content {
    background: white;
    border-radius: 16px;
    padding: 20px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 8px 20px rgba(42, 22, 154, 0.3);
    position: relative;
}

.qr-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.qr-modal-header h3 {
    color: #2A169A;
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}
.qr-message {
    text-align: center;
    color: #d8000c;
    font-weight: 600;
    font-size: 15px;
    padding: 40px 20px;
    margin: 0;
    background: rgba(255, 0, 0, 0.05);
    border-radius: 12px;
}
.qr-camera-controls {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.qr-camera-controls .app-btn {
    flex: 1;
}

/* Mobile */
@media screen and (max-width: 600px) {
    .option-btn {
        font-size: 16px;
        padding: 14px;
    }
    #shareTwitterBtn {
        margin-top: 12px;
        margin-bottom: 12px;
    }
    #playAgainBtn {
        margin-top: 12px;
    }

}
@media screen and (max-width: 600px) {
    #qr-icon {
        width: 55px;
        height: 55px;
        bottom: calc(15px + env(safe-area-inset-bottom));
        right: 15px;
    }
    .qr-camera-controls {
        flex-direction: column;
    }
}
