/* ============================================================
   GLOBAL
   ============================================================ */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;

    width: 100%;
    min-height: 100%;

    font-family:
        Arial,
        "Noto Sans JP",
        sans-serif;

    background: #080d17;
    color: white;
}

button,
input {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.hidden {
    display: none !important;
}

.screen-overlay {
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            rgba(5, 10, 20, 0.72),
            rgba(5, 10, 20, 0.95)
        );

    pointer-events: none;
}


/* ============================================================
   COMMON BUTTON
   ============================================================ */

.battle-button {
    width: 100%;
    height: 62px;

    margin-top: 16px;

    border: none;
    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            #fbbf24,
            #f97316
        );

    color: #111827;

    font-size: 17px;
    font-weight: 900;

    letter-spacing: 3px;

    cursor: pointer;

    box-shadow:
        0 8px 28px
        rgba(245, 158, 11, 0.22);

    transition:
        transform 0.08s;
}

.battle-button:active {
    transform: scale(0.97);
}

.secondary-button {
    width: 100%;
    height: 52px;

    margin-top: 10px;

    border: 1px solid #475569;
    border-radius: 12px;

    background: #1f2937;

    color: white;

    font-weight: 800;

    cursor: pointer;
}


/* ============================================================
   SIDE MENU
   ============================================================ */

.menu-overlay {
    position: fixed;

    z-index: 90;

    inset: 0;

    visibility: hidden;

    opacity: 0;

    background:
        rgba(0, 0, 0, 0.65);

    transition: 0.25s;
}

.menu-overlay.show {
    visibility: visible;
    opacity: 1;
}

.side-menu {
    position: fixed;

    z-index: 100;

    top: 0;
    right: 0;

    width: min(85%, 340px);
    height: 100dvh;

    background: #0f172a;

    transform:
        translateX(100%);

    transition:
        transform 0.25s ease;
}

.side-menu.show {
    transform:
        translateX(0);
}

.side-menu-header {
    height: 75px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 20px;

    border-bottom:
        1px solid #334155;

    color: #fbbf24;

    letter-spacing: 2px;
}

.menu-close {
    border: none;

    background: transparent;

    color: white;

    font-size: 20px;

    cursor: pointer;
}

.menu-item {
    width: 100%;
    height: 62px;

    padding: 0 22px;

    border: none;
    border-bottom:
        1px solid
        rgba(255,255,255,0.05);

    background: transparent;

    color: #e2e8f0;

    text-align: left;

    font-weight: 700;

    cursor: pointer;
}

.side-menu-divider {
    height: 1px;
    margin: 18px 20px;
    background: rgba(255, 255, 255, 0.12);
}

.side-menu-links {
    display: flex;
    flex-direction: column;
    padding: 0 20px;
}

.menu-link {
    padding: 7px 0;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.menu-link:hover {
    color: #fff;
}

.side-menu-link-separator {
    height: 10px;
}

.side-menu-footer {
    margin-top: auto;
    padding: 24px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
}



.home-language-icon {
    font-size: 15px;
}




.home-language option {
    color: #111;
}




.home-login-btn:hover {
    background:
        rgba(255,255,255,.17);
}


.home-login-btn:active {
    transform: scale(.97);
}


.home-login-icon {
    font-size: 17px;
}


/* =========================================
   LOGGED USER
========================================= */

.home-user-btn {
    height: 42px;

    padding: 5px 12px 5px 6px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    border:
        1px solid
        rgba(255, 255, 255, 0.12);

    border-radius: 12px;

    background:
        rgba(20, 20, 28, 0.88);

    color: #fff;

    font-size: 13px;
    font-weight: 700;

    white-space: nowrap;

    cursor: pointer;

    backdrop-filter: blur(10px);

    transition:
        background 0.15s ease,
        transform 0.15s ease;
}


.home-user-btn:hover {
    background:
        rgba(35, 35, 45, 0.95);
}


.home-user-btn:active {
    transform: scale(0.97);
}


/* AVATAR */

.home-user-avatar,
.home-user-avatar-fallback {
    width: 30px;
    height: 30px;

    flex: 0 0 30px;

    border-radius: 50%;
}


.home-user-avatar {
    display: block;

    object-fit: cover;

    border:
        1px solid
        rgba(255, 255, 255, 0.25);
}


.home-user-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;

    background:
        rgba(255, 255, 255, 0.15);

    color: #fff;

    font-size: 13px;
    font-weight: 800;

    text-transform: uppercase;
}


/* USER NAME */

.home-user-name {
    display: block;

    max-width: 100px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #fff;

    font-size: 13px;
    font-weight: 700;
}

/* =========================================
   HOME USER MENU
========================================= */

.home-user-menu {
    position: absolute;

    top: calc(100% + 10px);
    right: 0;

    width: 260px;

    padding: 12px;

    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;

    background: rgba(15, 18, 28, 0.96);

    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.35);

    backdrop-filter: blur(14px);

    z-index: 100;
}


