/* Games Hub — isolated styles (never loaded on catalogue hot paths) */

.gm-page { position: relative; }

.gm-hero { position: relative; overflow: hidden; min-height: 320px; }
.gm-hero-bg,
.gm-play-hero .gm-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.gm-hero-photo {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--pc-brand), color-mix(in srgb, var(--pc-brand) 50%, #000));
    background-size: cover;
    background-position: center;
    filter: blur(2px) saturate(1.1);
    transform: scale(1.05);
}
.gm-hero-content,
.gm-play-header {
    position: relative;
    z-index: 2;
}
/* ── Game play pages: compact toolbar + full-height stage (no hero banner) ── */
.gm-play-page.ph-page {
    padding-bottom: 0 !important;
    min-height: 100dvh;
    background: #0b1220 !important;
}
.gm-play-page {
    /* Clearance from page top to game toolbar — content already sits below ann-bar in flow. */
    --gm-play-header-offset: 118px;
    /* Viewport offset when toolbar is sticky under fixed site header (ann-bar + menu). */
    --gm-play-sticky-top: 159px;
    --gm-play-toolbar-height: 48px;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-top: var(--gm-play-header-offset) !important;
    padding-bottom: 0 !important;
    background: #0b1220;
}
.gm-play-topbar {
    position: sticky;
    top: var(--gm-play-sticky-top);
    z-index: 30;
    flex-shrink: 0;
    background: #0f172a;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.gm-play-topbar-inner {
    padding: 0 16px;
    max-width: 1240px;
    margin: 0 auto;
}
.gm-play-topbar-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--gm-play-toolbar-height);
    flex-wrap: nowrap;
}
.gm-play-fs-btn {
    flex-shrink: 0;
    margin-left: auto;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.gm-play-fs-btn:hover {
    background: rgba(255,255,255,0.16);
    border-color: rgba(255,255,255,0.35);
}
.gm-play-fs-btn:active { transform: scale(0.96); }
.gm-play-fs-btn .gm-fs-icon {
    width: 20px;
    height: 20px;
    display: block;
}
.gm-play-fs-btn .gm-fs-exit { display: none; }
.gm-play-fs-btn.is-active .gm-fs-enter { display: none; }
.gm-play-fs-btn.is-active .gm-fs-exit { display: block; }
.gm-play-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    position: relative;
}
.gm-play-fs-hint {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.92);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
    white-space: nowrap;
}
.gm-play-fs-hint.is-visible { opacity: 1; }
.gm-play-fs-exit {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 55;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}
.gm-play-fs-exit svg { width: 20px; height: 20px; display: block; }
.gm-play-fs-exit:hover { background: rgba(15, 23, 42, 0.92); }
.gm-play-stage:fullscreen .gm-play-fs-exit { display: inline-flex; }
.gm-play-stage:fullscreen {
    background: #0b1220;
    width: 100%;
    height: 100%;
}
.gm-play-stage:fullscreen .gm-play-panel {
    min-height: 100%;
    height: 100%;
}
.gm-play-page.gm-play-is-fullscreen .gm-play-topbar {
    display: none;
}
.gm-play-back {
    flex-shrink: 0;
    color: rgba(255,255,255,0.88);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.gm-play-back:hover { color: #fff; text-decoration: underline; }
.gm-play-topbar-text {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
    overflow: hidden;
}
.gm-play-topbar-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    flex-shrink: 0;
}
.gm-play-topbar-sub {
    margin: 0;
    font-size: 11px;
    line-height: 1.2;
    color: rgba(255,255,255,0.62);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.gm-play-topbar-sub::before {
    content: "·";
    margin-right: 10px;
    color: rgba(255,255,255,0.35);
}
.gm-play-page .gm-play-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    min-height: calc(100dvh - var(--gm-play-sticky-top, 159px) - var(--gm-play-toolbar-height, 48px));
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    background: transparent;
}
.gm-play-page .gm-play-panel--quiz {
    padding: 20px clamp(16px, 3vw, 32px) 32px;
    background: #fafaf7;
    overflow: auto;
}
.gm-play-page .gm-play-panel--flashcards {
    padding: 16px clamp(12px, 2.5vw, 28px) 28px;
    background: #fafaf7;
    overflow: auto;
}
.gm-edu-wrap,
.gm-drop-wrap,
.gm-race-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

@media (max-width: 991px) {
    .gm-play-page {
        --gm-play-header-offset: 108px;
        --gm-play-sticky-top: 148px;
    }
}
@media (max-width: 575px) {
    .gm-play-page {
        --gm-play-header-offset: 98px;
        --gm-play-sticky-top: 136px;
        --gm-play-toolbar-height: 44px;
    }
    .gm-play-topbar-inner { padding: 0 12px; }
    .gm-play-back { font-size: 11px; }
    .gm-play-topbar-title { font-size: 0.92rem; }
    .gm-play-topbar-sub { display: none; }
    .gm-play-fs-btn { width: 34px; height: 34px; }
    .gm-play-fs-btn .gm-fs-icon { width: 16px; height: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-fluid-canvas { display: none !important; }
    .hero-fluid-static { display: block !important; }
}

.gm-featured-pill {
    margin-top: 16px;
    font-size: 14px;
    color: rgba(255,255,255,0.88);
}
.gm-inline-link { color: #fff; font-weight: 700; }
.gm-reward-pill,
.gm-pill {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--pc-accent) 18%, #fff);
    color: var(--pc-brand);
    margin-top: 8px;
}

.gm-card-img {
    height: 160px;
    overflow: hidden;
    border-radius: 14px 14px 0 0;
}
.gm-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gm-card .ph-card-eyebrow,
.gm-card .ph-card-title,
.gm-card .ph-card-desc,
.gm-card .ph-card-link { padding-left: 18px; padding-right: 18px; }

.gm-play-panel {
    background: rgba(255,255,255,0.92);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 28px;
    margin: 32px 0 80px;
    box-shadow: 0 20px 50px rgba(2,6,23,0.08);
    backdrop-filter: blur(8px);
    min-height: 200px;
}
.gm-play-page .gm-loading {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    color: rgba(255,255,255,0.65);
}
.gm-play-page .gm-play-panel--quiz .gm-loading,
.gm-play-page .gm-play-panel--flashcards .gm-loading {
    color: #64748b;
}
.gm-loading { text-align: center; color: #64748b; padding: 48px 0; }

.gm-q-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}
.gm-plays-left {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}
.gm-fc-hint .gm-plays-left {
    display: block;
    margin-top: 6px;
    color: rgba(255,255,255,0.75);
    font-size: 11px;
    font-weight: 600;
}
.gm-q-hero {
    height: 180px;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
}
.gm-q-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gm-q-hero-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 12px 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.72));
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}
.gm-q-text {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.45;
    margin: 0 0 20px;
    color: #0f172a;
}
.gm-term-pick-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 6px;
}
.gm-term-pick {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    margin: 0 0 20px;
    letter-spacing: -0.02em;
}
.gm-option-def {
    text-align: left;
    line-height: 1.45;
    white-space: normal;
}
.gm-options { display: grid; gap: 10px; }
.gm-option {
    appearance: none;
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    text-align: left;
    font-size: 15px;
    cursor: pointer;
    transition: border-color 140ms, background 140ms;
}
.gm-option:hover { border-color: var(--pc-accent); }
.gm-option.is-selected { border-color: var(--pc-accent); background: color-mix(in srgb, var(--pc-accent) 8%, #fff); }
.gm-option.is-correct { border-color: #16a34a; background: #f0fdf4; }
.gm-option.is-wrong { border-color: #dc2626; background: #fef2f2; }

.gm-score-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.gm-score-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e2e8f0;
}
.gm-score-dot.is-correct { background: #16a34a; }
.gm-score-dot.is-wrong { background: #dc2626; }

.gm-grid-choices {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.gm-choice-card {
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    transition: border-color 140ms, transform 140ms;
}
.gm-choice-card:hover { transform: translateY(-2px); border-color: var(--pc-accent); }
.gm-choice-card.is-selected { border-color: var(--pc-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc-accent) 25%, transparent); }
.gm-choice-card img { width: 100%; height: 100px; object-fit: cover; display: block; }
.gm-choice-card p { padding: 12px; margin: 0; font-size: 13px; font-weight: 600; line-height: 1.35; }

.gm-play-panel--flashcards {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 32px 0 80px;
}
.gm-play-page .gm-fc-table {
    min-height: calc(100vh - 220px);
    min-height: calc(100dvh - 220px);
}

/* ── Term Match: Solitaire-style flashcards ── */
.gm-fc-table {
    position: relative;
    border-radius: 20px;
    padding: 24px 20px 28px;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.06) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 80%, rgba(0,0,0,0.15) 0%, transparent 50%),
        linear-gradient(160deg,
            color-mix(in srgb, var(--pc-brand) 88%, #0a3d2e) 0%,
            #0d4a38 35%,
            #0a3328 100%);
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.08), 0 24px 48px rgba(2, 6, 23, 0.22);
    overflow: hidden;
}
.gm-fc-table::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 12px,
        rgba(255,255,255,0.015) 12px,
        rgba(255,255,255,0.015) 24px
    );
    pointer-events: none;
}
.gm-fc-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    color: rgba(255,255,255,0.92);
}
.gm-fc-stat {
    font-size: 22px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    min-width: 72px;
}
.gm-fc-stat-right { text-align: right; }
.gm-fc-stat-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.65;
    margin-bottom: 2px;
}
.gm-fc-hint {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    opacity: 0.78;
    min-width: 140px;
}
.gm-fc-foundation {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 52px;
    height: 72px;
    border-radius: 8px;
    border: 2px dashed rgba(255,255,255,0.2);
    pointer-events: none;
    z-index: 1;
}
.gm-fc-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 14px 12px;
    max-width: 720px;
    margin: 0 auto;
    perspective: 1200px;
}
@media (min-width: 640px) {
    .gm-fc-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px 14px;
    }
}

