/* /public/css/flowmatch.css */

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 800px;
    margin: 50px auto 0 auto !important;
    padding: 0;
    display: flex;
    flex-direction: column;
    /* margin-bottom: 70px;  or more, for spacing */
    z-index: 1;
    position: relative;
    border: 1.5px solid #c5cad7;
    box-shadow:
        0 4px 15px #dbe2ec26,
        0 1.5px 6px #aab4c622;
    border-radius: 13px;
    background: #f7f8fb;
}
.header-bar {
    width: 100%;
    background: #40536a;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
    box-shadow: 0 1px 3px #00000014;
}
.align-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.select-container {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    padding-left: 14px;
}
.select-container select {
    padding: 7px 21px 7px 11px;
    border-radius: 8px;
    font-size: 1.25em;
    border: none;
    appearance: none;
    background: #fff;
    color: #313131;
    box-shadow: 0 1px 2px #1c25311c;
    transition: outline 0.22s;
    font-weight: 500;
}
.select-container select:focus {
    outline: 2px solid #80bfff;
}
.dropdown-menu-parent {
    position: relative;
    padding-right: 14px;
}
.settings-btn {
    background: none;
    border: none;
    padding: 0 5px;
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    border-radius: 5px;
    transition: background 0.17s;
    box-shadow: none;
}
.settings-btn:hover {
    background: #536a8b36;
}
.settings-btn img {
    width: 31px;
    height: 31px;
    filter: invert(0.8);
}
.tooltip {
    display: none;
}
.topic-label {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    user-select: none;
    pointer-events: none;
    max-width: 350px;
    overflow-wrap: break-word;
    word-break: break-all;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    box-sizing: border-box;
}
@media (max-width: 800px) {
    .topic-label {
        width: 300px;
        font-size: 20px;
        margin-left: 80px;
    }
}
@media (max-width: 650px) {
    .topic-label {
        width: 200px;
        font-size: 13px;
    }
}
#study-system {
    width: 100%;
    min-height: 300px;
    margin: 0;
    background: linear-gradient(135deg, #474954 0%, #6a6b7d 100%);
    background-color: unset;
    padding: 0.5em 1em 1.5em 1em !important;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    text-align: center;
    font-size: 1.23em;
    transition: background 0.22s;
}
#word-box {
    font-size: 1.5em;
    font-weight: bold;
    margin-top: 10px;
    margin-bottom: 10px;
}
.def-option {
    box-sizing: border-box;
    cursor: pointer;
    background: #e0e0e0;
    margin: 0.9em 0;
    padding: 1.3em 1.1em;
    border-radius: 8px;
    transition: background 0.2s;
    font-size: 1.19em;
    margin-left: 10px;
    position: relative;
}
.def-option:hover {
    background: #b3b3b3;
}
.def-option.correct {
    background: #b2ffb2;
}
.def-option.correct:hover {
    background: #7cff7c;
}
.def-option.incorrect {
    background: #ffb2b2;
}
.def-option.incorrect:hover {
    background: #ff6868;
}
#result {
    font-size: 1.19em;
    margin-top: 10px;
}

.quiz-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    min-width: 280px;
    background: linear-gradient(135deg, #23272c 100%, #444950 100%);
    /* Futuristic flowy gray gradient */
    border-radius: 16px;
    margin-top: 8px;
    box-shadow:
        0 3px 24px #11161b33,
        0 1px 7px #44485022;
    z-index: 1111;
    font-size: 1.15em;
    padding-bottom: 18px;
    padding-left: 0;
    border: 1.8px solid #363a3f;
}

.quiz-dropdown-content.show {
    display: block;
    animation: dropdownIn 0.22s cubic-bezier(0.19, 1.22, 0.35, 1);
}

.settings-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.4em;
    gap: 10px;
    margin-left: 0 !important;
    justify-content: center !important;
    width: 100% !important;
    text-align: center !important;
}
.settings-row label,
.settings-row select,
.settings-row button {
    margin-left: 0 !important;
    margin-right: 0 !important;
    display: block !important;
    margin: 0 auto !important;
    text-align: center !important;
}
#question-select {
    font-size: 1em;
    border-radius: 5px;
    padding: 4px 12px 4px 8px;
}

