/* ═══════════════════════════════════════════════════════════
   PANIC BUTTON & FAKE CLASSROOM OVERLAY
   Shared across all game pages.
   ═══════════════════════════════════════════════════════════ */

/* ── Panic Button ─────────────────────────────────────────── */
#panic-btn {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 9000;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    color: #5f6368;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-family: 'Google Sans', 'Roboto', system-ui, sans-serif;
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .08);
    transition: all .2s ease;
    opacity: .6;
}

#panic-btn:hover {
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
    background: #f8f9fa;
}

#panic-btn svg {
    flex-shrink: 0;
}

/* ── Panic Overlay (fake classroom) ──────────────────────── */
#panic-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #fff;
    display: none;
    flex-direction: column;
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
    overflow-y: auto;
}

#panic-overlay.active {
    display: flex;
}

/* ── Fake Classroom: Top Bar ─────────────────────────────── */
.gc-topbar {
    display: flex;
    align-items: center;
    height: 64px;
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.gc-menu-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    margin-right: 8px;
}

.gc-menu-icon:hover {
    background: #f1f3f4;
}

.gc-menu-icon svg {
    fill: #5f6368;
}

.gc-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
}

.gc-logo-img {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gc-logo-text {
    font-size: 1.25rem;
    font-weight: 400;
    color: #5f6368;
    letter-spacing: .3px;
}

.gc-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gc-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gc-icon-btn:hover {
    background: #f1f3f4;
}

.gc-icon-btn svg {
    fill: #5f6368;
    width: 22px;
    height: 22px;
}

.gc-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1a73e8;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Fake Classroom: Content ─────────────────────────────── */
.gc-content {
    flex: 1;
    background: #f1f3f4;
    padding: 24px;
}

.gc-classes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

/* ── Class Cards ─────────────────────────────────────────── */
.gc-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
    transition: box-shadow .2s ease;
    cursor: default;
}

.gc-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}

.gc-card-header {
    position: relative;
    padding: 16px;
    height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: #fff;
    overflow: hidden;
}

.gc-card-header h3 {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.3;
    z-index: 1;
}

.gc-card-header p {
    font-size: .82rem;
    opacity: .85;
    z-index: 1;
}

.gc-card-header .gc-teacher-avatar {
    position: absolute;
    right: 16px;
    bottom: -20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    z-index: 2;
    border: 2px solid #fff;
}

.gc-card-body {
    padding: 24px 16px 12px;
    min-height: 80px;
    border-bottom: 1px solid #e0e0e0;
    font-size: .85rem;
    color: #5f6368;
}

.gc-card-footer {
    display: flex;
    justify-content: flex-end;
    padding: 8px;
}

.gc-card-footer button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gc-card-footer button:hover {
    background: #f1f3f4;
}

.gc-card-footer button svg {
    fill: #5f6368;
    width: 20px;
    height: 20px;
}

/* Class card header colors (Google style) */
.gc-hdr-blue {
    background: #1967d2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='100'%3E%3Ctext x='170' y='70' font-size='50' fill='rgba(255,255,255,.12)' font-family='serif'%3E📘%3C/text%3E%3C/svg%3E") right top / auto 100% no-repeat;
}

.gc-hdr-green {
    background: #0d652d url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='100'%3E%3Ctext x='170' y='70' font-size='50' fill='rgba(255,255,255,.12)' font-family='serif'%3E🧪%3C/text%3E%3C/svg%3E") right top / auto 100% no-repeat;
}

.gc-hdr-orange {
    background: #e37400 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='100'%3E%3Ctext x='170' y='70' font-size='50' fill='rgba(255,255,255,.12)' font-family='serif'%3E📐%3C/text%3E%3C/svg%3E") right top / auto 100% no-repeat;
}

.gc-hdr-teal {
    background: #007b83 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='100'%3E%3Ctext x='170' y='70' font-size='50' fill='rgba(255,255,255,.12)' font-family='serif'%3E🌎%3C/text%3E%3C/svg%3E") right top / auto 100% no-repeat;
}

.gc-hdr-purple {
    background: #8430ce url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='100'%3E%3Ctext x='170' y='70' font-size='50' fill='rgba(255,255,255,.12)' font-family='serif'%3E📝%3C/text%3E%3C/svg%3E") right top / auto 100% no-repeat;
}

/* ── Dismiss button inside overlay ───────────────────────── */
#panic-dismiss {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 10001;
    padding: 8px 14px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Google Sans', system-ui, sans-serif;
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(26, 115, 232, .3);
    transition: background .2s;
    display: none;
}

#panic-dismiss:hover {
    background: #1765cc;
}

#panic-overlay.active~#panic-dismiss {
    display: block;
}

/* ── Mobile responsiveness ───────────────────────────────── */
@media (max-width: 600px) {
    .gc-classes {
        grid-template-columns: 1fr;
    }

    .gc-topbar {
        height: 56px;
        padding: 0 8px;
    }

    .gc-logo-text {
        font-size: 1rem;
    }

    #panic-btn {
        bottom: 8px;
        right: 8px;
        padding: 6px 10px;
        font-size: .75rem;
    }
}