:root {
    --bg: #e3e3e1;
    --text: #111111;
    --muted: #555555;
    --card: transparent;

    --dark-bg: #121213;
    --dark-text: #ffffff;
    --dark-muted: #d7dadc;
    --dark-line: #3a3a3c;

    --line: #d3d6da;
    --black: #111111;
    --white: #ffffff;

    --correct: #538d4e;
    --present: #b59f3b;
    --absent: #3a3a3c;

    --button-bg: #111111;
    --button-text: #ffffff;

    --modal-bg: #ffffff;
    --modal-text: #111111;
    --modal-muted: #555555;
    --modal-line: #d3d6da;

    --font-serif: Georgia, "Times New Roman", serif;
    --font-sans: Arial, Helvetica, sans-serif;
}

body.dark-mode {
    --bg: #121213;
    --text: #ffffff;
    --muted: #d7dadc;
    --card: transparent;

    --button-bg: #ffffff;
    --button-text: #111111;

    --modal-bg: #121213;
    --modal-text: #ffffff;
    --modal-muted: #d7dadc;
    --modal-line: #3a3a3c;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
}

body {
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font-family: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.home-page {
    background: var(--bg);
    color: var(--text);
}

#app {
    min-height: 100vh;
}

.home-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.home-card {
    width: min(520px, 100%);
    text-align: center;
    margin-top: -16px;
}

.logo-grid {
    width: 82px;
    height: 82px;
    margin: 0 auto 18px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    border: 4px solid var(--black);
    border-radius: 10px;
    padding: 4px;
    background: var(--black);
}

body.dark-mode .logo-grid {
    border-color: var(--white);
    background: var(--white);
}

.tile-logo {
    border-radius: 2px;
}

.tile-logo.yellow {
    background: #c9b458;
}

.tile-logo.green {
    background: #6aaa64;
}

.tile-logo.empty {
    background: #ffffff;
}

.app-title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 56px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -2px;
}

.app-tagline {
    margin: 22px auto 34px;
    max-width: 430px;
    font-family: var(--font-serif);
    font-size: 35px;
    line-height: 1.13;
    color: var(--text);
}

.welcome-text {
    margin: -14px 0 24px;
    color: var(--muted);
    font-size: 15px;
}

.home-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
}

.btn {
    min-width: 150px;
    height: 48px;
    border-radius: 999px;
    border: 1.5px solid var(--black);
    padding: 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}

.btn-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    display: block;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-icon * {
    fill: none;
    stroke: currentColor;
}

body.dark-mode .btn {
    border-color: var(--white);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
    opacity: 0.86;
}

.btn-primary {
    background: var(--black);
    color: var(--white);
}

body.dark-mode .btn-primary {
    background: var(--white);
    color: var(--black);
}

.btn-outline {
    background: transparent;
    color: var(--black);
}

body.dark-mode .btn-outline {
    color: var(--white);
}

.btn-full {
    width: 100%;
}

.home-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 46px;
}

.circle-btn {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    border: 1.5px solid var(--black);
    background: transparent;
    color: var(--black);
    font-size: 22px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s ease, background 0.12s ease;
}

body.dark-mode .circle-btn {
    color: var(--white);
    border-color: var(--white);
}

.circle-btn:hover {
    transform: translateY(-1px);
}

.circle-btn svg {
    width: 21px;
    height: 21px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.circle-btn svg * {
    fill: none;
    stroke: currentColor;
}

.home-meta {
    font-size: 15px;
    line-height: 1.45;
    color: var(--muted);
}

.home-meta a {
    color: var(--text);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Modal */

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.modal.is-open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.48);
}

.modal-card {
    position: relative;
    z-index: 2;
    width: min(480px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    background: var(--modal-bg);
    color: var(--modal-text);
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.modal-card h2 {
    margin: 0 0 16px;
    font-size: 28px;
    line-height: 1.15;
}

.modal-card p {
    line-height: 1.45;
    color: var(--modal-text);
}

.modal-card .login-reminder {
    color: #7a5a00;
    font-weight: 800;
}

.modal-card .login-reminder a {
    color: inherit;
    display: inline-block;
    margin-left: 4px;
}

body.dark-mode .modal-card .login-reminder {
    color: #f2d05b;
}

.modal-card a {
    color: var(--modal-text);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: var(--modal-text);
    font-size: 31px;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    opacity: 0.7;
}

/* Donation */

.donation-card {
    width: min(420px, 100%);
    text-align: left;
}

.donation-card h2 {
    margin-bottom: 10px;
}

.donation-card p {
    max-width: 320px;
    margin-left: 0;
    margin-right: 0;
}

.donation-qris-frame {
    width: min(280px, 100%);
    min-height: 280px;
    margin: 18px auto 12px;
    padding: 12px;
    border: 1.5px solid var(--modal-line);
    border-radius: 20px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.donation-qris-frame img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.donation-placeholder {
    width: 100%;
    min-height: 252px;
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.35;
}

.donation-note {
    color: var(--modal-muted) !important;
    font-size: 13px;
    text-align: center;
    margin-left: auto !important;
    margin-right: auto !important;
}

.about-card {
    width: min(500px, 100%);
    text-align: left;
}

.about-card p {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    line-height: 1.55;
}

.about-donation-link {
    margin-top: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1.5px solid var(--modal-text);
    background: var(--modal-text);
    color: var(--modal-bg);
    font: inherit;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}

.about-donation-link:hover {
    transform: translateY(-1px);
}

/* Help example */

.example-row {
    display: flex;
    gap: 5px;
    margin: 16px 0 8px;
}

.mini-tile {
    width: 42px;
    height: 42px;
    border: 2px solid var(--modal-line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 20px;
    color: var(--modal-text);
    transform-origin: center;
}

.mini-tile.correct,
.mini-tile.present,
.mini-tile.absent {
    color: #ffffff;
    border-color: transparent;
}

.mini-tile.correct {
    background: var(--correct);
}

.mini-tile.present {
    background: var(--present);
}

.mini-tile.absent {
    background: var(--absent);
}

#helpModal.is-open .mini-tile {
    animation: helpTileReveal 0.42s cubic-bezier(.2, .95, .28, 1.25) both;
}

#helpModal.is-open .example-row .mini-tile:nth-child(1) {
    animation-delay: 0.04s;
}

#helpModal.is-open .example-row .mini-tile:nth-child(2) {
    animation-delay: 0.1s;
}

#helpModal.is-open .example-row .mini-tile:nth-child(3) {
    animation-delay: 0.16s;
}

#helpModal.is-open .example-row .mini-tile:nth-child(4) {
    animation-delay: 0.22s;
}

#helpModal.is-open .example-row .mini-tile:nth-child(5) {
    animation-delay: 0.28s;
}

@keyframes helpTileReveal {
    0% {
        opacity: 0;
        transform: translateY(6px) scale(0.88);
        color: transparent;
    }

    55% {
        opacity: 1;
        transform: translateY(0) scale(1.06);
        color: transparent;
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    #helpModal.is-open .mini-tile {
        animation: none;
    }
}

/* Setting */

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 0;
    font-size: 17px;
    font-weight: 800;
    border-bottom: 1px solid var(--modal-line);
}

.setting-note {
    margin-bottom: 0;
    color: var(--modal-muted) !important;
    font-size: 14px;
}

/* Toggle switch */

.switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 30px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d3d6da;
    border-radius: 999px;
    transition: 0.2s ease;
}

.slider::before {
    content: "";
    position: absolute;
    height: 24px;
    width: 24px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}

.switch input:checked + .slider {
    background: var(--correct);
}

.switch input:checked + .slider::before {
    transform: translateX(24px);
}

/* Utility */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Responsive */

@media (max-width: 520px) {
    .modal {
        padding: 12px;
    }

    .home-screen {
        padding: 28px 18px;
    }

    .home-card {
        margin-top: 0;
    }

    .logo-grid {
        width: 78px;
        height: 78px;
    }

    .app-title {
        font-size: 50px;
    }

    .app-tagline {
        font-size: 31px;
        max-width: 390px;
    }

    .home-actions {
        gap: 10px;
    }

    .btn {
        min-width: 132px;
        padding: 0 18px;
    }

    .modal-card {
        padding: 26px 22px;
        max-height: calc(100dvh - 92px);
    }
}

@media (max-width: 380px) {
    .app-title {
        font-size: 46px;
    }

    .app-tagline {
        font-size: 28px;
    }

    .home-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn {
        width: 100%;
        max-width: 240px;
    }

    .home-icons {
        margin-bottom: 36px;
    }

    .mini-tile {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
}

/* =========================================================
   GAME PAGE
   ========================================================= */

.game-page {
    background: #121213;
    color: #ffffff;
    min-height: 100vh;
}

#gameApp {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 50px;
}

.game-topbar {
    height: 48px;
    border-bottom: 1px solid #3a3a3c;
    display: grid;
    grid-template-columns: 46px 1fr 46px;
    align-items: center;
    padding: 0 8px;
    background: #121213;
    position: sticky;
    top: 0;
    z-index: 50;
}

.game-title {
    text-align: center;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 28px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 1px;
    color: #ffffff;
    text-decoration: none;
}

.top-icon {
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.top-icon:hover {
    background: rgba(255, 255, 255, 0.08);
}

.game-info {
    text-align: center;
    padding: 10px 12px 2px;
    color: #d7dadc;
    font-size: 14px;
    line-height: 1.4;
}

#gameNumber {
    font-weight: 900;
    color: #ffffff;
}

#gameStatus {
    margin-top: 2px;
    color: #d7dadc;
}

.board-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 10px 10px 8px;
}

.board {
    width: min(320px, calc(100vw - 42px));
    display: grid;
    gap: 4px;
}

.board-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.game-tile {
    aspect-ratio: 1 / 1;
    border: 2px solid #3a3a3c;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #ffffff;
    font-size: clamp(24px, 7vw, 32px);
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    user-select: none;
}

.game-tile.filled {
    border-color: #565758;
    animation: tilePop 0.08s ease;
}

.game-tile.correct,
.game-tile.present,
.game-tile.absent {
    color: #ffffff;
    border-color: transparent;
}

.game-tile.correct {
    background: #538d4e;
}

.game-tile.present {
    background: #b59f3b;
}

.game-tile.absent {
    background: #3a3a3c;
}

.game-tile.flip {
    animation: tileFlip 0.45s ease forwards;
}

.keyboard {
    width: 100%;
    max-width: 480px;
    margin: auto auto 6px;
    padding: 0 8px 6px;
    touch-action: manipulation;
}

.key-row {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 6px;
}

.key-row.middle {
    padding: 0 14px;
}

.key {
    height: 50px;
    min-width: 0;
    flex: 1;
    border: 0;
    border-radius: 4px;
    background: #818384;
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    text-transform: uppercase;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.key.wide {
    flex: 1.55;
    font-size: 11px;
}

.key:hover {
    filter: brightness(1.05);
}

.key:active {
    transform: translateY(1px);
}

.key.correct,
.key.present,
.key.absent {
    color: #ffffff;
}

.key.correct {
    background: #538d4e;
}

.key.present {
    background: #b59f3b;
}

.key.absent {
    background: #3a3a3c;
}

.toast {
    position: fixed;
    top: 74px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    color: #121213;
    padding: 12px 16px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 2000;
    max-width: calc(100vw - 32px);
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.toast.show {
    opacity: 1;
}

.result-card {
    text-align: center;
}

.result-game-no {
    color: var(--modal-muted);
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 12px;
}

.result-answer {
    margin: 10px 0 8px;
    font-size: 42px;
    letter-spacing: 5px;
    font-weight: 900;
    color: var(--modal-text);
}

.result-meaning {
    margin: 0 auto 18px;
    color: var(--modal-muted) !important;
    line-height: 1.45;
}

.result-pattern {
    margin: 16px auto 18px;
    white-space: pre-line;
    font-size: 22px;
    line-height: 1.25;
}

.result-link {
    margin-top: 10px;
}

.game-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 40px;
    background: #121213;
    border-top: 1px solid #3a3a3c;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 6px 12px;
    z-index: 60;
}

.game-bottom-nav a {
    color: #d7dadc;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.game-bottom-nav a:hover {
    color: #ffffff;
}

/* Animasi */

@keyframes tilePop {
    0% {
        transform: scale(0.92);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes tileFlip {
    0% {
        transform: rotateX(0);
    }

    50% {
        transform: rotateX(90deg);
    }

    100% {
        transform: rotateX(0);
    }
}

@keyframes rowShake {
    10%, 90% {
        transform: translateX(-1px);
    }

    20%, 80% {
        transform: translateX(2px);
    }

    30%, 50%, 70% {
        transform: translateX(-4px);
    }

    40%, 60% {
        transform: translateX(4px);
    }
}

.board-row.shake {
    animation: rowShake 0.45s ease;
}

/* Game light mode */

body.game-page:not(.dark-mode) {
    background: #ffffff;
    color: #1a1a1b;
}

body.game-page:not(.dark-mode) #gameApp {
    background: #ffffff;
}

body.game-page:not(.dark-mode) .game-topbar {
    background: #ffffff;
    border-bottom-color: #d3d6da;
}

body.game-page:not(.dark-mode) .game-title,
body.game-page:not(.dark-mode) .top-icon,
body.game-page:not(.dark-mode) #gameNumber {
    color: #1a1a1b;
}

body.game-page:not(.dark-mode) #gameStatus,
body.game-page:not(.dark-mode) .game-info {
    color: #555555;
}

body.game-page:not(.dark-mode) .top-icon:hover {
    background: rgba(0, 0, 0, 0.06);
}

body.game-page:not(.dark-mode) .game-tile {
    border-color: #d3d6da;
    color: #1a1a1b;
}

body.game-page:not(.dark-mode) .game-tile.filled {
    border-color: #878a8c;
}

body.game-page:not(.dark-mode) .game-tile.correct,
body.game-page:not(.dark-mode) .game-tile.present,
body.game-page:not(.dark-mode) .game-tile.absent {
    color: #ffffff;
}

body.game-page:not(.dark-mode) .key {
    background: #d3d6da;
    color: #1a1a1b;
}

body.game-page:not(.dark-mode) .key.correct,
body.game-page:not(.dark-mode) .key.present,
body.game-page:not(.dark-mode) .key.absent {
    color: #ffffff;
}

body.game-page:not(.dark-mode) .key.correct {
    background: #6aaa64;
}

body.game-page:not(.dark-mode) .key.present {
    background: #c9b458;
}

body.game-page:not(.dark-mode) .key.absent {
    background: #787c7e;
}

body.game-page:not(.dark-mode) .game-bottom-nav {
    background: #ffffff;
    border-top-color: #d3d6da;
}

body.game-page:not(.dark-mode) .game-bottom-nav a {
    color: #555555;
}

body.game-page:not(.dark-mode) .game-bottom-nav a:hover {
    color: #1a1a1b;
}

/* Responsive game */

@media (max-width: 520px) {
    #gameApp {
        min-height: auto;
        padding-bottom: 44px;
    }

    .game-topbar {
        height: 46px;
        grid-template-columns: 42px 1fr 42px;
    }

    .game-title {
        font-size: 26px;
    }

    .top-icon {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .board-wrap {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .board {
        width: min(304px, calc(100vw - 46px));
    }

    .keyboard {
        margin: 4px auto 6px;
        padding-left: 5px;
        padding-right: 5px;
    }

    .key-row {
        gap: 4px;
        margin-bottom: 5px;
    }

    .key-row.middle {
        padding: 0 10px;
    }

    .key {
        height: 46px;
        font-size: 11px;
    }

    .key.wide {
        font-size: 10px;
    }

    .result-answer {
        font-size: 38px;
    }
}

@media (max-width: 380px) {
    #gameApp {
        padding-bottom: 42px;
    }

    .board {
        width: min(292px, calc(100vw - 42px));
    }

    .key-row {
        gap: 4px;
    }

    .key-row.middle {
        padding: 0 10px;
    }

    .key {
        height: 43px;
        font-size: 10px;
        border-radius: 4px;
    }

    .key.wide {
        font-size: 9px;
    }

    .game-bottom-nav {
        gap: 13px;
    }
}

#resultMeaning {
    margin: 10px auto 18px;
    max-width: 360px;
    font-size: 15px;
    line-height: 1.5;
    color: #555;
    text-align: center;
}

#resultMeaning div {
    margin-bottom: 3px;
}

#resultMeaning strong {
    color: #222;
}

body.dark-mode #resultMeaning {
    color: #d4d4d4;
}

body.dark-mode #resultMeaning strong {
    color: #ffffff;
}

/* =========================================================
   SAKLA RESULT SHARE FINAL
   ========================================================= */

.result-card {
    text-align: center;
    padding: 26px 22px 24px;
    overflow: visible;
}

.result-card .modal-close {
    top: 8px;
    right: 10px;
}

.result-card h2 {
    margin-bottom: 16px;
    font-size: 30px;
    font-weight: 900;
}

.result-game-no {
    color: var(--modal-muted);
    font-size: 14px;
    font-weight: 900;
    margin-bottom: 3px;
}

.result-game-date {
    color: var(--modal-muted);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 10px;
}

.result-answer {
    margin: 8px 0 10px;
    font-size: 44px;
    letter-spacing: 6px;
    font-weight: 900;
    line-height: 1;
    color: var(--modal-text);
}

#resultMeaning,
.result-meaning {
    margin: 10px auto 18px;
    max-width: 360px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--modal-muted) !important;
    text-align: center;
}

#resultMeaning div,
.result-meaning div {
    margin-bottom: 4px;
}

#resultMeaning strong,
.result-meaning strong {
    color: var(--modal-text);
    font-weight: 900;
}

.result-pattern {
    margin: 16px auto 20px;
    white-space: pre-line;
    font-size: 22px;
    line-height: 1.25;
    letter-spacing: 1px;
}

.result-action-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0 10px;
    position: relative;
}

.result-action-btn {
    width: 100%;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding-left: 10px;
    padding-right: 10px;
    white-space: nowrap;
    font-size: 14px;
    line-height: 1;
}

.result-action-icon {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
}

.result-save-wrap,
.result-share-wrap {
    position: relative;
    min-width: 0;
}

.result-save-menu,
.result-share-menu {
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 224px;
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--modal-line);
    border-radius: 18px;
    background: var(--modal-bg);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.result-save-menu[hidden],
.result-share-menu[hidden] {
    display: none;
}

.result-share-btn {
    width: 100%;
    min-height: 42px;
    border: 1.5px solid var(--modal-text);
    background: transparent;
    color: var(--modal-text);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.1;
    cursor: pointer;
    transition:
        transform 0.12s ease,
        opacity 0.12s ease,
        background 0.12s ease,
        color 0.12s ease;
}

.result-share-btn:hover {
    background: var(--modal-text);
    color: var(--modal-bg);
    transform: translateY(-1px);
}

.result-share-btn:active {
    transform: translateY(0);
    opacity: 0.82;
}

.result-link {
    margin-top: 10px;
}

body.game-page:not(.dark-mode) .result-share-btn {
    border-color: #111111;
    color: #111111;
    background: #ffffff;
}

body.game-page:not(.dark-mode) .result-share-btn:hover {
    background: #111111;
    color: #ffffff;
}

body.game-page.dark-mode .result-share-btn {
    border-color: #ffffff;
    color: #ffffff;
    background: #121213;
}

body.game-page.dark-mode .result-share-btn:hover {
    background: #ffffff;
    color: #111111;
}

@media (max-width: 520px) {
    .result-card {
        width: min(430px, calc(100vw - 24px));
        max-height: calc(100dvh - 92px);
        padding: 22px 14px 18px;
        border-radius: 18px;
        overflow-y: auto;
    }

    .result-card .modal-close {
        top: 8px;
        right: 10px;
        font-size: 30px;
    }

    .result-card h2 {
        margin-bottom: 12px;
        font-size: 26px;
        line-height: 1.05;
    }

    .result-game-no {
        font-size: 13px;
        margin-bottom: 2px;
    }

    .result-game-date {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .result-answer {
        margin: 8px 0;
        font-size: 34px;
        letter-spacing: 4px;
    }

    #resultMeaning,
    .result-meaning {
        max-width: 100%;
        margin: 8px auto 12px;
        font-size: 13px;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .result-pattern {
        margin: 10px auto 14px;
        font-size: 17px;
        line-height: 1.08;
        letter-spacing: 0;
    }

    .result-action-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin: 10px 0 8px;
    }

    #copyResultBtn {
        grid-column: 1 / -1;
        width: min(100%, 320px);
        justify-self: center;
    }

    #saveStoryBtn,
    .result-share-wrap {
        min-width: 0;
        width: 100%;
    }

    .result-action-btn {
        min-height: 42px;
        gap: 5px;
        padding: 7px 10px;
        font-size: 13px;
        border-width: 1.4px;
    }

    .result-action-icon {
        width: 16px;
        height: 16px;
        font-size: 12px;
    }

    .result-save-menu,
    .result-share-menu {
        right: 0;
        top: auto;
        bottom: calc(100% + 8px);
        transform: none;
        width: min(232px, calc(100vw - 48px));
        gap: 7px;
        padding: 9px;
    }

    .result-share-btn {
        min-height: 39px;
        padding: 8px 10px;
        font-size: 12px;
    }

    .result-link {
        min-height: 42px;
        margin-top: 8px;
        padding: 8px 14px;
        font-size: 13px;
        line-height: 1.15;
    }
}

@media (max-width: 380px) {
    .result-answer {
        font-size: 31px;
        letter-spacing: 3px;
    }

    .result-pattern {
        font-size: 16px;
    }

    .result-action-btn {
        font-size: 12px;
        padding-left: 7px;
        padding-right: 7px;
    }
}

/* =========================================================
   GAME VISUAL POLISH V2
   Flat 2D colors, ukuran lebih ringkas, animasi tetap hidup.
   ========================================================= */
body.game-page {
    --game-font: "Arial Black", "Trebuchet MS", Arial, Helvetica, sans-serif;
    --tile-empty-bg: rgba(255, 255, 255, 0.025);
    --tile-empty-border: #4b5068;
    --tile-filled-bg: #1f2230;
    --tile-shadow: 0 3px 0 rgba(0, 0, 0, 0.32);
    --tile-shadow-active: 0 4px 0 rgba(0, 0, 0, 0.36);
    --key-bg: #686c82;
    --key-shadow: 0 3px 0 rgba(0, 0, 0, 0.32);
}

body.game-page:not(.dark-mode) {
    --tile-empty-bg: #f8fafc;
    --tile-empty-border: #bcc5d7;
    --tile-filled-bg: #eef2f8;
    --tile-shadow: 0 3px 0 #c8ceda;
    --tile-shadow-active: 0 4px 0 #b9c1d1;
    --key-bg: #d8deeb;
    --key-shadow: 0 3px 0 #b9c1d1;
}

body.game-page #gameApp {
    min-height: 100svh;
    background: var(--bg);
}

body.game-page:not(.dark-mode) #gameApp {
    background: #ffffff;
}

body.game-page .game-title {
    font-family: Georgia, "Times New Roman", serif;
    letter-spacing: 2px;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);
}

body.game-page:not(.dark-mode) .game-title {
    text-shadow: 0 2px 0 rgba(15, 23, 42, 0.08);
}

body.game-page .game-info {
    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
}

body.game-page #gameNumber {
    font-family: var(--game-font);
    letter-spacing: 0.6px;
}

body.game-page .board-wrap {
    perspective: 900px;
}

body.game-page .board {
    width: min(326px, calc(100vw - 44px));
    gap: 6px;
}

body.game-page .board-row {
    gap: 6px;
    transform-style: preserve-3d;
}

body.game-page .game-tile {
    position: relative;
    overflow: hidden;
    border: 2px solid var(--tile-empty-border);
    border-radius: 8px;
    background: var(--tile-empty-bg);
    color: #ffffff;
    font-family: var(--game-font);
    font-size: clamp(24px, 6.4vw, 32px);
    letter-spacing: 1px;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
    box-shadow: var(--tile-shadow);
    transform-style: preserve-3d;
    transition:
        border-color 0.16s ease,
        background 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease;
}

body.game-page .game-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: transparent;
    opacity: 0;
    pointer-events: none;
}