#revisit-btn {
    padding: 13px 30px;
    font-size: 1.14em;
    border-radius: 11px;
    background: linear-gradient(96deg, #edf0f7 0%, #e0e2e7 80%);
    color: #38455a;
    box-shadow:
        0 2px 12px #a5a8b833,
        0 1.5px 6px #3643531a;
    border: 1.5px solid #b0b3bb;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition:
        background 0.15s,
        color 0.12s,
        box-shadow 0.17s;
    display: inline-block;
    box-sizing: border-box;
    vertical-align: middle;
    line-height: 1.2;
}

#revisit-btn:hover,
#revisit-btn:focus {
    background: linear-gradient(112deg, #dae0ee 0%, #cfd3d9 85%);
    color: #222;
    box-shadow:
        0 4px 18px #a5a8b859,
        0 2px 12px #36435329;
    outline: none;
    border-color: #8791a9;
}
#next-btn,
#reveal-btn,
#check-btn {
    padding: 13px 30px;
    font-size: 1.14em;
    border-radius: 11px;
    background: linear-gradient(96deg, #edf0f7 0%, #e0e2e7 80%);
    color: #38455a;
    box-shadow:
        0 2px 12px #a5a8b833,
        0 1.5px 6px #3643531a;
    border: 1.5px solid #b0b3bb;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition:
        background 0.15s,
        color 0.12s,
        box-shadow 0.17s;
    display: inline-block;
    box-sizing: border-box;
    vertical-align: middle;
    line-height: 1.2;
}

#next-btn:hover,
#next-btn:focus,
#reveal-btn:hover,
#reveal-btn:focus,
#check-btn:hover,
#check-btn:focus {
    background: linear-gradient(112deg, #dae0ee 0%, #cfd3d9 85%);
    color: #222;
    box-shadow:
        0 4px 18px #a5a8b859,
        0 2px 12px #36435329;
    outline: none;
    border-color: #8791a9;
}

#back-btn {
    padding: 13px 30px;
    font-size: 1.14em;
    border-radius: 11px;
    background: linear-gradient(96deg, #edf0f7 0%, #e0e2e7 80%);
    color: #38455a;
    box-shadow:
        0 2px 12px #a5a8b833,
        0 1.5px 6px #3643531a;
    border: 1.5px solid #b0b3bb;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition:
        background 0.15s,
        color 0.12s,
        box-shadow 0.17s;
    display: inline-block;
    box-sizing: border-box;
    vertical-align: middle;
    line-height: 1.2;
}
#back-btn:hover,
#back-btn:focus {
    background: linear-gradient(112deg, #dae0ee 0%, #cfd3d9 85%);
    color: #222;
    box-shadow:
        0 4px 18px #a5a8b859,
        0 2px 12px #36435329;
    outline: none;
    border-color: #8791a9;
}
#nav-btn-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
    margin-right: 25px;
}
@keyframes dropdownIn {
    0% {
        transform: translateY(-14px) scale(0.98);
        opacity: 0;
    }
    92% {
        opacity: 1;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}
.settings-dropdown-nice {
    padding: 12px 0 10px 0;
    background-color: #c3c3c3;
}

.settings-title {
    background: linear-gradient(97deg, #b3bbca 60%, #8d98ad 100%);
    font-size: 1.19em;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 12px 0 14px 0;
    color: #27324b;
    text-align: center;
    border-radius: 18px 18px 14px 14px;
    border-bottom: 1.5px solid #909bb0;
    margin: 0 18px 14px 18px;
    box-shadow: 0 2px 10px #a2acc233;
}

#bottom-btns button,
#bottom-btns select {
    width: 140px;
    height: 45px;
    font-size: 1.15em;
    border-radius: 8px;
    box-sizing: border-box;
    margin: 0;
    display: inline-block;
    text-align: center;
    text-align-last: center;
    -moz-text-align-last: center;
    padding: 0;
}

@media (max-width: 580px) {
    .container {
        max-width: 99vw;
    }
    .header-bar {
        font-size: 0.96em;
        height: 46px;
    }
    #study-system {
        padding: 10px;
    }
}

.audio-btn:hover svg path {
    fill: #2563eb !important;
}
.audio-btn:focus {
    outline: 2px solid #8abfff;
}