.gm-fc-card {
    appearance: none;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    width: 100%;
    aspect-ratio: 3 / 4.2;
    min-height: 140px;
    perspective: 900px;
    -webkit-tap-highlight-color: transparent;
}
.gm-fc-card:focus-visible {
    outline: 2px solid rgba(255,255,255,0.85);
    outline-offset: 3px;
    border-radius: 12px;
}
.gm-fc-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
    border-radius: 12px;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.35) inset,
        0 8px 20px rgba(0,0,0,0.35),
        0 2px 4px rgba(0,0,0,0.2);
}
.gm-fc-card.is-flipped .gm-fc-inner {
    transform: rotateY(180deg);
}
.gm-fc-card.is-wrong {
    animation: gm-fc-shake-card 0.45s ease;
}
.gm-fc-card.is-matched .gm-fc-inner {
    box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.85), 0 12px 28px rgba(0,0,0,0.4);
}
.gm-fc-card.is-collected {
    pointer-events: none;
    animation: gm-fc-collect 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes gm-fc-shake-card {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}
@keyframes gm-fc-collect {
    to {
        opacity: 0;
        transform: scale(0.35) translate(90px, -70px);
    }
}

.gm-fc-face {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 14px 12px;
    text-align: center;
}

.gm-fc-back {
    background:
        repeating-linear-gradient(
            -45deg,
            #1a4d7c,
            #1a4d7c 8px,
            #163f66 8px,
            #163f66 16px
        );
    border: 3px solid #fff;
}
.gm-fc-back-mark {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.45);
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.25), transparent 60%);
    box-shadow: inset 0 0 12px rgba(0,0,0,0.2);
}

