.top_body_margin_main {
    margin-top: 100px;
}

.top_body_margin_play {
    margin-top: 100px;
}

.top_body_margin_review {
    margin-top: 100px;
}

.scoreboard {
    position: fixed;
    /* top: 0; */
    top: env(safe-area-inset-top, 0);
    width: 100%;
    margin-top: 60px;
    margin-bottom: 4px;
    max-width: 600px;
}

.header-bar {
    position: fixed;
    top: env(safe-area-inset-top, 0);
    margin-top: 60px;
    left: 0;
    width: 100%;
    height: 50px;
    background: #111;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-bottom: 1px solid #333;
    z-index: 1000;
}

#modal_result {
    position: absolute;
    top: env(safe-area-inset-top, 0);
    margin-top: 60px;

    width: 90%;
    background: pink;
    min-width: 320px;


    min-height: 400px;
    height: 80vh;
    background: transparent;
    background: rgba(1, 1, 1, .9);
    min-height: 100%;
    z-index: 99999;
    padding-top: 0px;
    max-width: 500px;
}

#modal_first_click {
    position: absolute;
    top: env(safe-area-inset-top, 0);
    margin-top: 60px;


    width: 90%;
    background: pink;
    min-width: 320px;

    top: 0px;
    min-height: 400px;
    height: 80vh;
    background: transparent;
    background: rgba(1, 1, 1, .9);
    /* padding: 5%; */
    min-height: 100%;
    z-index: 99999;
    padding-top: 0px;
    max-width: 500px;
}



a {
    font-size: 20px;
}

html {
    font-size: 12px;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h2 {
    text-align: center;
}

.logo {
    width: 157px;
    height: 54px;
    background-image: url(../img/lingua1-alpha.png);
    background-repeat: no-repeat;
    background-position: -22px -73px;
    background-size: 200px 200px;
    image-rendering: pixelated;
    margin: 0px auto;
}

body {
    background: #000000;
    color: #eee;
    font-family: monospace;
    margin: 0;
    padding: 5%;
    display: flex;
    justify-content: center;
    padding-top: 35px;
}


body {
    /* your existing styles... */
    padding-top: env(safe-area-inset-top);
    padding-top: constant(safe-area-inset-top);
    /* for older iOS */

}

html,
body {
    -webkit-font-smoothing: antialiased;
    /* for WebKit browsers */
    -moz-osx-font-smoothing: grayscale;
    /* for macOS Firefox */

    color: #888;
}




.panel {
    min-width: 320px;
    margin: 0px auto;
}

.lang-dropdown {
    position: relative;
    width: 90%;
    max-width: 420px;
    margin: 40px auto;
    font-family: system-ui, sans-serif;
}

.lang-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: linear-gradient(145deg, #1f1f1f, #151515);
    color: #fff;
    font-size: 1.6rem;
    font-weight: 600;
    border: none;
    border-radius: 18px;
    padding: 18px 20px;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    color: #4CAF50;
    border-radius: 18px !important;
}

/* caret arrow */
.lang-control::after {
    /* content: "▾"; */
    content: "🟢";
    font-size: 1.2rem;
    color: #aaa;
}

/* dropdown panel */
.lang-options {
    position: absolute;
    top: 100%;
    /* directly below the control */
    left: 0;
    width: 100%;
    /* same width as the control */
    background: #1b1b1b;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    display: none;
    /* hidden by default */
    z-index: 100;
}

/* each option */
.lang-option {
    padding: 18px 20px;
    font-size: 1.2rem;
    color: #f4f4f4;
    border-bottom: 1px solid #333;
    text-align: left;
}

.lang-option:last-child {
    border-bottom: none;
}

.lang-option:hover {
    background: #00bfff33;
}

/* visible state */
.lang-dropdown.open .lang-options {
    display: block;
}

.question-stepper {
    height: 63px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 90%;
    max-width: 420px;
    margin: 20px auto;
    background: linear-gradient(145deg, #1f1f1f, #151515);
    border-radius: 18px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.stepper-btn {
    flex: 1;
    padding: 18px 0;
    font-size: 3.0rem;
    font-weight: 700;
    color: #fff;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 0px;
    color: #4CAF50;
}

.stepper-btn:hover,
.stepper-btn:active {
    background: #00bfff33;
}

.stepper-value {
    flex: 2;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
    user-select: none;
}

@media (hover: none) and (pointer: coarse) {
    .stepper-btn {
        padding: 22px 0;
        font-size: 2rem;
        color: #4CAF50;
    }

    .stepper-value {
        font-size: 1.6rem;

    }
}

.start-button {
    height: 56px;
    padding: 16px 0 !important;
    display: block;
    width: 90%;
    max-width: 420px;
    margin: 30px auto;
    padding: 18px 0;
    background: linear-gradient(145deg, #1f1f1f, #151515);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    border: none;
    border-radius: 18px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    border-radius: 18px !important;
    color: #4CAF50;
}

.start-button:hover {
    background: linear-gradient(145deg, #00bfff33, #1a1a1a);
}

.start-button:active {
    transform: scale(1.05);
    background: linear-gradient(145deg, #00bfff55, #111);
}

.lang-control:active {
    transform: scale(1.05);
    background: linear-gradient(145deg, #00bfff55, #111);
}

.stepper-btn:active {
    transform: scale(1.05);
    background: linear-gradient(145deg, #00bfff55, #111);
}

@media (hover: none) and (pointer: coarse) {
    .start-button {
        padding: 22px 0;
        font-size: 1.6rem;
        border-radius: 20px;
        color: #4CAF50;
    }
}


footer {
    position: fixed;
    bottom: 30px;
    width: 100%;
}

footer * {
    text-decoration: none;
    font-size: 12px;
    width: 33%;
    display: block;
    float: left;
    text-align: center;
    color: #ffffff82;
}












.panel {
    min-width: 320px;
    /* overflow-x: hidden; */
    width: 100%;
}

#question {
    margin-top: 0rem;
    margin-bottom: 0px;

    border-bottom-style: solid;
    padding-bottom: 14px;
    margin-bottom: 17px;
    border-color: #8888884a;
    border-bottom-width: 1px;
}

/* #question {
    margin-top: 1rem;
} */

.btn_text_bottom {
    font-size: 1.3rem;
    margin-top: 3px;
    color: rgb(255 165 0 / 100%);
    font-style: italic;
}

#category {
    color: #3F51B5;
    font-size: 1.5rem;
}

/* #key {
    color: rgb(255 165 0 / 100%);
    font-size: 1.5rem;
} */

#definition {
    text-align: center;
    font-size: 1.3rem;
    color: #888;

    /* min-height: 100px;
    max-height: 100px; */

    text-align: center;

    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;

    margin-top: 0px;

}

#definition_container {
    min-height: 100px;
    max-height: 100px;
}

.resultWord {
    text-align: center;
    font-style: italic;
    font-size: 1.3rem;
    color: #888;
}

#resultIcon {
    text-align: center;
    font-size: 8rem;
}

#resultWordSource {
    text-align: center;
    font-size: 2rem;
    color: #888;
}

#resultWordDest {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 0px;
    color: #4CAF50;
}

#resultWordPkey {
    text-align: center;
    font-size: 2rem;
}