.def-option.selected {
    background: #c1d6ff;
    box-shadow: 0 0 0 2.2px #3e6ae0;
    /* No border: keeps size identical, use outline effect instead */
}
.def-option.selected:hover {
    background: #b3cfff;
    box-shadow: 0 0 0 2.2px #1e55ed;
}
/*Star*/
.star-btn-study {
    background: none;
    border: none;
    padding: 0;
    margin-left: 7px;
    cursor: pointer;
    outline: none;
    font-size: 1.08em;
    vertical-align: middle;
    line-height: 1;
}
.star-study {
    color: #b8b8b8;
    font-size: 1.13em;
    position: relative;
    top: 2px; /* << shift star down for alignment */
    transition:
        color 0.16s,
        text-shadow 0.18s;
    text-shadow: none;
    font-family: inherit;
    pointer-events: none;
}
.star-study.starred {
    color: #ffd700;
    text-shadow:
        0 0 4px #ffe066,
        0 0 1px #ffd700;
}

.faded-btn-disabled {
    opacity: 0.44 !important;
    pointer-events: none !important;
    filter: grayscale(68%);
}

#lower-btns {
    display: flex;
    flex-direction: row;
    gap: 22px;
    justify-content: center;
    align-items: center;
    margin-top: 28px;
}

#start-btn:hover {
    background-color: #a3a3a3;
}

#lower-btns button {
    min-width: 120px;
    font-size: 1.14em;
    border-radius: 11px;
    background: linear-gradient(96deg, #edf0f7 0%, #e0e2e7 80%);
    color: #38455a;
    box-shadow:
        0 2px 12px #a5a8b833,
        0 1.5px 6px #3643531a;
    border: 1.5px solid #b0b3bb;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition:
        background 0.15s,
        color 0.12s,
        box-shadow 0.17s;
    display: inline-block;
    box-sizing: border-box;
    vertical-align: middle;
    line-height: 1.2;
    padding: 13px 30px;
    margin: 0;
}
#lower-btns button:hover,
#lower-btns button:focus {
    background: linear-gradient(112deg, #dae0ee 0%, #cfd3d9 85%);
    color: #222;
    box-shadow:
        0 4px 18px #a5a8b859,
        0 2px 12px #36435329;
    outline: none;
    border-color: #8791a9;
}

#nav-btn-visibility,
#speech-rate-select {
    height: 36px;
    min-width: 120px;
    width: auto !important;
    margin: 0 auto;
    display: block;
    text-align: center;
    text-align-last: center;
    -moz-text-align-last: center;
    font-size: 1em;
    border-radius: 7px;
    padding: 5px 20px 5px 8px;
    box-sizing: border-box;
}

#exit-menu-btn:hover,
#exit-menu-btn:focus {
    background: #ffead1 !important;
    color: #bb5a0a !important;
    border-color: #ffba6a !important;
    box-shadow:
        0 0 14px #ffc073aa,
        0 2px 12px #e8af8488 !important;
    outline: none;
}
#shuffle-btn:hover,
#shuffle-btn:focus,
#question-select:hover,
#question-select:focus,
#num-answers:hover,
#num-answers:focus,
#speech-rate-select:hover,
#speech-rate-select:focus,
#nav-btn-visibility:hover,
#nav-btn-visibility:focus,
#bg-color-select:hover,
#bg-color-select:focus {
    cursor: pointer;
    background-color: #dadce4;
}

#bg-color-select {
    border-radius: 7px;
    font-size: 1em;
    min-width: 120px;
    width: auto !important;
    margin: 0 auto;
    display: block;
    text-align: center;
    text-align-last: center;
    -moz-text-align-last: center;
    height: 36px;
    padding: 5px 20px 5px 8px;
    box-sizing: border-box;
}

#shuffle-btn:hover,
#start-btn:hover,
#review-btn:hover,
#restart-btn:hover,
#restart-exact-btn:hover,
#revisit-btn:hover,
#next-btn:hover,
#reveal-btn:hover,
#check-btn:hover,
#back-btn:hover,
#exit-menu-btn:hover,
#lower-btns button:hover {
    background-color: #b0b0b0;
}

/*Change label text*/
.dropdown-label {
    color: #ffffff !important;
    font-weight: 700 !important;
}
.general-dropdown-label {
    color: #339aff !important;
    font-weight: 700 !important;
    font-size: 19px;
}

.study-label {
    color: #7b88a6 !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    font-weight: bold;
}