.gm-fc-front {
    transform: rotateY(180deg);
    color: #fff;
    border: 3px solid rgba(255,255,255,0.92);
}
.gm-fc-front-term {
    background: linear-gradient(145deg,
        var(--pc-brand) 0%,
        color-mix(in srgb, var(--pc-brand) 70%, #000) 100%);
}
.gm-fc-front-def {
    background: linear-gradient(145deg,
        var(--pc-accent) 0%,
        color-mix(in srgb, var(--pc-accent) 65%, #000) 100%);
    background-size: cover;
    background-position: center;
}
.gm-fc-front-def::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(15,23,42,0.55) 0%,
        rgba(15,23,42,0.82) 100%);
    z-index: 0;
}
.gm-fc-front-def[style*="background-image"]::before {
    background: linear-gradient(180deg,
        rgba(15,23,42,0.35) 0%,
        rgba(15,23,42,0.88) 100%);
}
.gm-fc-front-label,
.gm-fc-front-text {
    position: relative;
    z-index: 1;
}
.gm-fc-front-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    opacity: 0.75;
    margin-bottom: 8px;
}
.gm-fc-front-text {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    max-height: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical;
}

.gm-result--flashcards {
    position: relative;
    overflow: hidden;
}
.gm-fc-win-burst {
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle, color-mix(in srgb, var(--pc-accent) 25%, transparent) 0%, transparent 65%);
    animation: gm-fc-burst 1.2s ease-out forwards;
    pointer-events: none;
}
@keyframes gm-fc-burst {
    from { opacity: 1; transform: scale(0.3); }
    to { opacity: 0; transform: scale(1.2); }
}