.wordMain {
    font-style: italic;
    color: #FF5722;
    /* color: #4CAF50; */
}

.wordKey {
    color: rgb(255 165 0 / 100%);
    font-size: 1.5rem;
    font-style: italic;
}


#timer {
    font-weight: bold;
    color: #FF5722;
}

#completeCount {
    font-weight: bold;
    color: #4CAF50;
}

#totalCount {
    font-weight: bold;
}


.btn_text_top,
.btn_text_bottom {
    pointer-events: none;
}

button * {
    pointer-events: none;
}

.button_answer {
    display: block;
    font-size: 1.5rem;
}

.eee {
    display: block;
}

#next span {
    display: inline-block;
    transform: scale(1.8);
    vertical-align: middle;
    margin-right: 5px;
}

#next {
    color: #FF5722;
    border-style: solid;
    border-color: #FF5722;
    /* opacity: .3; */
}

#next:disabled {
    opacity: .3;
}

#quit span {
    display: inline-block;
    transform: scale(1.8);
    vertical-align: middle;
    margin-right: 5px;
}

#skip span {
    display: inline-block;
    transform: scale(1.8);
    vertical-align: middle;
    margin-right: 5px;
}

button {
    margin: 0px;
    padding: .5rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    display: block;
    color: #4CAF50;


    /* border-color: rgb(255 255 255 / 25%); */


    border-color: #8888884a;
    border-style: solid;
    border-width: 1px;





    border-radius: 5px !important;
}

/* @media (max-width: 10000px) {  */

button {
    font-size: 18px;
    padding: 14px 20px;
    width: 100%;
    margin-bottom: 15px;
    appearance: none;
    border-radius: 0;
    background: none;
    /* border: 1px solid rgb(255 255 255 / 25%); */
    border-color: #8888884a;
    border-style: solid;
    border-width: 1px;

    font: inherit;
    color: inherit;
    cursor: pointer;
    color: #4CAF50;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: #888;
    border-color: #aaa;
    color: black;
}


/* } */


#panel_questions {
    width: 90%;
    margin: 0px auto;
}

#summary {
    width: 90%;
    margin: 0px auto;
}