#start-btn {
    background: linear-gradient(107deg, #e8fdf4 0%, #d6faea 50%, #cfeee1 100%);
    color: #248a4b;
    border: 2px solid #d5eee0;
    box-shadow:
        0 3px 18px #a4dec144,
        0 2px 8px #daf9e618;
    font-weight: 700;
    letter-spacing: 0.012em;
    border-radius: 11px;
    transition:
        background 0.19s,
        color 0.13s,
        box-shadow 0.16s,
        border-color 0.14s;
}
#start-btn:hover,
#start-btn:focus {
    background: linear-gradient(112deg, #caf7df 10%, #e4faf2 95%);
    color: #197847;
    border-color: #a3ddbe;
    box-shadow:
        0 8px 20px #b2f6d655,
        0 2px 14px #b7ffd233;
    outline: none;
}

/* REPLACE or ADD this - fixes dropdown text color */

select {
    color: #23252a;
    background: #f8f8f8;
}

#topic-dropdown {
    cursor: pointer;
}

#topic-tooltip {
    display: none;
    margin-left: 8px;
}

#topic-container:hover #topic-tooltip,
#topic-container:focus-within #topic-tooltip {
    display: block !important;
}
#settings-tooltip {
    display: none;
    margin-left: -5px !important;
}
#settings-container:hover #settings-tooltip,
#settings-container:focus-within #settings-tooltip {
    display: block !important;
}

.settings-dropdown-nice select,
#settings-dropdown select {
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
    font-size: 1em !important;
    padding: 7px 28px 7px 10px !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    display: block !important;
    margin: 0 auto !important;
    text-align: center !important;
    text-align-last: center !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}

#show-total-time,
#show-question-time {
    background: #e8e8e8;
}

.audio-btn.audio-playing {
    background: #dbeaff;
    box-shadow:
        0 0 0 2px #7ca0fd,
        0 0 12px 4px #73e1fa77;
    filter: drop-shadow(0 0 5px #7ca0fdcc);
}

/*Speech dropdown styling*/

#speech-voice-select {
    font-size: 1em;
    width: 180px;
    min-width: 180px;
    max-width: 240px;
    padding: 7px 28px 7px 10px;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
    text-align: center;
    background: #e8e8e8; /* <- main color */
    border: 1.5px solid #444956;
    color: #313131;
    box-shadow: 0 1px 2px #1c25311c;
    transition: outline 0.22s;
    font-weight: 500;
}
#speech-voice-select:focus {
    outline: 2px solid #80bfff;
}

#speech-voice-select:hover,
#speech-voice-select:focus {
    cursor: pointer;
    background-color: #dadce4;
}

/*Study info btns*/

.study-info-btns {
    display: flex;
    gap: 7px;
    position: static;
    margin-top: 8px;
    justify-content: flex-start;
    z-index: 9;
}
.circle-btn {
    width: 28px;
    height: 28px;
    background: #ececec;
    color: #324;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.08em;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #bcd;
    position: relative;
    box-shadow: 0 1px 2px #0001;
    transition:
        background 0.16s,
        border 0.16s;
    right: 5px;
}
.circle-btn:hover,
.circle-btn:focus {
    background: #e2eeff;
    border: 1.5px solid #64a7ed;
}
.btn-label {
    display: none;
    position: absolute;
    top: 35px;
    left: 50%;
    transform: translateX(-50%);
    background: #222a38;
    color: #fff;
    padding: 2px 5px;
    border-radius: 6px;
    font-size: 16px !important;
    white-space: nowrap;
    z-index: 99;
    pointer-events: none;
}
.circle-btn:hover .btn-label,
.circle-btn:focus .btn-label {
    display: block;
}
span[style*="display:inline-flex"] {
    position: relative;
}
/*More*/
#study-info-msg {
    transition:
        box-shadow 0.18s,
        transform 0.16s;
}
#study-info-msg:active {
    transform: translate(-50%, -50%) scale(98%);
}
#study-info-close {
    font-family: inherit;
    font-weight: bold;
    color: #666;
    opacity: 0.7;
    transition:
        background 0.14s,
        color 0.16s;
    padding: 0;
}
#study-info-close:hover {
    color: #cf1818 !important;
    background: #fff0f0 !important;
    transition:
        color 0.14s,
        background 0.16s;
}
#study-info-mask {
    transition: opacity 0.22s;
}

