@charset "UTF-8";
/* CSS Document */

/* --- Nền và font chung --- */
body {
    font-family: 'Segoe UI', Arial, sans-serif;

	background-color: linear-gradient(120deg, #f6f8fa 70%, #e3f0fa 100%);
    background-image: url('../img/background1.jpg'); /* đường dẫn hình nền */
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    color: #23272f;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* --- Hiệu ứng mờ ảnh câu hỏi --- */
.img-blur {
    filter:
        blur(28px)          /* Làm mờ mạnh */
        grayscale(0.4)      /* Chuyển sang xám nhẹ */
        brightness(0.9)     /* Giảm sáng nhẹ */
        saturate(0.75)      /* Giảm rực màu */
        contrast(0.9);      /* Giảm tương phản */;
    box-shadow: 0 4px 32px 0 #2d4665cc;
    transition: filter 0.33s cubic-bezier(.57,1.47,.43,1), box-shadow 0.25s;
}
.img-clear {
    filter: none !important;
    transition: filter 0.33s cubic-bezier(.57,1.47,.43,1);
}
.img-blur::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(36,49,63,0.12);
    border-radius: inherit;
    pointer-events: none;
}

/* --- Tiêu đề game --- */
.game-title-wrapper {
    text-align: center;
    margin: 26px auto 14px auto;
    background: none !important; /* Xóa nền nếu có */
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}
.game-title-img {
    display: inline-block;
    max-width: 100vw;
    max-height: 150px;
    margin: 0 auto 10px auto;
    object-fit: contain;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    filter: none !important;
}

}
.game-title {
    text-align: center;
    font-family: 'Luckiest Guy', 'Segoe UI', Arial, sans-serif;
    font-size: 3.1rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    background: linear-gradient(90deg, #e3f0fa 10%, #1976d2 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    text-shadow:
        2px 3px 8px #1976d240,
        0 4px 18px #1976d266,
        0 1px 0 #6600FF,
        0 2px 10px #1e88e54a;
    filter: drop-shadow(0 2px 5px #1e88e51a);
    margin: 0;
}


/* Nếu dùng h1 làm tiêu đề bên trong panel */
h1, .question-title {
    text-align: center;
    color: #1976d2;
    font-size: 2.2rem;
    letter-spacing: 1px;
    font-weight: 700;
    margin: 0 0 24px 0;
}

/* --- Header bar --- */
.header-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 6px;
    margin-top: 24px;
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Main layout --- */
.main-flex-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    max-width: 1300px;
    margin: 24px auto 0 auto;
    gap: 28px;
    min-height: 60vh;
    max-height: 85vh;
    overflow-y: auto;
}

/* --- Sidebar danh sách câu hỏi --- */
.sidebar-question-list {
    min-width: 75px;
    max-width: 105px;
    background: #FFFF66;
    border-radius: 12px;
    box-shadow: 0 2px 18px #1976d210;
    padding: 22px 7px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    height: fit-content;
    position: sticky;
    top: 30px;
}
.sidebar-question-list h4 {
    text-align: center;
    margin: 0 0 8px 0;
    font-size: 1.07rem;
    color: #1976d2;
}
.qnav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.14rem;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 2.2px solid #2196f3;
    background: #f5fbff;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 2px;
    transition: border 0.17s, background 0.17s, color 0.17s, box-shadow 0.14s;
    box-shadow: 0 1px 5px #2196f310;
    position: relative;
}
.qnav-btn.active, .qnav-btn:hover {
    background: #2196f3;
    color: #fff;
    border-color: #1976d2;
}
.qnav-btn .dot {
    position: absolute;
    bottom: 5px;
    right: 7px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #e2e2e2;
}
.qnav-btn.answered .dot { background: #31a94b; }
.qnav-btn.revealed .dot { background: #c62828; }
.qnav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 10px;
    margin-bottom: 12px;
}
.qnav-grid .qnav-btn {
    margin: 0;
    width: 100%;
}

/* --- Bảng thống kê --- */
.right-stats-panel {
    min-width: 185px;
    max-width: 220px;
    background: #FFFFCC;
    border-radius: 15px;
    box-shadow: 0 2px 18px #1976d210;
    padding: 26px 22px 20px 22px;
    margin-left: 0;
    position: sticky;
    top: 30px;
    height: fit-content;
}
.right-stats-panel h4 {
    margin-top: 0;
    color: #1976d2;
    font-size: 1.16rem;
    text-align: center;
    margin-bottom: 15px;
}
.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 1.09rem;
    border-bottom: 1px solid #f1f1f1;
    font-weight: 600;
}
.stat-row:last-child { border-bottom: none; }
.stat-right {
    min-width: 32px;
    font-size: 1.13rem;
    text-align: right;
    font-weight: bold;
}
.stat-correct { color: #219a31; }
.stat-revealed { color: #d32f2f; }
.stat-total { color: #1976d2; }

/* --- Content Panel --- */
.content-panel {
    flex: 1 1 0;
    min-width: 320px;
    max-width: 740px;
    background: #fff;
    border-radius: 13px;
    box-shadow: 0 2px 14px #1976d212;
    padding: 18px;
    margin: 0 0 18px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.tab-content {
    width: 100%;
    background: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
}

/* --- Hình ảnh câu hỏi --- */
.content-panel img,
.question-img, img {
    max-width: 90vw;
    max-height: 50vh;
    width: 100%;
    border-radius: 10px;
    display: block;
    margin: 0 auto 18px auto;
    box-shadow: 0 2px 10px #1976d222;
    object-fit: contain;
}

/* --- Hint chữ --- */
.hint {
    margin: 18px auto 12px auto;
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 0.28em;
}
.hint .blank {
    display: inline-block;
    width: 41px; height: 34px;
    border-bottom: 6px solid #1976d2;
    margin: 0 8px 8px 0;
    vertical-align: middle;
    font-size: 2.16rem;
    color: #1976d2;
    font-weight: bold;
    text-align: center;
    line-height: 34px;
    border-radius: 4px;
    background: #f8fbff;
    box-shadow: 0 1px 4px #1976d217;
    transition: color .13s, background .13s;
}
.hint .blank.underscore { font-size: 0; }
.blank { margin-right: 6px; }

/* --- Hintbox nổi bật --- */
.hintbox {
    margin: 20px auto 18px auto;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1560a7;
    letter-spacing: 1.1px;
    background: linear-gradient(90deg,#e3f0fa 60%,#d6ecfa 100%);
    border-radius: 12px;
    padding: 13px 28px;
    box-shadow: 0 2px 12px #2196f333;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 13px;
    word-break: break-word;
    line-height: 1.36;
    max-width: 92vw;
}
.hintbox b {
    color: #1976d2;
    font-size: 1.32rem;
    font-weight: 800;
    margin-right: 8px;
}

/* --- Form trả lời --- */
.answer-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.answer-form input {
    font-size: 1.18rem;
    padding: 9px 14px;
    border-radius: 7px;
    border: 1.5px solid #1976d299;
    width: 62%;
    min-width: 140px;
    background: #f8fbff;
    outline: none;
    transition: border 0.2s;
}
.answer-form input:focus {
    border-color: #1976d2;
    background: #fff;
}
.answer-form button,
.tab-content button,
.button-row button {
    font-size: 1.08rem;
    padding: 8px 18px;
    background: linear-gradient(90deg,#2196f3 0%,#21cbf3 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    margin-left: 0;
    margin-top: 5px;
    transition: background 0.18s, box-shadow 0.16s;
    box-shadow: 0 2px 8px #1976d215;
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.answer-form button:hover,
.tab-content button:hover,
.button-row button:hover {
    background: linear-gradient(90deg,#1976d2 0%,#1199e9 100%);
    box-shadow: 0 4px 18px #1976d235;
}
.button-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin: 14px 0 18px 0;
}
.button-row button:active { transform: scale(0.96); }
.button-row .emoji {
    font-size: 1.13em;
    margin-right: 2px;
    pointer-events: none;
}
.button-row form {
    margin: 0; padding: 0;
}
.button-row .answer-form input {
    width: 130px;
    min-width: 88px;
    padding: 9px 12px;
    font-size: 1.09rem;
    border-radius: 7px;
    border: 1.5px solid #1976d277;
    outline: none;
    transition: border 0.2s, box-shadow 0.16s;
}
.button-row .answer-form input:focus {
    border: 1.5px solid #1976d2;
    box-shadow: 0 2px 8px #1976d215;
    background: #f8fbff;
}

/* --- Reveal big answer --- */
.answer-reveal-big {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.7rem;
    color: #1560a7;
    font-weight: 900;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    background: linear-gradient(90deg,#e3f0fa 60%,#d6ecfa 100%);
    border-radius: 14px;
    padding: 22px 30px;
    margin: 30px auto 12px auto;
    box-shadow: 0 2px 16px #1976d220;
    text-align: center;
    min-width: 240px;
    max-width: 96vw;
    word-break: break-word;
}

/* --- Status messages --- */
.success, .fail, .reveal {
    text-align: center;
    font-size: 1.14rem;
    margin: 18px 0 0 0;
    padding: 7px 0 0 0;
    font-weight: bold;
    letter-spacing: 0.02em;
}
.success { color: #31a94b; }
.fail { color: #e53935; }
.reveal { color: #c62828; }

/* --- Timer --- */
.timer {
    font-size: 1.13rem;
    color: #1a5dc6;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

/* --- Bảng chữ cái --- */
.alphabet-box {
    margin-top: 30px;
    background: #f7fafc;
    border-radius: 12px;
    box-shadow: 0 2px 10px #1976d207;
    padding: 13px 10px 8px 10px;
    text-align: center;
}
.alphabet-title {
    color: #1976d2;
    font-weight: 600;
    margin-bottom: 8px;
}
.alphabet-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 5px;
    justify-content: center;
}
.alphabet-btn {
    width: 34px;
    height: 34px;
    background: #fff;
    border: 2px solid #2196f3;
    color: #1976d2;
    font-size: 1.17rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background .14s, color .14s, border .14s;
    margin-bottom: 4px;
}
.alphabet-btn.selected {
    background: #2196f3;
    color: #fff;
    border: 2px solid #1976d2;
}
.alphabet-btn:disabled {
    background: #e3e3e3;
    color: #aaa;
    cursor: not-allowed;
}

/* --- Logo Header --- */

.logo-header-small {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 7px;
    background: none;
    box-shadow: none;
    margin: 0;               /* Đảm bảo không có margin đẩy lệch */
    display: inline-block;
}
/* --- Admin Button --- */
.admin-btn {
    padding: 11px 20px;
    background: linear-gradient(90deg,#2196f3 0%,#21cbf3 100%);
    color: #fff;
    border-radius: 9px;
    font-size: 1.09rem;
    font-weight: 600;
    box-shadow: 0 2px 16px #1976d222;
    text-decoration: none;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: none;
    transition: background 0.18s;
    margin-right: 8px;
}
.admin-btn:hover {
    background: #1560a7;
    color: #fff;
}
.admin-btn-row {
    display: flex;
    align-items: center;      /* Chính xác để logo và text giữa hàng */
    gap: 9px;
    text-decoration: none;
    padding: 7px 16px;
}


/* Modal câu hỏi đặc biệt*/
.special-question-block {
    display: flex;
    flex-direction: column;
    align-items: center; /* căn giữa mọi thứ trong block */
    margin-bottom: 18px;
}

.special-btn {
    background: linear-gradient(90deg, #1976d2 10%, #21cbf3 90%);
    color: #fff;
    font-size: 1.09rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    box-shadow: 0 2px 14px #1976d255;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s, transform 0.1s;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;   /* Căn giữa icon và chữ trong nút */
    gap: 9px;
 	width: auto;
    max-width: 210px; /* Hoặc set max-width cho nút */
}
.special-btn:hover {
    background: linear-gradient(90deg, #1560a7 0%, #21cbf3 100%);
    transform: scale(1.03);
    box-shadow: 0 6px 24px #1976d288;
}

.special-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(40,50,90,0.33);
    align-items: center;
    justify-content: center;
}
.special-modal.active {
    display: flex;
}
.special-modal-content {
    background: #f8fbff;
    border-radius: 22px;
    max-width: 520px;
    width: 97vw;
    padding: 34px 28px 32px 28px;
    position: relative;
    box-shadow: 0 16px 56px #1976d245, 0 2px 8px #1976d233;
    animation: fadeIn 0.22s cubic-bezier(.5,1.8,.6,1);
    border: 3px solid #1976d21a;
}
@keyframes fadeIn {
    from {transform: translateY(60px) scale(0.96); opacity:0;}
    to {transform: translateY(0) scale(1); opacity:1;}
}
.special-modal-close {
    position: absolute;
    top: 12px; right: 18px;
    font-size: 2.3rem;
    color: #1976d2;
    cursor: pointer;
    font-weight: bold;
    opacity: 0.74;
    transition: opacity 0.16s;
    z-index: 1;
}
.special-modal-close:hover {
    opacity: 1;
}
.special-modal-title {
    text-align: center;
    color: #1976d2;
    font-size: 1.32rem;
    font-weight: 900;
    margin-bottom: 15px;
    letter-spacing: 1.4px;
    text-shadow: 0 2px 12px #1976d220;
}
.special-puzzle-wrapper {
    position: relative;
    width: 180px; height: 180px;
    margin: 0 auto 10px auto;
}
.special-img {
    width: 100%; height: 100%;
    border-radius: 10px;
    object-fit: cover;
}
.puzzle-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
}
.puzzle-piece {
    background: repeating-linear-gradient(
        135deg,
        #b4d1f7 0px, #b4d1f7 18px,
        #8cbcf2 18px, #8cbcf2 36px
    );
    border: 2.4px solid #fff;
    border-radius: 14px;
    box-sizing: border-box;
    transition: 
        opacity 0.35s,
        box-shadow 0.21s,
        transform 0.23s cubic-bezier(.5,1.8,.6,1);
    box-shadow: 0 2px 12px #1976d210, 0 6px 20px #1976d211;
    opacity: 1;
    filter: drop-shadow(0 2px 8px #2196f340);
    cursor: pointer;
}
.puzzle-piece.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.15) rotate(-2deg);
}
.puzzle-piece:not(.hidden):hover {
    box-shadow: 0 6px 22px #1560a77a, 0 1px 6px #2196f360;
    transform: scale(1.06) rotate(1deg);
    filter: drop-shadow(0 6px 22px #1560a733);
}
.special-hint {
    color: #1560a7;
    background: linear-gradient(90deg, #e3f0fa 60%, #cde4fd 100%);
    font-size: 1.23rem;
    font-weight: 700;
    letter-spacing: 1.1px;
    border-radius: 11px;
    padding: 14px 22px;
    margin: 0 auto 16px auto;   /* căn giữa block */
    text-align: center;
    max-width: 92vw;
    box-shadow: 0 2px 12px #1560a722, 0 1.5px 5px #1976d217;
    line-height: 1.45;
    word-break: break-word;
    display: block;  /* <-- block để margin auto hoạt động */
}

.special-answer {
    margin-top: 12px;
}
.special-answer input[type="text"] {
    font-size: 1.13rem;
    padding: 9px 18px;
    border-radius: 9px;
    border: 1.7px solid #1976d299;
    background: #f8fbff;
    margin-right: 7px;
    outline: none;
    width: 64%;
    min-width: 120px;
    transition: border 0.18s, box-shadow 0.19s;
}
.special-answer input[type="text"]:focus {
    border-color: #1976d2;
    background: #fff;
    box-shadow: 0 2px 8px #2196f32a;
}
.special-modal .special-puzzle-wrapper {
    width: 370px;
    height: 370px;
    max-width: 92vw;
    max-height: 74vw;
    margin: 0 auto 22px auto;
    background: #e7f0fd;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 6px 26px #1560a71f, 0 1.5px 5px #1976d217;
}

.special-modal .special-img {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 6px 32px #1976d222;
    filter: brightness(0.98);
}
.special-modal .special-puzzle-wrapper,
.special-modal .special-img {
    transition: all .25s cubic-bezier(.25,.8,.25,1);
}
.special-answer button,
#special-answer-btn {
    font-size: 1.09rem;
    padding: 10px 26px;
    background: linear-gradient(90deg, #1976d2 20%, #21cbf3 90%);
    color: #fff;
    border-radius: 8px;
    font-weight: 700;
    border: none;
    margin-top: 0;
    box-shadow: 0 2px 14px #1976d255;
    cursor: pointer;
    transition: background 0.17s, box-shadow 0.16s, transform 0.1s;
    margin-left: 4px;
}
.special-answer button:hover,
#special-answer-btn:hover {
    background: linear-gradient(90deg, #1560a7 0%, #21cbf3 100%);
    transform: scale(1.03);
    box-shadow: 0 6px 24px #1976d288;
}
#special-answer-btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    background: #b6c6dd !important;
}
.special-answer-result {
    margin-top: 11px;
    text-align: center;
    font-size: 1.07rem;
    font-weight: 700;
}
.special-title {
    color: #1976d2;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1.7px;
    background: linear-gradient(90deg, #e3f0fa 60%, #cde4fd 100%);
    border-radius: 12px;
    padding: 12px 22px 10px 22px;
    margin: 0 auto 16px auto;
    text-align: center;
    box-shadow: 0 2px 12px #1976d215, 0 1.5px 5px #1976d217;
    max-width: 92vw;
    line-height: 1.2;
    display: block;
    text-transform: uppercase;
}

/* Modal */
.intro-modal-backdrop {
    position: fixed;
    z-index: 10001;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(10,30,50,0.48);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    animation: fadeIn 0.36s;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.intro-modal-title {
    text-align: center;
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 1.75em;
    font-weight: bold;
    color: #330099;
    margin-bottom: 18px;
    margin-top: 0;
    letter-spacing: 0.03em;
    line-height: 1.3;
    background: linear-gradient(90deg, #2196f3 10%, #64b5f6 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    text-shadow:
        0 2px 12px #1976d244,
        0 2px 8px #1976d266;
}
@media (max-width: 600px) {
    .intro-modal-title { font-size: 1.2em; }
}

.intro-modal {
    background: #fff;
    border-radius: 18px;
    max-width: 440px;
    width: 94vw;
    box-shadow: 0 8px 36px #1976d288, 0 1px 8px #1976d255;
    padding: 28px 26px 16px 26px;
    position: relative;
    animation: popupScale 0.38s cubic-bezier(.56,1.36,.78,1.04);
}
@keyframes popupScale {
    0% { transform: scale(0.75); opacity: 0; }
    80% { transform: scale(1.08); }
    100% { transform: scale(1); opacity: 1; }
}
.intro-modal-close {
    position: absolute;
    top: 7px; right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #1976d2;
    cursor: pointer;
    font-weight: bold;
    opacity: 0.7;
}
.intro-modal-content {
    font-size: 1.1em;
    color: #2c365a;
    margin-bottom: 16px;
}
.intro-modal-content ul {
    padding-left: 20px;
    margin-top: 7px;
}
.intro-modal-btn {
    display: block;
    width: 100%;
    margin: 0 auto;
    font-size: 1.2em;
    font-weight: bold;
    background: linear-gradient(90deg, #2196f3 30%, #64b5f6 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 0 12px 0;
    cursor: pointer;
    box-shadow: 0 3px 8px #2196f320;
    letter-spacing: 0.03em;
    transition: background 0.18s;
}
.intro-modal-btn:hover {
    background: linear-gradient(90deg, #1976d2 40%, #4fc3f7 100%);
}
@media (max-width: 600px) {
    .intro-modal { padding: 16px 7px 10px 7px; max-width: 98vw; }
    .intro-modal-content { font-size: 1em; }
}

@media (max-width: 520px) {
    .special-title, .special-modal-title {
        font-size: 1.09rem;
        padding: 7px 4vw;
        border-radius: 9px;
    }
}
/* --- Nút Remote mobile --- */
.controller-btn {
    display: block;                /* Đổi từ inline-block sang block để margin auto có tác dụng */
    width: 60%;
    max-width: 160px;              /* Nhỏ gọn hơn */
    background: linear-gradient(90deg, #CC0033 60%, #FF0033 100%);
    color: #fff;
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 0.8em;
    font-weight: 700;
    border: none;
    border-radius: 14px;
    padding: 7px 0 8px 0;
    margin: 10px auto 18px auto;   /* Căn giữa ngang */
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 2px 10px #1976d233, 0 1px 4px #91c7ff40;
    transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
    text-align: center;
}


.controller-btn:hover,
.controller-btn:focus {
    background: linear-gradient(90deg, #990033 60%, #FF0000 100%);
    box-shadow: 0 6px 24px #1976d23a, 0 3px 9px #91c7ff50;
    transform: translateY(-2px) scale(1.04);
    outline: none;
}

.controller-btn:active {
    background: linear-gradient(90deg, #990033 70%, #FF0000 100%);
    transform: scale(0.97);
    box-shadow: 0 1px 5px #1976d233;
}

/*modal remote */
.modal {
    display: none; /* JS điều khiển */
    position: fixed;
    z-index: 9999;
    left: 0; top: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(30,44,66,0.37);
    align-items: center;
    justify-content: center;
    transition: background 0.18s;
}

/* Khi hiện modal */
.modal.show, .modal.active {
    display: flex !important;
}

/* Nội dung modal, căn giữa tự động */
.modal-content {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px #1976d269, 0 2px 8px #6bbfff1a;
    margin: auto;
    padding: 32px 30px 28px 30px;
    min-width: 320px;
    width: 100%;
    max-width: 440px;      /* max rộng popup, chỉnh theo ý bạn */
    max-height: 94vh;
    overflow-y: auto;
    position: relative;
    text-align: center;
    animation: modal-pop-in 0.36s cubic-bezier(.5,1.8,.9,1.2);
    font-family: 'Montserrat', Arial, sans-serif;
}

/* Responsive nhỏ */
@media (max-width: 500px) {
    .modal-content {
        min-width: unset;
        width: 96vw;
        max-width: 96vw;
        font-size: 0.97em;
        padding: 18px 5vw 14px 5vw;
    }
}

/* Các phần còn lại giữ nguyên */
.close {
    position: absolute;
    right: 16px;
    top: 12px;
    font-size: 2.1em;
    color: #1a1e25;
    cursor: pointer;
    transition: color 0.13s, transform 0.16s;
    z-index: 2;
}
.close:hover {
    color: #1976d2;
    transform: scale(1.23) rotate(6deg);
}
.modal-content img {
    margin: 13px 0 5px 0;
    border-radius: 10px;
    box-shadow: 0 2px 12px #1976d222;
    width: 150px;
    max-width: 70vw;
    background: #f4faff;
}
@media (max-width: 480px) {
    .modal-content img {
        width: 115px;
        max-width: 95vw;
    }
}
@keyframes modal-pop-in {
    0% { transform: scale(0.85) translateY(40px); opacity: 0; }
    80% { transform: scale(1.06) translateY(-8px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.back-home-btn {
    background: linear-gradient(90deg, #007700 60%, #00DD00 100%);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 0.55em;
    padding: 2px 7px;
    box-shadow: 0 1px 2px #1976d222;
    cursor: pointer;
    line-height: 1.1;
    min-height: 0;
    transition: background .15s, transform .14s;
}

.back-home-btn:active { background: #1252a1; }

/* --- Responsive --- */
@media (max-width: 1300px) {
    .main-flex-container { max-width: 99vw; gap: 10px; }
    .content-panel { max-width: 99vw; padding: 2vw 2vw 2vw 2vw; }
    .content-panel img { max-width: 90vw;}
    .header-bar { max-width: 99vw;}
}
@media (max-width: 1000px) {
    .main-flex-container { flex-direction: column; gap: 11px; }
    .sidebar-question-list, .right-stats-panel { flex-direction: row; max-width: unset; min-width: unset; width: 100%; padding: 12px 3px 12px 3px; border-radius: 9px; margin: 0 0 13px 0;}
    .sidebar-question-list, .right-stats-panel { width: 100%; }
    .qnav-btn { width: 34px; height: 34px; font-size: 0.96rem;}
    .stat-row { font-size: 1rem; }
    .content-panel { padding: 3vw; }
}
@media (max-width: 700px) {
    .hintbox { font-size: 1.25rem; padding: 8px 10px; border-radius: 7px; }
    .hintbox b { font-size: 1.2rem; }
    .content-panel, .tab-content, .sidebar-question-list, .right-stats-panel { border-radius: 8px; }
    .game-title, h1 { font-size: 2.1rem; }
    .answer-reveal-big { font-size: 1.65rem; padding: 8px 4vw; }
    .hint { font-size: 1.25rem; }
    .question-img { margin-bottom: 15px !important;}
    .alphabet-box { padding: 7px 1vw 8px 1vw; }
}
@media (max-width: 600px) {
    .button-row { gap: 8px; }
    .button-row button, .button-row .answer-form button { padding: 8px 6vw; font-size: 0.99rem; }
    .button-row .answer-form input { width: 85vw; }
    .content-panel { padding: 2vw; }
}
@media (max-width: 520px) {
    .special-modal-content {
        padding: 14px 2vw 20px 2vw;
        border-radius: 12px;
    }
    .special-modal .special-puzzle-wrapper {
        width: 94vw;
        height: 52vw;
        max-width: 97vw;
        max-height: 62vw;
        border-radius: 9px;
    }
    .special-modal .special-img {
        border-radius: 9px;
    }
}

@media (max-width: 520px) {
    .special-hint {
        font-size: 1.04rem;
        padding: 8px 5vw;
        border-radius: 8px;
    }
}
@media (min-width: 600px) {
    .game-title-img {
        max-width: 900px;
    }
}