#result {
    margin-top: 1rem;
    font-weight: bold;
}

.container {
    max-width: 900px;
    width: 100%;
}

#result {
    font-weight: bold;
}

#hud {
    width: 100%;
    margin-bottom: 1rem;
    display: none;
}

#progressbar {
    width: 100%;
    background: #333;
    border-radius: 8px;
    overflow: hidden;
    height: 20px;
    margin-bottom: .5rem;
}

#progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00ff99, #00ccff);
    transition: width 0.4s ease;
}

#stats {
    font-weight: bold;
    text-align: right;
    color: #0f0;
}

.button_answer.answer-selected .btn_text_bottom {
    color: rgb(255 165 0 / 100%);
    transform: scale(1.3);
}

.button_answer.answer-selected .btn_text_top {
    color: rgb(255 165 0 / 100%);
    transform: scale(1.3);
}

.answer-selected {
    background: rgb(70 241 70 / 52%);
}

.resultContainer {
    display: none;
}

.resultContainer {
    min-height: 100px;
}

#scores {
    display: none;
}


.score {
    width: 33%;
    float: left;
}

.score_element {
    margin: 0px auto;

    width: 100%;
    text-align: center;

}



#modal_first_click p {
    text-align: left;
    font-size: 1.3rem;
    width: 94%;
    margin: 0px auto;

}

#modal_first_click div {
    font-size: 1.3rem;
    width: 100%;

    margin: 0px auto;
}


@media (min-width: 768px) {
    /* styles for non-mobile (tablet and larger) */

    #modal_result {
        padding: 3%;

    }

    #modal_first_click {
        padding: 3%;
    }

    .buttons_nav {
        position: unset !important;
    }
}

/* 
@media (min-width: 768px) {

} */

.buttons_nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    position: fixed;
    bottom: 0;
    width: 90%;
    left: 0;
    right: 0;
    width: 90%;
    margin: 0 auto;
    max-width: 600px;
}


.panel_main {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.buttons_nav .bnp {
    flex: 1;
}

.buttons_nav button {
    width: 100%;
    padding: 12px 0;
    color: #4CAF50;
    height: 45px;
}

.buttons_nav button:active {
    border-color: #4CAF50 !important;
    transform: scale(1.1);
}

.reveal {
    display: flex;
    justify-content: center;
    width: 100%;
    opacity: 0.4;
}

.reveal>div {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-style: solid;
    padding: 9px;
    /* border-color: pink; */
}

.scorereview {
    width: 100%;
    margin: 40px auto;
    /* color: #fff; */
    font-family: monospace;
    text-align: center;
    padding: 0px;
    margin-top: 0px;
}

.scorereview table {
    width: 100%;
    border-collapse: collapse;
}

.scorereview th,
.scorereview td {
    border-bottom: 1px solid #333;
    padding: 12px 8px;
}

.scorereview th {
    font-size: 18px;
    color: #0f0;
    border-bottom: 2px solid #0f0;
}

.scorereview td:first-child {
    text-align: left;
}

#table_leader_board tr:nth-child(even) {
    background-color: #222;
}

#table_leader_board tr:nth-child(odd) {
    background-color: #111;
}

#table_leader_board th {
    background-color: #000;
}

#table_leader_board td,
#table_leader_board th {
    color: #fff;
    padding: 8px 12px;
    text-align: center;
    background: none;
}

.hide {
    display: none;
}

.fade-in {
    opacity: 0;
    transition: opacity 0.4s ease-in;
}

.fade-in.show {
    opacity: 1;
}

#loadingOverlay {
    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: 9999;
}

.spinner {
    border: 6px solid #ccc;
    border-top: 6px solid #000;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.text_center {
    text-align: center;
}

/* 
@media (max-width: 767px) {
    .buttons_nav {
        bottom: 10px;
    }
}
 */

.buttons_nav {
    bottom: 10px;
}
















#btn-finished {
    background: #222;
    color: #fff;
    border: 1px solid #555;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    width: 90%;
    margin: 0px auto;
    color: #4CAF50;
    max-width: 300px;
}

#btn-finished:hover {
    background: #333;
}

.section {
    width: 100%;
    margin: 30px auto;
    /* color: #fff; */
    font-family: monospace;
}

.section h3 {
    border-bottom: 2px solid #fff;
    padding-bottom: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.question-block {
    margin-bottom: 40px;
    text-align: left;
}

.question {
    font-size: 18px;
    margin-bottom: 10px;
}

ul {
    list-style: none;
    padding: 0;
}

li {
    padding: 4px 0;
    font-size: 16px;
}

li::before {
    content: "• ";
    color: #888;
}

li:contains("✅") {
    color: #0f0;
}

li:contains("❌") {
    color: #f33;
}