.circle-btn span {
    font-size: 0.6em;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.circle-btn[data-type="image"] span {
    font-size: 0.5em; /* makes emoji slightly smaller */
    line-height: 1.1;
}

.study-info-btns {
    display: flex;
    justify-content: flex-end;
    position: absolute;
    top: 5%;
    right: 1%;
    margin: 0 !important;
    width: 93%;
    z-index: 10;
}
.study-info-btns.info-hidden {
    display: none !important;
}

.flowmatch-timed-mode-btn,
#hide-answers-btn {
    width: 230px !important;
    min-height: 38px !important;
    font-size: 1.15em !important;
    border-radius: 8px !important;
    padding: 7px 0 !important;
    margin: 0 !important;
    display: inline-block !important;
    text-align: center !important;
    text-align-last: center !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    word-break: break-word !important;
}
.flowmatch-timed-mode-btn {
    background: linear-gradient(135deg, #35363a 0%, #222328 100%) !important;
    color: #fff !important;
    border: 1.2px solid #1c1f25 !important;
    box-shadow: 0 1.5px 7px #34485022 !important;
}

.flowmatch-timed-mode-btn.timed-off {
    background: #e4e4e4 !important;
    color: #888 !important;
    border: 1.2px solid #cfcfcf !important;
    opacity: 0.94 !important;
    filter: grayscale(0%);
    box-shadow: none !important;
}
#info-toggle {
    width: 230px !important;
    min-height: 38px !important;
    font-size: 1.15em !important;
    border-radius: 8px !important;
    padding: 7px 0 !important;
    margin: 0 !important;
    display: inline-block !important;
    text-align: center !important;
    text-align-last: center !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    word-break: break-word !important;
    background: linear-gradient(135deg, #35363a 0%, #222328 100%) !important;
    color: #fff !important;
    border: 1.2px solid #1c1f25 !important;
    box-shadow: 0 1.5px 7px #34485022 !important;
}

#info-toggle.info-off {
    background: #e4e4e4 !important;
    color: #888 !important;
    border: 1.2px solid #cfcfcf !important;
    opacity: 0.94 !important;
    filter: grayscale(0%);
    box-shadow: none !important;
    cursor: pointer;
}
#total-time-display {
    color: #284 !important;
}
#question-time-display {
    color: #468cfa !important;
}

.def-option.submitted-gray {
    background: #c6c6c6 !important;
    color: #797979 !important;
}

#submit-confirm-modal {
    z-index: 9999999;
}

#hide-answers-btn.hide-off {
    background: #e4e4e4 !important;
    color: #888 !important;
    border: 1.2px solid #cfcfcf !important;
    opacity: 0.94 !important;
    filter: grayscale(0%);
    box-shadow: none !important;
    cursor: pointer;
}
#hide-answers-btn.hide-on {
    background: linear-gradient(135deg, #35363a 0%, #222328 100%) !important;
    color: #fff !important;
    border: 1.2px solid #1c1f25 !important;
    opacity: 1 !important;
    filter: none;
    box-shadow: 0 1.5px 7px #34485022 !important;
    cursor: pointer;
}

/*Three buttons popup animation*/

#study-info-msg {
    transition:
        opacity 0.22s,
        transform 0.25s cubic-bezier(0.22, 1.12, 0.37, 1),
        box-shadow 0.18s;
    opacity: 0;
    transform: translate(-50%, calc(-50% + 40px)) scale(0.97);
    pointer-events: none;
}
#study-info-msg.info-msg-slide-in {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translate(-50%, -50%) scale(1);
}
#study-info-mask {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.21s;
}
#study-info-mask.info-mask-fade-in {
    opacity: 1 !important;
    pointer-events: auto !important;
}

#defs-list::-webkit-scrollbar {
    width: 10px;
    background: transparent;
}
#defs-list::-webkit-scrollbar-thumb {
    background: #bfc4d6;
    border-radius: 8px;
}

#defs-list {
    overscroll-behavior: contain;
}