@media (prefers-reduced-motion: reduce) {
    .gm-fc-inner { transition: none; }
    .gm-fc-card.is-flipped .gm-fc-inner { transform: none; }
    .gm-fc-back { display: none; }
    .gm-fc-front { transform: none; position: relative; }
    .gm-fc-card:not(.is-flipped) .gm-fc-front { display: none; }
    .gm-fc-card.is-collected { animation: none; opacity: 0.35; }
    .gm-fc-card.is-wrong .gm-fc-inner { animation: none; }
}

.gm-timer { font-weight: 700; color: var(--pc-brand); margin-bottom: 12px; }

.gm-result {
    text-align: center;
    padding: 24px 0;
}
.gm-result h2 { font-size: 28px; margin: 0 0 8px; }
.gm-result p { color: #475569; margin: 0 0 20px; }

.gm-btn {
    appearance: none;
    border: none;
    border-radius: 12px;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.gm-btn-primary { background: var(--pc-accent); color: #fff; }
.gm-btn-primary:hover { color: #fff; background: color-mix(in srgb, var(--pc-accent) 85%, #000); }
.gm-btn-ghost { background: transparent; color: #475569; border: 1px solid #cbd5e1; }

.gm-modal[hidden] { display: none !important; }
.gm-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.gm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,0.55);
}
.gm-modal-card {
    position: relative;
    background: #fff;
    border-radius: 18px;
    padding: 28px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(2,6,23,0.2);
}
.gm-modal-title { margin: 0 0 8px; font-size: 22px; }
.gm-modal-desc { margin: 0 0 16px; color: #64748b; font-size: 14px; }
.gm-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.gm-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
    margin-bottom: 12px;
}
.gm-error { color: #dc2626; font-size: 13px; }
.gm-success { color: #16a34a; font-size: 13px; }
.gm-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.gm-win-cta { margin-top: 16px; text-align: center; }

.gm-course-cta {
    margin-top: 16px;
    padding: 16px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    gap: 14px;
    align-items: center;
}
.gm-course-cta img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; }
.gm-course-cta a { font-weight: 700; color: var(--pc-accent); }

/* ── Lucky Wheel (Temu-style) ── */
.gm-wheel-page .gm-wheel-panel {
    text-align: center;
    padding: 8px clamp(12px, 3vw, 24px) 24px;
    background: linear-gradient(180deg, #fff7ed 0%, #fff 45%);
    border-radius: 0;
    border: none;
    justify-content: center;
}
.gm-wheel-stage {
    position: relative;
    width: min(560px, 96vw, calc(100dvh - var(--gm-play-sticky-top, 159px) - var(--gm-play-toolbar-height, 48px) - 72px));
    height: min(560px, 96vw, calc(100dvh - var(--gm-play-sticky-top, 159px) - var(--gm-play-toolbar-height, 48px) - 72px));
    margin: 0 auto 16px;
}
.gm-wheel-glow {
    position: absolute;
    inset: -12%;
    background: radial-gradient(circle, rgba(251, 146, 60, 0.35) 0%, transparent 70%);
    animation: gm-wheel-pulse 2.5s ease-in-out infinite;
}
@keyframes gm-wheel-pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.04); }
}
.gm-wheel-pointer {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 34px solid #dc2626;
    filter: drop-shadow(0 3px 4px rgba(0,0,0,0.25));
    z-index: 4;
}
.gm-wheel-disc-wrap {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 10px;
    background: linear-gradient(145deg, #fbbf24, #ea580c, #fbbf24);
    box-shadow: 0 14px 48px rgba(234, 88, 12, 0.38), inset 0 0 0 5px #fff;
    cursor: grab;
    touch-action: none;
    user-select: none;
}
.gm-wheel-disc-wrap--dragging {
    cursor: grabbing;
}
.gm-wheel-disc-wrap--disabled {
    cursor: not-allowed;
    opacity: 0.72;
    pointer-events: none;
}
.gm-wheel-disc {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    transition: transform 4.2s cubic-bezier(0.12, 0.75, 0.08, 1);
    box-shadow: inset 0 0 0 3px rgba(255,255,255,0.5);
    pointer-events: none;
}
.gm-wheel-label {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 88px;
    margin-left: -44px;
    margin-top: -12px;
    font-size: 12.5px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.45);
    line-height: 1.15;
    text-align: center;
    pointer-events: none;
}
.gm-wheel-hub {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ef4444, #b91c1c);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25), inset 0 2px 0 rgba(255,255,255,0.25);
    z-index: 3;
    pointer-events: none;
    letter-spacing: 0.04em;
}
.gm-wheel-drag-hint {
    font-size: 13px;
    color: #9a3412;
    margin: 0 0 8px;
    font-weight: 500;
}
.gm-wheel-spins-left {
    font-size: 14px;
    font-weight: 600;
    color: #c2410c;
    margin: 0 0 8px;
}
.gm-wheel-status {
    font-size: 15px;
    font-weight: 700;
    color: #ea580c;
    margin: 0 0 10px;
    min-height: 1.25em;
}
.gm-wheel-status[hidden] { display: none !important; }
.gm-btn-wheel {
    background: linear-gradient(180deg, #fb923c, #ea580c);
    color: #fff;
    font-size: 16px;
    padding: 14px 36px;
    border-radius: 999px;
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.gm-btn-wheel:hover:not(:disabled) {
    background: linear-gradient(180deg, #f97316, #c2410c);
    color: #fff;
}
.gm-btn-wheel:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.gm-wheel-fine {
    font-size: 12px;
    color: #94a3b8;
    margin: 14px 0 0;
}
.gm-wheel-result { margin-top: 20px; }
.gm-wheel-win h2 { color: #16a34a; }
.gm-wheel-lose h2 { color: #64748b; font-size: 22px; }
.gm-wheel-msg { color: #64748b; }

@media (prefers-reduced-motion: reduce) {
    .gm-wheel-glow { animation: none; }
    .gm-wheel-disc { transition: none; }
}

/* ── EduCraft (Minecraft-style 3D miner) ── */
.gm-educraft-page .gm-educraft-panel {
    padding: 0;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid #cbd5e1;
    background: #0f172a;
}
.gm-edu-wrap { position: relative; }
.gm-edu-hud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: linear-gradient(180deg, #1e293b, #0f172a);
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 600;
}
.gm-edu-hud-item { white-space: nowrap; }
.gm-edu-canvas-wrap {
    flex: 1;
    width: 100%;
    min-height: calc(100vh - 220px);
    min-height: calc(100dvh - 220px);
    line-height: 0;
    background: #87ceeb;
}
.gm-edu-canvas-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    cursor: crosshair;
}
.gm-edu-quiz {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 5;
}
.gm-edu-quiz[hidden] { display: none !important; }
.gm-edu-quiz-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px 20px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}
.gm-edu-quiz-eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin: 0 0 6px;
}
.gm-edu-quiz-card h3 {
    font-size: 1.05rem;
    margin: 0 0 16px;
    color: #0f172a;
    line-height: 1.35;
}
.gm-edu-toast {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.92);
    color: #fff;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 13px;
    z-index: 6;
    pointer-events: none;
}
.gm-edu-toast[hidden] { display: none !important; }
.gm-edu-result {
    padding: 24px 20px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}

/* ── EduDrop (Fortnite-style island loot) ── */
.gm-edudrop-page .gm-edudrop-panel {
    padding: 0;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid #cbd5e1;
    background: #0f172a;
}
.gm-drop-wrap { position: relative; }
.gm-drop-hud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: linear-gradient(180deg, #312e81, #1e1b4b);
    color: #e0e7ff;
    font-size: 12px;
    font-weight: 600;
}
.gm-drop-hud-item { white-space: nowrap; }
.gm-drop-hud-item.is-danger { color: #fca5a5; }
.gm-drop-canvas-wrap {
    flex: 1;
    width: 100%;
    min-height: calc(100vh - 220px);
    min-height: calc(100dvh - 220px);
    line-height: 0;
    background: #6ec5ff;
}
.gm-drop-canvas-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    cursor: default;
}
.gm-drop-prompt {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    z-index: 4;
    pointer-events: none;
}
.gm-drop-prompt[hidden] { display: none !important; }
.gm-drop-prompt kbd {
    background: #334155;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: inherit;
}
.gm-drop-quiz {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 5;
}
.gm-drop-quiz[hidden] { display: none !important; }
.gm-drop-quiz-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px 20px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
    border-top: 4px solid #3b82f6;
}
.gm-drop-rarity-uncommon { border-top-color: #22c55e; }
.gm-drop-rarity-rare { border-top-color: #3b82f6; }
.gm-drop-rarity-epic { border-top-color: #a855f7; }
.gm-drop-rarity-legendary { border-top-color: #f59e0b; }
.gm-drop-quiz-eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin: 0 0 6px;
}
.gm-drop-quiz-card h3 {
    font-size: 1.05rem;
    margin: 0 0 16px;
    color: #0f172a;
    line-height: 1.35;
}
.gm-drop-toast {
    position: absolute;
    top: 56px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.92);
    color: #fff;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 13px;
    z-index: 6;
    pointer-events: none;
}
.gm-drop-toast[hidden] { display: none !important; }
.gm-drop-storm-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    box-shadow: inset 0 0 80px 40px rgba(147, 51, 234, 0.45);
    animation: gm-storm-pulse 2s ease-in-out infinite;
}
.gm-drop-storm-vignette[hidden] { display: none !important; }
@keyframes gm-storm-pulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}
.gm-drop-result {
    padding: 24px 20px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}
@media (prefers-reduced-motion: reduce) {
    .gm-drop-storm-vignette { animation: none; }
}

/* ── EduRacer (cockpit pseudo-3D racing) ── */
.gm-eduracer-page .gm-eduracer-panel {
    padding: 0;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid #1e293b;
    background: #020617;
}
.gm-race-cockpit .gm-race-canvas-wrap {
    flex: 1;
    width: 100%;
    min-height: calc(100vh - 120px);
    min-height: calc(100dvh - 120px);
    line-height: 0;
    background: #020617;
    position: relative;
}
.gm-race-cockpit .gm-race-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.gm-race-wrap { position: relative; }
.gm-race-gate-flash {
    top: 28% !important;
    font-size: 1.35rem;
    letter-spacing: 0.12em;
    text-shadow: 0 0 24px rgba(56, 189, 248, 0.9);
}
.gm-race-quiz {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 5;
}
.gm-race-quiz[hidden] { display: none !important; }
.gm-race-quiz-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px 20px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
    border-top: 4px solid #dc2626;
}
.gm-race-quiz-eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin: 0 0 6px;
}
.gm-race-quiz-card h3 {
    font-size: 1.05rem;
    margin: 0 0 16px;
    color: #0f172a;
    line-height: 1.35;
}
.gm-race-result {
    padding: 24px 20px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}
.gm-race-start {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    z-index: 4;
    pointer-events: none;
    padding: 20px;
    text-align: center;
}
.gm-race-start[hidden] { display: none !important; }
.gm-race-start p {
    margin: 0;
    padding: 14px 18px;
    border-radius: 12px;
    background: rgba(127, 29, 29, 0.92);
    color: #fef2f2;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.gm-race-start kbd {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    background: #fff;
    color: #7f1d1d;
    font-family: inherit;
    font-size: 13px;
}
.gm-race-touch {
    display: none;
    position: absolute;
    inset: auto 0 12px 0;
    padding: 0 12px;
    z-index: 6;
    pointer-events: none;
}
.gm-race-touch-btn {
    pointer-events: auto;
    position: absolute;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.82);
    color: #f8fafc;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    touch-action: manipulation;
    user-select: none;
}
.gm-race-touch-go {
    right: 14px;
    bottom: 0;
    width: 72px;
    height: 72px;
    font-size: 15px;
    background: rgba(220, 38, 38, 0.92);
}
.gm-race-touch-left { left: 14px; bottom: 68px; }
.gm-race-touch-right { left: 78px; bottom: 68px; }
.gm-race-touch-brake { left: 46px; bottom: 8px; font-size: 14px; }
@media (hover: none), (pointer: coarse) {
    .gm-race-touch { display: block; }
    .gm-race-hud-item:first-child { display: none; }
}