body.game-page .game-tile.filled {
    border-color: #6b7288;
    background: var(--tile-filled-bg);
    transform: translateY(-2px) scale(1.025);
    box-shadow: var(--tile-shadow-active);
    animation: tilePop3d 0.2s cubic-bezier(.2, 1.25, .45, 1);
}

body.game-page:not(.dark-mode) .game-tile {
    color: #1f2937;
}

body.game-page .game-tile.correct,
body.game-page .game-tile.present,
body.game-page .game-tile.absent {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
}

body.game-page .game-tile.correct {
    background: #538d4e;
}

body.game-page .game-tile.present {
    background: #b59f3b;
}

body.game-page .game-tile.absent {
    background: #3a3a3c;
}

body.game-page .game-tile.correct::after,
body.game-page .game-tile.present::after,
body.game-page .game-tile.absent::after {
    opacity: 1;
}

body.game-page .game-tile.flip {
    animation: tileReveal3d 0.58s cubic-bezier(.18, .84, .28, 1.04) forwards;
}

body.game-page .keyboard {
    width: min(100%, 610px);
    max-width: 610px;
    margin: auto auto 9px;
    padding: 6px 12px 8px;
}

body.game-page .key-row {
    gap: 6px;
    margin-bottom: 7px;
}

body.game-page .key-row.middle {
    padding: 0 16px;
}

body.game-page .key {
    height: 50px;
    border-radius: 8px;
    background: var(--key-bg);
    color: #ffffff;
    font-family: var(--game-font);
    font-size: 13px;
    letter-spacing: 0.4px;
    box-shadow: var(--key-shadow);
    transition:
        transform 0.1s ease,
        filter 0.12s ease,
        box-shadow 0.12s ease,
        background 0.18s ease;
}

body.game-page:not(.dark-mode) .key {
    color: #344054;
}

body.game-page .key:hover {
    filter: brightness(1.08);
}

body.game-page .key:active,
body.game-page .key.pressed {
    transform: translateY(2px) scale(0.985);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.26);
}

body.game-page .key.wide {
    flex: 1.72;
    font-size: 13px;
}

body.game-page .key.correct {
    background: #538d4e;
    color: #ffffff;
}

body.game-page .key.present {
    background: #b59f3b;
    color: #ffffff;
}

body.game-page .key.absent {
    background: #3a3a3c;
    color: #ffffff;
}

body.game-page .board-row.shake {
    animation: rowShake3d 0.48s ease;
}

@keyframes tilePop3d {
    0% {
        opacity: 0.6;
        transform: translateY(3px) scale(0.9) rotateX(12deg);
    }

    70% {
        transform: translateY(-3px) scale(1.05) rotateX(-5deg);
    }

    100% {
        opacity: 1;
        transform: translateY(-2px) scale(1.025) rotateX(0);
    }
}

@keyframes tileReveal3d {
    0% {
        transform: rotateX(0deg) translateZ(0) scale(1.02);
        filter: brightness(1);
    }

    44% {
        transform: rotateX(88deg) translateZ(18px) scale(1.04);
        filter: brightness(1.22);
    }

    56% {
        transform: rotateX(88deg) translateZ(18px) scale(1.04);
        filter: brightness(1.18);
    }

    100% {
        transform: rotateX(0deg) translateZ(0) scale(1);
        filter: brightness(1);
        box-shadow: 0 12px 18px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.24);
    }
}

@keyframes rowShake3d {
    10%, 90% {
        transform: translateX(-2px) rotateZ(-0.4deg);
    }

    20%, 80% {
        transform: translateX(4px) rotateZ(0.4deg);
    }

    30%, 50%, 70% {
        transform: translateX(-7px) rotateZ(-0.6deg);
    }

    40%, 60% {
        transform: translateX(7px) rotateZ(0.6deg);
    }
}

@media (max-width: 520px) {
    body.game-page .board {
        width: min(296px, calc(100vw - 46px));
        gap: 5px;
    }

    body.game-page .board-row {
        gap: 5px;
    }

    body.game-page .game-tile {
        border-radius: 7px;
        font-size: clamp(23px, 7.2vw, 30px);
    }

    body.game-page .keyboard {
        padding-left: 8px;
        padding-right: 8px;
    }

    body.game-page .key-row {
        gap: 4px;
        margin-bottom: 6px;
    }

    body.game-page .key-row.middle {
        padding: 0 10px;
    }

    body.game-page .key {
        height: 44px;
        border-radius: 7px;
        font-size: 11px;
    }

    body.game-page .key.wide {
        font-size: 11px;
    }
}

@media (max-width: 380px) {
    body.game-page .board {
        width: min(282px, calc(100vw - 38px));
        gap: 4px;
    }

    body.game-page .board-row {
        gap: 4px;
    }

    body.game-page .keyboard {
        padding-left: 6px;
        padding-right: 6px;
    }

    body.game-page .key-row {
        gap: 4px;
    }

    body.game-page .key-row.middle {
        padding: 0 8px;
    }

    body.game-page .key {
        height: 41px;
        border-radius: 6px;
        font-size: 10px;
    }

    body.game-page .key.wide {
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.game-page .game-tile,
    body.game-page .game-tile.filled,
    body.game-page .game-tile.flip,
    body.game-page .board-row.shake,
    body.game-page .key,
    body.game-page .key.pressed {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

/* =========================================================
   GAME LOOK V3
   Meniru feel contoh: flat 2D, warna lebih cerah, tombol menyala.
   ========================================================= */
body.game-page {
    --sakla-green: #78b857;
    --sakla-yellow: #f4c542;
    --sakla-dark-gray: #45495d;
    --sakla-dark-key: #686d86;
    --sakla-dark-empty: #171923;
    --sakla-dark-border: #676b84;
    --sakla-light-gray: #a8b4c9;
    --sakla-light-key: #dce3ee;
    --sakla-light-empty: #f8fafc;
    --sakla-light-border: #bcc6d8;
}

body.game-page.dark-mode {
    background: #12131c;
}

body.game-page.dark-mode #gameApp {
    background: #12131c;
}

body.game-page:not(.dark-mode) {
    background: #ffffff;
}

body.game-page:not(.dark-mode) #gameApp {
    background: #ffffff;
}

body.game-page .game-topbar {
    background: transparent;
}

body.game-page .top-icon,
body.game-page .btn,
body.game-page .modal-close {
    transition:
        transform 0.12s ease,
        background 0.12s ease,
        color 0.12s ease,
        box-shadow 0.12s ease,
        filter 0.12s ease;
}

body.game-page .top-icon:active,
body.game-page .btn:active,
body.game-page .modal-close:active {
    transform: translateY(1px) scale(0.96);
    filter: brightness(1.18);
    box-shadow: 0 0 0 4px rgba(120, 184, 87, 0.22);
}

body.game-page .board {
    width: min(324px, calc(100vw - 44px));
    gap: 6px;
}

body.game-page .board-row {
    gap: 6px;
}

body.game-page .game-tile {
    border-radius: 0;
    border-width: 2px;
    background: var(--sakla-dark-empty);
    border-color: var(--sakla-dark-border);
    color: #ffffff;
    box-shadow: none;
    font-family: "Arial Black", "Trebuchet MS", Arial, Helvetica, sans-serif;
    font-size: clamp(24px, 6.2vw, 31px);
    letter-spacing: 0.5px;
    text-shadow: none;
}

body.game-page:not(.dark-mode) .game-tile {
    background: var(--sakla-light-empty);
    border-color: var(--sakla-light-border);
    color: #ffffff;
}

body.game-page .game-tile.filled {
    background: var(--sakla-dark-empty);
    border-color: var(--sakla-dark-border);
    box-shadow: none;
    transform: none;
}

body.game-page:not(.dark-mode) .game-tile.filled {
    background: var(--sakla-light-empty);
    border-color: var(--sakla-light-border);
    color: #ffffff;
}

body.game-page .game-tile.correct,
body.game-page:not(.dark-mode) .game-tile.correct {
    background: var(--sakla-green);
    border-color: var(--sakla-green);
    color: #ffffff;
}

body.game-page .game-tile.present,
body.game-page:not(.dark-mode) .game-tile.present {
    background: var(--sakla-yellow);
    border-color: var(--sakla-yellow);
    color: #ffffff;
}

body.game-page .game-tile.absent {
    background: var(--sakla-dark-gray);
    border-color: var(--sakla-dark-gray);
    color: #ffffff;
}

body.game-page:not(.dark-mode) .game-tile.absent {
    background: var(--sakla-light-gray);
    border-color: var(--sakla-light-gray);
    color: #ffffff;
}

body.game-page .game-tile::after {
    display: none;
}

body.game-page .keyboard {
    width: min(100%, 610px);
    max-width: 610px;
    padding: 6px 12px 10px;
}

body.game-page .key-row {
    gap: 6px;
    margin-bottom: 6px;
}

body.game-page .key-row.middle {
    padding: 0;
}

body.game-page .key {
    height: 54px;
    border-radius: 4px;
    background: var(--sakla-dark-key);
    color: #ffffff;
    font-family: "Arial Black", "Trebuchet MS", Arial, Helvetica, sans-serif;
    font-size: 13px;
    box-shadow: none;
}

body.game-page:not(.dark-mode) .key {
    background: var(--sakla-light-key);
    color: #3d4758;
}

body.game-page .key:hover {
    filter: brightness(1.12);
}

body.game-page .key:active,
body.game-page .key.pressed {
    transform: translateY(1px) scale(0.97);
    filter: brightness(1.25);
    box-shadow: 0 0 0 4px rgba(120, 184, 87, 0.2);
}

body.game-page .key.correct,
body.game-page:not(.dark-mode) .key.correct {
    background: var(--sakla-green);
    color: #ffffff;
}

body.game-page .key.present,
body.game-page:not(.dark-mode) .key.present {
    background: var(--sakla-yellow);
    color: #ffffff;
}

body.game-page .key.absent {
    background: #36394a;
    color: #ffffff;
}

body.game-page:not(.dark-mode) .key.absent {
    background: var(--sakla-light-gray);
    color: #ffffff;
}

body.game-page .key.wide {
    flex: 1.65;
    font-size: 13px;
}

body.game-page .key[data-key="BACKSPACE"] {
    font-size: 20px;
}

body.game-page .game-tile.flip {
    animation: tileRevealFlat 0.5s cubic-bezier(.2, .9, .3, 1.05) forwards;
}

body.game-page .game-tile.filled {
    animation: tilePopFlat 0.18s cubic-bezier(.2, 1.2, .35, 1);
}

@keyframes tilePopFlat {
    0% {
        transform: scale(0.86);
    }

    72% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes tileRevealFlat {
    0% {
        transform: rotateX(0deg) scale(1);
    }

    48% {
        transform: rotateX(88deg) scale(1.03);
    }

    100% {
        transform: rotateX(0deg) scale(1);
    }
}

@media (max-width: 520px) {
    body.game-page .board {
        width: min(300px, calc(100vw - 46px));
        gap: 5px;
    }

    body.game-page .board-row {
        gap: 5px;
    }

    body.game-page .game-tile {
        font-size: clamp(23px, 7.1vw, 29px);
    }

    body.game-page .keyboard {
        padding-left: 8px;
        padding-right: 8px;
    }

    body.game-page .key-row {
        gap: 5px;
        margin-bottom: 6px;
    }

    body.game-page .key {
        height: 48px;
        border-radius: 4px;
        font-size: 11px;
    }

    body.game-page .key.wide {
        font-size: 11px;
    }

    body.game-page .key[data-key="BACKSPACE"] {
        font-size: 18px;
    }
}

@media (max-width: 380px) {
    body.game-page .board {
        width: min(286px, calc(100vw - 36px));
        gap: 4px;
    }

    body.game-page .board-row {
        gap: 4px;
    }

    body.game-page .key-row {
        gap: 4px;
    }

    body.game-page .key {
        height: 44px;
        font-size: 10px;
    }
}

/* =========================================================
   GAME LAYOUT V4
   Compact professional layout: no overlap, modern font, one-screen fit.
   ========================================================= */
body.game-page {
    --v4-bg-dark: #12131c;
    --v4-bg-light: #ffffff;
    --v4-text-dark: #f7f8ff;
    --v4-text-light: #2f3848;
    --v4-muted-dark: #c8cbd8;
    --v4-muted-light: #657084;
    --v4-green: #79b957;
    --v4-yellow: #f5c542;
    --v4-dark-gray: #4b5064;
    --v4-dark-key: #6d7289;
    --v4-dark-key-used: #363a4a;
    --v4-dark-empty: #171923;
    --v4-dark-border: #686d84;
    --v4-light-gray: #a9b4c7;
    --v4-light-key: #dce3ee;
    --v4-light-key-mid: #aab5c8;
    --v4-light-empty: #fbfcff;
    --v4-light-border: #c1c8d6;
    min-height: 100svh;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--v4-bg-dark);
    color: var(--v4-text-dark);
}

body.game-page:not(.dark-mode) {
    background: var(--v4-bg-light);
    color: var(--v4-text-light);
}

body.game-page #gameApp {
    height: 100svh;
    min-height: 100svh;
    max-height: 100svh;
    overflow: hidden;
    display: grid;
    grid-template-rows: 54px minmax(44px, auto) minmax(0, 1fr) auto;
    gap: 0;
    padding: 0 0 max(8px, env(safe-area-inset-bottom));
    background: var(--v4-bg-dark);
}

body.game-page:not(.dark-mode) #gameApp {
    background: var(--v4-bg-light);
}

body.game-page .game-topbar {
    position: relative;
    top: auto;
    z-index: 4;
    height: 54px;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    padding: 0 12px;
    border-bottom: 1px solid rgba(104, 109, 132, 0.42);
    background: var(--v4-bg-dark);
}

body.game-page:not(.dark-mode) .game-topbar {
    background: var(--v4-bg-light);
    border-bottom-color: rgba(193, 200, 214, 0.75);
}

body.game-page .game-title {
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(30px, 8vw, 38px);
    line-height: 1;
    letter-spacing: 1px;
    color: var(--v4-text-dark);
    text-shadow: none;
    white-space: nowrap;
}

body.game-page:not(.dark-mode) .game-title {
    color: var(--v4-text-light);
    text-shadow: none;
}

body.game-page .top-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    color: var(--v4-text-dark);
    background: transparent;
    font-family: inherit;
    font-size: 23px;
    line-height: 1;
}

body.game-page:not(.dark-mode) .top-icon {
    color: var(--v4-text-light);
}

body.game-page .top-icon:hover,
body.game-page .top-icon:focus-visible {
    background: rgba(109, 114, 137, 0.28);
    outline: none;
}

body.game-page .top-icon:active {
    transform: scale(0.94);
    background: rgba(121, 185, 87, 0.24);
    box-shadow: 0 0 0 4px rgba(121, 185, 87, 0.16);
}

body.game-page .game-info {
    align-self: start;
    min-height: 44px;
    padding: 7px 16px 6px;
    display: grid;
    gap: 2px;
    place-items: center;
    text-align: center;
    font-family: inherit;
    color: var(--v4-muted-dark);
    line-height: 1.25;
}

body.game-page:not(.dark-mode) .game-info {
    color: var(--v4-muted-light);
}

body.game-page #gameNumber {
    margin: 0;
    color: var(--v4-text-dark);
    font-family: inherit;
    font-size: clamp(15px, 4.5vw, 20px);
    font-weight: 800;
    letter-spacing: 0.1px;
}

body.game-page:not(.dark-mode) #gameNumber {
    color: var(--v4-text-light);
}

body.game-page #gameStatus {
    margin: 0;
    max-width: min(520px, calc(100vw - 44px));
    color: var(--v4-muted-dark);
    font-size: clamp(13px, 3.8vw, 16px);
    font-weight: 500;
    line-height: 1.28;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

body.game-page:not(.dark-mode) #gameStatus {
    color: var(--v4-muted-light);
}

body.game-page .board-wrap {
    min-height: 0;
    padding: 6px 12px 8px;
    display: flex;
    align-items: start;
    justify-content: center;
    perspective: none;
}

body.game-page .board {
    width: min(292px, calc(100vw - 54px));
    display: grid;
    gap: 5px;
}

body.game-page .board-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    transform-style: flat;
}

body.game-page .game-tile {
    aspect-ratio: 1 / 1;
    border: 2px solid var(--v4-dark-border);
    border-radius: 0;
    background: var(--v4-dark-empty);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: clamp(24px, 7vw, 34px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    text-transform: uppercase;
    text-shadow: none;
    box-shadow: none;
    user-select: none;
}

body.game-page:not(.dark-mode) .game-tile {
    background: var(--v4-light-empty);
    border-color: var(--v4-light-border);
    color: #ffffff;
}

body.game-page .game-tile.filled {
    background: var(--v4-dark-empty);
    border-color: var(--v4-dark-border);
    box-shadow: none;
    transform: none;
    animation: tilePopCompact 0.14s ease-out;
}

body.game-page:not(.dark-mode) .game-tile.filled {
    background: var(--v4-light-empty);
    border-color: var(--v4-light-border);
}

body.game-page .game-tile.correct,
body.game-page:not(.dark-mode) .game-tile.correct {
    background: var(--v4-green);
    border-color: var(--v4-green);
    color: #ffffff;
}

body.game-page .game-tile.present,
body.game-page:not(.dark-mode) .game-tile.present {
    background: var(--v4-yellow);
    border-color: var(--v4-yellow);
    color: #ffffff;
}

body.game-page .game-tile.absent {
    background: var(--v4-dark-gray);
    border-color: var(--v4-dark-gray);
    color: #ffffff;
}

body.game-page:not(.dark-mode) .game-tile.absent {
    background: var(--v4-light-gray);
    border-color: var(--v4-light-gray);
    color: #ffffff;
}

body.game-page .game-tile::after {
    display: none;
}

body.game-page .game-tile.flip {
    animation: tileFlipCompact 0.46s ease forwards;
}

body.game-page .keyboard {
    width: min(100%, 640px);
    max-width: 640px;
    margin: 0 auto;
    padding: 4px 12px 0;
    touch-action: manipulation;
}

body.game-page .key-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 6px;
}

body.game-page .key-row.middle {
    padding: 0;
}

body.game-page .key {
    min-width: 0;
    height: 50px;
    flex: 1;
    border: 0;
    border-radius: 6px;
    background: var(--v4-dark-key);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: clamp(15px, 4vw, 20px);
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    box-shadow: none;
    transition: transform 0.08s ease, filter 0.1s ease, background 0.12s ease, box-shadow 0.12s ease;
}

body.game-page:not(.dark-mode) .key {
    background: var(--v4-light-key);
    color: var(--v4-text-light);
}

body.game-page .key.wide {
    flex: 1.45;
    font-size: clamp(13px, 3.5vw, 18px);
}

body.game-page .key[data-key="BACKSPACE"] {
    font-size: clamp(19px, 5vw, 24px);
}

body.game-page .key:hover,
body.game-page .key:focus-visible {
    filter: brightness(1.09);
    outline: none;
}

body.game-page .key:active,
body.game-page .key.pressed {
    transform: scale(0.96);
    filter: brightness(1.2);
    box-shadow: 0 0 0 4px rgba(121, 185, 87, 0.2);
}

body.game-page .key.correct,
body.game-page:not(.dark-mode) .key.correct {
    background: var(--v4-green);
    color: #ffffff;
}

body.game-page .key.present,
body.game-page:not(.dark-mode) .key.present {
    background: var(--v4-yellow);
    color: #ffffff;
}

body.game-page .key.absent {
    background: var(--v4-dark-key-used);
    color: #ffffff;
}

body.game-page:not(.dark-mode) .key.absent {
    background: var(--v4-light-key-mid);
    color: #ffffff;
}

body.game-page .game-bottom-nav {
    display: none;
}

body.game-page .toast {
    top: 64px;
    border-radius: 10px;
    font-family: inherit;
}

@keyframes tilePopCompact {
    0% { transform: scale(0.9); }
    70% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

@keyframes tileFlipCompact {
    0% { transform: rotateX(0deg); }
    48% { transform: rotateX(88deg); }
    100% { transform: rotateX(0deg); }
}

@media (max-width: 520px) {
    body.game-page #gameApp {
        grid-template-rows: 48px minmax(42px, auto) minmax(0, 1fr) auto;
        padding-bottom: max(7px, env(safe-area-inset-bottom));
    }

    body.game-page .game-topbar {
        height: 48px;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        padding: 0 10px;
    }

    body.game-page .game-title {
        height: 48px;
        font-size: clamp(28px, 8.5vw, 34px);
    }

    body.game-page .top-icon {
        width: 34px;
        height: 34px;
        font-size: 22px;
    }

    body.game-page .game-info {
        padding: 6px 14px 5px;
    }

    body.game-page .board-wrap {
        padding-top: 5px;
        padding-bottom: 7px;
    }

    body.game-page .board {
        width: min(286px, calc(100vw - 58px));
        gap: 5px;
    }

    body.game-page .board-row {
        gap: 5px;
    }

    body.game-page .game-tile {
        font-size: clamp(23px, 7vw, 30px);
    }

    body.game-page .keyboard {
        padding-left: 10px;
        padding-right: 10px;
    }

    body.game-page .key-row {
        gap: 5px;
        margin-bottom: 5px;
    }

    body.game-page .key {
        height: 46px;
        border-radius: 6px;
        font-size: clamp(14px, 3.8vw, 18px);
    }

    body.game-page .key.wide {
        font-size: clamp(12px, 3.4vw, 16px);
    }
}

@media (max-width: 390px) {
    body.game-page #gameApp {
        grid-template-rows: 46px minmax(39px, auto) minmax(0, 1fr) auto;
    }

    body.game-page .game-topbar {
        height: 46px;
    }

    body.game-page .game-title {
        height: 46px;
        font-size: clamp(26px, 8vw, 31px);
    }

    body.game-page .game-info {
        padding-top: 5px;
        padding-bottom: 4px;
    }

    body.game-page .board {
        width: min(270px, calc(100vw - 58px));
        gap: 4px;
    }

    body.game-page .board-row {
        gap: 4px;
    }

    body.game-page .key-row {
        gap: 4px;
        margin-bottom: 5px;
    }

    body.game-page .key {
        height: 42px;
        border-radius: 5px;
        font-size: 13px;
    }

    body.game-page .key.wide {
        font-size: 12px;
    }
}

@media (max-height: 720px) and (max-width: 520px) {
    body.game-page .board {
        width: min(252px, calc(100vw - 74px));
    }

    body.game-page .key {
        height: 39px;
    }

    body.game-page #gameStatus {
        font-size: 12px;
    }
}

/* =========================================================
   GAME LAYOUT V5
   Mobile Safari overflow fix: keyboard/topbar never exceed viewport.
   ========================================================= */
html,
body.game-page {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body.game-page #gameApp,
body.game-page .game-topbar,
body.game-page .game-info,
body.game-page .board-wrap,
body.game-page .keyboard {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
}

body.game-page .game-topbar {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
}

body.game-page .keyboard {
    width: min(100%, 632px);
    max-width: min(632px, calc(100vw - 18px));
    padding-left: 0;
    padding-right: 0;
}

body.game-page .key-row {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

body.game-page .key {
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
}

body.game-page .key.wide {
    flex: 1.36;
}

@media (max-width: 520px) {
    body.game-page .game-topbar {
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        padding-left: max(8px, env(safe-area-inset-left));
        padding-right: max(8px, env(safe-area-inset-right));
    }

    body.game-page .top-icon {
        justify-self: center;
    }

    body.game-page .keyboard {
        max-width: calc(100vw - 20px);
        padding-left: 0;
        padding-right: 0;
    }

    body.game-page .key-row {
        gap: 4px;
    }

    body.game-page .key.wide {
        flex: 1.28;
    }
}

@media (max-width: 390px) {
    body.game-page .keyboard {
        max-width: calc(100vw - 18px);
    }

    body.game-page .key-row {
        gap: 3px;
    }

    body.game-page .key.wide {
        flex: 1.2;
    }
}

/* =========================================================
   GAME LAYOUT V6
   Restore bottom navigation without breaking compact mobile layout.
   ========================================================= */
body.game-page #gameApp {
    padding-bottom: calc(42px + env(safe-area-inset-bottom));
}

body.game-page .game-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    min-height: 38px;
    width: 100%;
    max-width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 7px max(12px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    box-sizing: border-box;
    overflow: hidden;
    border-top: 1px solid rgba(104, 109, 132, 0.42);
    background: rgba(18, 19, 28, 0.96);
    backdrop-filter: blur(10px);
}

body.game-page:not(.dark-mode) .game-bottom-nav {
    border-top-color: rgba(193, 200, 214, 0.75);
    background: rgba(255, 255, 255, 0.96);
}

body.game-page .game-bottom-nav a {
    color: var(--v4-muted-dark);
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.12s ease, transform 0.12s ease;
}

body.game-page:not(.dark-mode) .game-bottom-nav a {
    color: var(--v4-muted-light);
}

body.game-page .game-bottom-nav a:hover,
body.game-page .game-bottom-nav a:focus-visible {
    color: var(--v4-text-dark);
    outline: none;
}

body.game-page:not(.dark-mode) .game-bottom-nav a:hover,
body.game-page:not(.dark-mode) .game-bottom-nav a:focus-visible {
    color: var(--v4-text-light);
}

body.game-page .game-bottom-nav a:active {
    transform: scale(0.95);
    color: var(--v4-green);
}

@media (max-width: 520px) {
    body.game-page #gameApp {
        padding-bottom: calc(39px + env(safe-area-inset-bottom));
    }

    body.game-page .game-bottom-nav {
        min-height: 36px;
        gap: 18px;
        padding-top: 6px;
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }

    body.game-page .game-bottom-nav a {
        font-size: 13px;
    }
}