#question-index {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    margin-right: 3px;
    margin-top: 20px;
    min-width: 0px;
}
#question-index {
    max-height: 420px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 7px 4px 7px 4px; /* <-- add space so outlines/shadows show! */
}
.qidx-btn {
    transition:
        background 0.19s,
        color 0.17s,
        outline 0.18s,
        opacity 0.15s;
    opacity: 1;
}
.qidx-btn.qidx-active {
    background: #4378fa !important;
    color: #fff !important;
    outline: 2px solid #294;
}
.qidx-btn.qidx-faded {
    opacity: 0.36 !important;
    pointer-events: none !important;
}

.qidx-correct {
    background: #32d46a !important; /* vivid green */
    color: #fff !important;
    border: none !important;
    outline: none !important;
}
.qidx-incorrect {
    background: #ff3b2e !important; /* vivid red */
    color: #fff !important;
    border: none !important;
    outline: none !important;
}
.qidx-active.qidx-active-correct {
    background: linear-gradient(135deg, #4378fa 31%, #32d46a 100%) !important;
    color: #fff !important;
    outline: 2px solid #294 !important;
}
.qidx-active.qidx-active-incorrect {
    background: linear-gradient(135deg, #4378fa 31%, #ff3b2e 100%) !important;
    color: #fff !important;
    outline: 2px solid #294 !important;
}

.qidx-btn-wrap {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 38px;
    vertical-align: middle;
}
.qidx-star {
    pointer-events: none;
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.89em;
    color: #ffd700;
    text-shadow:
        0 0 3px #ffe066,
        0 0 0.5px #ffd700;
    z-index: 10;
    font-family: inherit;
    line-height: 1;
    user-select: none;
}

.bookmark-btn {
    width: 20px;
    height: 18px;
    line-height: 1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    z-index: 21;
}
.bookmark-btn:focus .bookmark-icon,
.bookmark-btn:hover .bookmark-icon {
    color: #fa1;
    border-radius: 3px;
}
.bookmark-icon {
    font-size: 1.08em;
    transition:
        color 0.19s,
        text-shadow 0.18s;
    user-select: none;
    pointer-events: none;
    vertical-align: middle;
    line-height: 1;
}
.sr-only {
    position: absolute !important;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.bookmark-icon {
    width: 16px;
    height: 20px;
    display: block;
    stroke-width: 1.9;
    transition:
        stroke 0.16s,
        fill 0.18s;
}
.bookmark-btn:focus .bookmark-icon,
.bookmark-btn:hover .bookmark-icon {
    stroke: #3377ff !important;
    fill: #8080ff !important;
}

.container,
.header-bar,
#study-system,
.test-div {
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
    margin: auto;
}

#manual-timers-reveal-wrap button {
    background: linear-gradient(97deg, #e9f3ff 0%, #d6e6f5 100%) !important;
    color: #244 !important;
    border-radius: 9px !important;
    border: 1.4px solid #b6bddb !important;
    font-weight: 600 !important;
    font-size: 1.07em !important;
    box-shadow: 0 2px 8px #dae7fa33 !important;
    padding: 8px 22px !important;
    margin: 0 9px 0 0 !important;
    transition:
        background 0.14s,
        color 0.13s;
}
#manual-timers-reveal-wrap button:hover {
    background: linear-gradient(97deg, #cbe0fa 0%, #b8d4ec 100%) !important;
    color: #1636bc !important;
}

#shuffle-btn.active {
    background: #80bfff !important;
    color: #fff !important;
    border: 2px solid #1163ce !important;
    box-shadow:
        0 0 18px #5ec3ff99,
        0 1.5px 7px #34485022 !important;
}

#shuffle-btn {
    /* Inactive should just use normal button or dropdown color, remove custom bg if applied by JS: */
    background: inherit;
    color: #23252a;
    border: none;
    box-shadow: none;
}

#topic-dropdown:hover,
select:hover,
.settings-dropdown-nice select:hover {
    box-shadow:
        0 0 0 2px #5dacff,
        0 2px 12px 0 #4bb9ff44;
    border: 1px solid #63b7ff !important;
    color: #3e3e3e;
    background: linear-gradient(98deg, #6f7b8c 0%, #345d8b 100%) !important;
    transition:
        box-shadow 0.16s,
        border 0.16s,
        background 0.16s,
        color 0.12s;
}

#exit-confirm-modal > div,
#switch-topic-modal > div {
    background: linear-gradient(120deg, #82b6ee 0%, #527aad 100%) !important;
    color: #232e38 !important;
    border-radius: 12px !important;
    box-shadow: 0 5px 30px #12336f33 !important;
    border: 2.5px solid #3482d8 !important;
}

#study-info-msg .audio-btn {
    margin-top: 24px !important;
    margin-left: -13px !important;
}

#study-info-msg-content > div {
    max-width: 320px;
    word-break: break-word;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 220px;
    box-sizing: border-box;
    padding-left: 0px;
    padding-top: 4px;
}
#study-info-msg .audio-btn {
    position: absolute;
    left: 10px;
    margin-left: 0 !important;
    top: 0px;
}
#study-info-msg {
    position: relative;
}