/* ── Mission briefing + action canvas games ── */
.gm-instruct {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.72), rgba(0, 0, 0, 0.92));
    backdrop-filter: blur(6px);
}
.gm-instruct-card {
    max-width: 520px;
    width: 100%;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 26px 24px 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}
.gm-instruct-brand {
    text-align: center;
    margin-bottom: 14px;
}
.gm-instruct-logo {
    max-height: 52px;
    max-width: 180px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}
.gm-instruct-tag {
    margin: 0 0 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fbbf24;
}
.gm-instruct-card h2 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    line-height: 1.2;
}
.gm-instruct-sub {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(248, 250, 252, 0.78);
}
.gm-instruct-steps {
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}
.gm-instruct-steps li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.45;
    color: rgba(248, 250, 252, 0.92);
}
.gm-instruct-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.gm-instruct-controls {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 13px;
    line-height: 1.5;
    color: rgba(248, 250, 252, 0.85);
}
.gm-instruct-controls kbd {
    display: inline-block;
    margin-right: 6px;
    padding: 2px 7px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 11px;
    font-family: inherit;
}
.gm-instruct-go { width: 100%; margin-top: 4px; }

.gm-action-wrap {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}
.gm-action-hud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.88));
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.gm-action-canvas-wrap {
    flex: 1;
    position: relative;
    min-height: 400px;
    background: #020617;
}
.gm-action-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}
.gm-daily-canvas-wrap,
.gm-term-canvas-wrap,
.gm-career-canvas-wrap {
    flex: 1;
    position: relative;
    min-height: 400px;
    background: #020617;
}
.gm-daily-canvas-wrap canvas,
.gm-term-canvas-wrap canvas,
.gm-career-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.gm-wheel-wrap {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 16px;
}