@media (max-width: 390px) {
    body.game-page .game-bottom-nav {
        gap: 14px;
    }

    body.game-page .game-bottom-nav a {
        font-size: 12px;
    }
}

/* =========================================================
   GAME LAYOUT V7
   Mobile landscape guard: ask user to rotate to portrait.
   ========================================================= */
.rotate-warning {
    display: none;
}

@media (orientation: landscape) and (max-height: 540px) and (pointer: coarse) {
    body.game-page {
        overflow: hidden;
    }

    body.game-page #gameApp,
    body.game-page .game-bottom-nav,
    body.game-page .modal {
        visibility: hidden;
        pointer-events: none;
    }

    body.game-page .rotate-warning {
        position: fixed;
        inset: 0;
        z-index: 99999;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
        background: #12131c;
        color: #ffffff;
        text-align: center;
    }

    body.game-page:not(.dark-mode) .rotate-warning {
        background: #ffffff;
        color: #2f3848;
    }

    .rotate-warning-card {
        width: min(520px, 92vw);
        display: grid;
        justify-items: center;
        gap: 12px;
    }

    .rotate-warning-icon {
        width: 58px;
        height: 58px;
        border-radius: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(121, 185, 87, 0.18);
        color: #79b957;
        font-size: 38px;
        font-weight: 900;
    }

    .rotate-warning h2 {
        margin: 0;
        font-size: clamp(22px, 5vw, 34px);
        line-height: 1.1;
        font-weight: 900;
    }

    .rotate-warning p {
        margin: 0;
        max-width: 440px;
        color: #c8cbd8;
        font-size: clamp(14px, 3vw, 18px);
        line-height: 1.45;
        font-weight: 600;
    }

    body.game-page:not(.dark-mode) .rotate-warning p {
        color: #657084;
    }
}

/* =========================================================
   GAME LAYOUT V8
   Light/dark text color corrections for tiles, keys, and nav.
   ========================================================= */
body.game-page.dark-mode .game-tile,
body.game-page.dark-mode .game-tile.filled {
    color: #ffffff;
}