#study-info-msg,
#study-info-msg *,
#study-info-msg span,
#study-info-msg div,
#study-info-msg b,
#study-info-msg i {
    color: #111 !important;
}

#topic-search {
    width: 170px !important;
    max-width: 214px;
    min-width: 80px;
    height: 35px;
    min-height: 35px;
    max-height: 35px;
    white-space: normal;
    word-break: break-all;
    overflow-wrap: break-word;
    background: #fff;
    border: none;
    color: #23252a;
    font-size: 1.25em;
    font-weight: 500;
    border-radius: 8px 0 0 8px;
    box-sizing: border-box;
}

#topic-search:focus {
    outline: 2px solid #80bfff;
}

#topic-dropdown-btn {
    border: none;
    background: #fff;
    color: #23252a;
    font-size: 1.25em;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    padding: 0 10px;
    height: 35px;
    min-height: 35px;
    max-height: 35px;
    line-height: 30px;
    transition:
        background 0.15s,
        color 0.1s;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

#topic-dropdown-btn:hover,
#topic-dropdown-btn:focus {
    background: #292b36 !important;
    color: #fff !important;
}

#topic-dropdown-list {
    min-width: 214px;
    max-width: 330px !important;
    word-break: break-all;
    white-space: normal;
}

#topic-dropdown-list div:hover {
    background: #dbeaff !important;
    color: #355 !important;
}

#topic-dropdown-list div {
    border: 1.5px solid transparent;
    box-sizing: border-box;
    transition:
        background 0.16s,
        border 0.17s,
        box-shadow 0.17s;
    margin: 1.5px 2.7px; /* <--- tighten horizontally */
    padding-left: 8px !important;
    padding-right: 8px !important;
    width: calc(100% - 5.4px); /* auto-fit inner padding, subtract margin */
}

#topic-dropdown-list div:hover {
    background: #dbeaff !important;
    color: #355 !important;
    border: 1.5px solid #73a3fa !important;
    box-shadow: 0 0 0 2px #90c6ff44;
}

#topic-dropdown-list div.selected,
#topic-dropdown-list div.current-topic {
    background: #d3e7ff !important;
    color: #222 !important;
    border: 2.2px solid #4378fa !important;
    box-shadow:
        0 0 9px 2px #b2c7fa88,
        0 0 0 3.5px #477afbc4;
}

#topic-dropdown-list div.current-topic {
    background: #b8d4fa !important; /* darker for glow+current */
    box-shadow:
        0 0 16px 2.5px #8cc2ffcc,
        0 0 0 3.5px #477afbc4,
        0 0 6px 2.5px #4378fa77;
}

#random-word {
    overflow: auto;
    height: auto;
    min-height: 0;
    max-height: 200px !important;
    word-break: break-word;

    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    padding-top: 0.25em;
    padding-bottom: 0.25em;
    margin-top: 0.2em;
    margin-bottom: 0.2em;
}
.def-option {
    overflow: auto;
    height: auto;
    min-height: 0;
    max-height: 7em;
    word-break: break-word;
    white-space: pre-wrap;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.def-option:hover {
    background: #b3b3b3 !important;
}

.def-option {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    display: block !important;
}
button,
button:disabled,
#lower-btns button,
#nav-btn-row button,
#exit-menu-btn,
.qidx-btn,
.bookmark-btn,
.audio-btn,
#start-btn,
#shuffle-btn,
#info-toggle,
#hide-answers-btn {
    cursor: pointer !important;
}
button:disabled,
.faded-btn-disabled {
    cursor: not-allowed !important;
}