/* Jump Quest — Super Mario-style platformer */
.gm-jumpquest-panel { background: #020617; }
.gm-jq-wrap { background: #0f172a; }
.gm-jq-hud {
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
    border-bottom: 2px solid #6366f1;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.04em;
}
.gm-jq-hud span { color: #fef08a; }
.gm-jq-mute {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
}
.gm-jq-canvas-wrap {
    flex: 1;
    position: relative;
    min-height: 480px;
    overflow: hidden;
    background: #020617;
}
.gm-jq-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: auto;
}
.gm-jq-touch {
    display: none;
    position: absolute;
    bottom: 16px;
    left: 0;
    right: 0;
    padding: 0 20px;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
    z-index: 5;
}
@media (pointer: coarse) {
    .gm-jq-touch { display: flex; }
}
.gm-jq-touch-btn {
    pointer-events: auto;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.35);
    background: rgba(15, 23, 42, 0.75);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    backdrop-filter: blur(6px);
}
.gm-jq-touch-jump {
    width: 72px;
    height: 72px;
    margin-bottom: 12px;
    background: rgba(220, 38, 38, 0.75);
}
.gm-jq-touch-btn:active { transform: scale(0.94); }
.gm-action-result {
    padding: 24px 20px;
    background: linear-gradient(180deg, #0f172a, #1e293b);
    color: #f8fafc;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.gm-action-result h2 { color: #fbbf24; }
.gm-result-hint { color: rgba(248, 250, 252, 0.65); font-size: 14px; }

.gm-race-hud {
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.98), rgba(69, 10, 10, 0.95));
    border-bottom: 2px solid rgba(251, 191, 36, 0.35);
}
.gm-edu-hud {
    background: linear-gradient(180deg, rgba(30, 58, 95, 0.98), rgba(15, 23, 42, 0.95));
    border-bottom: 2px solid rgba(56, 189, 248, 0.3);
}
.gm-drop-hud {
    background: linear-gradient(180deg, rgba(49, 46, 129, 0.98), rgba(30, 27, 75, 0.95));
    border-bottom: 2px solid rgba(167, 139, 250, 0.35);
}
.gm-collect-flash {
    position: absolute;
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%);
    padding: 12px 22px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.92);
    color: #0f172a;
    font-weight: 800;
    font-size: 14px;
    z-index: 12;
    pointer-events: none;
    animation: gm-flash-pop 0.85s ease-out forwards;
}
@keyframes gm-flash-pop {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
    100% { opacity: 0; transform: translate(-50%, -80%) scale(1); }
}