body.game-page:not(.dark-mode) .game-tile,
body.game-page:not(.dark-mode) .game-tile.filled {
    color: var(--v4-text-light, #2f3848);
}

body.game-page .game-tile.correct,
body.game-page .game-tile.present,
body.game-page .game-tile.absent,
body.game-page:not(.dark-mode) .game-tile.correct,
body.game-page:not(.dark-mode) .game-tile.present,
body.game-page:not(.dark-mode) .game-tile.absent {
    color: #ffffff;
}

body.game-page.dark-mode .key {
    color: #ffffff;
}

body.game-page:not(.dark-mode) .key {
    color: var(--v4-text-light, #2f3848);
}

body.game-page .key.correct,
body.game-page .key.present,
body.game-page .key.absent,
body.game-page:not(.dark-mode) .key.correct,
body.game-page:not(.dark-mode) .key.present,
body.game-page:not(.dark-mode) .key.absent {
    color: #ffffff;
}

body.game-page.dark-mode .top-icon,
body.game-page.dark-mode .game-title,
body.game-page.dark-mode #gameNumber {
    color: var(--v4-text-dark, #f7f8ff);
}

body.game-page:not(.dark-mode) .top-icon,
body.game-page:not(.dark-mode) .game-title,
body.game-page:not(.dark-mode) #gameNumber {
    color: var(--v4-text-light, #2f3848);
}

body.game-page .game-topbar {
    grid-template-columns: 82px minmax(0, 1fr) 82px;
}

body.game-page .top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

body.game-page .top-icon svg {
    width: 22px;
    height: 22px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.15;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.game-page .top-icon svg * {
    fill: none;
    stroke: currentColor;
}

body.game-page.dark-mode #gameStatus,
body.game-page.dark-mode .game-info,
body.game-page.dark-mode .game-bottom-nav a {
    color: var(--v4-muted-dark, #c8cbd8);
}

body.game-page:not(.dark-mode) #gameStatus,
body.game-page:not(.dark-mode) .game-info,
body.game-page:not(.dark-mode) .game-bottom-nav a {
    color: var(--v4-muted-light, #657084);
}

/* =========================================================
   RESULT MODAL V9
   Match game board typography/colors and professional icons/buttons.
   ========================================================= */
body.game-page .result-card {
    width: min(470px, calc(100vw - 28px));
    max-height: min(780px, calc(100dvh - 34px));
    padding: 24px 20px 20px;
    border-radius: 22px;
    background: var(--v4-bg-dark, #12131c);
    color: var(--v4-text-dark, #f7f8ff);
    border: 1px solid rgba(104, 109, 132, 0.52);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    overflow-y: auto;
}

body.game-page:not(.dark-mode) .result-card {
    background: #ffffff;
    color: var(--v4-text-light, #2f3848);
    border-color: rgba(193, 200, 214, 0.78);
    box-shadow: 0 22px 60px rgba(47, 56, 72, 0.18);
}

body.game-page .result-card .modal-close {
    top: 10px;
    right: 12px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 32px;
    line-height: 1;
    color: var(--v4-muted-dark, #c8cbd8);
}

body.game-page:not(.dark-mode) .result-card .modal-close {
    color: var(--v4-muted-light, #657084);
}

body.game-page .result-card .modal-close:hover,
body.game-page .result-card .modal-close:focus-visible {
    background: rgba(109, 114, 137, 0.24);
    color: var(--v4-text-dark, #f7f8ff);
    outline: none;
}

body.game-page:not(.dark-mode) .result-card .modal-close:hover,
body.game-page:not(.dark-mode) .result-card .modal-close:focus-visible {
    color: var(--v4-text-light, #2f3848);
}

body.game-page .result-card h2 {
    margin: 0 44px 14px;
    color: inherit;
    font-size: clamp(34px, 8vw, 52px);
    line-height: 0.98;
    font-weight: 900;
    letter-spacing: -0.04em;
}

body.game-page .result-game-no {
    margin: 0 0 4px;
    color: var(--v4-muted-dark, #c8cbd8);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.02em;
}

body.game-page:not(.dark-mode) .result-game-no {
    color: var(--v4-muted-light, #657084);
}

body.game-page .result-game-date {
    margin: 0 0 18px;
    color: var(--v4-muted-dark, #c8cbd8);
    font-size: 15px;
    font-weight: 800;
}

body.game-page:not(.dark-mode) .result-game-date {
    color: var(--v4-muted-light, #657084);
}

body.game-page .result-answer {
    margin: 0 0 10px;
    color: inherit;
    font-size: clamp(42px, 11vw, 64px);
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0.08em;
}

body.game-page #resultMeaning,
body.game-page .result-meaning {
    margin: 0 auto 18px;
    max-width: 390px;
    color: var(--v4-muted-dark, #c8cbd8) !important;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 500;
}

body.game-page:not(.dark-mode) #resultMeaning,
body.game-page:not(.dark-mode) .result-meaning {
    color: var(--v4-muted-light, #657084) !important;
}

body.game-page #resultMeaning strong,
body.game-page .result-meaning strong {
    color: inherit;
    font-weight: 900;
}

body.game-page .result-pattern {
    margin: 16px auto 20px;
    display: grid;
    justify-content: center;
    gap: 4px;
    white-space: normal;
    font-size: 0;
    line-height: 1;
    letter-spacing: 0;
}

body.game-page .result-pattern-row {
    display: flex;
    justify-content: center;
    gap: 4px;
}

body.game-page .result-pattern-tile {
    width: 24px;
    height: 24px;
    display: inline-block;
    border-radius: 0;
    background: var(--v4-dark-gray, #4b5064);
}

body.game-page:not(.dark-mode) .result-pattern-tile {
    background: var(--v4-light-gray, #a9b4c7);
}

body.game-page .result-pattern-tile.correct,
body.game-page:not(.dark-mode) .result-pattern-tile.correct {
    background: var(--v4-green, #79b957);
}

body.game-page .result-pattern-tile.present,
body.game-page:not(.dark-mode) .result-pattern-tile.present {
    background: var(--v4-yellow, #f5c542);
}

body.game-page .result-pattern-tile.absent {
    background: var(--v4-dark-gray, #4b5064);
}

body.game-page:not(.dark-mode) .result-pattern-tile.absent {
    background: var(--v4-light-gray, #a9b4c7);
}

body.game-page .result-action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0 12px;
}

body.game-page #copyResultBtn {
    grid-column: 1 / -1;
    width: min(100%, 340px);
    justify-self: center;
}

body.game-page .result-action-btn,
body.game-page .result-link {
    min-height: 48px;
    border-radius: 999px;
    border: 2px solid currentColor;
    gap: 9px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0;
    transition: transform 0.1s ease, filter 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, color 0.12s ease;
}

body.game-page .result-action-btn.btn-primary {
    background: var(--v4-text-dark, #f7f8ff);
    color: var(--v4-bg-dark, #12131c);
    border-color: var(--v4-text-dark, #f7f8ff);
}

body.game-page:not(.dark-mode) .result-action-btn.btn-primary {
    background: var(--v4-text-light, #2f3848);
    color: #ffffff;
    border-color: var(--v4-text-light, #2f3848);
}

body.game-page .result-action-btn.btn-outline,
body.game-page .result-link {
    background: transparent;
    color: var(--v4-text-dark, #f7f8ff);
    border-color: var(--v4-text-dark, #f7f8ff);
}

body.game-page:not(.dark-mode) .result-action-btn.btn-outline,
body.game-page:not(.dark-mode) .result-link {
    color: var(--v4-text-light, #2f3848);
    border-color: var(--v4-text-light, #2f3848);
}

body.game-page .result-action-btn:active,
body.game-page .result-link:active,
body.game-page .result-share-btn:active {
    transform: scale(0.97);
    filter: brightness(1.16);
    box-shadow: 0 0 0 4px rgba(121, 185, 87, 0.2);
}

body.game-page .result-action-btn:hover,
body.game-page .result-link:hover,
body.game-page .result-share-btn:hover {
    filter: brightness(1.08);
}

body.game-page .result-action-icon,
body.game-page .result-menu-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

body.game-page .result-action-icon svg,
body.game-page .result-menu-icon svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.game-page .result-share-wrap {
    position: relative;
    min-width: 0;
}

body.game-page .result-share-menu {
    right: 0;
    top: auto;
    bottom: calc(100% + 10px);
    transform: none;
    width: min(240px, calc(100vw - 48px));
    gap: 8px;
    padding: 10px;
    border-radius: 18px;
    background: var(--v4-bg-dark, #12131c);
    border: 1px solid rgba(104, 109, 132, 0.72);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

body.game-page:not(.dark-mode) .result-share-menu {
    background: #ffffff;
    border-color: rgba(193, 200, 214, 0.95);
    box-shadow: 0 18px 42px rgba(47, 56, 72, 0.18);
}

body.game-page .result-share-btn {
    min-height: 42px;
    border-radius: 999px;
    border: 1.5px solid currentColor;
    background: transparent;
    color: var(--v4-text-dark, #f7f8ff);
    font-family: inherit;
    font-size: 13px;
    font-weight: 900;
}

body.game-page:not(.dark-mode) .result-share-btn {
    color: var(--v4-text-light, #2f3848);
    background: transparent;
}

body.game-page .result-link {
    width: min(100%, 340px);
    margin: 8px auto 0;
}

@media (max-width: 520px) {
    body.game-page .result-card {
        width: min(430px, calc(100vw - 24px));
        max-height: calc(100dvh - 34px);
        padding: 22px 16px 18px;
        border-radius: 20px;
    }

    body.game-page .result-card h2 {
        margin-bottom: 12px;
    }

    body.game-page .result-game-date {
        margin-bottom: 14px;
    }

    body.game-page .result-answer {
        letter-spacing: 0.07em;
    }

    body.game-page #resultMeaning,
    body.game-page .result-meaning {
        margin-bottom: 15px;
        font-size: 15px;
    }

    body.game-page .result-pattern-tile {
        width: 21px;
        height: 21px;
    }

    body.game-page .result-action-btn,
    body.game-page .result-link {
        min-height: 45px;
        font-size: 14px;
    }
}

@media (max-width: 380px) {
    body.game-page .result-card {
        padding-left: 13px;
        padding-right: 13px;
    }

    body.game-page .result-pattern-tile {
        width: 19px;
        height: 19px;
    }
}

body.game-page .result-action-icon svg *,
body.game-page .result-menu-icon svg * {
    fill: none;
    stroke: currentColor;
}

/* =========================================================
   RESULT PATTERN LETTERS V10
   Show guessed letters inside result pattern tiles.
   ========================================================= */
body.game-page .result-pattern {
    gap: 5px;
}

body.game-page .result-pattern-row {
    gap: 5px;
}

body.game-page .result-pattern-tile {
    width: 31px;
    height: 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

body.game-page:not(.dark-mode) .result-pattern-tile {
    color: #ffffff;
}

@media (max-width: 520px) {
    body.game-page .result-pattern-tile {
        width: 27px;
        height: 27px;
        font-size: 15px;
    }
}

@media (max-width: 380px) {
    body.game-page .result-pattern-tile {
        width: 24px;
        height: 24px;
        font-size: 13px;
    }
}

/* =========================================================
   RESULT MODAL V11
   Explicit MENANG/KALAH score badge and transparent answer box.
   ========================================================= */
body.game-page .result-score {
    width: max-content;
    min-width: 76px;
    margin: -6px auto 14px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1.5px solid rgba(104, 109, 132, 0.72);
    color: var(--v4-muted-dark, #c8cbd8);
    background: rgba(104, 109, 132, 0.12);
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.04em;
}

body.game-page .result-score.win {
    border-color: rgba(121, 185, 87, 0.72);
    color: var(--v4-green, #79b957);
    background: rgba(121, 185, 87, 0.14);
}

body.game-page .result-score.lose {
    border-color: rgba(239, 68, 68, 0.72);
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

body.game-page:not(.dark-mode) .result-score {
    color: var(--v4-muted-light, #657084);
    border-color: rgba(193, 200, 214, 0.95);
    background: rgba(220, 227, 238, 0.55);
}

body.game-page:not(.dark-mode) .result-score.win {
    color: #4f8c36;
    border-color: rgba(121, 185, 87, 0.78);
    background: rgba(121, 185, 87, 0.14);
}

body.game-page:not(.dark-mode) .result-score.lose {
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.78);
    background: rgba(239, 68, 68, 0.12);
}

body.game-page .result-answer {
    width: max-content;
    max-width: 100%;
    margin: 0 auto 12px;
    padding: 12px 18px;
    border-radius: 18px;
    border: 1.5px solid rgba(104, 109, 132, 0.72);
    background: rgba(104, 109, 132, 0.1);
    color: var(--v4-text-dark, #f7f8ff);
    letter-spacing: 0.08em;
}

body.game-page:not(.dark-mode) .result-answer {
    color: var(--v4-text-light, #2f3848);
    border-color: rgba(193, 200, 214, 0.95);
    background: rgba(220, 227, 238, 0.32);
}

body.game-page .result-card h2 {
    margin-bottom: 12px;
    text-transform: uppercase;
}

@media (max-width: 520px) {
    body.game-page .result-score {
        margin-bottom: 12px;
        padding: 6px 12px;
        font-size: 14px;
    }

    body.game-page .result-answer {
        padding: 10px 14px;
        border-radius: 16px;
    }
}

/* =========================================================
   RESULT MODAL V12
   Smaller result typography and win/lose title colors.
   ========================================================= */
body.game-page .result-card h2 {
    font-size: clamp(28px, 6.8vw, 42px);
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

body.game-page .result-card h2.win {
    color: var(--v4-green, #79b957);
}

body.game-page .result-card h2.lose {
    color: #ef4444;
}

body.game-page .result-score {
    margin: -2px auto 10px;
    padding: 6px 12px;
    min-width: 66px;
    font-size: 14px;
}

body.game-page .result-game-no {
    font-size: 15px;
    margin-bottom: 2px;
}

body.game-page .result-game-date {
    font-size: 13px;
    margin-bottom: 10px;
}

body.game-page .result-answer {
    margin-bottom: 9px;
    padding: 8px 13px;
    border-radius: 14px;
    font-size: clamp(32px, 8.4vw, 48px);
    letter-spacing: 0.06em;
}

body.game-page #resultMeaning,
body.game-page .result-meaning {
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.3;
}

body.game-page .result-pattern {
    margin-top: 11px;
    margin-bottom: 10px;
}

body.game-page .result-next-word {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 14px;
    padding: 7px 11px;
    border: 1px solid var(--modal-line);
    border-radius: 999px;
    color: var(--modal-muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.25;
    text-align: center;
}

body.game-page .result-next-word strong {
    color: var(--modal-text);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

@media (max-width: 520px) {
    body.game-page .result-card h2 {
        font-size: clamp(26px, 6.6vw, 34px);
        margin-bottom: 7px;
    }

    body.game-page .result-score {
        margin-bottom: 9px;
        padding: 5px 11px;
        font-size: 13px;
    }

    body.game-page .result-answer {
        padding: 8px 12px;
        border-radius: 13px;
        font-size: clamp(29px, 7.8vw, 38px);
    }

    body.game-page #resultMeaning,
    body.game-page .result-meaning {
        font-size: 13px;
    }

    body.game-page .result-next-word {
        margin-bottom: 12px;
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* =========================================================
   TOPBAR ICON VISIBILITY FIX
   Keeps SVG icons visible on mobile Safari/Chrome.
   ========================================================= */
body.game-page .game-topbar {
    grid-template-columns: 126px minmax(0, 1fr) 126px;
}

body.game-page .top-left-actions,
body.game-page .top-actions {
    width: 126px;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.game-page .top-left-actions {
    justify-content: flex-start;
}

body.game-page .top-actions {
    justify-content: flex-end;
}

body.game-page .top-icon {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    opacity: 1;
    visibility: visible;
    background: rgba(109, 114, 137, 0.18);
    color: var(--v4-text-dark, #f7f8ff);
    text-decoration: none;
}

body.game-page:not(.dark-mode) .top-icon {
    background: rgba(209, 216, 229, 0.82);
    color: var(--v4-text-light, #2f3848);
}

body.game-page .top-icon svg {
    width: 22px !important;
    height: 22px !important;
    display: block !important;
    overflow: visible;
    opacity: 1 !important;
    visibility: visible !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2.3 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

body.game-page .top-icon svg * {
    fill: none !important;
    stroke: currentColor !important;
    vector-effect: non-scaling-stroke;
}

@media (max-width: 520px) {
    body.game-page .game-topbar {
        grid-template-columns: 118px minmax(0, 1fr) 118px;
    }

    body.game-page .top-left-actions,
    body.game-page .top-actions {
        width: 118px;
        gap: 5px;
    }

    body.game-page .top-icon {
        width: 34px;
        min-width: 34px;
        height: 34px;
        min-height: 34px;
    }

    body.game-page .top-icon svg {
        width: 21px !important;
        height: 21px !important;
    }
}

/* =========================================================
   GAME LEADERBOARD
   ========================================================= */
body.game-page .game-topbar {
    grid-template-columns: 132px minmax(0, 1fr) 132px;
}

body.game-page .top-left-actions,
body.game-page .top-actions {
    width: 132px;
    gap: 4px;
}

body.game-page .top-icon {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    border-radius: 8px;
}

body.game-page .top-icon svg {
    width: 19px !important;
    height: 19px !important;
}

body.game-page .leaderboard-card {
    width: min(460px, calc(100vw - 32px));
    text-align: left;
}

body.game-page .leaderboard-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

body.game-page .leaderboard-head h2 {
    margin: 0 0 2px;
    font-size: 30px;
    line-height: 1.05;
}

body.game-page .leaderboard-head p,
body.game-page .leaderboard-note {
    margin: 0;
    color: var(--modal-muted);
    font-size: 13px;
    line-height: 1.4;
}

body.game-page .leaderboard-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

body.game-page .leaderboard-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(104, 109, 132, 0.45);
    background: rgba(104, 109, 132, 0.12);
}

body.game-page:not(.dark-mode) .leaderboard-item {
    border-color: rgba(193, 200, 214, 0.9);
    background: rgba(244, 246, 250, 0.92);
}

body.game-page .leaderboard-rank {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--v4-green, #79b957);
    color: #ffffff;
    font-size: 14px;
    font-weight: 950;
}

body.game-page .leaderboard-player {
    min-width: 0;
    display: grid;
    gap: 2px;
}

body.game-page .leaderboard-player strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--modal-text);
    font-size: 15px;
    font-weight: 950;
    letter-spacing: 0.02em;
}

body.game-page .leaderboard-player span,
body.game-page .leaderboard-stats small {
    color: var(--modal-muted);
    font-size: 12px;
    font-weight: 800;
}

body.game-page .leaderboard-stats {
    display: grid;
    justify-items: end;
    gap: 2px;
    color: var(--modal-text);
    font-weight: 950;
}

body.game-page .leaderboard-stats span {
    font-size: 16px;
}

body.game-page .leaderboard-empty {
    padding: 18px 14px;
    border-radius: 14px;
    border: 1px dashed rgba(104, 109, 132, 0.6);
    color: var(--modal-muted);
    text-align: center;
    font-size: 14px;
    font-weight: 800;
}

body.game-page .leaderboard-note {
    margin-top: 12px;
}

body.game-page .result-secondary-link {
    display: block;
    margin: 10px auto 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--modal-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: pointer;
}

body.game-page .result-secondary-link:hover,
body.game-page .result-secondary-link:focus-visible {
    color: var(--modal-text);
}

body.game-page .result-bottom-actions {
    width: min(100%, 360px);
    margin: 10px auto 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}

body.game-page .result-bottom-actions .result-link {
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal;
    line-height: 1.1;
    font-size: 13px;
    text-decoration: none !important;
}

body.game-page .result-leaderboard-link {
    cursor: pointer;
}

body.game-page .result-status-line {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto 8px;
}

body.game-page .result-status-line h2,
body.game-page .result-status-line .result-score {
    margin: 0;
}

body.game-page .result-status-line .result-score {
    min-height: 32px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 18px;
    line-height: 1;
}

body.game-page .result-link-icon {
    width: 17px;
    height: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

body.game-page .result-link-icon svg {
    width: 17px;
    height: 17px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.game-page .result-link-icon svg * {
    fill: none;
    stroke: currentColor;
}

@media (max-width: 360px) {
    body.game-page .result-status-line {
        gap: 8px;
    }

    body.game-page .result-status-line .result-score {
        min-height: 28px;
        padding: 0 8px;
        font-size: 15px;
    }

    body.game-page .result-bottom-actions {
        gap: 8px;
    }

    body.game-page .result-bottom-actions .result-link {
        min-height: 42px;
        padding: 0 8px;
        font-size: 12px;
    }
}

@media (max-width: 520px) {
    body.game-page .game-topbar {
        grid-template-columns: 124px minmax(0, 1fr) 124px;
    }

    body.game-page .top-left-actions,
    body.game-page .top-actions {
        width: 124px;
        gap: 4px;
    }

    body.game-page .top-icon {
        width: 28px;
        min-width: 28px;
        height: 28px;
        min-height: 28px;
        border-radius: 8px;
    }

    body.game-page .top-icon svg {
        width: 18px !important;
        height: 18px !important;
    }

    body.game-page .leaderboard-card {
        width: min(430px, calc(100vw - 24px));
        padding: 22px 16px 18px;
    }

    body.game-page .leaderboard-head h2 {
        font-size: 26px;
    }

    body.game-page .leaderboard-item {
        grid-template-columns: 34px minmax(0, 1fr) auto;
        padding: 9px;
    }
}

@media (max-width: 360px) {
    body.game-page .game-topbar {
        grid-template-columns: 112px minmax(0, 1fr) 112px;
    }

    body.game-page .top-left-actions,
    body.game-page .top-actions {
        width: 112px;
        gap: 3px;
    }

    body.game-page .top-icon {
        width: 25px;
        min-width: 25px;
        height: 25px;
        min-height: 25px;
    }

    body.game-page .top-icon svg {
        width: 16px !important;
        height: 16px !important;
    }
}

/* =========================================================
   GAME LEADERBOARD V2
   ========================================================= */
body.game-page .game-topbar {
    grid-template-columns: 108px minmax(0, 1fr) 108px !important;
}

body.game-page .top-left-actions,
body.game-page .top-actions {
    width: 108px !important;
    gap: 6px !important;
}

body.game-page .top-left-actions {
    justify-content: flex-start;
}

body.game-page .top-actions {
    justify-content: flex-end;
}

body.game-page .leaderboard-card {
    overflow: hidden;
}

body.game-page .leaderboard-list {
    gap: 12px;
}

body.game-page .leaderboard-podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 8px;
    margin-top: 12px;
}

body.game-page .leaderboard-podium-card {
    min-width: 0;
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    padding: 14px 8px 12px;
    border-radius: 18px;
    border: 1px solid rgba(104, 109, 132, 0.5);
    background: rgba(104, 109, 132, 0.15);
    text-align: center;
    animation: leaderboard-rise 0.44s ease both;
}

body.game-page:not(.dark-mode) .leaderboard-podium-card {
    border-color: rgba(193, 200, 214, 0.95);
    background: rgba(244, 246, 250, 0.96);
}

body.game-page .leaderboard-podium-card.rank-1 {
    min-height: 138px;
    border-color: rgba(121, 185, 87, 0.72);
    background: rgba(121, 185, 87, 0.18);
    animation-delay: 0.08s;
}

body.game-page:not(.dark-mode) .leaderboard-podium-card.rank-1 {
    background: rgba(121, 185, 87, 0.16);
}

body.game-page .leaderboard-podium-card.rank-2 {
    animation-delay: 0.16s;
}

body.game-page .leaderboard-podium-card.rank-3 {
    animation-delay: 0.24s;
}

body.game-page .leaderboard-crown {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--v4-yellow, #f7c948);
    color: #1f2633;
    font-size: 15px;
    font-weight: 950;
    box-shadow: 0 8px 18px rgba(247, 201, 72, 0.22);
}

body.game-page .leaderboard-podium-card.rank-1 .leaderboard-crown {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    background: var(--v4-green, #79b957);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(121, 185, 87, 0.28);
}

body.game-page .leaderboard-podium-card strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--modal-text);
    font-size: 14px;
    font-weight: 950;
}

body.game-page .leaderboard-podium-card.rank-1 strong {
    font-size: 16px;
}

body.game-page .leaderboard-podium-card span {
    max-width: 100%;
    color: var(--modal-muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
}

body.game-page .leaderboard-rest {
    display: grid;
    gap: 8px;
}

body.game-page .leaderboard-rest .leaderboard-item {
    animation: leaderboard-slide 0.32s ease both;
}

body.game-page .leaderboard-rest .leaderboard-item:nth-child(2) {
    animation-delay: 0.08s;
}

body.game-page .leaderboard-item {
    grid-template-columns: 36px minmax(0, 1fr);
}

body.game-page .leaderboard-item:hover,
body.game-page .leaderboard-podium-card:hover {
    filter: brightness(1.06);
}

@keyframes leaderboard-rise {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes leaderboard-slide {
    from {
        opacity: 0;
        transform: translateX(14px);
    }

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

@media (max-width: 520px) {
    body.game-page .game-topbar {
        grid-template-columns: 102px minmax(0, 1fr) 102px !important;
    }

    body.game-page .top-left-actions,
    body.game-page .top-actions {
        width: 102px !important;
        gap: 4px !important;
    }

    body.game-page .top-icon {
        width: 30px;
        min-width: 30px;
        height: 30px;
        min-height: 30px;
    }

    body.game-page .top-icon svg {
        width: 18px !important;
        height: 18px !important;
    }

    body.game-page .leaderboard-podium {
        gap: 6px;
    }

    body.game-page .leaderboard-podium-card {
        min-height: 104px;
        padding: 12px 6px 10px;
        border-radius: 16px;
    }

    body.game-page .leaderboard-podium-card.rank-1 {
        min-height: 126px;
    }

    body.game-page .leaderboard-podium-card span {
        font-size: 10px;
    }
}

@media (max-width: 360px) {
    body.game-page .game-topbar {
        grid-template-columns: 92px minmax(0, 1fr) 92px !important;
    }

    body.game-page .top-left-actions,
    body.game-page .top-actions {
        width: 92px !important;
        gap: 3px !important;
    }

    body.game-page .top-icon {
        width: 28px;
        min-width: 28px;
        height: 28px;
        min-height: 28px;
    }
}

/* =========================================================
   RECENT WORDS MODAL
   ========================================================= */
body.game-page .recent-words-card {
    width: min(520px, calc(100vw - 32px));
    text-align: left;
}

body.game-page .recent-words-head {
    margin-bottom: 14px;
}

body.game-page .recent-words-head h2 {
    margin: 0 0 4px;
    font-size: 28px;
    line-height: 1.05;
}

body.game-page .recent-words-head p {
    margin: 0;
    color: var(--modal-muted);
    font-size: 13px;
    font-weight: 800;
}

body.game-page .recent-words-list {
    display: grid;
    gap: 10px;
}

body.game-page .recent-word-item {
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(104, 109, 132, 0.48);
    background: rgba(104, 109, 132, 0.12);
    animation: recent-word-in 0.34s ease both;
    animation-delay: var(--delay, 0ms);
}

body.game-page:not(.dark-mode) .recent-word-item {
    border-color: rgba(193, 200, 214, 0.92);
    background: rgba(244, 246, 250, 0.96);
}

body.game-page .recent-word-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--modal-muted);
    font-size: 11px;
    font-weight: 900;
}

body.game-page .recent-word-tiles {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

body.game-page .recent-word-tiles span {
    width: 36px;
    height: 36px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--v4-green, #79b957);
    color: #ffffff;
    font-size: 18px;
    font-weight: 950;
    line-height: 1;
}

body.game-page .recent-word-detail {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

body.game-page .recent-word-detail strong {
    min-width: 0;
    color: var(--modal-text);
    font-size: 14px;
    line-height: 1.35;
    font-weight: 900;
}

body.game-page .recent-word-detail small {
    flex: 0 0 auto;
    color: var(--modal-muted);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

body.game-page .recent-words-empty {
    padding: 18px 14px;
    border-radius: 14px;
    border: 1px dashed rgba(104, 109, 132, 0.6);
    color: var(--modal-muted);
    text-align: center;
    font-size: 14px;
    font-weight: 800;
}

@keyframes recent-word-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 520px) {
    body.game-page .recent-words-card {
        width: min(430px, calc(100vw - 24px));
        padding: 22px 16px 18px;
    }

    body.game-page .recent-words-head h2 {
        font-size: 24px;
    }

    body.game-page .recent-word-meta,
    body.game-page .recent-word-detail {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    body.game-page .recent-word-detail small {
        white-space: normal;
    }

    body.game-page .recent-word-tiles span {
        width: 32px;
        height: 32px;
        border-radius: 7px;
        font-size: 16px;
    }
}

/* =========================================================
   HOME ICON VISIBILITY FIX
   Forces SVG icons to render on mobile browsers.
   ========================================================= */
.home-page .circle-btn {
    opacity: 1 !important;
    visibility: visible !important;
    color: var(--black) !important;
}

body.dark-mode.home-page .circle-btn {
    color: var(--white) !important;
}

.home-page .circle-btn svg {
    width: 22px !important;
    height: 22px !important;
    display: block !important;
    overflow: visible;
    opacity: 1 !important;
    visibility: visible !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2.3 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

.home-page .circle-btn svg * {
    fill: none !important;
    stroke: currentColor !important;
    vector-effect: non-scaling-stroke;
}

@media (max-width: 520px) {
    .home-page .circle-btn {
        background: rgba(255, 255, 255, 0.08);
    }

    .home-page:not(.dark-mode) .circle-btn {
        background: rgba(0, 0, 0, 0.04);
    }
}

/* =========================================================
   RESULT HEADER + LEADBOARD ACTION FIX
   ========================================================= */
body.game-page .result-status-line {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto 7px;
}

body.game-page .result-status-line h2,
body.game-page .result-status-line .result-score {
    margin: 0;
    line-height: 1;
}

body.game-page .result-status-line .result-score {
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid currentColor !important;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06) !important;
    box-shadow: none !important;
    font-size: clamp(16px, 3.8vw, 24px);
    font-weight: 950;
    letter-spacing: 0.01em;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.game-page .result-status-line .result-score.win {
    color: #57ac4d;
}

body.game-page .result-status-line .result-score.lose {
    color: #ef4444;
}

body.game-page .result-edition-line {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 11px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--modal-muted);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.35;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

body.game-page .result-edition-line .result-game-no,
body.game-page .result-edition-line .result-game-date {
    margin: 0;
    color: inherit;
    font: inherit;
    letter-spacing: 0;
}

body.game-page .result-edition-line .result-game-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.11);
}

body.game-page .result-edition-line .result-game-date {
    display: inline;
}

body.game-page .result-edition-line .result-game-date:empty {
    display: none;
}

body.game-page .result-bottom-actions .result-link {
    gap: 8px;
    border-radius: 12px;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 950;
    letter-spacing: 0;
}

body.game-page .result-bottom-actions .result-profile-link {
    border-color: rgba(87, 172, 77, 0.45);
    background: rgba(87, 172, 77, 0.13);
    color: #3f8f39;
}

body.game-page.dark-mode .result-bottom-actions .result-profile-link {
    color: #9ee08f;
}

body.game-page .result-bottom-actions .result-profile-link:hover,
body.game-page .result-bottom-actions .result-profile-link:focus {
    border-color: rgba(87, 172, 77, 0.7);
    background: rgba(87, 172, 77, 0.2);
}

body.game-page .result-bottom-actions .result-leaderboard-link {
    border-color: rgba(245, 190, 50, 0.52);
    background: rgba(245, 190, 50, 0.15);
    color: #9a6a00;
}

body.game-page.dark-mode .result-bottom-actions .result-leaderboard-link {
    color: #ffd05a;
}

body.game-page .result-bottom-actions .result-leaderboard-link:hover,
body.game-page .result-bottom-actions .result-leaderboard-link:focus {
    border-color: rgba(245, 190, 50, 0.8);
    background: rgba(245, 190, 50, 0.23);
}

body.game-page .result-bottom-actions .result-link:hover,
body.game-page .result-bottom-actions .result-link:focus,
body.game-page .result-bottom-actions .result-link:active {
    text-decoration: none !important;
}

/* =========================================================
   RESULT EDITION STATS LINK + MODAL
   ========================================================= */
body.game-page .result-edition-stats-link-wrap {
    width: min(300px, 100%);
    margin: 5px auto 7px;
    display: flex;
    justify-content: flex-end;
}

body.game-page .result-edition-stats-link {
    border: 0;
    background: transparent;
    color: var(--modal-muted);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 0;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    transition: color 0.14s ease, transform 0.14s ease;
}

body.game-page .result-edition-stats-link:hover,
body.game-page .result-edition-stats-link:focus {
    color: var(--modal-text);
    transform: translateX(1px);
}

body.game-page .result-edition-stats-link span {
    font-size: 16px;
    line-height: 0.8;
}

body.game-page .edition-stats-card {
    width: min(420px, calc(100vw - 24px));
    padding: 25px 18px 18px;
    border-radius: 18px;
    text-align: left;
}

body.game-page .edition-stats-head {
    margin-bottom: 14px;
}

body.game-page .edition-stats-head h2 {
    margin: 0 0 5px;
    color: var(--modal-text);
    font-size: clamp(22px, 6vw, 30px);
    font-weight: 950;
    letter-spacing: -0.03em;
    line-height: 1;
}

body.game-page .edition-stats-head p {
    margin: 0;
    color: var(--modal-muted);
    font-size: 12px;
    font-weight: 850;
}

body.game-page .edition-stats-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

body.game-page .edition-stats-summary span {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    color: var(--modal-muted);
    font-size: 11px;
    font-weight: 900;
}

body.game-page:not(.dark-mode) .edition-stats-summary span {
    background: #eef2f8;
}

body.game-page .edition-stats-bars {
    display: grid;
    gap: 9px;
}

body.game-page .edition-stats-row {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

body.game-page .edition-stats-label {
    color: var(--modal-text);
    font-size: 12px;
    font-weight: 950;
    text-align: center;
}

body.game-page .edition-stats-track {
    position: relative;
    height: 20px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    overflow: hidden;
}

body.game-page:not(.dark-mode) .edition-stats-track {
    background: #e8edf5;
}

body.game-page .edition-stats-bar {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #57ac4d;
    transition: width 0.28s ease;
}

body.game-page .edition-stats-percent {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    color: var(--modal-muted);
    font-size: 11px;
    font-weight: 950;
    line-height: 1;
    pointer-events: none;
}

body.game-page .edition-stats-track.has-value .edition-stats-percent {
    color: #ffffff;
}

body.game-page .edition-stats-row.loss .edition-stats-bar {
    background: #ef4444;
}

body.game-page .edition-stats-empty {
    padding: 16px 12px;
    border: 1px dashed rgba(148, 163, 184, 0.5);
    border-radius: 14px;
    color: var(--modal-muted);
    text-align: center;
    font-size: 13px;
    font-weight: 850;
}

/* =========================================================
   PRACTICE MODE
   ========================================================= */
body.practice-page .result-edition-stats-link-wrap,
body.practice-page .result-next-word,
body.practice-page .result-bottom-actions {
    display: none !important;
}

body.practice-page .result-card {
    padding-bottom: 24px;
}

/* =========================================================
   STREAK SAKLA - RESULT MODAL
   ========================================================= */
body.game-page .result-streak {
    width: min(430px, 100%);
    margin: 10px auto 0;
    padding: 11px 12px;
    border: 1px solid rgba(83, 141, 78, 0.3);
    border-radius: 15px;
    background: rgba(83, 141, 78, 0.1);
    color: var(--modal-text);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    text-align: left;
}

body.game-page .result-streak[hidden] {
    display: none !important;
}

body.game-page .result-streak-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(83, 141, 78, 0.14);
    font-size: 20px;
    line-height: 1;
}

body.game-page .result-streak-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

body.game-page .result-streak-copy strong {
    color: var(--modal-text);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.25;
}

body.game-page .result-streak-copy > span {
    color: var(--modal-muted);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.35;
}

body.game-page .result-streak-badge {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(83, 141, 78, 0.15);
    color: #447b40;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

body.game-page.dark-mode .result-streak-badge {
    color: #a8db9e;
}

body.game-page .result-streak.is-shield {
    border-color: rgba(59, 130, 246, 0.32);
    background: rgba(59, 130, 246, 0.1);
}

body.game-page .result-streak.is-shield .result-streak-icon,
body.game-page .result-streak.is-shield .result-streak-badge {
    background: rgba(59, 130, 246, 0.14);
    color: #2563eb;
}

body.game-page.dark-mode .result-streak.is-shield .result-streak-badge {
    color: #93c5fd;
}

body.game-page .result-streak.is-milestone {
    border-color: rgba(181, 159, 59, 0.34);
    background: rgba(181, 159, 59, 0.12);
}

body.game-page .result-streak.is-milestone .result-streak-icon,
body.game-page .result-streak.is-milestone .result-streak-badge {
    background: rgba(181, 159, 59, 0.16);
    color: #8b7420;
}

body.game-page.dark-mode .result-streak.is-milestone .result-streak-badge {
    color: #ead270;
}

body.game-page .result-streak.is-broken {
    border-color: rgba(107, 114, 128, 0.28);
    background: rgba(107, 114, 128, 0.09);
}

body.game-page .result-streak.is-guest {
    border-style: dashed;
    border-color: rgba(181, 159, 59, 0.34);
    background: rgba(181, 159, 59, 0.08);
}

@media (max-width: 430px) {
    body.game-page .result-streak {
        padding: 9px 10px;
        border-radius: 13px;
        gap: 8px;
    }

    body.game-page .result-streak-icon {
        width: 32px;
        height: 32px;
        border-radius: 10px;
        font-size: 18px;
    }

    body.game-page .result-streak-copy strong {
        font-size: 12px;
    }

    body.game-page .result-streak-copy > span {
        font-size: 10px;
    }

    body.game-page .result-streak-badge {
        padding: 4px 7px;
        font-size: 9px;
    }
}

/* =========================================================
   LEADERBOARD PRO POLISH
   ========================================================= */
body.game-page .leaderboard-card {
    width: min(500px, calc(100vw - 22px));
    padding: 26px 18px 18px;
    border-radius: 18px;
}

body.game-page .leaderboard-head {
    margin-bottom: 12px;
}

body.game-page .leaderboard-head h2 {
    margin: 0 0 4px;
    font-size: clamp(24px, 6vw, 32px);
    font-weight: 950;
    letter-spacing: -0.03em;
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

body.game-page .leaderboard-title-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: rgba(87, 172, 77, 0.14);
    color: #57ac4d;
    flex: 0 0 auto;
}

body.game-page .leaderboard-title-icon svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.game-page:not(.dark-mode) .leaderboard-title-icon {
    background: #ecf8e9;
    color: #3f8f39;
}

body.game-page .leaderboard-head p {
    width: fit-content;
    padding: 4px 9px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.1);
    font-size: 11px;
    font-weight: 900;
}

body.game-page .leaderboard-list {
    gap: 10px;
    margin-top: 8px;
}

body.game-page .leaderboard-podium {
    gap: 9px;
    margin-top: 8px;
}

body.game-page .leaderboard-podium-card {
    position: relative;
    min-height: 108px;
    padding: 12px 7px 10px;
    border-radius: 16px;
    border-color: rgba(148, 163, 184, 0.38);
    background: rgba(148, 163, 184, 0.11);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}

body.game-page:not(.dark-mode) .leaderboard-podium-card {
    background: #f7f9fc;
    border-color: #d8deea;
}

body.game-page .leaderboard-podium-card.rank-1 {
    min-height: 128px;
    border-color: rgba(87, 172, 77, 0.55);
    background: rgba(87, 172, 77, 0.12);
}

body.game-page:not(.dark-mode) .leaderboard-podium-card.rank-1 {
    background: #f1faee;
}

body.game-page .leaderboard-podium-card.rank-2,
body.game-page .leaderboard-podium-card.rank-3 {
    padding-top: 13px;
}

body.game-page .leaderboard-crown {
    width: 31px;
    height: 31px;
    border-radius: 10px;
    font-size: 13px;
    box-shadow: none;
}

body.game-page .leaderboard-podium-card.rank-1 .leaderboard-crown {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    box-shadow: none;
}

body.game-page .leaderboard-podium-card strong,
body.game-page .leaderboard-podium-card.rank-1 strong,
body.game-page .leaderboard-name {
    max-width: 100%;
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1.1;
    letter-spacing: 0;
}

body.game-page .leaderboard-podium-card.rank-1 .leaderboard-name {
    font-size: 13px;
}

body.game-page .leaderboard-meta {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

body.game-page .leaderboard-meta span,
body.game-page .leaderboard-podium-card span {
    width: auto;
    max-width: 100%;
    padding: 3px 5px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    color: var(--modal-muted);
    font-size: 9.5px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

body.game-page .leaderboard-meta .leaderboard-score-chip {
    background: rgba(245, 190, 50, 0.18);
    color: #ffd05a;
}

body.game-page:not(.dark-mode) .leaderboard-meta .leaderboard-score-chip {
    background: #fff3c4;
    color: #8a6400;
}

body.game-page:not(.dark-mode) .leaderboard-meta span {
    background: #e9eef7;
}

body.game-page .leaderboard-rest {
    gap: 6px;
}

body.game-page .leaderboard-rest .leaderboard-item,
body.game-page .leaderboard-item {
    min-height: 54px;
    padding: 8px 10px;
    border-radius: 13px;
    border-color: rgba(148, 163, 184, 0.34);
    background: rgba(148, 163, 184, 0.09);
}

body.game-page .leaderboard-rest .leaderboard-item {
    min-height: 46px;
    padding: 6px 9px;
    border-radius: 12px;
}

body.game-page:not(.dark-mode) .leaderboard-rest .leaderboard-item,
body.game-page:not(.dark-mode) .leaderboard-item {
    background: #f7f9fc;
    border-color: #d8deea;
}

body.game-page .leaderboard-rank {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 13px;
}

body.game-page .leaderboard-rest .leaderboard-rank {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    font-size: 12px;
}

body.game-page .leaderboard-player {
    gap: 5px;
}

body.game-page .leaderboard-rest .leaderboard-player {
    gap: 3px;
}

body.game-page .leaderboard-player strong {
    font-size: 13px;
    letter-spacing: 0;
}

body.game-page .leaderboard-rest .leaderboard-player strong {
    font-size: 12px;
}

body.game-page .leaderboard-rest .leaderboard-meta span {
    padding: 2px 5px;
    font-size: 9px;
}

body.game-page .leaderboard-player .leaderboard-meta {
    justify-content: flex-start;
}

body.game-page {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body.game-page::-webkit-scrollbar {
    width: 0;
    height: 0;
}

@supports selector(html:has(body.game-page)) {
    html:has(body.game-page) {
        scrollbar-width: none;
    }

    html:has(body.game-page)::-webkit-scrollbar {
        width: 0;
        height: 0;
    }
}

@media (max-width: 420px) {
    body.game-page .leaderboard-card {
        padding: 24px 14px 16px;
    }

    body.game-page .leaderboard-podium {
        gap: 6px;
    }

    body.game-page .leaderboard-podium-card {
        min-height: 104px;
        padding-left: 5px;
        padding-right: 5px;
    }

    body.game-page .leaderboard-podium-card.rank-1 {
        min-height: 122px;
    }

    body.game-page .leaderboard-meta span,
    body.game-page .leaderboard-podium-card span {
        padding: 3px 4px;
        font-size: 9px;
    }
}

/* =========================================================
   STREAK SAKLA V1.1 - GAME PAGE PILL
   Keeps streak visible without adding another game layout row.
   ========================================================= */
body.game-page .game-meta-line {
    max-width: min(520px, calc(100vw - 34px));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    white-space: nowrap;
}

body.game-page .game-streak-pill {
    min-height: 25px;
    padding: 3px 9px;
    border: 1px solid rgba(121, 185, 87, 0.34);
    border-radius: 999px;
    background: rgba(121, 185, 87, 0.1);
    color: #a8db8d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

body.game-page:not(.dark-mode) .game-streak-pill {
    border-color: rgba(83, 141, 78, 0.26);
    background: rgba(83, 141, 78, 0.08);
    color: #3f773a;
}

body.game-page .game-streak-pill:hover,
body.game-page .game-streak-pill:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(121, 185, 87, 0.6);
    background: rgba(121, 185, 87, 0.17);
    outline: none;
}

body.game-page .game-streak-pill strong {
    color: inherit;
    font-size: 12px;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
}

body.game-page .game-streak-icon {
    font-size: 13px;
    line-height: 1;
}

body.game-page .game-streak-pill.is-loading {
    opacity: 0.68;
}

body.game-page .game-streak-pill.is-at-risk,
body.game-page .game-streak-pill.is-shield {
    border-color: rgba(59, 130, 246, 0.36);
    background: rgba(59, 130, 246, 0.11);
    color: #93c5fd;
}

body.game-page:not(.dark-mode) .game-streak-pill.is-at-risk,
body.game-page:not(.dark-mode) .game-streak-pill.is-shield {
    color: #2563eb;
}

body.game-page .game-streak-pill.is-milestone {
    border-color: rgba(181, 159, 59, 0.38);
    background: rgba(181, 159, 59, 0.12);
    color: #ead270;
}

body.game-page:not(.dark-mode) .game-streak-pill.is-milestone {
    color: #8b7420;
}

body.game-page .game-streak-pill.is-restart,
body.game-page .game-streak-pill.is-unavailable {
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(148, 163, 184, 0.08);
    color: var(--v4-muted-dark, #aeb4c4);
}

body.game-page:not(.dark-mode) .game-streak-pill.is-restart,
body.game-page:not(.dark-mode) .game-streak-pill.is-unavailable {
    color: var(--v4-muted-light, #687084);
}

body.game-page .game-streak-pill.is-guest {
    border-color: rgba(181, 159, 59, 0.35);
    background: rgba(181, 159, 59, 0.1);
    color: #ead270;
}

body.game-page:not(.dark-mode) .game-streak-pill.is-guest {
    color: #8b7420;
}

@media (max-width: 390px) {
    body.game-page .game-meta-line {
        gap: 7px;
    }

    body.game-page .game-streak-pill {
        min-height: 23px;
        padding: 3px 7px;
        font-size: 10px;
    }

    body.game-page .game-streak-pill strong {
        font-size: 11px;
    }

    body.game-page .game-streak-icon {
        font-size: 12px;
    }
}

@media (max-width: 345px) {
    body.game-page .game-streak-pill.is-guest #gameStreakUnit {
        display: none;
    }
}

/* =========================================================
   RESULT ACTIONS V2
   Salin + Bagikan; Simpan berada di dalam menu Bagikan.
   ========================================================= */
body.game-page .result-next-word {
    width: fit-content;
    max-width: 100%;
    margin: 2px auto 13px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--modal-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.25;
}

body.game-page .result-next-word-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

body.game-page .result-next-word-icon svg {
    width: 16px;
    height: 16px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.game-page .result-action-row {
    width: min(100%, 360px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}

body.game-page .result-action-row #copyResultBtn,
body.game-page .result-action-row .result-share-wrap,
body.game-page .result-action-row .result-action-btn {
    grid-column: auto;
    width: 100%;
    min-width: 0;
}

body.game-page .result-action-row .result-action-btn {
    min-height: 46px;
    padding: 8px 12px;
    border-width: 1.5px;
    font-size: 14px;
}

body.game-page .result-action-row .result-share-wrap {
    position: relative;
}

body.game-page .result-action-row #openShareMenuBtn {
    background: var(--v4-text-dark, #f7f8ff);
    color: var(--v4-bg-dark, #12131c);
    border-color: var(--v4-text-dark, #f7f8ff);
}

body.game-page:not(.dark-mode) .result-action-row #openShareMenuBtn {
    background: var(--v4-text-light, #2f3848);
    color: #ffffff;
    border-color: var(--v4-text-light, #2f3848);
}

body.game-page .result-action-row .result-share-menu {
    right: 0;
    left: auto;
    top: auto;
    bottom: calc(100% + 10px);
    transform: none;
    width: min(260px, calc(100vw - 48px));
    z-index: 12;
}

body.game-page .result-share-menu #saveStoryBtn {
    color: var(--v4-green, #79b957);
}

body.game-page:not(.dark-mode) .result-share-menu #saveStoryBtn {
    color: #4f8c36;
}

body.game-page .result-bottom-actions {
    width: min(100%, 360px);
    margin: 10px auto 0;
    padding-top: 9px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

body.game-page .result-bottom-actions .result-link,
body.game-page .result-bottom-actions .result-profile-link,
body.game-page .result-bottom-actions .result-leaderboard-link {
    width: 100%;
    min-height: 36px;
    margin: 0;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--modal-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.1;
    text-decoration: none;
    box-shadow: none;
}

body.game-page .result-bottom-actions .result-link:hover,
body.game-page .result-bottom-actions .result-link:focus-visible,
body.game-page .result-bottom-actions .result-leaderboard-link:hover,
body.game-page .result-bottom-actions .result-leaderboard-link:focus-visible {
    border-color: rgba(148, 163, 184, 0.22);
    background: rgba(148, 163, 184, 0.09);
    color: var(--modal-text);
    transform: none;
    filter: none;
    box-shadow: none;
    outline: none;
}

body.game-page .result-bottom-actions .result-profile-link .result-link-icon {
    color: var(--v4-green, #79b957);
}

body.game-page .result-bottom-actions .result-leaderboard-link .result-link-icon {
    color: var(--v4-yellow, #f5c542);
}

body.game-page .result-bottom-actions .result-link-icon,
body.game-page .result-bottom-actions .result-link-icon svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 360px) {
    body.game-page .result-action-row {
        gap: 8px;
    }

    body.game-page .result-action-row .result-action-btn {
        min-height: 44px;
        padding-left: 9px;
        padding-right: 9px;
        font-size: 13px;
    }

    body.game-page .result-bottom-actions {
        gap: 4px;
    }

    body.game-page .result-bottom-actions .result-link,
    body.game-page .result-bottom-actions .result-leaderboard-link {
        padding-left: 6px;
        padding-right: 6px;
        font-size: 11px;
    }
}

/* =========================================================
   RESULT META BAR + SHAREABLE STREAK V1
   ========================================================= */
body.game-page .result-meta-bar {
    width: min(100%, 360px);
    margin: 10px auto 0;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    background: rgba(148, 163, 184, 0.07);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

body.game-page:not(.dark-mode) .result-meta-bar {
    border-color: rgba(101, 112, 132, 0.18);
    background: rgba(220, 227, 238, 0.34);
}

body.game-page .result-meta-divider {
    width: 1px;
    min-height: 36px;
    align-self: stretch;
    background: rgba(148, 163, 184, 0.22);
}

body.game-page .result-meta-item {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--modal-text);
}

body.game-page .result-meta-action {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-family: inherit;
    cursor: pointer;
}

body.game-page .result-meta-action:hover,
body.game-page .result-meta-action:focus-visible {
    color: var(--v4-green, #79b957);
    outline: none;
}

body.game-page .result-meta-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--modal-muted);
}

body.game-page .result-meta-icon svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.game-page .result-meta-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
    text-align: left;
}

body.game-page .result-meta-label {
    color: var(--modal-muted);
    font-size: 10px;
    font-weight: 750;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

body.game-page .result-meta-copy strong {
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.1;
    white-space: nowrap;
}

body.game-page #resultNextTimer {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

body.game-page .result-streak {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    cursor: default;
}

body.game-page .result-streak-side {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

body.game-page .result-streak-share-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: inherit;
    background: rgba(83, 141, 78, 0.13);
    opacity: 0.82;
    transition: opacity 0.14s ease, transform 0.14s ease, background 0.14s ease;
}

body.game-page .result-streak-share-icon[hidden] {
    display: none !important;
}

body.game-page .result-streak-share-icon svg {
    width: 15px;
    height: 15px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.game-page .result-streak.is-shareable {
    cursor: pointer;
    transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
}

body.game-page .result-streak.is-shareable:hover,
body.game-page .result-streak.is-shareable:focus-visible {
    border-color: rgba(83, 141, 78, 0.55);
    background: rgba(83, 141, 78, 0.15);
    transform: translateY(-1px);
    outline: none;
}

body.game-page .result-streak.is-shareable:hover .result-streak-share-icon,
body.game-page .result-streak.is-shareable:focus-visible .result-streak-share-icon {
    opacity: 1;
    transform: translateY(-1px);
    background: rgba(83, 141, 78, 0.2);
}

body.game-page .result-streak.is-sharing {
    pointer-events: none;
    opacity: 0.62;
}

body.practice-page .result-meta-bar {
    display: none !important;
}

@media (max-width: 360px) {
    body.game-page .result-meta-bar {
        padding: 9px 8px;
        gap: 7px;
    }

    body.game-page .result-meta-item {
        gap: 6px;
    }

    body.game-page .result-meta-icon,
    body.game-page .result-meta-icon svg {
        width: 16px;
        height: 16px;
    }

    body.game-page .result-meta-label {
        font-size: 9px;
    }

    body.game-page .result-meta-copy strong {
        font-size: 12px;
    }
}

/* =========================================================
   GAME HEADER — LENCANA KOLEKSI USER
   ========================================================= */
body.game-page .game-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

body.game-page .game-brand .game-title {
    flex: 0 0 auto;
}

body.game-page .game-player-badge {
    --badge-accent: #94a3b8;
    --badge-accent-2: #64748b;
    --badge-soft: rgba(148, 163, 184, 0.18);
    position: relative;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    text-decoration: none;
    isolation: isolate;
    transition: transform 160ms ease, filter 160ms ease;
    -webkit-tap-highlight-color: transparent;
}

body.game-page .game-player-badge:hover,
body.game-page .game-player-badge:focus-visible {
    transform: translateY(-1px) scale(1.04);
    filter: brightness(1.06);
    outline: none;
}

body.game-page .game-player-badge-ring {
    width: 32px;
    height: 32px;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: conic-gradient(
        from -90deg,
        var(--badge-accent) 0deg,
        var(--badge-accent-2) var(--badge-progress-angle),
        rgba(148, 163, 184, 0.24) var(--badge-progress-angle),
        rgba(148, 163, 184, 0.24) 360deg
    );
    box-shadow: 0 7px 16px rgba(15, 23, 42, 0.24);
}

body.game-page .game-player-badge-icon {
    width: 100%;
    height: 100%;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), var(--badge-soft));
    color: var(--badge-accent-2);
    border: 1px solid rgba(255, 255, 255, 0.72);
}

body.game-page.dark-mode .game-player-badge-icon,
body.game-page[data-theme="dark"] .game-player-badge-icon {
    background: linear-gradient(145deg, rgba(31, 36, 54, 0.98), rgba(18, 19, 28, 0.98));
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--badge-accent);
}

body.game-page .game-player-badge-icon svg {
    width: 17px;
    height: 17px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.game-page .game-player-badge-level {
    position: absolute;
    right: -4px;
    bottom: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #111827;
    color: #ffffff;
    border: 2px solid #ffffff;
    font-size: 8px;
    line-height: 1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 950;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.22);
}

body.game-page.dark-mode .game-player-badge-level,
body.game-page[data-theme="dark"] .game-player-badge-level {
    border-color: #12131c;
    background: #f8fafc;
    color: #111827;
}

body.game-page .game-player-badge.is-progress {
    opacity: 0.74;
    filter: saturate(0.72);
}

body.game-page .game-player-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 11px);
    left: 50%;
    z-index: 80;
    width: max-content;
    max-width: min(230px, calc(100vw - 24px));
    padding: 8px 10px;
    border-radius: 9px;
    background: rgba(15, 23, 42, 0.96);
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 11px;
    line-height: 1.3;
    font-weight: 750;
    text-align: center;
    white-space: normal;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -4px);
    transition: opacity 140ms ease, transform 140ms ease;
}

body.game-page .game-player-badge:hover::after,
body.game-page .game-player-badge:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

body.game-page .game-player-badge.tone-lime {
    --badge-accent: #84cc16;
    --badge-accent-2: #4d7c0f;
    --badge-soft: rgba(132, 204, 22, 0.16);
}

body.game-page .game-player-badge.tone-amber {
    --badge-accent: #fbbf24;
    --badge-accent-2: #b45309;
    --badge-soft: rgba(251, 191, 36, 0.17);
}

body.game-page .game-player-badge.tone-rose {
    --badge-accent: #fb7185;
    --badge-accent-2: #be123c;
    --badge-soft: rgba(251, 113, 133, 0.16);
}

body.game-page .game-player-badge.tone-slate {
    --badge-accent: #94a3b8;
    --badge-accent-2: #475569;
    --badge-soft: rgba(148, 163, 184, 0.18);
}

body.game-page .game-player-badge.tone-violet {
    --badge-accent: #a78bfa;
    --badge-accent-2: #6d28d9;
    --badge-soft: rgba(167, 139, 250, 0.18);
}

body.game-page .game-player-badge.tone-blue {
    --badge-accent: #60a5fa;
    --badge-accent-2: #1d4ed8;
    --badge-soft: rgba(96, 165, 250, 0.17);
}

body.game-page .game-player-badge.tone-cyan {
    --badge-accent: #22d3ee;
    --badge-accent-2: #0e7490;
    --badge-soft: rgba(34, 211, 238, 0.16);
}

body.game-page .game-player-badge.tone-green {
    --badge-accent: #4ade80;
    --badge-accent-2: #15803d;
    --badge-soft: rgba(74, 222, 128, 0.16);
}

body.game-page .game-player-badge.tone-gold {
    --badge-accent: #facc15;
    --badge-accent-2: #ca8a04;
    --badge-soft: rgba(250, 204, 21, 0.19);
}

body.game-page .game-player-badge.tone-legend {
    --badge-accent: #f59e0b;
    --badge-accent-2: #7c3aed;
    --badge-soft: rgba(124, 58, 237, 0.17);
}

body.game-page .game-player-badge.tone-legend .game-player-badge-ring {
    box-shadow: 0 7px 19px rgba(124, 58, 237, 0.3), 0 0 0 1px rgba(245, 158, 11, 0.22);
}

@media (max-width: 360px) {
    body.game-page .game-brand {
        gap: 5px;
    }

    body.game-page .game-player-badge,
    body.game-page .game-player-badge-ring {
        width: 28px;
        height: 28px;
        border-radius: 10px;
    }

    body.game-page .game-player-badge-icon {
        border-radius: 8px;
    }

    body.game-page .game-player-badge-icon svg {
        width: 15px;
        height: 15px;
    }

    body.game-page .game-player-badge-level {
        right: -3px;
        bottom: -3px;
        min-width: 14px;
        height: 14px;
        font-size: 7px;
    }
}

/* =========================================================
   GAME HEADER — POPUP PROFIL LENCANA
   ========================================================= */
body.game-page .game-player-badge {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

body.game-page .collection-badge-card {
    --badge-accent: #94a3b8;
    --badge-accent-2: #475569;
    --badge-soft: rgba(148, 163, 184, 0.18);
    width: min(390px, calc(100vw - 28px));
    max-height: min(88vh, 700px);
    padding: 0 !important;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.64);
    border-radius: 26px;
    background: #ffffff;
    color: #111827;
    text-align: left;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.34);
    scrollbar-width: thin;
}

body.game-page .collection-badge-close {
    top: 14px;
    right: 14px;
    z-index: 8;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.54);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.game-page .collection-badge-cover {
    position: relative;
    min-height: 164px;
    padding: 22px 22px 42px;
    overflow: hidden;
    background:
        radial-gradient(circle at 78% 16%, rgba(255, 255, 255, 0.34), transparent 32%),
        linear-gradient(135deg, var(--badge-accent-2), var(--badge-accent));
    color: #ffffff;
    isolation: isolate;
}

body.game-page .collection-badge-cover::before,
body.game-page .collection-badge-cover::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

body.game-page .collection-badge-cover::before {
    width: 170px;
    height: 170px;
    top: -90px;
    right: -52px;
    border: 34px solid rgba(255, 255, 255, 0.13);
}

body.game-page .collection-badge-cover::after {
    width: 108px;
    height: 108px;
    left: -48px;
    bottom: -64px;
    background: rgba(255, 255, 255, 0.12);
}

body.game-page .collection-badge-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.12em;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.game-page .collection-badge-user {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-top: 21px;
    min-width: 0;
}

body.game-page .collection-badge-avatar {
    flex: 0 0 auto;
    width: 62px;
    height: 62px;
    padding: 3px;
    overflow: hidden;
    border-radius: 21px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.98);
    color: var(--badge-accent-2);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.22);
    font-size: 24px;
    font-weight: 950;
}

body.game-page .collection-badge-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 17px;
}

body.game-page .collection-badge-user-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

body.game-page .collection-badge-user-copy small {
    color: rgba(255, 255, 255, 0.72);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.1em;
}

body.game-page .collection-badge-user-copy strong {
    max-width: 235px;
    overflow: hidden;
    color: #ffffff;
    font-size: 18px;
    line-height: 1.15;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

body.game-page .collection-badge-body {
    position: relative;
    padding: 61px 24px 24px;
    text-align: center;
}

body.game-page .collection-badge-emblem {
    position: absolute;
    top: -48px;
    left: 50%;
    width: 94px;
    height: 94px;
    transform: translateX(-50%);
    border-radius: 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18), 0 0 0 7px rgba(255, 255, 255, 0.34);
}

body.game-page .collection-badge-emblem-inner {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), var(--badge-soft));
    color: var(--badge-accent-2);
    border: 1px solid color-mix(in srgb, var(--badge-accent) 28%, transparent);
}

body.game-page .collection-badge-emblem-inner svg {
    width: 37px;
    height: 37px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.game-page .collection-badge-emblem-level {
    position: absolute;
    right: -8px;
    bottom: -5px;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #111827;
    color: #ffffff;
    border: 3px solid #ffffff;
    font-size: 9px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: 0.03em;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.2);
}

body.game-page .collection-badge-status {
    min-height: 27px;
    padding: 0 11px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--badge-soft);
    color: var(--badge-accent-2);
    font-size: 11px;
    font-weight: 950;
}

body.game-page .collection-badge-card.is-progress .collection-badge-status {
    background: rgba(148, 163, 184, 0.14);
    color: #64748b;
}

body.game-page .collection-badge-body h2 {
    margin: 11px 0 7px;
    color: #111827;
    font-size: 27px;
    line-height: 1.08;
    font-weight: 950;
    letter-spacing: -0.035em;
}

body.game-page .collection-badge-description {
    max-width: 310px;
    margin: 0 auto;
    color: #667085;
    font-size: 14px;
    line-height: 1.52;
    font-weight: 650;
}

body.game-page .collection-badge-stat {
    margin-top: 20px;
    padding: 14px 15px;
    border-radius: 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #f7f8fb;
    border: 1px solid #e7eaf0;
    text-align: left;
}

body.game-page .collection-badge-stat span {
    color: #8a93a3;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.08em;
}

body.game-page .collection-badge-stat strong {
    color: #111827;
    font-size: 15px;
    font-weight: 950;
    white-space: nowrap;
}

body.game-page .collection-badge-progress {
    height: 8px;
    margin-top: 13px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8ebf1;
}

body.game-page .collection-badge-progress > span {
    height: 100%;
    min-width: 8px;
    display: block;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--badge-accent-2), var(--badge-accent));
    box-shadow: 0 0 12px var(--badge-soft);
}

body.game-page .collection-badge-progress-copy {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    color: #7b8494;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 750;
    text-align: left;
}

body.game-page .collection-badge-progress-copy span {
    max-width: 190px;
}

body.game-page .collection-badge-progress-copy strong {
    flex: 0 0 auto;
    color: #475467;
    font-weight: 900;
    white-space: nowrap;
}

body.game-page .collection-badge-card.tone-lime {
    --badge-accent: #84cc16;
    --badge-accent-2: #4d7c0f;
    --badge-soft: rgba(132, 204, 22, 0.16);
}
body.game-page .collection-badge-card.tone-amber {
    --badge-accent: #fbbf24;
    --badge-accent-2: #b45309;
    --badge-soft: rgba(251, 191, 36, 0.17);
}
body.game-page .collection-badge-card.tone-rose {
    --badge-accent: #fb7185;
    --badge-accent-2: #be123c;
    --badge-soft: rgba(251, 113, 133, 0.16);
}
body.game-page .collection-badge-card.tone-slate {
    --badge-accent: #94a3b8;
    --badge-accent-2: #475569;
    --badge-soft: rgba(148, 163, 184, 0.18);
}
body.game-page .collection-badge-card.tone-violet {
    --badge-accent: #a78bfa;
    --badge-accent-2: #6d28d9;
    --badge-soft: rgba(167, 139, 250, 0.18);
}
body.game-page .collection-badge-card.tone-blue {
    --badge-accent: #60a5fa;
    --badge-accent-2: #1d4ed8;
    --badge-soft: rgba(96, 165, 250, 0.17);
}
body.game-page .collection-badge-card.tone-cyan {
    --badge-accent: #22d3ee;
    --badge-accent-2: #0e7490;
    --badge-soft: rgba(34, 211, 238, 0.16);
}
body.game-page .collection-badge-card.tone-green {
    --badge-accent: #4ade80;
    --badge-accent-2: #15803d;
    --badge-soft: rgba(74, 222, 128, 0.16);
}
body.game-page .collection-badge-card.tone-gold {
    --badge-accent: #facc15;
    --badge-accent-2: #ca8a04;
    --badge-soft: rgba(250, 204, 21, 0.19);
}
body.game-page .collection-badge-card.tone-legend {
    --badge-accent: #f59e0b;
    --badge-accent-2: #7c3aed;
    --badge-soft: rgba(124, 58, 237, 0.17);
}

body.game-page.dark-mode .collection-badge-card,
body.game-page[data-theme="dark"] .collection-badge-card {
    border-color: rgba(255, 255, 255, 0.08);
    background: #161823;
    color: #f8fafc;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62);
}

body.game-page.dark-mode .collection-badge-emblem,
body.game-page[data-theme="dark"] .collection-badge-emblem {
    background: #1d202d;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36), 0 0 0 7px rgba(18, 20, 29, 0.38);
}

body.game-page.dark-mode .collection-badge-emblem-inner,
body.game-page[data-theme="dark"] .collection-badge-emblem-inner {
    background: linear-gradient(145deg, rgba(42, 46, 63, 0.98), rgba(24, 26, 38, 0.98));
    color: var(--badge-accent);
    border-color: rgba(255, 255, 255, 0.1);
}

body.game-page.dark-mode .collection-badge-emblem-level,
body.game-page[data-theme="dark"] .collection-badge-emblem-level {
    background: #f8fafc;
    color: #111827;
    border-color: #1d202d;
}

body.game-page.dark-mode .collection-badge-body h2,
body.game-page[data-theme="dark"] .collection-badge-body h2,
body.game-page.dark-mode .collection-badge-stat strong,
body.game-page[data-theme="dark"] .collection-badge-stat strong {
    color: #f8fafc;
}

body.game-page.dark-mode .collection-badge-description,
body.game-page[data-theme="dark"] .collection-badge-description {
    color: #aeb7c8;
}

body.game-page.dark-mode .collection-badge-stat,
body.game-page[data-theme="dark"] .collection-badge-stat {
    background: #202331;
    border-color: rgba(255, 255, 255, 0.08);
}

body.game-page.dark-mode .collection-badge-stat span,
body.game-page[data-theme="dark"] .collection-badge-stat span,
body.game-page.dark-mode .collection-badge-progress-copy,
body.game-page[data-theme="dark"] .collection-badge-progress-copy {
    color: #8f9aae;
}

body.game-page.dark-mode .collection-badge-progress,
body.game-page[data-theme="dark"] .collection-badge-progress {
    background: #292d3c;
}

body.game-page.dark-mode .collection-badge-progress-copy strong,
body.game-page[data-theme="dark"] .collection-badge-progress-copy strong {
    color: #d7deea;
}

@media (max-width: 420px) {
    body.game-page .collection-badge-card {
        width: min(365px, calc(100vw - 20px));
        border-radius: 23px;
    }

    body.game-page .collection-badge-cover {
        min-height: 155px;
        padding: 19px 19px 40px;
    }

    body.game-page .collection-badge-avatar {
        width: 58px;
        height: 58px;
        border-radius: 19px;
    }

    body.game-page .collection-badge-avatar img {
        border-radius: 15px;
    }

    body.game-page .collection-badge-user-copy strong {
        max-width: 210px;
        font-size: 17px;
    }

    body.game-page .collection-badge-body {
        padding: 58px 19px 21px;
    }

    body.game-page .collection-badge-body h2 {
        font-size: 25px;
    }

    body.game-page .collection-badge-progress-copy {
        display: grid;
        gap: 3px;
    }
}

/* =========================================================
   GAME HEADER — POPUP PROFIL STREAK V5
   ========================================================= */
body.game-page button.game-streak-pill {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    font-family: inherit;
    cursor: pointer;
}

body.game-page .streak-profile-card {
    --streak-accent: #fb923c;
    --streak-accent-2: #c2410c;
    --streak-accent-deep: #7c2d12;
    --streak-soft: rgba(249, 115, 22, 0.16);
    width: min(400px, calc(100vw - 28px));
    max-height: min(90vh, 760px);
    padding: 0 !important;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 28px;
    background: #ffffff;
    color: #111827;
    text-align: left;
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.38);
    scrollbar-width: thin;
}

body.game-page .streak-profile-card.is-risk,
body.game-page .streak-profile-card.is-shield {
    --streak-accent: #60a5fa;
    --streak-accent-2: #2563eb;
    --streak-accent-deep: #1e3a8a;
    --streak-soft: rgba(59, 130, 246, 0.16);
}

body.game-page .streak-profile-card.is-restart,
body.game-page .streak-profile-card.is-empty {
    --streak-accent: #94a3b8;
    --streak-accent-2: #475569;
    --streak-accent-deep: #1e293b;
    --streak-soft: rgba(148, 163, 184, 0.17);
}

body.game-page .streak-profile-card.is-milestone {
    --streak-accent: #facc15;
    --streak-accent-2: #d97706;
    --streak-accent-deep: #78350f;
    --streak-soft: rgba(250, 204, 21, 0.2);
}

body.game-page .streak-profile-close {
    top: 14px;
    right: 14px;
    z-index: 8;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(15, 23, 42, 0.5);
    color: #ffffff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.game-page .streak-profile-cover {
    position: relative;
    min-height: 166px;
    padding: 22px 22px 43px;
    overflow: hidden;
    background:
        radial-gradient(circle at 82% 12%, rgba(255, 255, 255, 0.35), transparent 31%),
        radial-gradient(circle at 4% 100%, rgba(255, 255, 255, 0.15), transparent 31%),
        linear-gradient(138deg, var(--streak-accent-deep), var(--streak-accent-2) 58%, var(--streak-accent));
    color: #ffffff;
    isolation: isolate;
}

body.game-page .streak-profile-cover::before,
body.game-page .streak-profile-cover::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: -1;
}

body.game-page .streak-profile-cover::before {
    width: 186px;
    height: 186px;
    top: -105px;
    right: -55px;
    border: 35px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
}

body.game-page .streak-profile-cover::after {
    width: 150px;
    height: 150px;
    left: -74px;
    bottom: -98px;
    border-radius: 44px;
    background: rgba(255, 255, 255, 0.11);
    transform: rotate(28deg);
}

body.game-page .streak-profile-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.12em;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.game-page .streak-profile-user {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    margin-top: 21px;
}

body.game-page .streak-profile-avatar {
    flex: 0 0 auto;
    width: 62px;
    height: 62px;
    padding: 3px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 21px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.98);
    color: var(--streak-accent-deep);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.24);
    font-size: 24px;
    font-weight: 950;
}

body.game-page .streak-profile-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 17px;
}

body.game-page .streak-profile-user-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

body.game-page .streak-profile-user-copy small {
    color: rgba(255, 255, 255, 0.72);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.1em;
}

body.game-page .streak-profile-user-copy strong {
    max-width: 240px;
    overflow: hidden;
    color: #ffffff;
    font-size: 18px;
    line-height: 1.15;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

body.game-page .streak-profile-body {
    position: relative;
    padding: 64px 24px 24px;
    text-align: center;
}

body.game-page .streak-profile-emblem {
    position: absolute;
    top: -53px;
    left: 50%;
    width: 106px;
    height: 106px;
    transform: translateX(-50%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 35px;
    display: grid;
    place-content: center;
    justify-items: center;
    background: #ffffff;
    color: var(--streak-accent-2);
    box-shadow: 0 19px 45px rgba(15, 23, 42, 0.2), 0 0 0 7px rgba(255, 255, 255, 0.35);
    isolation: isolate;
}

body.game-page .streak-profile-emblem-glow {
    position: absolute;
    inset: 11px;
    z-index: -1;
    border-radius: 27px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), var(--streak-soft));
    border: 1px solid color-mix(in srgb, var(--streak-accent) 28%, transparent);
}

body.game-page .streak-profile-emblem-icon {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 21px;
    line-height: 1;
    filter: drop-shadow(0 4px 7px rgba(15, 23, 42, 0.16));
}

body.game-page .streak-profile-emblem strong {
    margin-top: 4px;
    color: var(--streak-accent-2);
    font-size: 35px;
    line-height: 0.92;
    font-weight: 1000;
    letter-spacing: -0.06em;
    font-variant-numeric: tabular-nums;
}

body.game-page .streak-profile-emblem small {
    margin-top: 5px;
    color: #94a3b8;
    font-size: 8px;
    font-weight: 950;
    letter-spacing: 0.14em;
}

body.game-page .streak-profile-status {
    min-height: 27px;
    padding: 0 11px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--streak-soft);
    color: var(--streak-accent-2);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.045em;
}

body.game-page .streak-profile-body h2 {
    margin: 11px 0 7px;
    color: #111827;
    font-size: 27px;
    line-height: 1.08;
    font-weight: 950;
    letter-spacing: -0.035em;
}

body.game-page .streak-profile-description {
    max-width: 320px;
    margin: 0 auto;
    color: #667085;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 650;
}

body.game-page .streak-profile-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 19px;
}

body.game-page .streak-profile-stats > div {
    min-width: 0;
    padding: 13px 12px;
    border: 1px solid #e7eaf0;
    border-radius: 17px;
    display: grid;
    gap: 5px;
    background: #f7f8fb;
    text-align: left;
}

body.game-page .streak-profile-stats span {
    color: #8a93a3;
    font-size: 9px;
    font-weight: 950;
    letter-spacing: 0.075em;
}

body.game-page .streak-profile-stats strong {
    color: #111827;
    font-size: 15px;
    font-weight: 900;
}

body.game-page .streak-profile-stats b {
    color: var(--streak-accent-2);
    font-size: 22px;
    font-weight: 1000;
    font-variant-numeric: tabular-nums;
}

body.game-page .streak-profile-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 17px;
    color: #8a93a3;
    font-size: 9px;
    font-weight: 950;
    letter-spacing: 0.075em;
}

body.game-page .streak-profile-progress-head strong {
    color: #475467;
    font-size: 11px;
    letter-spacing: 0;
}

body.game-page .streak-profile-progress {
    height: 9px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8ebf1;
}

body.game-page .streak-profile-progress > span {
    min-width: 0;
    height: 100%;
    display: block;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--streak-accent-2), var(--streak-accent));
    box-shadow: 0 0 13px var(--streak-soft);
    transition: width 0.45s ease;
}

body.game-page .streak-profile-progress-copy {
    margin: 7px 0 0;
    color: #7b8494;
    font-size: 11px;
    line-height: 1.4;
    font-weight: 750;
    text-align: left;
}

body.game-page .streak-profile-shield {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #e7eaf0;
    border-radius: 19px;
    background: #f9fafb;
    text-align: left;
}

body.game-page .streak-profile-shield.is-available,
body.game-page .streak-profile-shield.is-protecting {
    border-color: rgba(59, 130, 246, 0.23);
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.09), rgba(239, 246, 255, 0.78));
}

body.game-page .streak-profile-shield.is-used {
    border-color: rgba(148, 163, 184, 0.22);
    background: #f7f8fa;
}

body.game-page .streak-profile-shield.is-unavailable {
    opacity: 0.74;
}

body.game-page .streak-profile-shield-icon {
    flex: 0 0 auto;
    width: 43px;
    height: 43px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.13);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.08);
    font-size: 21px;
}

body.game-page .streak-profile-shield-content {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    gap: 6px;
}

body.game-page .streak-profile-shield-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

body.game-page .streak-profile-shield strong {
    color: #344054;
    font-size: 12px;
    line-height: 1.25;
    font-weight: 950;
}

body.game-page .streak-profile-shield-head em {
    flex: 0 0 auto;
    min-height: 21px;
    padding: 0 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    font-size: 8px;
    line-height: 1;
    font-style: normal;
    font-weight: 1000;
    letter-spacing: 0.055em;
}

body.game-page .streak-profile-shield.is-used .streak-profile-shield-head em,
body.game-page .streak-profile-shield.is-unavailable .streak-profile-shield-head em {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}

body.game-page .streak-profile-shield small {
    color: #667085;
    font-size: 10px;
    line-height: 1.5;
    font-weight: 680;
}

body.game-page .streak-profile-shield-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 10px;
    color: #667085;
    font-size: 9px;
    line-height: 1.35;
    font-weight: 800;
}

body.game-page .streak-profile-shield-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

body.game-page .streak-profile-shield-meta b {
    color: #2563eb;
    font-size: 13px;
    font-weight: 1000;
    font-variant-numeric: tabular-nums;
}

body.game-page .streak-profile-shield-rules {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 1px;
}

body.game-page .streak-profile-shield-rules > span {
    min-height: 22px;
    padding: 0 8px;
    border: 1px solid rgba(59, 130, 246, 0.12);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.64);
    color: #516077;
    font-size: 8px;
    line-height: 1;
    font-weight: 850;
}

body.game-page.dark-mode .streak-profile-card,
body.game-page[data-theme="dark"] .streak-profile-card {
    border-color: rgba(255, 255, 255, 0.08);
    background: #161823;
    color: #f8fafc;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
}

body.game-page.dark-mode .streak-profile-emblem,
body.game-page[data-theme="dark"] .streak-profile-emblem {
    border-color: rgba(255, 255, 255, 0.1);
    background: #1d202d;
    box-shadow: 0 19px 45px rgba(0, 0, 0, 0.38), 0 0 0 7px rgba(18, 20, 29, 0.4);
}

body.game-page.dark-mode .streak-profile-emblem-glow,
body.game-page[data-theme="dark"] .streak-profile-emblem-glow {
    border-color: rgba(255, 255, 255, 0.1);
    background: linear-gradient(145deg, rgba(42, 46, 63, 0.98), rgba(24, 26, 38, 0.98));
}

body.game-page.dark-mode .streak-profile-emblem strong,
body.game-page[data-theme="dark"] .streak-profile-emblem strong {
    color: var(--streak-accent);
}

body.game-page.dark-mode .streak-profile-body h2,
body.game-page[data-theme="dark"] .streak-profile-body h2,
body.game-page.dark-mode .streak-profile-stats strong,
body.game-page[data-theme="dark"] .streak-profile-stats strong,
body.game-page.dark-mode .streak-profile-shield strong,
body.game-page[data-theme="dark"] .streak-profile-shield strong {
    color: #f8fafc;
}

body.game-page.dark-mode .streak-profile-description,
body.game-page[data-theme="dark"] .streak-profile-description,
body.game-page.dark-mode .streak-profile-progress-copy,
body.game-page[data-theme="dark"] .streak-profile-progress-copy,
body.game-page.dark-mode .streak-profile-shield small,
body.game-page[data-theme="dark"] .streak-profile-shield small,
body.game-page.dark-mode .streak-profile-shield-meta,
body.game-page[data-theme="dark"] .streak-profile-shield-meta {
    color: #aeb7c8;
}

body.game-page.dark-mode .streak-profile-stats > div,
body.game-page[data-theme="dark"] .streak-profile-stats > div,
body.game-page.dark-mode .streak-profile-shield,
body.game-page[data-theme="dark"] .streak-profile-shield {
    border-color: rgba(255, 255, 255, 0.08);
    background: #202331;
}

body.game-page.dark-mode .streak-profile-progress,
body.game-page[data-theme="dark"] .streak-profile-progress {
    background: #292d3c;
}

body.game-page.dark-mode .streak-profile-progress-head,
body.game-page[data-theme="dark"] .streak-profile-progress-head,
body.game-page.dark-mode .streak-profile-stats span,
body.game-page[data-theme="dark"] .streak-profile-stats span {
    color: #8f9aae;
}

body.game-page.dark-mode .streak-profile-progress-head strong,
body.game-page[data-theme="dark"] .streak-profile-progress-head strong {
    color: #d7deea;
}

body.game-page.dark-mode .streak-profile-shield.is-available,
body.game-page[data-theme="dark"] .streak-profile-shield.is-available,
body.game-page.dark-mode .streak-profile-shield.is-protecting,
body.game-page[data-theme="dark"] .streak-profile-shield.is-protecting {
    border-color: rgba(96, 165, 250, 0.22);
    background: rgba(59, 130, 246, 0.11);
}

body.game-page.dark-mode .streak-profile-shield.is-used,
body.game-page[data-theme="dark"] .streak-profile-shield.is-used {
    border-color: rgba(255, 255, 255, 0.07);
    background: #1d202c;
}

body.game-page.dark-mode .streak-profile-shield-head em,
body.game-page[data-theme="dark"] .streak-profile-shield-head em {
    background: rgba(96, 165, 250, 0.16);
    color: #93c5fd;
}

body.game-page.dark-mode .streak-profile-shield-meta b,
body.game-page[data-theme="dark"] .streak-profile-shield-meta b {
    color: #93c5fd;
}

body.game-page.dark-mode .streak-profile-shield-rules > span,
body.game-page[data-theme="dark"] .streak-profile-shield-rules > span {
    border-color: rgba(96, 165, 250, 0.14);
    background: rgba(255, 255, 255, 0.045);
    color: #aeb7c8;
}

@media (max-width: 420px) {
    body.game-page .streak-profile-card {
        width: min(370px, calc(100vw - 20px));
        border-radius: 23px;
    }

    body.game-page .streak-profile-cover {
        min-height: 157px;
        padding: 19px 19px 40px;
    }

    body.game-page .streak-profile-avatar {
        width: 58px;
        height: 58px;
        border-radius: 19px;
    }

    body.game-page .streak-profile-avatar img {
        border-radius: 15px;
    }

    body.game-page .streak-profile-user-copy strong {
        max-width: 215px;
        font-size: 17px;
    }

    body.game-page .streak-profile-body {
        padding: 61px 18px 20px;
    }

    body.game-page .streak-profile-body h2 {
        font-size: 25px;
    }

    body.game-page .streak-profile-emblem {
        width: 101px;
        height: 101px;
        border-radius: 32px;
    }
}

@media (max-width: 350px) {
    body.game-page .streak-profile-stats {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   GAME HEADER V7 — RINGKAS, TERPUSAT, DAN PROFESIONAL
   ========================================================= */
body.game-page .game-topbar {
    grid-template-columns: minmax(44px, 1fr) auto minmax(112px, 1fr) !important;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding-inline: 10px;
}

body.game-page .top-left-actions,
body.game-page .top-actions {
    width: auto !important;
    min-width: 0;
    gap: 7px !important;
}

body.game-page .top-left-actions {
    justify-self: start;
    justify-content: flex-start;
}

body.game-page .top-actions {
    justify-self: end;
    justify-content: flex-end;
}

body.game-page .game-brand {
    justify-self: center;
    gap: 7px;
}

body.game-page .top-icon {
    position: relative;
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 11px !important;
    background: linear-gradient(145deg, rgba(54, 59, 78, 0.9), rgba(31, 34, 48, 0.96));
    color: #eef2ff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 5px 14px rgba(0, 0, 0, 0.18);
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

body.game-page:not(.dark-mode):not([data-theme="dark"]) .top-icon {
    border-color: rgba(148, 163, 184, 0.2);
    background: linear-gradient(145deg, #ffffff, #edf1f7);
    color: #334155;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 5px 14px rgba(15, 23, 42, 0.09);
}

body.game-page .top-icon:hover,
body.game-page .top-icon:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.55);
    background: linear-gradient(145deg, rgba(76, 70, 229, 0.94), rgba(60, 52, 205, 0.96));
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.22);
    outline: none;
}

body.game-page .top-icon:active {
    transform: translateY(0) scale(0.96);
}

body.game-page .top-icon svg {
    width: 18px !important;
    height: 18px !important;
    stroke-width: 2.1 !important;
}

body.game-page .top-icon-help {
    border-color: rgba(247, 201, 72, 0.3);
}

body.game-page .top-icon-help .top-icon-pulse {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #f7c948;
    box-shadow: 0 0 0 3px rgba(247, 201, 72, 0.12);
}

body.game-page .game-title {
    letter-spacing: 0.06em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

/* =========================================================
   PUSAT BANTUAN V7
   ========================================================= */
body.game-page .help-hub-card {
    width: min(430px, calc(100vw - 24px));
    max-height: min(88vh, 680px);
    padding: 24px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 25px;
    background:
        radial-gradient(circle at 92% 4%, rgba(99, 102, 241, 0.16), transparent 34%),
        linear-gradient(165deg, #202332 0%, #171924 100%);
    color: #f8fafc;
    text-align: left;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

body.game-page:not(.dark-mode):not([data-theme="dark"]) .help-hub-card {
    border-color: rgba(148, 163, 184, 0.2);
    background:
        radial-gradient(circle at 92% 4%, rgba(99, 102, 241, 0.1), transparent 34%),
        linear-gradient(165deg, #ffffff 0%, #f6f8fc 100%);
    color: #111827;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

body.game-page .help-hub-close {
    top: 15px;
    right: 15px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: currentColor;
}

body.game-page:not(.dark-mode):not([data-theme="dark"]) .help-hub-close {
    background: rgba(15, 23, 42, 0.06);
}

body.game-page .help-hub-hero {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding-right: 30px;
    margin-bottom: 20px;
}

body.game-page .help-hub-emblem {
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: linear-gradient(145deg, #6257ee, #4338ca);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(79, 70, 229, 0.28);
}

body.game-page .help-hub-emblem svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.game-page .help-hub-kicker {
    margin: 0 0 4px;
    color: #a5b4fc;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

body.game-page:not(.dark-mode):not([data-theme="dark"]) .help-hub-kicker {
    color: #4f46e5;
}

body.game-page .help-hub-hero h2 {
    margin: 0 0 5px;
    color: inherit;
    font-size: clamp(23px, 5vw, 30px);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

body.game-page .help-hub-hero p:last-child {
    margin: 0;
    color: #aeb7c8;
    font-size: 13px;
    line-height: 1.45;
}

body.game-page:not(.dark-mode):not([data-theme="dark"]) .help-hub-hero p:last-child {
    color: #64748b;
}

body.game-page .help-hub-grid {
    display: grid;
    gap: 10px;
}

body.game-page .help-hub-option {
    width: 100%;
    min-height: 76px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 12px;
    padding: 12px 13px;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.045);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

body.game-page:not(.dark-mode):not([data-theme="dark"]) .help-hub-option {
    border-color: rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.75);
}

body.game-page .help-hub-option:hover,
body.game-page .help-hub-option:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.42);
    background: rgba(99, 102, 241, 0.11);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
    outline: none;
}

body.game-page .help-hub-option.is-primary {
    border-color: rgba(99, 102, 241, 0.35);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.19), rgba(79, 70, 229, 0.08));
}

body.game-page .help-hub-option-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.075);
    color: #a5b4fc;
}

body.game-page:not(.dark-mode):not([data-theme="dark"]) .help-hub-option-icon {
    background: #eef2ff;
    color: #4f46e5;
}

body.game-page .help-hub-option.is-primary .help-hub-option-icon {
    background: linear-gradient(145deg, #6257ee, #4338ca);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.2);
}

body.game-page .help-hub-option-icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.game-page .help-hub-option-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

body.game-page .help-hub-option-copy strong {
    color: inherit;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
}

body.game-page .help-hub-option-copy small {
    color: #9ca8ba;
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1.35;
}

body.game-page:not(.dark-mode):not([data-theme="dark"]) .help-hub-option-copy small {
    color: #64748b;
}

body.game-page .help-hub-option-arrow {
    color: #818cf8;
    font-size: 25px;
    font-weight: 400;
    line-height: 1;
    transition: transform 160ms ease;
}

body.game-page .help-hub-option:hover .help-hub-option-arrow,
body.game-page .help-hub-option:focus-visible .help-hub-option-arrow {
    transform: translateX(3px);
}

body.game-page .help-hub-footnote {
    margin: 15px 0 0;
    color: #7f8a9b;
    font-size: 10.5px;
    font-weight: 750;
    text-align: center;
    letter-spacing: 0.02em;
}

@media (max-width: 520px) {
    body.game-page .game-topbar {
        grid-template-columns: minmax(38px, 1fr) auto minmax(101px, 1fr) !important;
        gap: 6px;
        padding-inline: 6px;
    }

    body.game-page .top-actions {
        gap: 5px !important;
    }

    body.game-page .top-icon {
        width: 31px !important;
        min-width: 31px !important;
        height: 31px !important;
        min-height: 31px !important;
        border-radius: 10px !important;
    }

    body.game-page .top-icon svg {
        width: 17px !important;
        height: 17px !important;
    }

    body.game-page .help-hub-card {
        width: min(410px, calc(100vw - 18px));
        padding: 21px 16px 17px;
        border-radius: 22px;
    }

    body.game-page .help-hub-hero {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 11px;
        padding-right: 26px;
        margin-bottom: 16px;
    }

    body.game-page .help-hub-emblem {
        width: 48px;
        height: 48px;
        border-radius: 15px;
    }

    body.game-page .help-hub-emblem svg {
        width: 25px;
        height: 25px;
    }

    body.game-page .help-hub-hero h2 {
        font-size: 23px;
    }

    body.game-page .help-hub-hero p:last-child {
        font-size: 12px;
    }

    body.game-page .help-hub-option {
        min-height: 68px;
        grid-template-columns: 41px minmax(0, 1fr) 15px;
        gap: 10px;
        padding: 10px;
        border-radius: 15px;
    }

    body.game-page .help-hub-option-icon {
        width: 41px;
        height: 41px;
        border-radius: 12px;
    }

    body.game-page .help-hub-option-icon svg {
        width: 21px;
        height: 21px;
    }

    body.game-page .help-hub-option-copy strong {
        font-size: 13px;
    }

    body.game-page .help-hub-option-copy small {
        font-size: 10.5px;
    }
}

@media (max-width: 355px) {
    body.game-page .game-topbar {
        grid-template-columns: 31px minmax(0, 1fr) 91px !important;
        gap: 3px;
        padding-inline: 3px;
    }

    body.game-page .top-actions {
        gap: 3px !important;
    }

    body.game-page .top-icon {
        width: 28px !important;
        min-width: 28px !important;
        height: 28px !important;
        min-height: 28px !important;
        border-radius: 9px !important;
    }

    body.game-page .top-icon svg {
        width: 15px !important;
        height: 15px !important;
    }

    body.game-page .game-brand {
        gap: 4px;
    }
}


/* =========================================================
   GAME HEADER V10 — DUA AKSI SEIMBANG DI KIRI DAN KANAN
   ========================================================= */
body.game-page .game-topbar {
    grid-template-columns: minmax(78px, 1fr) auto minmax(78px, 1fr) !important;
}

body.game-page .top-left-actions,
body.game-page .top-actions {
    min-width: 75px;
}

/* Semua pilihan pada Pusat Bantuan memiliki bobot visual yang sama. */
body.game-page .help-hub-option.is-primary {
    border-color: rgba(255, 255, 255, 0.075);
    background: rgba(255, 255, 255, 0.045);
}

body.game-page:not(.dark-mode):not([data-theme="dark"]) .help-hub-option.is-primary {
    border-color: rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.75);
}

body.game-page .help-hub-option.is-primary .help-hub-option-icon {
    background: rgba(255, 255, 255, 0.075);
    color: #a5b4fc;
    box-shadow: none;
}

body.game-page:not(.dark-mode):not([data-theme="dark"]) .help-hub-option.is-primary .help-hub-option-icon {
    background: #eef2ff;
    color: #4f46e5;
}

@media (max-width: 420px) {
    body.game-page .game-topbar {
        grid-template-columns: 75px minmax(0, 1fr) 75px !important;
        gap: 6px;
        padding-inline: 6px;
    }

    body.game-page .top-left-actions,
    body.game-page .top-actions {
        min-width: 75px;
        gap: 5px !important;
    }
}

/* =========================================================
   GAME POPUPS V13 — PANDUAN RINGKAS & KARTU INFORMASI PRO
   ========================================================= */

/* Panduan cepat dibuat lebih ringkas agar tombol aksi selalu terlihat. */
body.game-page #entryHelpModal .help-card-visual {
    width: min(420px, calc(100vw - 20px));
    max-height: min(94dvh, 690px);
    padding: 16px !important;
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 24px;
    scrollbar-width: thin;
}

body.game-page #entryHelpModal .help-visual-head {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 11px;
    padding-right: 28px;
}

body.game-page #entryHelpModal .help-mark {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 28px;
}

body.game-page #entryHelpModal .help-kicker {
    margin-bottom: 4px;
    font-size: 9px;
}

body.game-page #entryHelpModal h2 {
    margin-bottom: 2px;
    font-size: 24px;
}

body.game-page #entryHelpModal .help-visual-head p:not(.help-kicker) {
    font-size: 12px;
}

body.game-page #entryHelpModal .help-rule-card {
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px;
    min-height: 70px;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 15px;
}

body.game-page #entryHelpModal .help-rule-label {
    top: 7px;
    right: 10px;
    font-size: 8px;
}

body.game-page #entryHelpModal .help-card-visual .example-row {
    gap: 4px;
    margin: 8px 0 0;
}

body.game-page #entryHelpModal .help-card-visual .mini-tile {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 14px;
}

body.game-page #entryHelpModal .help-rule-card p {
    padding-top: 9px;
    font-size: 11.5px;
    line-height: 1.38;
}

body.game-page #entryHelpModal .help-more-link {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin-top: 10px;
    padding: 11px 14px;
    border-radius: 14px;
}

body.game-page #entryHelpModal .login-reminder {
    margin: 8px 0 0;
    font-size: 11px;
}

/* Kerangka umum popup informasi. */
body.game-page .about-pro-card,
body.game-page .donation-pro-card,
body.game-page .recent-words-pro-card {
    position: relative;
    width: min(440px, calc(100vw - 22px));
    max-height: min(92dvh, 760px);
    padding: 20px !important;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 26px;
    background: #ffffff;
    color: #0f172a;
    text-align: left;
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.22);
    isolation: isolate;
    scrollbar-width: thin;
}

body.game-page .about-pro-card::before,
body.game-page .donation-pro-card::before,
body.game-page .recent-words-pro-card::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 0 auto;
    height: 128px;
    background:
        radial-gradient(circle at 88% 18%, rgba(245, 190, 50, 0.24), transparent 34%),
        linear-gradient(135deg, rgba(87, 172, 77, 0.13), rgba(255, 255, 255, 0));
}

body.game-page .donation-pro-card::before {
    background:
        radial-gradient(circle at 88% 18%, rgba(249, 115, 22, 0.20), transparent 34%),
        linear-gradient(135deg, rgba(245, 190, 50, 0.16), rgba(255, 255, 255, 0));
}

body.game-page .recent-words-pro-card::before {
    background:
        radial-gradient(circle at 88% 18%, rgba(99, 102, 241, 0.18), transparent 34%),
        linear-gradient(135deg, rgba(79, 70, 229, 0.10), rgba(255, 255, 255, 0));
}

body.game-page .popup-pro-head {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 13px;
    align-items: center;
    min-width: 0;
    margin-bottom: 16px;
    padding-right: 34px;
}

body.game-page .popup-pro-emblem {
    width: 58px;
    height: 58px;
    border: 1px solid rgba(87, 172, 77, 0.22);
    border-radius: 18px;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(145deg, #ffffff, #f0fdf4);
    color: #3f8f36;
    box-shadow: 0 12px 25px rgba(87, 172, 77, 0.14);
}

body.game-page .donation-pro-head .popup-pro-emblem {
    border-color: rgba(249, 115, 22, 0.22);
    background: linear-gradient(145deg, #ffffff, #fff7ed);
    color: #ea580c;
    box-shadow: 0 12px 25px rgba(234, 88, 12, 0.13);
}

body.game-page .recent-words-pro-head .popup-pro-emblem {
    border-color: rgba(99, 102, 241, 0.22);
    background: linear-gradient(145deg, #ffffff, #eef2ff);
    color: #4f46e5;
    box-shadow: 0 12px 25px rgba(79, 70, 229, 0.13);
}

body.game-page .popup-pro-emblem svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.game-page .popup-pro-heading {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

body.game-page .popup-pro-kicker {
    margin-bottom: 3px;
    color: #3f8f36;
    font-size: 9px;
    font-weight: 950;
    letter-spacing: 0.12em;
}

body.game-page .donation-pro-head .popup-pro-kicker { color: #ea580c; }
body.game-page .recent-words-pro-head .popup-pro-kicker { color: #4f46e5; }

body.game-page .popup-pro-heading > strong {
    color: #0f172a;
    font-size: 25px;
    font-weight: 950;
    line-height: 1.05;
    letter-spacing: -0.025em;
}

body.game-page .popup-pro-heading > small {
    margin-top: 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

/* Tentang SAKLA. */
body.game-page .about-pro-visual {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    min-height: 112px;
    padding: 13px 15px;
    overflow: hidden;
    border: 1px solid rgba(87, 172, 77, 0.24);
    border-radius: 19px;
    background: linear-gradient(135deg, #f0fdf4, #ffffff 68%);
}

body.game-page .about-pro-visual img {
    display: block;
    width: 104px;
    max-height: 100px;
    object-fit: contain;
}

body.game-page .about-pro-visual span {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

body.game-page .about-pro-visual b {
    color: #3f8f36;
    font-size: 25px;
    font-weight: 950;
    letter-spacing: 0.08em;
}

body.game-page .about-pro-visual small {
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

body.game-page .about-pro-copy {
    display: grid;
    gap: 9px;
    margin-top: 13px;
}

body.game-page .about-pro-copy p {
    margin: 0;
    color: #526074;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.55;
}

body.game-page .about-pro-facts,
body.game-page .donation-pro-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

body.game-page .about-pro-facts > span,
body.game-page .donation-pro-summary > span {
    min-width: 0;
    padding: 10px 7px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    border-radius: 14px;
    background: #f8fafc;
    text-align: center;
}

body.game-page .about-pro-facts b,
body.game-page .donation-pro-summary b {
    display: block;
    color: #0f172a;
    font-size: 16px;
    font-weight: 950;
}

body.game-page .about-pro-facts small,
body.game-page .donation-pro-summary small {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 9.5px;
    font-weight: 800;
    line-height: 1.25;
}

body.game-page .about-pro-support {
    width: 100% !important;
    margin-top: 14px !important;
    padding: 12px 15px !important;
    justify-content: flex-start !important;
    border-radius: 15px !important;
}

body.game-page .about-pro-support > span:last-child {
    margin-left: auto;
    font-size: 22px;
    line-height: 1;
}

/* Dukung SAKLA. */
body.game-page .donation-pro-summary {
    margin: 0 0 13px;
}

body.game-page .donation-pro-qris {
    position: relative;
    width: min(290px, 100%);
    margin: 0 auto;
    padding: 16px;
    border: 1px solid rgba(249, 115, 22, 0.22);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
}

body.game-page .donation-pro-qris img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 13px;
}

body.game-page .donation-scan-label {
    position: absolute;
    z-index: 3;
    top: 9px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 9px;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .09em;
    box-shadow: 0 5px 14px rgba(15, 23, 42, .08);
}

body.game-page .donation-pro-note {
    margin: 13px 0 0;
    padding: 10px 12px;
    border: 1px solid rgba(249, 115, 22, 0.18);
    border-radius: 14px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.4;
    text-align: center;
}

/* Kata sebelumnya. */
body.game-page .recent-words-pro-card {
    width: min(470px, calc(100vw - 22px));
}

body.game-page .recent-words-pro-card .recent-words-list {
    display: grid;
    gap: 9px;
    margin-top: 2px;
}

body.game-page .recent-words-pro-card .recent-word-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(118px, .78fr) minmax(0, 1.22fr);
    gap: 12px;
    align-items: center;
    padding: 12px 13px;
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 17px;
    background: linear-gradient(135deg, #eef2ff, #ffffff 68%);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045);
}

body.game-page .recent-words-pro-card .recent-word-item::after {
    content: "";
    position: absolute;
    right: -32px;
    top: -38px;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: #6366f1;
    opacity: 0.05;
    pointer-events: none;
}

body.game-page .recent-words-pro-card .recent-word-meta {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: -2px;
    color: #4f46e5;
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .04em;
    text-transform: uppercase;
}

body.game-page .recent-words-pro-card .recent-word-tiles {
    display: grid;
    grid-template-columns: repeat(5, 28px);
    gap: 4px;
    justify-content: start;
}

body.game-page .recent-words-pro-card .recent-word-tiles span {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(79, 70, 229, 0.20);
    border-radius: 7px;
    display: inline-grid;
    place-items: center;
    background: #ffffff;
    color: #312e81;
    font-size: 12px;
    font-weight: 950;
    box-shadow: 0 4px 10px rgba(79, 70, 229, .08);
}

body.game-page .recent-words-pro-card .recent-word-detail {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

body.game-page .recent-words-pro-card .recent-word-detail strong {
    overflow: hidden;
    color: #0f172a;
    font-size: 13px;
    font-weight: 950;
    line-height: 1.3;
    text-overflow: ellipsis;
}

body.game-page .recent-words-pro-card .recent-word-detail small {
    margin-top: 4px;
    color: #64748b;
    font-size: 10.5px;
    font-weight: 750;
    line-height: 1.35;
}

body.game-page .recent-words-pro-card .recent-words-empty {
    padding: 24px 14px;
    border: 1px dashed rgba(99, 102, 241, 0.28);
    border-radius: 17px;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

/* Mode gelap. */
body.game-page.dark-mode .about-pro-card,
body.game-page[data-theme="dark"] .about-pro-card,
body.game-page.dark-mode .donation-pro-card,
body.game-page[data-theme="dark"] .donation-pro-card,
body.game-page.dark-mode .recent-words-pro-card,
body.game-page[data-theme="dark"] .recent-words-pro-card {
    border-color: rgba(71, 85, 105, 0.58);
    background: linear-gradient(180deg, #171a25, #11131c);
    color: #f8fafc;
}

body.game-page.dark-mode .popup-pro-heading > strong,
body.game-page[data-theme="dark"] .popup-pro-heading > strong,
body.game-page.dark-mode .about-pro-facts b,
body.game-page[data-theme="dark"] .about-pro-facts b,
body.game-page.dark-mode .donation-pro-summary b,
body.game-page[data-theme="dark"] .donation-pro-summary b,
body.game-page.dark-mode .recent-words-pro-card .recent-word-detail strong,
body.game-page[data-theme="dark"] .recent-words-pro-card .recent-word-detail strong {
    color: #f8fafc;
}

body.game-page.dark-mode .popup-pro-heading > small,
body.game-page[data-theme="dark"] .popup-pro-heading > small,
body.game-page.dark-mode .about-pro-copy p,
body.game-page[data-theme="dark"] .about-pro-copy p,
body.game-page.dark-mode .about-pro-visual small,
body.game-page[data-theme="dark"] .about-pro-visual small,
body.game-page.dark-mode .recent-words-pro-card .recent-word-detail small,
body.game-page[data-theme="dark"] .recent-words-pro-card .recent-word-detail small {
    color: #aeb7c7;
}

body.game-page.dark-mode .popup-pro-emblem,
body.game-page[data-theme="dark"] .popup-pro-emblem,
body.game-page.dark-mode .about-pro-facts > span,
body.game-page[data-theme="dark"] .about-pro-facts > span,
body.game-page.dark-mode .donation-pro-summary > span,
body.game-page[data-theme="dark"] .donation-pro-summary > span,
body.game-page.dark-mode .recent-words-pro-card .recent-words-empty,
body.game-page[data-theme="dark"] .recent-words-pro-card .recent-words-empty {
    background: #202433;
    border-color: rgba(71, 85, 105, .55);
}

body.game-page.dark-mode .about-pro-visual,
body.game-page[data-theme="dark"] .about-pro-visual,
body.game-page.dark-mode .recent-words-pro-card .recent-word-item,
body.game-page[data-theme="dark"] .recent-words-pro-card .recent-word-item {
    border-color: rgba(71, 85, 105, .55);
    background: linear-gradient(135deg, #202433, #181b26 72%);
}

body.game-page.dark-mode .recent-words-pro-card .recent-word-tiles span,
body.game-page[data-theme="dark"] .recent-words-pro-card .recent-word-tiles span,
body.game-page.dark-mode .donation-pro-qris,
body.game-page[data-theme="dark"] .donation-pro-qris {
    border-color: rgba(71, 85, 105, .55);
    background: #171a25;
    color: #c7d2fe;
}

body.game-page.dark-mode .donation-pro-note,
body.game-page[data-theme="dark"] .donation-pro-note {
    border-color: rgba(249, 115, 22, .24);
    background: rgba(124, 45, 18, .20);
    color: #fdba74;
}

@media (max-width: 520px) {
    body.game-page #entryHelpModal .help-card-visual {
        max-height: calc(100dvh - 14px);
        padding: 14px !important;
        border-radius: 21px;
    }

    body.game-page #entryHelpModal .help-rule-card {
        grid-template-columns: 108px minmax(0, 1fr);
        padding: 9px 10px;
    }

    body.game-page #entryHelpModal .help-card-visual .mini-tile {
        width: 27px;
        height: 27px;
        font-size: 12px;
    }

    body.game-page .about-pro-card,
    body.game-page .donation-pro-card,
    body.game-page .recent-words-pro-card {
        width: calc(100vw - 14px);
        max-height: calc(100dvh - 14px);
        padding: 16px !important;
        border-radius: 23px;
    }

    body.game-page .popup-pro-head {
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 11px;
        margin-bottom: 13px;
    }

    body.game-page .popup-pro-emblem {
        width: 52px;
        height: 52px;
        border-radius: 16px;
    }

    body.game-page .popup-pro-heading > strong { font-size: 22px; }

    body.game-page .about-pro-visual {
        grid-template-columns: 94px minmax(0, 1fr);
        min-height: 98px;
        padding: 11px 12px;
    }

    body.game-page .about-pro-visual img {
        width: 90px;
        max-height: 84px;
    }

    body.game-page .recent-words-pro-card .recent-word-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    body.game-page .recent-words-pro-card .recent-word-tiles {
        justify-content: start;
    }
}

@media (max-width: 360px) {
    body.game-page #entryHelpModal .help-rule-card {
        grid-template-columns: 100px minmax(0, 1fr);
        gap: 7px;
    }

    body.game-page #entryHelpModal .help-card-visual .mini-tile {
        width: 25px;
        height: 25px;
        border-radius: 7px;
        font-size: 11px;
    }

    body.game-page .about-pro-facts,
    body.game-page .donation-pro-summary {
        gap: 5px;
    }

    body.game-page .about-pro-facts > span,
    body.game-page .donation-pro-summary > span {
        padding-inline: 4px;
    }
}

/* =========================================================
   LATIHAN V22 - samakan shell dengan halaman game V13
   ========================================================= */
body.practice-page .practice-mode-pill {
    border-color: rgba(245, 190, 50, 0.38);
    background: rgba(245, 190, 50, 0.11);
    color: #ead270;
    cursor: default;
    pointer-events: none;
}

body.practice-page:not(.dark-mode) .practice-mode-pill {
    border-color: rgba(181, 139, 24, 0.26);
    background: rgba(245, 190, 50, 0.12);
    color: #8b7420;
}

body.practice-page .game-brand .game-title img {
    display: block;
    width: auto;
    height: 40px;
    max-width: 112px;
    object-fit: contain;
}

@media (max-width: 420px) {
    body.practice-page .game-brand .game-title img {
        height: 36px;
        max-width: 102px;
    }
}

/* =========================================================
   HOME MOBILE NATURE V1
   Tema terang: pantai | Tema gelap: gunung dan hutan
   ========================================================= */
body.home-page {
    --home-text: #0b2d1c;
    --home-muted: rgba(22, 50, 38, 0.72);
    --home-line: rgba(42, 91, 63, 0.27);
    --home-surface: rgba(255, 253, 247, 0.72);
    --home-surface-strong: rgba(255, 253, 247, 0.9);
    --home-accent: #16723a;
    --home-accent-bright: #60b928;
    --home-shadow: 0 14px 34px rgba(44, 71, 54, 0.15);
    min-height: 100dvh;
    background-color: #e9f4ed;
    background-image: url("../img/home-bg-light.webp");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    color: var(--home-text);
    position: relative;
    isolation: isolate;
}

body.home-page.dark-mode {
    --home-text: #f7f4e8;
    --home-muted: rgba(239, 240, 229, 0.72);
    --home-line: rgba(210, 221, 201, 0.22);
    --home-surface: rgba(5, 18, 17, 0.66);
    --home-surface-strong: rgba(6, 20, 18, 0.88);
    --home-accent: #55b92a;
    --home-accent-bright: #91df31;
    --home-shadow: 0 18px 38px rgba(0, 0, 0, 0.3);
    background-color: #071311;
    background-image: url("../img/home-bg-dark.webp");
}

body.home-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(245, 251, 247, 0.08) 0%, rgba(255, 250, 239, 0.16) 42%, rgba(255, 247, 232, 0.42) 100%),
        radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.25), transparent 54%);
}

body.home-page.dark-mode::before {
    background:
        linear-gradient(180deg, rgba(2, 10, 14, 0.1) 0%, rgba(2, 13, 12, 0.22) 46%, rgba(1, 10, 9, 0.6) 100%),
        radial-gradient(circle at 50% 50%, rgba(29, 70, 49, 0.03), rgba(0, 7, 8, 0.18) 70%);
}

body.home-page #app {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
}

.home-v2-shell {
    width: min(100%, 460px);
    min-height: 100dvh;
    margin: 0 auto;
    padding: max(16px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
}

.home-v2-header {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.home-v2-header-spacer {
    width: 44px;
    height: 44px;
    display: block;
}

.home-v2-header-button,
.home-v2-account-button {
    width: 44px;
    height: 44px;
    margin: 0;
    border: 1px solid var(--home-line);
    border-radius: 15px;
    background: var(--home-surface);
    color: var(--home-text);
    box-shadow: 0 8px 22px rgba(15, 38, 27, 0.1);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.home-v2-account-button {
    position: relative;
    border-radius: 50%;
    padding: 2px;
    font-size: 15px;
    font-weight: 900;
    text-decoration: none;
}

.home-v2-account-button img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    object-fit: cover;
}

.home-v2-account-button i {
    position: absolute;
    right: 1px;
    bottom: 2px;
    width: 9px;
    height: 9px;
    border: 2px solid var(--home-surface-strong);
    border-radius: 50%;
    background: #58b92a;
}

.home-v2-header-button:hover,
.home-v2-account-button:hover,
.home-v2-header-button:focus-visible,
.home-v2-account-button:focus-visible {
    transform: translateY(-1px);
    border-color: var(--home-accent);
}

.home-v2-header-button svg,
.home-v2-account-button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.home-v2-main {
    width: 100%;
    flex: 1 0 auto;
    padding: clamp(24px, 5.5vh, 50px) 4px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.home-v2-logo {
    width: min(174px, 48vw);
    margin: 0 0 14px;
    line-height: 0;
}

.home-v2-logo img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 12px rgba(4, 35, 17, 0.2));
}

.home-v2-kicker {
    margin: 0 0 9px;
    color: var(--home-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.26em;
}

.home-v2-title {
    margin: 0;
    color: var(--home-text);
    font-size: clamp(25px, 7vw, 31px);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.035em;
    text-shadow: 0 2px 18px rgba(255, 255, 255, 0.18);
}

.home-v2-subtitle {
    max-width: 330px;
    margin: 9px 0 0;
    color: var(--home-muted);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.45;
}

.home-v2-edition {
    width: min(332px, 100%);
    margin-top: clamp(24px, 4.5vh, 38px);
    overflow: hidden;
    border: 1px solid var(--home-line);
    border-radius: 18px;
    background: var(--home-surface);
    color: var(--home-text);
    box-shadow: var(--home-shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.home-v2-edition-top {
    min-height: 48px;
    padding: 9px 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.home-v2-edition-label {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.home-v2-edition-label svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.home-v2-edition-number {
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(89, 185, 42, 0.14);
    color: var(--home-accent);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0;
}

.home-v2-edition-date {
    padding: 6px 8px;
    border: 1px solid var(--home-line);
    border-radius: 9px;
    color: var(--home-accent);
    background: rgba(255, 255, 255, 0.12);
    font-size: 9px;
    font-weight: 950;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

.home-v2-edition-meta {
    min-height: 39px;
    border-top: 1px solid var(--home-line);
    padding: 8px 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--home-muted);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.13em;
}

.home-v2-edition-meta i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--home-accent-bright);
    box-shadow: 0 0 0 4px rgba(89, 185, 42, 0.1);
}

.home-v2-actions {
    width: min(300px, 92%);
    margin-top: 20px;
    display: grid;
    gap: 10px;
}

.home-v2-action {
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 15px;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 9px 22px rgba(6, 58, 25, 0.15);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.home-v2-action:hover,
.home-v2-action:focus-visible {
    transform: translateY(-1px);
}

.home-v2-action:active {
    transform: translateY(0);
}

.home-v2-action svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.home-v2-action-primary {
    border-color: rgba(146, 222, 62, 0.28);
    background: linear-gradient(135deg, #126b32, #258f32);
    color: #ffffff;
}

body.home-page.dark-mode .home-v2-action-primary {
    background: linear-gradient(135deg, #4ba620, #237a26);
}

.home-v2-action-primary svg {
    fill: currentColor;
    stroke: currentColor;
}

.home-v2-action-secondary {
    border-color: var(--home-line);
    background: var(--home-surface);
    color: var(--home-text);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.home-v2-login-action {
    width: 100%;
    min-height: 46px;
    margin: 0;
    border: 1px solid var(--home-line);
    padding: 0 18px;
    background: var(--home-surface-strong);
    color: var(--home-text);
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.home-v2-login-action:hover,
.home-v2-login-action:focus-visible {
    border-color: var(--home-accent);
    color: var(--home-accent);
}

.home-v2-account-note {
    margin: 15px 0 0;
    border: 0;
    padding: 3px;
    background: transparent;
    color: var(--home-muted);
    font-size: 11px;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
}

.home-v2-account-note strong {
    color: var(--home-accent);
    font-weight: 950;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.home-v2-dock {
    position: relative;
    width: 100%;
    min-height: 68px;
    border: 1px solid var(--home-line);
    border-radius: 22px;
    padding: 7px 4px;
    background: var(--home-surface-strong);
    box-shadow: var(--home-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: visible;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.home-v2-dock::before {
    content: "";
    position: absolute;
    inset: 7px 4px;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(var(--home-line), var(--home-line)) 20% center / 1px 52px no-repeat,
        linear-gradient(var(--home-line), var(--home-line)) 40% center / 1px 52px no-repeat,
        linear-gradient(var(--home-line), var(--home-line)) 60% center / 1px 52px no-repeat,
        linear-gradient(var(--home-line), var(--home-line)) 80% center / 1px 52px no-repeat;
}

.home-v2-dock-item {
    position: relative;
    z-index: 1;
    min-width: 0;
    min-height: 52px;
    margin: 0;
    border: 0;
    padding: 3px 1px;
    background: transparent;
    color: var(--home-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 9px;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.16s ease, transform 0.16s ease;
}

.home-v2-dock-item:hover,
.home-v2-dock-item:focus-visible {
    color: var(--home-accent);
    transform: translateY(-1px);
}

.home-v2-dock-item > svg,
.home-v2-theme-icon,
.home-v2-theme-icon svg {
    width: 21px;
    height: 21px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.home-v2-theme-toggle {
    position: relative;
    justify-self: center;
    align-self: center;
    width: 64px;
    min-width: 64px;
    height: 64px;
    min-height: 64px;
    margin: 0;
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
    padding: 0;
    background: linear-gradient(145deg, #176d36, #074a28);
    color: #ffffff;
    box-shadow:
        0 9px 20px rgba(8, 65, 31, 0.3),
        0 0 0 4px rgba(75, 169, 48, 0.14);
    transform: translateY(-13px);
    z-index: 2;
}

body.home-page.dark-mode .home-v2-theme-toggle {
    border-color: rgba(255, 239, 169, 0.8);
    background: linear-gradient(145deg, #ffd858, #eaa822);
    color: #253213;
    box-shadow:
        0 9px 22px rgba(0, 0, 0, 0.34),
        0 0 0 4px rgba(255, 208, 61, 0.12);
}

.home-v2-theme-toggle:hover,
.home-v2-theme-toggle:focus-visible {
    color: inherit;
    transform: translateY(-15px) scale(1.03);
}

.home-v2-theme-toggle .home-v2-theme-icon,
.home-v2-theme-toggle .home-v2-theme-icon svg {
    width: 26px;
    height: 26px;
}

.home-v2-theme-icon-sun {
    display: none;
}

body.home-page.dark-mode .home-v2-theme-icon-moon {
    display: none;
}

body.home-page.dark-mode .home-v2-theme-icon-sun {
    display: block;
}

.home-v2-footer {
    width: 100%;
    margin: 10px auto 0;
    color: var(--home-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3em;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
}

.home-v2-footer a {
    color: var(--home-text);
    font-weight: 900;
    text-decoration: none;
}

.home-v2-footer a:hover,
.home-v2-footer a:focus-visible {
    color: var(--home-accent);
}

.home-menu-card {
    width: min(390px, calc(100vw - 28px));
    padding: 25px 20px 20px;
    border: 1px solid var(--home-line);
    border-radius: 22px;
    background: var(--home-surface-strong);
    color: var(--home-text);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.home-menu-kicker {
    margin: 0 0 5px;
    color: var(--home-accent);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.2em;
}

.home-menu-card h2 {
    margin: 0 0 17px;
    font-size: 25px;
    letter-spacing: -0.03em;
}

.home-menu-links {
    display: grid;
    gap: 7px;
}

.home-menu-links a,
.home-menu-links button {
    width: 100%;
    min-height: 44px;
    margin: 0;
    border: 1px solid var(--home-line);
    border-radius: 13px;
    padding: 0 13px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--home-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.home-menu-links a:hover,
.home-menu-links button:hover,
.home-menu-links a:focus-visible,
.home-menu-links button:focus-visible {
    border-color: var(--home-accent);
    color: var(--home-accent);
}

.home-menu-links span {
    font-size: 21px;
    line-height: 1;
}

.home-menu-links .home-menu-logout {
    margin-top: 5px;
    border-color: rgba(204, 72, 72, 0.3);
    color: #b83d3d;
}

body.home-page.dark-mode .home-menu-links .home-menu-logout {
    color: #ff9292;
}

@media (max-width: 360px) {
    .home-v2-shell {
        padding-inline: 12px;
    }

    .home-v2-main {
        padding-inline: 0;
    }

    .home-v2-edition-top {
        padding-inline: 11px;
    }

    .home-v2-edition-label {
        font-size: 11px;
    }

    .home-v2-edition-date {
        font-size: 8px;
        padding-inline: 6px;
    }

    .home-v2-dock-item {
        font-size: 8px;
    }
}

@media (max-height: 730px) {
    .home-v2-main {
        padding-top: 18px;
        padding-bottom: 18px;
    }

    .home-v2-logo {
        width: min(150px, 44vw);
        margin-bottom: 10px;
    }

    .home-v2-edition {
        margin-top: 19px;
    }

    .home-v2-actions {
        margin-top: 15px;
    }
}

@media (min-width: 720px) {
    .home-v2-shell {
        width: min(100%, 480px);
        padding-inline: 20px;
    }

    .home-v2-main {
        padding-top: clamp(36px, 7vh, 62px);
    }
}

@media (min-width: 1000px) {
    body.home-page {
        background-image: url("../img/home-bg-light-desktop.webp");
        background-position: center;
    }

    body.home-page.dark-mode {
        background-image: url("../img/home-bg-dark-desktop.webp");
    }

    body.home-page::before {
        background:
            radial-gradient(circle at 50% 47%, rgba(255, 255, 255, 0.2), transparent 42%),
            linear-gradient(180deg, rgba(250, 253, 249, 0.04), rgba(255, 248, 234, 0.22));
    }

    body.home-page.dark-mode::before {
        background:
            radial-gradient(circle at 50% 47%, rgba(19, 54, 39, 0.12), transparent 44%),
            linear-gradient(180deg, rgba(0, 7, 10, 0.05), rgba(0, 7, 7, 0.3));
    }

    .home-v2-shell {
        width: min(100%, 700px);
        min-height: 100dvh;
        padding: 26px 34px 18px;
        display: flex;
        flex-direction: column;
    }

    .home-v2-header {
        width: 100%;
    }

    .home-v2-header-button,
    .home-v2-account-button {
        width: 46px;
        height: 46px;
        background: var(--home-surface-strong);
    }

    .home-v2-header-spacer {
        width: 46px;
        height: 46px;
    }

    .home-v2-main {
        width: 100%;
        padding: clamp(34px, 6vh, 66px) 0 28px;
        flex: 1 0 auto;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .home-v2-logo {
        width: 196px;
        margin-bottom: 15px;
    }

    .home-v2-kicker {
        margin-bottom: 8px;
    }

    .home-v2-title {
        font-size: 30px;
    }

    .home-v2-subtitle {
        max-width: 340px;
        font-size: 13px;
    }

    .home-v2-edition {
        width: min(390px, 100%);
        margin-top: 28px;
        background: var(--home-surface-strong);
    }

    .home-v2-edition-top {
        min-height: 50px;
    }

    .home-v2-actions {
        width: min(500px, 100%);
        margin-top: 18px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .home-v2-action {
        min-height: 48px;
    }

    .home-v2-login-action {
        min-height: 48px;
    }

    .home-v2-dock {
        width: min(540px, 100%);
        margin: 8px auto 0;
        border-radius: 20px;
    }

    .home-v2-footer {
        width: min(540px, 100%);
        margin: 9px auto 0;
    }
}

/* =========================================================
   GAME WORD CONTRIBUTOR V1
   Kredit ringkas hanya muncul untuk kata kiriman yang diterima.
   ========================================================= */
body.game-page .word-contributor[hidden] {
    display: none;
}

body.game-page .word-contributor {
    max-width: min(360px, calc(100vw - 40px));
    min-height: 24px;
    margin: 3px auto 0;
    padding: 3px 9px 3px 7px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(20, 32, 24, 0.76);
    color: #e4eadf;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.2;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

body.game-page:not(.dark-mode):not([data-theme="dark"]) .word-contributor {
    background: rgba(255, 255, 255, 0.74);
    color: #4d5e52;
}

body.game-page .word-contributor-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9bd66f;
}

body.game-page:not(.dark-mode):not([data-theme="dark"]) .word-contributor-icon {
    color: #4f8b3d;
}

body.game-page .word-contributor-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.game-page .word-contributor-copy {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.game-page .word-contributor strong {
    color: #b9e994;
    font-weight: 850;
}

body.game-page:not(.dark-mode):not([data-theme="dark"]) .word-contributor strong {
    color: #356c2c;
}

@media (max-width: 520px) {
    body.game-page .word-contributor {
        max-width: calc(100vw - 34px);
        min-height: 23px;
        margin-top: 2px;
        padding: 3px 8px 3px 6px;
        gap: 5px;
        font-size: 11.5px;
    }

    body.game-page .word-contributor-icon {
        width: 15px;
        height: 15px;
        flex-basis: 15px;
    }
}

@media (max-width: 520px) and (max-height: 720px) {
    body.game-page .word-contributor {
        min-height: 21px;
        padding-top: 2px;
        padding-bottom: 2px;
        font-size: 11px;
    }
}

/* =========================================================
   PRACTICE MOBILE LAYOUT FIX V1
   Keyboard selalu muat satu layar dan dock tetap satu baris.
   ========================================================= */
@media (max-width: 520px) and (orientation: portrait) {
    body.practice-page .keyboard {
        left: 50%;
        right: auto;
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        padding-left: 0;
        padding-right: 0;
        box-sizing: border-box;
        transform: translateX(-50%);
    }

    body.practice-page .key-row {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        gap: 4px;
        overflow: hidden;
    }

    body.practice-page .key {
        min-width: 0;
        flex: 1 1 0;
        padding-left: 0;
        padding-right: 0;
    }

    body.practice-page .key.wide {
        flex: 1.28 1 0;
    }

    body.practice-page .game-bottom-nav {
        grid-template-rows: minmax(0, 1fr);
        overflow: visible;
    }
}

@media (max-width: 390px) and (orientation: portrait) {
    body.practice-page .keyboard {
        width: calc(100vw - 18px);
        max-width: calc(100vw - 18px);
    }

    body.practice-page .key-row {
        gap: 3px;
    }

    body.practice-page .key.wide {
        flex: 1.2 1 0;
    }
}

@media (min-width: 1450px) {
    .home-v2-shell {
        width: min(100%, 740px);
    }

    .home-v2-main {
        padding-top: clamp(42px, 7vh, 78px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-v2-header-button,
    .home-v2-account-button,
    .home-v2-action,
    .home-v2-dock-item {
        transition: none;
    }
}

/* =========================================================
   GAME BOTTOM THEME BUTTON V5
   Tombol tema melayang tanpa menambah tinggi navigasi.
   ========================================================= */
body.game-page #gameApp {
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
}

@media (min-width: 521px) {
    body.game-page .board-wrap {
        align-items: flex-end;
        padding-bottom: 12px;
    }

    body.game-page .board {
        width: min(324px, calc(100vw - 54px));
    }
}

@media (min-width: 521px) and (max-height: 760px) {
    body.game-page .board {
        width: min(292px, calc(100vw - 54px));
    }
}

body.game-page .game-bottom-nav,
body.game-page:not(.dark-mode) .game-bottom-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 68px;
    overflow: visible;
    isolation: isolate;
}

body.game-page .game-bottom-nav-group {
    min-width: 0;
    width: 100%;
    max-width: 176px;
    display: grid;
    align-items: center;
    gap: 0;
}

body.game-page .game-bottom-nav-auth .game-bottom-nav-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.game-page .game-bottom-nav-guest .game-bottom-nav-group {
    width: min(78px, 100%);
    grid-template-columns: minmax(0, 1fr);
}

body.game-page .game-bottom-nav-left {
    justify-self: end;
}

body.game-page .game-bottom-nav-right {
    justify-self: start;
}

body.game-page .game-bottom-nav-group > a,
body.game-page .game-bottom-nav .game-bottom-nav-link {
    min-width: 0;
    width: 100%;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

body.game-page .game-bottom-nav .game-bottom-nav-link {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--v4-muted-dark);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.12s ease, transform 0.12s ease;
}

body.game-page:not(.dark-mode) .game-bottom-nav .game-bottom-nav-link {
    color: var(--v4-muted-light);
}

body.game-page .game-bottom-nav .game-bottom-nav-link:hover,
body.game-page .game-bottom-nav .game-bottom-nav-link:focus-visible {
    color: var(--v4-text-dark);
    outline: none;
}

body.game-page:not(.dark-mode) .game-bottom-nav .game-bottom-nav-link:hover,
body.game-page:not(.dark-mode) .game-bottom-nav .game-bottom-nav-link:focus-visible {
    color: var(--v4-text-light);
}

body.game-page .game-bottom-nav .game-bottom-nav-link:active {
    color: var(--v4-green);
    transform: scale(0.95);
}

body.game-page .game-bottom-nav a.game-bottom-nav-logout {
    color: #ff5f5f !important;
}

body.game-page:not(.dark-mode) .game-bottom-nav a.game-bottom-nav-logout {
    color: #d62f2f !important;
}

body.game-page .game-bottom-nav a.game-bottom-nav-logout:hover,
body.game-page .game-bottom-nav a.game-bottom-nav-logout:focus-visible,
body.game-page .game-bottom-nav a.game-bottom-nav-logout:active {
    color: #ff9b9b !important;
}

body.game-page:not(.dark-mode) .game-bottom-nav a.game-bottom-nav-logout:hover,
body.game-page:not(.dark-mode) .game-bottom-nav a.game-bottom-nav-logout:focus-visible,
body.game-page:not(.dark-mode) .game-bottom-nav a.game-bottom-nav-logout:active {
    color: #9f1f1f !important;
}

body.game-page .game-theme-toggle {
    position: absolute;
    left: 50%;
    top: 0;
    z-index: 81;
    width: 48px;
    height: 48px;
    border: 2px solid rgba(255, 244, 193, 0.72);
    border-radius: 50%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #29351a;
    background: #f8c83e;
    box-shadow:
        0 8px 18px rgba(0, 0, 0, 0.32),
        0 0 0 4px rgba(248, 200, 62, 0.12);
    transform: translate(-50%, -50%);
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
    transition: transform 0.14s ease, filter 0.14s ease, box-shadow 0.14s ease, background 0.16s ease;
    -webkit-tap-highlight-color: transparent;
}

body.game-page:not(.dark-mode) .game-theme-toggle {
    border-color: rgba(255, 255, 255, 0.78);
    color: #fff6dc;
    background: #0b4a3e;
    box-shadow:
        0 8px 18px rgba(12, 55, 49, 0.28),
        0 0 0 4px rgba(11, 74, 62, 0.1);
}

body.game-page .game-theme-toggle:hover,
body.game-page .game-theme-toggle:focus-visible {
    transform: translate(-50%, -50%) scale(1.04);
    filter: brightness(1.04);
    outline: none;
}

body.game-page .game-theme-toggle:focus-visible {
    box-shadow:
        0 8px 18px rgba(0, 0, 0, 0.3),
        0 0 0 4px rgba(248, 200, 62, 0.16),
        0 0 0 7px rgba(255, 255, 255, 0.64);
}

body.game-page .game-theme-toggle:active {
    transform: translate(-50%, -50%) scale(0.96);
}

body.game-page .game-theme-icon {
    width: 23px;
    height: 23px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.game-page .game-theme-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.game-page .game-theme-icon-moon,
body.game-page:not(.dark-mode) .game-theme-icon-sun {
    display: none;
}

body.game-page:not(.dark-mode) .game-theme-icon-moon {
    display: inline-flex;
}

/* Login langsung di halaman game */
body.game-page .game-login-modal {
    padding: 18px;
}

body.game-page .game-login-modal .modal-backdrop {
    background: rgba(5, 7, 13, 0.72);
    backdrop-filter: blur(5px);
}

body.game-page .game-login-card {
    width: min(390px, 100%);
    padding: 30px 26px 25px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    background: #181b27;
    color: var(--v4-text-dark);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
}

body.game-page:not(.dark-mode) .game-login-card {
    border-color: rgba(148, 163, 184, 0.32);
    background: #ffffff;
    color: var(--v4-text-light);
    box-shadow: 0 24px 70px rgba(35, 48, 72, 0.2);
}

body.game-page .game-login-card h2 {
    margin: 0 34px 7px;
    color: inherit;
    font-family: inherit;
    font-size: 25px;
    letter-spacing: -0.3px;
}

body.game-page .game-login-intro {
    margin: 0 auto 22px;
    max-width: 290px;
    color: var(--v4-muted-dark);
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

body.game-page:not(.dark-mode) .game-login-intro {
    color: var(--v4-muted-light);
}

body.game-page .game-login-card .form-group label {
    color: var(--v4-text-dark);
}

body.game-page:not(.dark-mode) .game-login-card .form-group label {
    color: var(--v4-text-light);
}

body.game-page .game-login-card .form-group input {
    border-color: rgba(148, 163, 184, 0.34);
    background: rgba(255, 255, 255, 0.055);
    color: var(--v4-text-dark);
}

body.game-page:not(.dark-mode) .game-login-card .form-group input {
    border-color: rgba(148, 163, 184, 0.5);
    background: #f8fafc;
    color: var(--v4-text-light);
}

body.game-page .game-login-card .form-group input:focus {
    border-color: var(--v4-green);
    box-shadow: 0 0 0 3px rgba(121, 185, 87, 0.18);
}

body.game-page .game-login-card .form-group input::placeholder {
    color: var(--v4-muted-dark);
}

body.game-page:not(.dark-mode) .game-login-card .form-group input::placeholder {
    color: var(--v4-muted-light);
}

body.game-page .game-login-card .modal-close {
    color: var(--v4-muted-dark);
}

body.game-page:not(.dark-mode) .game-login-card .modal-close {
    color: var(--v4-muted-light);
}

body.game-page .game-login-card .game-login-submit {
    min-height: 46px;
    border: 0;
    border-radius: 10px;
    background: var(--v4-green);
    color: #ffffff;
    font-size: 15px;
    font-weight: 850;
}

body.game-page .game-login-card .game-login-submit:hover,
body.game-page .game-login-card .game-login-submit:focus-visible {
    filter: brightness(1.08);
    outline: none;
}

body.game-page .game-login-card .game-login-submit:disabled {
    cursor: wait;
    opacity: 0.62;
}

body.game-page .game-login-card .form-message {
    min-height: 20px;
    margin-bottom: 12px;
    font-size: 13px;
}

body.game-page .game-login-card .form-message.error {
    color: #ff7878;
}

body.game-page:not(.dark-mode) .game-login-card .form-message.error {
    color: #c93636;
}

body.game-page .game-login-card .form-message.success {
    color: #91d478;
}

body.game-page .login-reminder .game-login-inline {
    appearance: none;
    -webkit-appearance: none;
    margin: 0 0 0 4px;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

body.game-page .login-reminder .game-login-inline:hover,
body.game-page .login-reminder .game-login-inline:focus-visible {
    opacity: 0.76;
    outline: none;
}

@media (max-width: 520px) {
    body.game-page .game-login-card {
        padding: 27px 20px 21px;
        border-radius: 18px;
    }

    body.game-page .game-login-card h2 {
        font-size: 23px;
    }
}

@media (max-width: 520px) {
    body.game-page .game-bottom-nav,
    body.game-page:not(.dark-mode) .game-bottom-nav {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 58px;
    }

    body.game-page .game-bottom-nav-group {
        max-width: 132px;
    }

    body.game-page .game-bottom-nav-guest .game-bottom-nav-group {
        width: min(70px, 100%);
    }

    body.game-page .game-bottom-nav .game-bottom-nav-link {
        font-size: 13px;
    }

    body.game-page .game-theme-toggle {
        width: 46px;
        height: 46px;
    }

    body.game-page .game-theme-icon {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 360px) {
    body.game-page .game-bottom-nav,
    body.game-page:not(.dark-mode) .game-bottom-nav {
        gap: 54px;
    }

    body.game-page .game-bottom-nav .game-bottom-nav-link {
        font-size: 12px;
    }
}

/* =========================================================
   GAME MOBILE KEYBOARD FIX V1
   Menjaga tiga baris keyboard tetap utuh di atas navigasi
   pada Safari/Chrome mobile dengan toolbar browser aktif.
   ========================================================= */
@media (max-width: 520px) and (orientation: portrait) {
    body.game-page #gameApp {
        height: 100dvh;
        min-height: 100dvh;
        max-height: 100dvh;
        grid-template-rows: 48px minmax(42px, auto) minmax(0, 1fr);
        padding-bottom: calc(232px + env(safe-area-inset-bottom));
    }

    body.game-page .keyboard {
        position: fixed;
        left: 50%;
        right: auto;
        bottom: calc(70px + env(safe-area-inset-bottom));
        z-index: 70;
        width: min(632px, calc(100vw - 20px));
        max-width: calc(100vw - 20px);
        margin: 0;
        padding-top: 4px;
        padding-bottom: 0;
        transform: translateX(-50%);
    }
}

@media (max-width: 390px) and (orientation: portrait) {
    body.game-page #gameApp {
        grid-template-rows: 46px minmax(39px, auto) minmax(0, 1fr);
        padding-bottom: calc(218px + env(safe-area-inset-bottom));
    }

    body.game-page .keyboard {
        bottom: calc(68px + env(safe-area-inset-bottom));
        width: calc(100vw - 18px);
        max-width: calc(100vw - 18px);
    }
}

@media (max-width: 520px) and (max-height: 720px) and (orientation: portrait) {
    body.game-page #gameApp {
        padding-bottom: calc(205px + env(safe-area-inset-bottom));
    }
}

/* =========================================================
   GAME NATURE BACKGROUND V5
   Gelap: gunung/hutan | Terang: pantai
   Menggunakan gambar yang sama dengan halaman Home.
   ========================================================= */
body.game-page {
    position: relative;
    isolation: isolate;
    background-color: #12131c;
    background-image: none;
}

body.game-page:not(.dark-mode):not([data-theme="dark"]) {
    background-color: #eef7f8;
    background-image: none;
}

body.game-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.15;
    filter: none;
    background-image: url("../img/home-bg-light.webp");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

body.game-page.dark-mode::before,
body.game-page[data-theme="dark"]::before {
    opacity: 0.65;
    filter: brightness(1.45) saturate(1.08);
    background-image: url("../img/home-bg-dark.webp");
}

body.game-page #gameApp {
    position: relative;
    z-index: 1;
    background: transparent;
}

body.game-page:not(.dark-mode):not([data-theme="dark"]) #gameApp {
    background: transparent;
}

body.game-page.dark-mode #gameApp,
body.game-page[data-theme="dark"] #gameApp {
    background: transparent;
}

body.game-page .game-topbar,
body.game-page:not(.dark-mode):not([data-theme="dark"]) .game-topbar {
    background: transparent;
}

@media (min-width: 1000px) {
    body.game-page::before {
        background-image: url("../img/home-bg-light-desktop.webp");
        background-position: center;
    }

    body.game-page.dark-mode::before,
    body.game-page[data-theme="dark"]::before {
        background-image: url("../img/home-bg-dark-desktop.webp");
    }
}

/* =========================================================
   PRACTICE BOTTOM NAV V2
   Mengunci semua menu latihan pada satu baris dan menjaga
   keyboard tetap utuh di atas dock pada mobile maupun desktop.
   ========================================================= */
body.practice-page .game-bottom-nav,
body.practice-page:not(.dark-mode) .game-bottom-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(30px, 1fr);
    grid-auto-flow: column;
    align-items: center;
    justify-content: stretch;
    column-gap: 68px;
    row-gap: 0;
    overflow: visible;
}

body.practice-page .game-bottom-nav-left {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
}

body.practice-page .game-bottom-nav-right {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
}

body.practice-page .game-bottom-nav-group {
    width: 100%;
    max-width: 176px;
    min-width: 0;
    min-height: 30px;
    align-self: center;
}

body.practice-page .game-bottom-nav-auth .game-bottom-nav-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(30px, 1fr);
    align-items: center;
}

body.practice-page .game-bottom-nav-guest .game-bottom-nav-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(30px, 1fr);
    align-items: center;
}

body.practice-page .game-bottom-nav-group > a,
body.practice-page .game-bottom-nav .game-bottom-nav-link {
    min-width: 0;
    min-height: 30px;
    padding: 0 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
}

body.practice-page .game-theme-toggle {
    grid-column: 1 / -1;
    grid-row: 1;
}

/* Fallback jika latihan.php lama sempat tertinggal di hosting. */
body.practice-page .game-bottom-nav:not(.game-bottom-nav-auth):not(.game-bottom-nav-guest) {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 0;
}

body.practice-page .game-bottom-nav:not(.game-bottom-nav-auth):not(.game-bottom-nav-guest) > a {
    min-width: 0;
    min-height: 30px;
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

@media (max-width: 520px) and (orientation: portrait) {
    body.practice-page .game-bottom-nav,
    body.practice-page:not(.dark-mode) .game-bottom-nav {
        grid-template-rows: minmax(30px, 1fr);
        column-gap: 58px;
        row-gap: 0;
    }

    body.practice-page .game-bottom-nav-group {
        max-width: 132px;
    }

    body.practice-page .keyboard {
        bottom: calc(70px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 360px) and (orientation: portrait) {
    body.practice-page .game-bottom-nav,
    body.practice-page:not(.dark-mode) .game-bottom-nav {
        column-gap: 54px;
    }

    body.practice-page .game-bottom-nav-group > a,
    body.practice-page .game-bottom-nav .game-bottom-nav-link {
        padding-inline: 1px;
        font-size: 12px;
    }
}

/* =========================================================
   VIRTUAL KEYBOARD TOUCH GUARD V1
   Mencegah huruf terseleksi, disalin, atau memunculkan callout
   saat tombol keyboard game/latihan disentuh atau ditekan lama.
   ========================================================= */
body.game-page .keyboard,
body.game-page .keyboard *,
body.practice-page .keyboard,
body.practice-page .keyboard * {
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
}

body.game-page .keyboard,
body.game-page .key,
body.practice-page .keyboard,
body.practice-page .key {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