/* HEADER */

.home-user-menu-header {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 6px;
}


.user-menu-avatar {
    width: 42px;
    height: 42px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.15);

    color: white;

    font-size: 18px;
    font-weight: 800;
}


.user-menu-avatar img {
    width: 100%;
    height: 100%;

    border-radius: 50%;

    object-fit: cover;
}


/* USER INFO */

.user-menu-info {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 3px;
}


.user-menu-info strong {
    color: white;

    font-size: 14px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.user-menu-info span {
    color: rgba(255, 255, 255, 0.55);

    font-size: 11px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* DIVIDER */

.home-user-menu-divider {
    height: 1px;

    margin: 10px 4px;

    background: rgba(255, 255, 255, 0.10);
}


/* MENU ITEM */

.home-user-menu-item {
    width: 100%;

    padding: 10px 12px;

    display: flex;
    align-items: center;

    gap: 10px;

    border: 0;
    border-radius: 9px;

    background: transparent;

    color: white;

    font-size: 13px;
    font-weight: 700;

    text-align: left;

    cursor: pointer;

    transition: background 0.15s ease;
}


.home-user-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}


.home-user-menu-item.logout {
    color: #ff8080;
}


/* MOBILE */

@media (max-width: 600px) {

    .home-user-menu {
        width: 230px;
    }

}
/* =========================================================
   REVIEW HEADER
   ========================================================= */
.review-header-button {
    height: 40px;
    padding: 0 7px 0 11px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 20px;
    background: rgba(18, 22, 32, 0.78);
    color: #fff;
    font-family: inherit;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.review-header-button:hover {
    background: rgba(255, 255, 255, 0.12);
}

.review-header-button:active {
    transform: scale(.96);
}

.review-header-button.hidden {
    display: none;
}

.review-floating-icon {
    font-size: 18px;
    line-height: 1;
}

.review-floating-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .5px;
}

.review-floating-count {
    min-width: 23px;
    height: 23px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}



/* =========================================================
   REVIEW SCREEN
   ========================================================= */

.review-screen {
    position: fixed;
    inset: 0;
    z-index: 800;
    min-height: 100dvh;
    padding: 20px;
    overflow-y: auto;
    background: #10141f;
    color: #fff;
}

.review-header {
    width: min(700px, 100%);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.review-back-button {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
}

.review-header-info {
    flex: 1;
}

.review-title {
    font-size: 18px;
    font-weight: 800;
}

.review-session-info {
    margin-top: 3px;
    font-size: 12px;
    opacity: .65;
}

.review-card {
    position: relative;
    width: min(700px, 100%);
    margin: 0 auto;
    padding: 25px;
    border-radius: 20px;
    background: rgba(255,255,255,.07);
}

.review-question-level {
    margin-bottom: 20px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    opacity: .65;
}

.review-streak {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 12px;
    font-weight: 800;
}

.review-question {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: clamp(24px, 5vw, 38px);
    font-weight: 800;
}

.review-reading {
    min-height: 30px;
    margin-bottom: 20px;
    text-align: center;
    opacity: .7;
}

.review-answers {
    display: grid;
    gap: 10px;
}

.review-answer-button {
    min-height: 58px;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
}

.review-screen.hidden {
    display: none;
}

.review-answer-button {
    min-height: 58px;
    padding: 12px 16px;
    border: 2px solid transparent;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
    transition: transform .12s ease, opacity .12s ease, background .15s ease;
}

.review-answer-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.review-answer-button:disabled {
    cursor: default;
}

.review-answer-button.correct {
    background: #22c55e;
    color: #fff;
    border-color: #16a34a;
}

.review-answer-button.wrong {
    background: #ef4444;
    color: #fff;
    border-color: #dc2626;
}

.review-streak.correct {
    color: #22c55e;
}

.review-streak.wrong {
    color: #ef4444;
}

.review-streak.mastered {
    color: #22c55e;
    font-weight: 900;
}
/* =========================================================
   INFO SCREEN
   ========================================================= */

.info-screen {
    position: fixed;
    inset: 0;
    z-index: 2000;
    overflow-y: auto;
    background: #080d17;
    color: #fff;
}

.info-container {
    width: min(760px, calc(100% - 40px));
    margin: 0 auto;
    padding: 30px 0 60px;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.info-header h1 {
    margin: 0;
    font-size: 24px;
}

.info-back-button {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

.info-content {
    line-height: 1.7;
}

.info-content h2 {
    margin: 0 0 20px;
}

.info-content h3 {
    margin: 30px 0 8px;
}

.info-content p {
    color: rgba(255, 255, 255, 0.72);
}

.info-footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
}

@media (max-width: 600px) {
    .info-container {
        width: calc(100% - 32px);
        padding-top: 20px;
    }

    .info-header {
        margin-bottom: 28px;
    }

    .info-header h1 {
        font-size: 20px;
    }
}