@media (max-width: 800px) {
    #random-word {
        font-size: 1.02em !important;
        max-width: 98vw !important;
        word-break: break-word;
        overflow-x: auto;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .def-option {
        font-size: 0.92em !important;
        max-width: 98vw !important;
        width: 100% !important;
        word-break: break-word;
        white-space: pre-wrap;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0.55em !important;
        padding-right: 0.55em !important;
    }
    #lower-btns button,
    #nav-btn-row button {
        font-size: 1em !important;
        padding: 12px 8px !important;
        min-width: 74px !important;
        width: auto !important;
        max-width: 99vw !important;
        box-sizing: border-box;
    }
    #study-system {
        padding: 2px 2vw 18px 2vw !important;
    }
    .container {
        left: -7px !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100vw !important;
        border-radius: 0 !important;
    }
}

#unstar-btn-tooltip {
    opacity: 1;
    transition: opacity 0.14s;
    pointer-events: none;
}
.star-glow {
    box-shadow:
        0 0 10px 3px #ffe066aa,
        0 0 19px 7px #ffd70060 !important;
    outline: 1.5px solid #ffd700 !important;
    background: #fffbe6 !important;
    transition:
        box-shadow 0.17s,
        outline 0.13s,
        background 0.15s;
}
#unstar-all-btn.star-glow {
    box-shadow:
        0 0 10px 3px #ffe066aa,
        0 0 19px 7px #ffd70060 !important;
    outline: 1.5px solid #ffd700 !important;
    background: #fffbe6 !important;
    transition:
        box-shadow 0.17s,
        outline 0.13s,
        background 0.15s;
}

#start-title {
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal !important;
    max-width: 95vw !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
    box-sizing: border-box !important;
    display: block !important;
}

@media (max-width: 800px) {
    .container {
        margin: 0 auto !important;
        width: 95% !important;
        left: unset !important;
        border-radius: 14px !important;
        right: 5px !important;
    }
    #note-inject-here {
        left: -5px !important;
        position: relative !important;
    }
}

@media (max-width: 600px) {
    #bottom-btns {
        gap: 8px !important;
    }
    #bottom-btns button,
    #bottom-btns select {
        width: 75px !important;
        font-size: 16px !important;
        height: 32px !important;
        padding: 0 !important;
    }
    #bottom-btns .general-dropdown-label {
        font-size: 16px !important;
        padding-bottom: 2px !important;
    }
    .topic-label {
        position: static !important;
        transform: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        margin: 8px 0 0 0 !important;
        background: none !important;
        font-size: 13px !important;
        text-align: center !important;
        box-sizing: border-box !important;
        left: unset !important;
        top: unset !important;
    }
    .header-bar {
        flex-direction: column !important;
        height: auto !important;
        min-height: 66px !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        padding-bottom: 5px !important;
    }
    .align-container {
        margin-top: 10px;
    }
    .study-info-btns {
        gap: 3px !important;
    }
    .circle-btn {
        width: 20px !important;
        height: 20px !important;
        font-size: 0.72em !important;
        min-width: 20px !important;
        min-height: 20px !important;
    }
    .btn-label {
        font-size: 11px !important;
    }

    #random-word {
        max-height: none !important;
        overflow: visible !important;
    }
    #lower-btns {
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 99vw !important;
        align-items: stretch !important;
        justify-content: center !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    #lower-btns button {
        min-width: 0 !important;
        max-width: 100vw !important;
        width: 100% !important;
        font-size: 1em !important;
        padding: 12px 6px !important;
        margin: 0 !important;
    }
    #unstar-btn-tooltip {
        font-size: 0.85em !important;
        padding: 8px 8px !important;
        max-width: 96vw !important;
        line-height: 1.1 !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        min-width: 0 !important;
    }
    .def-option {
        font-size: 0.87em !important;
    }
    .def-option .study-info-btns,
    .def-option .circle-btn {
        font-size: 1em !important;
    }
    #word-box {
        font-size: 18px !important;
        padding: 5px 0 !important;
    }
}

/*End page on small screens START*/

#random-word {
    max-width: 98vw !important;
    width: 100% !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
    display: block !important;
}
#lower-btns,
#lower-btns button,
#lower-btns > * {
    box-sizing: border-box !important;
    max-width: 98vw !important;
    width: 100% !important;
}

/*End page on small screens END*/

#settings-dropdown {
    max-height: 70vh !important;
    overflow-y: auto !important;
}
